Case study · M.Tech · Medical imaging

Skin lesion classification using Vision Transformers

This M.Tech skin lesion classification project sorts dermoscopic images from the public HAM10000 dataset into seven categories with a Vision Transformer (ViT-Base/16), and tests it against DINOv2, EfficientNet-B4 and ResNet-50.

Last updated

Results page from this project’s IEEE-format paper on HAM10000 skin lesion classification: a confusion matrix, an ablation study table and chart, and a comparison with published HAM10000 results.
IEEE-format paper
Skin lesion classification web app built for the project: upload a skin image and choose between the ViT and DINOv2 models.
Web app
Bar chart comparing Vision Transformer (ViT-Base/16) and DINOv2 skin lesion classifiers with EfficientNet-B4 and ResNet-50 on accuracy, AUC-ROC, F1, balanced accuracy, precision and recall.
Results

From a delivered M.Tech project, shown with names and institute details removed. Select an image to zoom.

The ViT scored highest of the four on every metric in the comparison. The student received an IEEE-format paper, an M.Tech thesis, a Flask web app, a PPT and the training notebooks.

What is this project, at a glance?

A research comparison of transformer and CNN models for dermoscopic skin lesions, deployed as a web app.

At a glance
ItemDetails
LevelM.Tech
DomainMedical image analysis, deep learning
Problem typeMulti-class image classification (7 lesion types) on an imbalanced dataset
DatasetHAM10000, a public dermoscopy dataset
Core methodsTransfer learning with ViT-Base/16 and DINOv2; EfficientNet-B4 and ResNet-50 baselines; weighted sampling, label smoothing and augmentation; ablation study; Grad-CAM
StackPython, PyTorch, timm, Hugging Face weights, Albumentations, scikit-learn, Flask, HTML/CSS/JS, LaTeX
DeliverablesIEEE-format paper, M.Tech thesis, short report, web app, PPT, code and Jupyter notebooks

What problem does the project solve?

Skin cancer is usually caught by a dermatologist reading a dermoscopic image, and that expertise is unevenly available. Catching melanoma early matters, so skin lesion classification using deep learning is an active research area.

The catch is the data. In HAM10000, benign moles make up most of the images, so a model can score high accuracy and still miss rare, dangerous lesions. The project asked two questions:

  • Do transformer models, which look at the whole image at once, classify skin lesions better than standard CNNs?
  • Which class-imbalance fixes actually help, and by how much?

How was it built?

All four models were trained and tested under the same conditions, so the comparison is fair.

  • Data: a stratified train, validation and test split, with images resized per model and normalised.
  • Augmentation: flips, rotations, colour jitter, blur and coarse dropout, which imitates hair and ruler marks.
  • Imbalance handling: weighted random sampling, label smoothing and extra augmentation for rare classes.
  • Models: ViT-Base/16 and self-supervised DINOv2 against EfficientNet-B4 and ResNet-50, all fine-tuned with AdamW, a cosine schedule and early stopping on balanced accuracy.
  • Evaluation: six metrics, a confusion matrix, an ablation study and Grad-CAM heatmaps.
Block diagram: user upload, Flask web server and image pre-processing feed a ViT-B/16 model and a DINOv2 model, whose softmax outputs are aggregated into a JSON response.
ArchitectureSystem architecture: user upload, Flask server and preprocessing feed two transformer models, whose outputs are combined into a JSON response.

What did we build?

  • Web app (Flask + HTML/CSS/JS): drag-and-drop upload, a choice between the 7-class ViT model and a broader DINOv2 model, and a results panel with the top class, confidence, per-class probabilities and a risk badge. A gallery page explains each condition, next to a medical disclaimer.
  • Codebase: separate modules for data, models, training, evaluation and inference, one config file, Jupyter notebooks, and scripts that regenerate every figure.
Skin Disease Classifier web app: a hero banner with headline statistics, an image upload box and a model selector offering the ViT HAM10000 model or the DINOv2 model.
Web app · upload & classifyWeb app built for the project: upload a skin image and choose between the ViT and DINOv2 models. Result screens are not shown here because they contain real lesion photographs.

What were the results?

ViT-Base/16 came out on top on all six metrics, with DINOv2 second. Both transformers beat EfficientNet-B4 and ResNet-50, which supports the idea that whole-image attention helps with lesion borders and colour patterns.

Grouped bar chart on the HAM10000 test set: ViT-Base/16 has the tallest bar in every group, followed by DINOv2, EfficientNet-B4 and ResNet-50.
Results · model comparisonViT-Base/16, DINOv2, EfficientNet-B4 and ResNet-50 compared on accuracy, AUC-ROC, F1, balanced accuracy, precision and recall.

