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 a learning tool — not medical advice — and the full code and a ready-to-run notebook are on the GitHub repo. Check the repo for the step-by-step code and Colab notebook.

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.


Want to learn more about GenAI and Prompt Engineering !


Discover more from Debabrata Pruseth

Subscribe to get the latest posts sent to your email.

Scroll to Top