Instructions to use Sidharth1743/Fingernail_anemia_QLora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Sidharth1743/Fingernail_anemia_QLora with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Sidharth1743/Fingernail_anemia_QLora", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Fingernail MedSigLIP QLoRA
Overview
This repository provides QLoRA fine‑tuning artifacts for fingernail‑based anemia detection using a MedSigLIP vision encoder. It includes the trained LoRA adapters, linear head, processor config, and detailed evaluation metrics. The goal is a lightweight, GPU‑efficient fine‑tuning pipeline suitable for limited VRAM setups.
Contents
fingernails_qlora/lora_adapters/– LoRA adapter weights and configlinear_head.pt– classification headprocessor/– preprocessing configtest_metrics.json– evaluation metricstrain_config.json– training hyperparameters
code/fingernails/– training and split scripts (mirrors the code repo)README.md– technical report
Dataset (Counts Only)
Source dataset folder in the main project:
Dataset/Detection of Anemia using Colour of the Fingernails Image Datasets from Ghana/Fingernails/
Split counts (from code/fingernails/*.csv):
- Train: 3409 images (Non‑Anemia 1371, Anemia 2038)
- Val: 390 images (Non‑Anemia 150, Anemia 240)
- Test: 417 images (Non‑Anemia 174, Anemia 243)
Method
- Backbone: MedSigLIP vision encoder (frozen backbone).
- Fine‑tuning: QLoRA (LoRA adapters for parameter‑efficient tuning).
- Classifier: linear head on pooled vision embeddings.
- Preprocessing: resize to 448x448, RGB conversion, normalize to [-1, 1].
Experiments & Results
QLoRA Fine‑Tuning (Test Metrics)
From fingernails_qlora/test_metrics.json:
- Accuracy: 0.582734
- Precision: 0.582734
- Recall: 1.000000
- F1: 0.736364
- ROC‑AUC: 0.620288
Zero‑Shot Baselines (Comparison)
Baseline (fingernails, test=417)
- Accuracy: 0.417266
- Precision: 0.000000
- Recall: 0.000000
- F1: 0.000000
- ROC‑AUC: 0.440542
- Confusion Matrix: [[174, 0], [243, 0]]
Baseline (ROI, test=417)
- Accuracy: 0.412470
- Precision: 0.478261
- Recall: 0.090535
- F1: 0.152249
- ROC‑AUC: 0.406485
- Confusion Matrix: [[150, 24], [221, 22]]
Baseline (all fingernails, test=4216)
- Accuracy: 0.439042
- Precision: 0.701031
- Recall: 0.107894
- F1: 0.187006
- ROC‑AUC: 0.564913
- Confusion Matrix: [[1579, 116], [2249, 272]]
Comparison Table (Test Metrics)
| Experiment | Accuracy | Precision | Recall | F1 | ROC‑AUC | Notes |
|---|---|---|---|---|---|---|
| Zero‑shot baseline (test=417) | 0.417266 | 0.000000 | 0.000000 | 0.000000 | 0.440542 | no training |
| Zero‑shot baseline (ROI, test=417) | 0.412470 | 0.478261 | 0.090535 | 0.152249 | 0.406485 | ROI cropped |
| Zero‑shot baseline (all, test=4216) | 0.439042 | 0.701031 | 0.107894 | 0.187006 | 0.564913 | all images |
| QLoRA fine‑tune (test=417) | 0.582734 | 0.582734 | 1.000000 | 0.736364 | 0.620288 | 5 epochs |
Training Command (QLoRA)
uv run python src/fingernails/qlora_finetune.py \
--train-csv "src/fingernails/train.csv" \
--val-csv "src/fingernails/val.csv" \
--test-csv "src/fingernails/test.csv" \
--model-dir medsiglip \
--output-dir results/fingernails_qlora \
--batch-size 2 \
--accumulation-steps 8 \
--epochs 5 \
--lr 2e-4 \
--class-weight 1.5 \
--log-every 20
Hardware Requirements
Minimum working configuration used in this project:
- GPU: 1x NVIDIA RTX 3060 (12 GB VRAM)
- RAM: 16 GB or more recommended
- Disk: 5+ GB (dataset + artifacts)
Limitations
- For research and triage only; not for clinical diagnosis.
- Metrics depend on dataset distribution and acquisition conditions.
- QLoRA recall is high in this run; calibration should be validated in broader settings.
Contact
Model author: Sidharth (Hugging Face: Sidharth1743).
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support