Inspiration
I wanted to build an AI system that went beyond simply calling an existing API. I was particularly interested in computer vision and the possibility of applying machine learning to a real-world problem. This led me to explore whether I could build an image-classification system capable of distinguishing between different skin-image categories using a neural network that I designed and trained myself.
This became MELA-SCAN, an experimental AI system for skin-image classification.
What it does
MELA-SCAN takes a skin image as input and uses a custom convolutional neural network (CNN) to classify it into one of two categories represented in the dataset: Healthy or Eczema.
The goal was not simply to train a model, but to create a complete machine-learning pipeline—from dataset preparation and model development to evaluation and deployment as an accessible web application.
How I built it
I built the model in Python using PyTorch. Instead of relying on a pretrained image classifier, I designed a custom CNN containing approximately 10.42 million trainable parameters.
The images were processed and normalized before being passed through the network. I trained the model on a dataset containing 3,316 images, then evaluated its performance on a held-out test set using several metrics rather than relying on accuracy alone.
I also built a Gradio interface around the trained model. This allows a user to upload an image and receive the model's predicted class and probability estimates. The application automatically uses CPU or GPU execution depending on the available hardware.
Finally, I deployed the application publicly using Render, making the finished system accessible through a web browser without requiring users to install Python or any machine-learning libraries.
Results
On the test set, MELA-SCAN achieved:
- 99.00% accuracy
- 99.55% precision
- 98.22% sensitivity
- 99.63% specificity
- 98.88% F1 score
- 99.93% ROC-AUC
These results were encouraging, particularly because the model was trained from scratch rather than using a pretrained image-classification backbone.
However, these numbers should not be interpreted as clinical performance. The evaluation was performed on the project's dataset, and performance on carefully controlled test data does not guarantee that the model will generalize to real-world images from different cameras, lighting conditions, populations, or clinical environments.
Challenges
One of the biggest challenges was turning a model that worked locally into an application that could actually be used online. The original deployment environment attempted to install a CUDA-enabled version of PyTorch, which was too memory-intensive for the free hosting environment.
I solved this by switching the deployment to a CPU-only PyTorch configuration and pinning the Python version to maintain compatibility with the dependencies.
Another deployment issue occurred when the application could not find the trained model file because the model was stored inside the models/ directory. I corrected the file path and redeployed the application successfully.
These problems taught me that building an AI project is not just about training a model. Dependency management, memory constraints, file organization, deployment configuration, and reproducibility can be just as important as the machine-learning code itself.
What I learned
Building MELA-SCAN gave me practical experience with the entire machine-learning development cycle. I learned how to work with image datasets, design and train a CNN, evaluate a classifier using multiple statistical metrics, save and load model weights, build an interactive inference interface, use Git and GitHub for version control, manage large model files with Git LFS, and deploy a machine-learning application to the web.
Most importantly, I learned the difference between achieving a high score on a test set and demonstrating that an AI system is reliable in the real world. That distinction is especially important when machine learning is applied to areas such as healthcare.
MELA-SCAN is therefore an experimental research and engineering project—not a medical diagnostic device. Its purpose is to demonstrate what I could build from the ground up while exploring the challenges involved in applying computer vision to a real-world problem.
Built With
- gradio
- matplotlib
- numpy
- pandas
- python
- pytorch
- scikit-learn
- torchvision
Log in or sign up for Devpost to join the conversation.