Enhanced Neoplasia Detection in Endoscopic Images with Domain-Specific Pretraining and Focal Loss for Severe Class Imbalance
ICANSee is a simple set of improvements over the original RARE Challenge baseline to reduce data leakage, prevent overfitting, and improve recall in a highly imbalanced setting.
- Evaluation protocol: validation-only by default, with optional separate test set via
--eval_data_path. - Early stopping: stops training when the chosen validation metric stops improving (patience/min_delta configurable).
- Sensitivity-focused training option: allow saving the best checkpoint by
Sensitivitywhen recall is the priority. - Focal loss tuning: support for
focal_alpha/focal_gammato bias towards the positive (neoplasia) class. - Gastronet baseline integration: easy evaluation and use of pretrained weights (
--use_gastronetor--pretrained_path).
Train (validation-only evaluation, AUPRC as selection metric):
env PYTHONPATH=. python3 train.py \
--data_path data \
--model resnet50 \
--epochs 30 \
--loss focal_loss --focal_alpha 0.9 --focal_gamma 1.0 \
--sampling oversample \
--use_gastronet \
--save_metric AUPRC \
--patience 8 --min_delta 0.001The focal loss
Equivalently, written per-class in terms of
-
$\gamma$ : increases down-weighting of easy examples as it grows. -
$\alpha$ : balances positive/negative classes; higher$\alpha$ emphasizes the positive class.
