Based in Sydney, Australia, Foundry is a blog by Rebecca Thao. Her posts explore modern architecture through photos and quotes by influential architects, engineers, and artists.

Pinkterview: Matthijs Hollemans

Hello hello!

Welcome to another Pinkterview. This week I talk with my friend, author, and developer extraordinaire Matthijs Hollemans. It's a really fun interview so let's jump right to it. :) 

For those who may not know you, could you tell us who Matthijs Hollemans is?

Hi there. I’m a 41-year-old self-employed software developer from the Netherlands. Besides doing programming for a living, I also like to write about it. My most notable book is The iOS Apprentice, published by RayWenderlich.com

Occasionally I also write and record songs. I play a little bit of guitar, bass, keys, and sometimes make an attempt to sing. Oh, and I recently picked up the drums for a new challenge. I also started weightlifting not too long ago, since I felt like my health was going downhill quick once I passed 40. Getting old hurts. ;-)

For work, I provide consulting services where I help companies add deep learning to their mobile apps. Some of the things I do are converting deep learning models to run efficiently on iPhone and iPad, advise clients on how to best train models so they work well on mobile, and occasionally I also train the models myself.

How did you get into programming?

One glorious spring day when I was nine years old my dad brought home a Commodore 64 and I was hooked right away. At first we didn’t have many games but the C=64 came with a manual that explained how to write your own programs, so I started typing those in. And before long I was making my own games.

That’s pretty much how I spent my childhood and teenage years: trying to debug my own horrible BASIC code. I got my first paid programming gig at 18, writing software that controlled a system for long-term fruit storage. Since then I’ve worked for small startups, a few big companies, but I’ve been mostly self-employed as an independent developer.

Did you major in computer science or software development?

Neither, really. I studied electrical engineering at a technical university. We had the option of specializing in electronics, energy (high voltage electricity), or computer engineering, and I chose the latter. This specialization dealt with the intersection of hardware and software. For example, we’d design and build our own circuit boards and then write device drivers for them. It’s what programmers consider low-level stuff, but what hardware engineers consider to be high-level. ¯\_(ツ)_/¯

I figured it would be a good idea to learn more about hardware, since by that time I had been programming for about a decade already (and of course I thought I knew it all, he he). This was in the mid 1990s and people were still building new kinds of computers such as the BeBox, and it seemed interesting to learn how to design my own computers.

Even though I went to school to study hardware I never did anything with it professionally afterwards (and by now I’ve forgotten most of what I learned), but occasionally I tinker a bit with my Arduino. Hardware is fun, and I enjoy making real things with my own hands in the physical world, not just the virtual world we programmers spend all our time in.

Can you tell us a bit about your website machinethink.net?

It’s my blog about machine learning, and specifically about how to do machine learning efficiently on iOS devices. The website has articles on Metal, TensorFlow, Core ML, and all the fun things you can do with them! Of course, one of the reasons I blog about this stuff is because it helps to attract new clients for my consulting business. :-)

But really, once I learn something new I like to write a blog post about it. This is something I recommend to any developer, no matter what your experience level: writing about what you just learned is a great way to reinforce this newfound knowledge, and it’s nice to give back to the community, which opens up new doors for your career. Even if you think what you’ve just learned isn’t anything special, there’s always someone who hasn’t learned it yet and they can benefit from your blog post.

What was it that caught your attention and made you want to focus on machine learning?

Every so often I find myself getting bored with the work I’m doing, which is a sign it’s time to move on to something new. Before I focused on machine learning, I was doing regular iOS app development. But I had been doing that since 2008 and it didn’t feel like enough of a challenge anymore. (Also, business reasons: there are many more iOS developers now than there used to be in the early years, and so you’re competing with more people for the same kind of work. It makes sense to specialize.)

Anyway, I started to look around for something else to do—I remember looking at far-out things like synthetic biology—but eventually landed on machine learning. I guess what I like about it is the low-level stuff, such as writing custom GPU kernels to do the calculations.