Training and validation curves track each other closely, a sign the model is not just memorising. In the confusion matrix most test images sit on the diagonal; the errors left are mainly between look-alike classes, especially melanoma and benign moles.

Two line charts: training and validation cross-entropy loss falling, and training and validation accuracy rising, over 30 epochs.
Results · training curvesTraining and validation loss and accuracy curves over 30 epochs.
Seven-by-seven confusion matrix for the Vision Transformer with classes akiec, bcc, bkl, df, mel, nv and vasc; most counts lie on the diagonal.
Results · confusion matrixConfusion matrix for the Vision Transformer on the 7-class HAM10000 test set.

The ablation study removed one imbalance fix at a time. Dropping weighted sampling hurt macro F1 the most, and removing all of them hurt it further.

Shown with student, guide and institute details removed.

What did the student receive?

  • IEEE-format conference paper in LaTeX, with the method, results tables, ablation and a comparison with published HAM10000 results, laid out to the IEEE paper format.
  • M.Tech thesis covering the literature survey, project plan (Gantt chart and risk register), design, implementation, testing and results, plus a shorter summary report.
  • Flask web app with upload, model choice, a results panel and a conditions gallery.
  • Training and evaluation code with configs, Jupyter notebooks and figure scripts.
  • PowerPoint presentation for reviews and the final viva.
Two-column IEEE-format paper page with a confusion matrix, an ablation table and bar chart, a comparison table and chart, and discussion text.
IEEE-format paperResults page from the IEEE-format paper: confusion matrix, ablation study, and a comparison with published HAM10000 results.

How does it compare with our other skin project?

Both projects classify skin images, but they answer different questions. Pick the one closer to what your course asks for.

Two skin projects compared
AspectThis projectIn-browser screening
LevelM.TechM.E.
ImagesDermoscopic, 7 lesion types (HAM10000)Ordinary photos, 22 skin conditions
FocusTransformer vs CNN researchPrivate, server-free deployment
Runs onFlask serverThe user’s browser (ONNX)
Main write-upIEEE-format paper and thesisDissertation report and seminar

Read the case study on skin disease detection using deep learning in the browser. For more ideas in this area, see our computer vision and machine learning projects for final year.

How could you adapt this project?

Keep the pipeline and add one clear contribution of your own. If you are looking for Vision Transformer projects at M.Tech level, these are directions to discuss with your guide:

Topic ideas, not delivered projects

These are suggestions for your own topic. The delivered work is the project above.

  • Topic ideaSegment first, then classifyCrop the lesion with a U-Net or SAM step and test whether melanoma and mole confusions drop.
  • Topic ideaCross-dataset robustnessTrain on HAM10000, test on another public ISIC set and report the change.
  • Topic ideaDistil the ViT for phonesCompress the transformer into a small mobile model and compare speed and accuracy.
  • Topic ideaImage plus patient metadataFuse age and body site with the image features and measure the gain on hard classes.

Frequently asked questions

Can I get a similar skin lesion classification project?

Yes. Tell us your level, deadline and whether you need a paper. We scope a version with its own contribution, such as a new model, dataset or extension, and deliver the code, a report in your institution’s format and the paper if required.

Which dataset does skin lesion classification use, and is it free?

HAM10000, a public dermoscopy dataset with seven diagnostic categories, free to download for research. One benign class dominates it, so handling class imbalance is part of the work.

Why use a Vision Transformer instead of a CNN?

A Vision Transformer relates every image patch to every other one through self-attention, so it can weigh border shape and colour spread across the whole lesion. Here both transformers beat the two CNN baselines.

What will I need to explain in the viva?

The data split and why imbalance matters, how ViT patches and attention work, why balanced accuracy and macro F1 sit next to accuracy, what the ablation shows, how the Flask app serves a prediction, and the limits of the work. The handover walkthrough covers each one.

Will the IEEE-format paper be published?

Acceptance is decided by the conference or journal. We prepare the paper in IEEE format, help you choose suitable venues and support you through reviewer comments.

A research prototype, and your institution’s rules apply

This system supports learning and research; it is not a medical device. Our work is building, writing support, guidance and explanation, so check what your university allows before you submit.

Delivered work

Related case studies

More medical imaging projects we delivered, shown with names and institute details removed.

Want a deep learning project with a paper? Tell us your topic.

Share your level, topic and deadline. You get a written plan and a fixed quote, and the consultation is free.

B.Tech · M.Tech · PhD · Projects · Papers · Thesis · Reports

WhatsApp Free consultation