Image processing with basic deep learning libraries, OpenCV.

My first steps into the world of A.I.

Part 1: The start of everything

Intro

In a world where it’s difficult to avoid the rapid advances of technology, I was among the many who learned to embrace. My name is Amerald, I’m an intern student working at Medmain with the A.I. engineers. This is the story of my ongoing pursuit of machine learning.


As a curious student studying in a modern technological university, the media around me has been popularizing the rise of “Big Data” for quite a while now. In my eyes, this was just a term directly related to the predicted explosion of AI technology that is currently only in its infancy stage. In other words, it is a direct applicable field of Big Data that will eventually grow into an entire industry. Yes, more than it already is currently.

Image from University of Waterloo’s Big Data Research Lab

Naturally, a tech nerd such as myself became increasingly interested in the subject and began taking my first steps before I knew it.


Although it’s only the first step, it was a large one. In fact, I travelled to the other side of the globe with that step. I landed in Japan.

Image from Original Travel

I was lucky enough to gain an internship opportunity at an start-up company in the city of Fukuoka, located in the Kyushu region. This where I will be spending the next 4 months, diving into the field of AI.

Image from Kyushu Japan Holidays

Background

The name of the company is Medmain, A start-up company in Fukuoka aiming to “Pioneer the new age of medicine through Artificial Intelligence”.

Official Site of Medmain
Our Vision : Creating a world where revolutionary medical treatment is the standard.
Our Mission: Lead the transformation of globalized medical care, become the central core of that new ecosystem.
Our Value: Providing new value to all medical affiliates.

I had been interested in the concept of Machine Learning for a while now, but I never searched deep for its core concepts and potential for different industries. So, it came as a surprise when I learned it was also applicable in a field such as medical diagnosis. But how exactly is it applied anyways?

With this question in mind, I continued my exploration to find out the answer.


The Beginning

I had some basic knowledge of Python, but that was enough for me to begin learning some pretty interesting things. Outside of the classroom, I’ve never coded using anything but basic libraries and thus it was an entirely new landscape for me to explore once I knew the keywords. For me, it felt like the things I’ve read in textbooks all of a sudden made total sense, especially when libraries like Numpy and Matplotlib felt practical. Specifically, performing advanced or otherwise complex mathematical operations on a large dataset was much more efficient and convenient with Numpy. Matplotlib gave a way to display necessary labels of values and increased the readability of products. These libraries proved to be powerful tools in my journey.

Image from Tensorflow Tutorial

I started studying some simple image processing using the OpenCV library. Within a week, I learned to manipulate images and organize them into a data format which was easy for processing later on. I was soon able to write code for splitting images, resize them, add padding, and outline certain features in a image, given the coordinates.


Using the library felt very powerful, simple commands such as

cv2.imread

and

cv2.imshow

were able to store and display image data and convert them into a process-ready state for further calculations. This was a phenomenal step from me, since I had never worked with anything that actually gave me visual feedback, aside from HTML. The more I worked with the library, the more I realized that it felt like a programmer’s Photoshop. With enough imagination and time, you could probably do some amazing things with these modules.

For example, splitting the image was more intuitive than I originally thought. I learned that each pixel was actually organized into an array and splicing the list at the right places was enough to do the job. To be able to perform operations on each exact pixel of an image was a feat I’ve never thought of as possible… well, until today.


The library also contained some really handy functions, like

cv2.resize

to resize a image, and

cv2.copyMakeBorder

to create border and padding around an image.

At the end of the day, nothing prides me more than visual results of my hard work.

This felt like a great starting point for the “deep learning” (no puns intended) that was to come.

Image from OpenCV forums

Aside

I also had some time to play around with video processing using OpenCV, it was surprisingly enjoyable using color filtering to achieve some simple object tracking.

from OpenCV Python Documentation

The library is extremely developer-friendly and I can understand how this may contribute to deep learning.

That’s it for my first few weeks of training, please look forward to the next part!