Hello everyone,
First of all, I want to thank fast.ai and the users for the amazing course and forum posts! Second, I would like to share a web application I made based on the second lecture. This is actually my first self-made project, and this course is the first in which I learn about machine learning. So I would like to receive some feedback.
The application I made is a melanoma classifier, which you can visit here: https://melanoma-classifier.herokuapp.com/. As you see from the url, I used Heroku to deploy the app. And you can find the source code here (including the Jupiter notebook with which I trained the model): https://github.com/Mees-Molenaar/melanoma-classifier.
In the notebook I have made lists of problems that occurred and possible improvements that can be made, which I will copy here:
Improvements
This is my second project (I am still finishing the first project). I already felt more comfortable using the fast.ai library. However, there is still room for improvement.
- Making sure the training data is trustworthy since I am no dermatologist
- Maybe using resnet50 instead of resnet34
- Using other transforms (maybe just like the satellite in lesson 3, for this problem I can use vertical flips?)
- And in lesson 3 there was a part about picture sizes, maybe that also can help this model. However, I didn’t fully understand it yet.
- Improving the learning rate
- Change the number of epochs.
Difficulties
During this project, I had several difficulties challenges that I would like to share with you.
-
Finding a trustworthy dataset (I was not able to find the source of these pictures)
-
I am no dermatologist so it is hard for me to verify the data.
-
Making the web-application. My only experience is using Flask in the cs50 course I followed online via Edx. However, the most problematic part was deploying the model on a hosting site. After a lot of tries, I was finally able to launch the app on Heroku.
-
I am not able to run the code locally yet, so I had to upload it to Heroku to check if it worked. This takes quite some time, so honestly, I should try to install the necessary programs locally. Since I don’t have NVIDIA graphics card, so don’t have CUDA, I for some reason was not able to install the fastai library (even using the pytorch CPU only library)
-
First time using Heroku: needed to change the Procfile, but I didn’t know how. I found out that for the web application you need this line of code:
web: gunicorn application:app
- And you should rename application to your filename that creates the Flask instance, and app to the name you gives this Flask instance in your application file.
- Lastly, I got a problem: Unexpected key(s) in state_dict. This seems to be a problem with different fastai library versions you use for learning the model and making predictions in your web app. So you have to make sure you use the same fastai library versions.
Thanks a lot for your time reading about this project, and I would be glad to answer any questions.
Cheers,
Mees