Machine learning was already a bit of a hype when I found it, and so I didn’t think I could compete with experienced ML practitioners who had a few years’ headstart. However, I soon realized that machine learning was going to happen on mobile soon. Apple then released neural network support in Metal Performance Shaders, and it became obvious that the intersection of machine learning and mobile developement was exactly where I fit in.

What are examples of things people could add to their apps and projects with your deep learning services?

One of the biggest successes of machine learning—or really deep learning—has been in computer vision, so an obvious use of this in apps is using the camera or the user’s photo library. A lot of my clients’ apps use the camera in one way or the other.

The most basic thing you can do is image classification—point the camera at something and the app tells you what it is, for example to detect whether a plant is poisonous or not. But these days I see people do more advanced computer vision stuff such as object detection (recognizing multiple objects in an image or video) and segmentation (making a prediction for every pixel, for example to repace the background from a photo with something else).

A lot of the research in this area, however, doesn’t really take mobile device limitations into account. It’s common for computer vision papers to use really big neural networks that deliver great results but that run way too slow on an iPhone. So, just because someone has published a paper with a fancy new machine learning technique doesn’t mean you can take their work and put it on an iPhone without modifications—usually it will be way too slow or use too much battery power.

So that’s where I come in. I know the tricks you need to pull in order to optimize these neural networks so that the iPhone’s GPU can handle them.

Machine learning on mobile isn’t just limited to deep learning, though. Deep learning is just one set of techniques in the ML toolbox. Old-school algorithms like logistic regression or decision trees can also be very useful in mobile apps. Anywhere you have code that tries to predict something based on a set of rules or heuristics you can replace with a machine learning model (it turns out that usually the ML model does better than the heuristics). So if you’re using heuristics in your app you might benefit from some machine learning. :-)

What is your advice for programmers looking to get into machine learning? Do you have any tips or resources you recommend?

There are a lot of great free courses and websites where you can learn about ML. However, before you begin you need to ask yourself what you’re really interested in: learning more about the algorithms themselves, or do you want to build practical solutions where ML is just one of the building blocks?

A lot of the courses and books focus on just the algorithms and are very theoretical. One of the most often recommended courses is the one by Andrew Ng on Coursera. Personally, I got a lot out of this course, but it’s a lot of work and involves a fair bit of math (linear algebra, calculus, statistics) and in the end it doesn’t teach you very much about doing machine learning.

To really learn how to put ML into practice, you’ll have to do real projects. For that, I recommend doing competitions on Kaggle. They’ve got a number of beginner competitions that are very accessible, including tutorials on how to get started. I’ve learned a lot from doing these competitions (and I’m still doing them on a regular basis).

Note that the language of choice is Python (although R and MATLAB are also used a lot). If you’re an iOS developer you might not like the idea of learning a new language, but Python is very much like Swift, and it has many great packages for doing machine learning and data science. It’s worth learning if you’re interested in ML!

What can we expect from Matthijs Hollemans in the future, do you have any cool upcoming projects?

Yes, but they are secrets. ;-)

One thing I definitely want to do more of is original research. I’ve always been an engineer, not an academic, and I feel like I haven’t really invented enough. Machine learning is really driven by research and it would be great to help create some new knowledge in this field.

How can readers follow you and keep up to date with your work?

You can follow me on Twitter at @mhollemans, on GitHub as hollance (you can find a lot of my iOS machine learning code here), and of course there is my blog Machine Think. Cheers!

The End

And another awesome Pinkterview is done :) 

Thanks Matthijs for your time and insight. Not being versed in machine learning it's definitely educational getting some tips and resources on the subject. What about you? Do you like machine learning or are interested in it? Leave your answers and suggestions in the comments section below.

As always, thanks for reading and until next time! :)

Dev Tunes #2

Programming Resources #2