
How I built a beginner-friendly skin-cancer detector
I trained a computer model to look at skin pictures and sort them into seven common types of skin spots (including melanoma). This project is for AI education and experimentation only. It is not a diagnostic tool and should not be used to decide whether a skin lesion is cancerous. Any real concern about a skin spot should be reviewed by a qualified medical professional. Clinical use would require medical validation, regulatory approval, bias testing, privacy controls and expert oversight.
🛠️ GitHub Repository: 👉 View the Code on GitHub
( https://github.com/debabratapruseth/HAM10000_SkinCancer_AI )
Project Workflow at a Glance
In this beginner-friendly skin cancer detection project, I followed this workflow:
- Load the HAM10000 skin lesion image dataset
- Prepare and split images carefully to avoid patient-level leakage
- Use EfficientNetB0 as a transfer learning model
- Train the model in two stages
- Evaluate accuracy, melanoma recall and confusion matrix results
- Use explainability techniques to inspect what the model is looking at
- Treat the model as an educational prototype, not a clinical tool
Research PDF
A formal research-style PDF version of this article is available here: Deep Learning for Skin Cancer Detection: A Practical Framework for Automated Skin Lesion Classification
Suggested citation:
Pruseth, D. (2025). Deep Learning for Skin Cancer Detection: A Practical Framework for Automated Skin Lesion Classification. Debabrata Pruseth AI Blog.
Why this matters (in plain words)
When skin cancer is found early, treatment is more effective. Tools like this can help screen lots of pictures quickly so doctors can focus on the cases that need attention. For learners, this project is a great hands-on way to see how computers can learn from images.
The pictures I used
I used the HAM10000 collection — about 10,000 close-up photos of skin spots. The pictures are labeled into 7 groups, for example: harmless moles, melanoma (a serious type), and a few other kinds. Each picture also has simple info like age or where on the body the spot was taken.
What I did — explained simply
- I started with a ready-made image model EfficientNetB0 (one that already knows how to understand photos).
- I taught it, using the HAM10000 pictures, to tell which of the 7 groups a new picture belongs to.
- I trained it in two steps: first the new parts that learn skin pictures, then I gently adjusted the whole model to get better results.
- I also checked which parts of the image the model was using to make its decision (so we get an idea of what it’s looking at).
How I checked if it worked (easy terms)
I looked at simple numbers you care about:
- How many spots did it correctly identify? (overall accuracy)
- How good was it at finding melanoma? (important — we want to miss as few real cases as possible)
- Were there many mistakes where it mixed up types? (confusion matrix — a simple table of right/wrong answers) I focused on making sure the model didn’t miss melanoma — catching those is the priority.
A few plain tips I used
- Don’t mix pictures from the same patient into both the training and the testing sets — that gives false confidence.
- If the model seems to “cheat” by looking at background items (like rulers or labels), clean those pictures or change how you train it.
- If the model overfits (does great on training pictures but not on new ones), make the training more varied so it generalizes better.
What to expect from results
You’ll usually see the model do well on common, harmless spots. Rare or tricky types are harder to get right unless you give the model extra help (more examples, smarter training). You can tune the model to be safer for screening — meaning it flags more suspicious cases even if that raises the number of false alarms.
Responsible use — short and clear
This is a learning project, not a replacement for a doctor. Any real clinical use requires careful testing, approval, and expert review. Also, the picture collection used may not represent every skin tone or camera type — be mindful of bias.
Want to try it yourself? (super simple steps)
If you want the full code, the Colab notebook, and exact commands, head to the GitHub repo for this project — it has the runnable notebook, requirements, and example outputs. Check the repo to run it yourself and explore the code.
No heavy setup needed — the GitHub repo includes everything to get started.
Discover more from Debabrata Pruseth
Subscribe to get the latest posts sent to your email.


