Skip to content
ModelListedExternal
Download

Anemia Palor 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...

KindOtherVersionRevision 5659a76

Model source

Kind
Other
File size
18.3 MB
Version
vRevision 5659a76
Updated
Sep 22, 2026
Downloads
15
Source
Hugging Face

Source description

Explainable Dual-Head EfficientNet-B0 for Anemia Detection

The core model is a dual-head EfficientNet-B0 that jointly performs:

  1. Binary classification — Anemic vs. Non-Anemic
  2. Regression — estimated hemoglobin (Hb) level in g/dL
  3. 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.

AnemicNon-AnemicTotal
Samples424 (59.7%)286 (40.3%)710
Mean Hb (g/dL)8.9412.4110.36
Std Hb (g/dL)1.871.122.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

ClassPrecisionRecallF1-scoreSupport
Non-Anemic0.740.930.8257
Anemic0.940.780.8585
Accuracy0.84142
Weighted avg0.860.850.84142
  • AUC-ROC: 0.902

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.

import torch
from PIL import Image
from torchvision import transforms

model = torch.load("conjify_dual_head_effnetb0.pt", map_location="cpu")
model.eval()

preprocess = transforms.Compose([
    transforms.Resize((224, 224)),
    transforms.ToTensor(),
    transforms.Normalize(mean=[0.485, 0.456, 0.406],
                          std=[0.229, 0.224, 0.225]),
])

img = Image.open("conjunctiva.jpg").convert("RGB")
x = preprocess(img).unsqueeze(0)

with torch.no_grad():
    cls_logit, hb_pred = model(x)
    prob_anemic = torch.sigmoid(cls_logit).item()

print(f"Anemic probability: {prob_anemic:.3f}")
print(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:

@article{appiahene2023cpanemic,
  title   = {CP-AnemiC: A conjunctival pallor dataset and benchmark for anemia detection in children},
  author  = {Appiahene, P. and Chaturvedi, K. and Asare, J. W. and Donkoh, E. T. and Prasad, M.},
  journal = {Medicine in Novel Technology and Devices},
  volume  = {18},
  pages   = {100244},
  year    = {2023},
  doi     = {10.1016/J.MEDNTD.2023.100244}
}

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.

Sources

1 source
Hugging FacePrimaryVersion 5659a76e6d3d42a9059e559f4182e07a7eb6387d
huggingface.co/galihkjaya/anemia-palor-detection/tree/5659a76e6d3d42a9059e559f4182e07a7eb6387d

Verified Sep 9

Model artifacts

1 artifact

model.pt

pt · 18.3 MB · SHA-256 8c8d521750f0…e00e · Hugging Face

Download

Source excerpts

2 excerpts

--- license: mit tags: - image-classification - regression - computer-vision - medical-imaging - anemia-detection - efficientnet - healthcare - multi-task-learning pipeline_tag: image-classification --- # Explainable Dual-Head EfficientNet-B0 for Anemia Detection The core model is a **dual-head EfficientNet-B0** that jointly performs: 1. **Binary classification** — Anemic vs. Non-Anemic 2. **Regression** — estimated hemoglobin (Hb) level in g/dL 3. 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](https://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**](https://doi.org/10.1016/J.MEDNTD.2023.100244) (Appiahene et al., 2023) — a public conjunctival pallor dataset collected from pediatric subjects in Ghana, with laborator...

Source context: 15 downloads · 0 likes · Pipeline image-classification · Repo galihkjaya/anemia-palor-detection