Inspiration

I've always been interested in making sure that technology is accessible. When I released SeaLion, my first library, and saw a tremendous response back I felt that designing and creating APIs and libraries that other people could use was where my passion would lay forever. It was an invaluable learning experience for me and it helped countless other people as well in their journey towards learning machine learning.

I remember hearing about AI being used in malware detection the other day. It's no secret today that AI is everywhere, being used in every field - and so I wondered how I could add to this momentum. One of the things I noticed when using tensorflow and other libraries was just the sheer amount of work it took for me to learn and get started with them. For all the talk I had heard about doctors using machine learning, I wondered how they would get started. I had some programming background, but they may have none. So I decided that if I wanted to be part of this movement of using AI for good I had to make it more equitable and easy-to-use. That's what MakeCNN does - make it possible for you to build models to do things like diagnose diseases in just a few lines of code : )

What it does

MakeCNN is a python library which you can get like such from PyPI :

pip install mcnn

that will enable you to build Convolutional Neural Networks (CNNs) for image classification tasks in a few seconds. Simply put, all you do is give it data!, you just feed in the path to the folder with the training and testing data, and it will process all of that from the folders and then use it to train the model.

Some code :

from mcnn.make import AutoWork
aw = AutoWork(path_to_folder) # instantiate the AutoWork class, which we'll need
aw.train() # train the model
aw.test_evaluate() # get the accuracy, numeric value from 0 - 1 (more is better) 

you can also use this method to predict on a single image, or a folder filled with many images :

aw.predict(path_to_single_image)
aw.predict_directory(path_to_folder_of_images)

The best part? You NEVER have to make any models or do any data/image processing. Just train, get a sandwich or something to eat, and come back with a nice model :D

How we built it

To make the CNN we used tensorflow, an open source machine learning framework. This was to make the CNN with all of its bells and whistles.

To get the images from the file, we had to go through each image, process it with opencv, and then store that into numpy arrays. Such images could be used to train the CNN. For some specifics on the CNN model, we used Adam Optimization and Cross-Entropy Loss, given that this is an image classification problem MakeCNN is solving.

Challenges we ran into

Biggest challenge by far was finding a good model architecture. We had to try many different models to see which one would generalize best, run fastest, etc. to meet the overarching needs of everyone. Also I had to learn how to use opencv and the tensorflow API on the spot, so I need a lot of documentation. overall though, we were "in the zone" the entire time : )

Accomplishments that we're proud of

On this COVID-19 X-Ray Dataset, our model achieved 97.5% validation accuracy. This was astounding for such a dataset of relevance and prominence. I also love the fact that this is a library, open-source for anyone to download, edit, or use. The process of going from nothing, to an idea, to a project, to a library was something I wouldn't trade for anything.

What we learned

The biggest thing we learnt was to be flexible and use the documentation. For example I thought I was going to use one way of where I manually parsed through the image files one by one in a for loop to process the data, but then it turns out tensorflow has an ImageDataGenerator class to do to that in a much more efficient and fast manner - so I had to learn to switch immediately. Overall I learnt that you shouldn't be afraid of the documentation and you should be willing to switch and change code FAST. Don't get emotional if the code you spent a day on can be fixed by a few lines in a few seconds.

What's next for MakeCNN

I may continue to expand beyond image classification to things like sentiment analysis and generative learning with models like RNNs and GANs. I will continue to update MakeCNN as new ideas come, and I definitely hope it will help others! Whatever I do I hope to spread ML and make it more open to all.

Built With

Share this project:

Updates