Ayush Deshmukh Home

Spot the Pox

A cascaded attention module for Mpox lesion classification · research internship, CANDLE Research Lab, IIT Roorkee

Ayush Deshmukh · supervised by Prof. Sparsh Mittal

TL;DR At the CANDLE Research Lab, IIT Roorkee, working with Prof. Sparsh Mittal, I built a cascaded attention module for an EfficientViT backbone to classify Mpox skin lesions. It reached 97.5% accuracy on MCSI, above all six baselines I compared against, with 13% fewer parameters than EfficientViT-L1 and 5.5× fewer FLOPs in the attention modules it replaces. I later extended it on my own into a DAGM GCPR 2025 paper.

The problem

Mpox lesions look a lot like chickenpox, measles and acne, and lab confirmation is slow. The datasets are also tiny: MCSI has only 400 images across four classes. The goal of the internship was a classifier that is accurate on that little data and cheap enough to run on modest hardware, rather than just stacking a bigger backbone.

What I built

Architecture of the cascaded attention module Input features go through a 3 by 3 convolution and are split into three heads. In each head two branches build Q, K and V with a 3 by 3 and a 1 by 1 convolution and run attention over the spatial positions. Branch outputs are concatenated per head, all heads are concatenated, projected back with a 1 by 1 convolution, added to the input and batch-normalised. input x : B × C × H × W 3×3 conv C → 3 × 16 head 1 · 16 ch head 2 · 16 ch head 3 · 16 ch Inside every head same 2 branches, same weights, ×3 heads branch 1 3×3 conv 16 → 16 1×1 conv 16 → 3 × 8 Q K V attention softmax(Qᵀ·K / √8) · V 8 ch branch 2 3×3 conv 16 → 16 1×1 conv 16 → 3 × 8 Q K V attention softmax(Qᵀ·K / √8) · V 8 ch concat 2 branches → 16 ch concat 3 heads → 48 ch 1×1 conv 48 → C + residual (skip) connection BatchNorm2d (affine = False) output : B × C × H × W
The cascaded attention module. A 3×3 convolution expands the input to 3 × 16 channels and splits it into three heads. Each head runs two Q/K/V attention branches (a 3×3 then a 1×1 convolution, Q, K and V of 8 channels each, softmax attention over the H×W positions) and concatenates them. The two branches use the same weights in all three heads. Heads are concatenated, projected back to C channels, added to the input and batch-normalised. Drawn from model.py (CascadedAttentionModule) in the CAM repo; utils.py swaps it into the backbone.

Results

ModelAccuracy %mean ± std, 10 foldsPrecisionRecallF1Params
EfficientViT-L1 + CAM (ours)97.5 ± 0.770.97890.97110.974245.8M
EfficientViT-L197.25 ± 1.840.97280.97440.971552.7M
CoAtNet-196.75 ± 3.740.97110.96720.967441.7M
DeiT3-M95.75 ± 3.340.96080.95770.955938.8M
ViT-B/1695.75 ± 3.550.95780.95620.954286.6M
MobileNetV3-L93.75 ± 5.430.94340.94740.93925.5M
ResNet10189.25 ± 4.870.89080.89190.884544.5M

MCSI, 10-fold cross-validation. Baseline rows are the fold means in the per-model result CSVs of my later solo repo (MCSI/Scores and Hyperparams/*/results_*.csv), evaluated on the same folds. Precision, recall and F1 are macro averages. The CAM row is from my own internship runs (mean and sample standard deviation over 10 trials). The CAM repo does not include saved scores, so these cells cannot be reproduced from it. FLOPs are counted with PyTorch's FlopCounterMode (convolutions and matrix multiplies, two FLOPs per multiply-add) on a 224×224 image, for the six swapped modules only and for the full network. Params are counted with timm's stock classifier head and random weights; the CAM row is EfficientViT-L1 with CascadedAttentionModule in stage-3 blocks 1–6, using model.py and utils.py from the CAM repo.

Scatter plot of MCSI accuracy against parameter count. EfficientViT-L1 with the cascaded attention module is at 97.5% and 45.8 million parameters, above EfficientViT-L1 at 97.25% and 52.7 million, and above the other five baselines.
Accuracy against size. The module moves EfficientViT-L1 up and to the left. It is the most accurate model but not the smallest: CoAtNet-1, DeiT3-medium, ResNet101 and MobileNetV3 have fewer parameters. Accuracy: CSVs as in the table (CAM: 97.5% as reported). Params: timm counts as above.
Per-fold test accuracy of the six baselines on MCSI, ten folds each, with mean and standard deviation, plus the CAM model over 10 trials, mean 97.5 and standard deviation 0.77.
Fold-to-fold spread. Each baseline dot is one 40-image test fold; diamonds are mean ± sample standard deviation. The baselines' standard deviations are 1.8–5.4 points, so a 0.25-point gap such as 97.5% against 97.25% is small next to their spread. The top row, CAM, shows the 10 trial scores from my internship runs (mean 97.5, standard deviation 0.77); I am showing them as I recorded them and they are not reproducible from the CAM repo. Baselines: the same result CSVs, column Accuracy.

Then I extended it solo

After the internship I kept going on my own and added dilated convolutions inside each attention head. That extension became a single-author paper at DAGM GCPR 2025: A Cascaded Dilated Convolution Approach for Mpox Lesion Classification.

Thanks

To Prof. Sparsh Mittal and the CANDLE Research Lab at IIT Roorkee for hosting me and for the infrastructure that made this possible.