Convolutional Neural Networks & Image Classification
This is the first part of a machine learning series: the subtopics I’ve learned, projects where I’ve used machine learning, the mistakes I’ve made along the way — and how you can learn machine learning, too.
A nineteen-year-old college student starting her second summer internship at Sandia National Laboratories in Albuquerque, New Mexico. (Habitually, I now say, “Don’t worry, there’s no humidity — it’s a dry heat!”)
I finished my tasks for my first project and was ready for another challenge. After talking to the right managers and describing my interests and skills, I was handed a behemoth: a Python-based Machine Learning project primarily for the Department of Energy.
Whoa. For someone without much experience in programming at the time, this was a daunting project. I had some experience in Python, but only dreamed of working on a mind-bending task such as this.
My mentor for this project was not only incredibly bright, but patient. Despite being excited to jump right in, before I had a chance to review any code that was already written, my mentor sat me down to explain exactly what machine learning was, how it works, and why we wanted to use it.
Before I continue, I want to put out a disclaimer: this technology was (and currently is, to my knowledge), used by the United States Department of Energy and Department of Defense. Although it’s needless to say, I will say it anyway — I will not go into specific details of what I worked on.
My mentor asked me to explain what I thought machine learning was. Simple enough, right?
As I explained what I knew about machine learning, I realized I knew almost nothing beyond general, super high level concepts. I knew machine learning:
- Automates analytical model building
- Learns and improves through experience
- Builds understanding without explicit instruction
- … HAL 9000?
My mentor gave me a wonderful example. He showed me a picture of a cat, and asked me if I knew what it was.
“It’s a picture of a cat,” I bravely stated.
“How do you know this is a picture of a cat?”
“Well, it has a tail, 2 ears shaped in triangles, cat eyes, it’s fluffy….”
“Right, but have you ever seen this image before? How did you know to categorize this image as a cat?” While I have not seen the image my mentor showed me, I have seen photos like it, and logically deduced that the image was of a cat.
“One day, when you were young, you were shown a picture of a cat,” my mentor continued. “You were made aware of the properties and characteristics of a cat. Let me show you another picture, and I want you to tell me what it is:”
“That’s a cat, too,” I said, knowing exactly where he was going with this. I explained that I knew the first photo was a photo of cat due to its fluffiness, but this one definitely isn’t fluffy. I had to rely on my abundant knowledge of cats to know that this was also a cat.
Without me telling you (and with a large assumption that you are visually able), would you be able to deduce that all of these are images of cats?
How do we, as humans, understand that these are all illustrations of cats? Cats can come in all shapes, colors and sizes, some cats are missing limbs or ears, some cats are conjoined twins.
We were conditioned to parse “cat” in these ways, with each iteration of exposure to a “cat,” widening our definition of a cat, thus becoming “smarter.”
And this — all of this — was my introduction to machine learning (specifically image classification by training a Convolutional Neural Network).