Explainable Dual-Head EfficientNet-B0 for Anemia Detection
The core model is a dual-head EfficientNet-B0 that jointly performs:
- Binary classification — Anemic vs. Non-Anemic
- Regression — estimated hemoglobin (Hb) level in g/dL
- Also, it actually integated with Generative models (soon to be)
from a single image of the palpebral conjunctiva, captured via a smartphone camera. The model is part of the Conjify self-screening ecosystem (
conjify.netlify.app), developed for the Statistics Essay Competition (SEC) Satria Data 2026.
Model Description
- Backbone: EfficientNet-B0, pretrained on ImageNet
- Parameters: 5.3M
- Model size: 21 MB
- Shared representation: 1,280-dim feature vector from the final global average pooling layer
- Classification head:
Dropout → Linear(1280→1) → Sigmoid
- Regression head: MLP
1280 → 512 → 128 → 1 (predicts Hb, z-score normalized during training, denormalized at inference)
- Combined loss:
L = 0.6 · L_cls + 0.4 · L_reg (BCE with class weighting + MSE)
- Interpretability: Grad-CAM applied on the
conv_head layer; coverage, intensity, and mean activation statistics are extracted from the activation map and passed downstream as structured context for an LLM interpretation layer (Llama 3.3 70B in the full Conjify pipeline).
Training Procedure
- Optimizer: AdamW with Cosine Annealing learning rate schedule
- Strategy: Progressive unfreezing in two phases
- Phase 1: backbone frozen, only the two heads trained (stable initialization)
- Phase 2: full fine-tuning of backbone + heads
- Input: RGB images resized to 224×224, normalized with ImageNet statistics
- Augmentation: applied on the training split to improve robustness to lighting/orientation variation typical of in-field conjunctiva photos
- Target normalization: Hb values z-score normalized before regression to keep both loss terms on comparable scales
Training Data
CP-AnemiC (Appiahene et al., 2023) — a public conjunctival pallor dataset collected from pediatric subjects in Ghana, with laboratory-confirmed Hb values as ground truth.
| Anemic | Non-Anemic | Total |
|---|
| Samples | 424 (59.7%) | 286 (40.3%) | 710 |
| Mean Hb (g/dL) | 8.94 | 12.41 | 10.36 |
| Std Hb (g/dL) | 1.87 | 1.12 | 2.26 |
Split: 568 train (80%) / 142 validation (20%), stratified to preserve class balance.
Evaluation Results
Evaluated on the 142-sample validation split, using the checkpoint with the lowest validation loss.
Classification
| Class | Precision | Recall | F1-score | Support |
|---|
| Non-Anemic | 0.74 | 0.93 | 0.82 | 57 |
| Anemic | 0.94 | 0.78 | 0.85 | 85 |
| Accuracy | | | 0.84 | 142 |
| Weighted avg | 0.86 | 0.85 | 0.84 | 142 |
Regression (Hb estimation)
- MAE: 1.515 g/dL
- RMSE: 2.041 g/dL
These regression errors are precise enough to separate severe anemia (Hb < 8 g/dL) from mild–moderate cases for screening purposes, though not yet precise enough for clinical diagnosis.
Intended Use
This model is intended as a non-invasive, self-screening aid for anemia risk, to be used alongside an LLM interpretation layer that translates raw predictions and Grad-CAM statistics into actionable, plain-language health guidance.
It is not a diagnostic device. It does not replace laboratory hemoglobin testing or clinical evaluation. See the
Limitations below.
Limitations
- Domain gap: trained on conjunctiva images from pediatric subjects in Ghana (CP-AnemiC); performance on adult and Indonesian populations is not yet validated. Population-specific fine-tuning is a planned next step.
- Dataset size: 710 images is small for a regression task of this kind; regression error (MAE 1.515 g/dL) reflects this.
- No clinical validation / no Human-in-the-Loop review yet — required before any clinical-scale deployment.
- Sensitive to image quality, lighting, and conjunctiva positioning at capture time.
How to Use
Example assumes a PyTorch implementation with a custom dual-head wrapper around efficientnet_b0. Adjust to match your actual checkpoint format/framework.
1import torch
2from PIL import Image
3from torchvision import transforms
4
5model = torch.load("conjify_dual_head_effnetb0.pt", map_location="cpu")
6model.eval()
7
8preprocess = transforms.Compose([
9 transforms.Resize((224, 224)),
10 transforms.ToTensor(),
11 transforms.Normalize(mean=[0.485, 0.456, 0.406],
12 std=[0.229, 0.224, 0.225]),
13])
14
15img = Image.open("conjunctiva.jpg").convert("RGB")
16x = preprocess(img).unsqueeze(0)
17
18with torch.no_grad():
19 cls_logit, hb_pred = model(x)
20 prob_anemic = torch.sigmoid(cls_logit).item()
21
22print(f"Anemic probability: {prob_anemic:.3f}")
23print(f"Estimated Hb: {hb_pred.item():.2f} g/dL")
Citation
If you use this model, please cite both the original dataset and the conference paper:
Dataset:
1@article{appiahene2023cpanemic,
2 title = {CP-AnemiC: A conjunctival pallor dataset and benchmark for anemia detection in children},
3 author = {Appiahene, P. and Chaturvedi, K. and Asare, J. W. and Donkoh, E. T. and Prasad, M.},
4 journal = {Medicine in Novel Technology and Devices},
5 volume = {18},
6 pages = {100244},
7 year = {2023},
8 doi = {10.1016/J.MEDNTD.2023.100244}
9}
Conference paper (if published in proceedings):
Please refer to the National Conference 2026 proceedings for the full citation when available.
Disclaimer
This model is a research prototype developed for a conference paper (National Conference STIS 2026). It is not a certified medical device and should not be used as a substitute for professional medical advice, diagnosis, or treatment. The model is intended for educational and screening research purposes only, pending clinical validation and potential publication in peer-reviewed proceedings.