← Back to projects

Face2Visceral

Hackathon · 6 hours · 3rd Place

A dual-encoder ResNet-18 model that estimates visceral body fat ratio from a facial image, optionally conditioned on age and sex. Trained on UTKFace and CT scan datasets using PyTorch Lightning.

How it works

Two ResNet-18 encoders process the face and a paired CT reference. Their features are fused and passed through a regression head to predict the visceral fat ratio.

Training

UTKFace (facial images) paired with CT scan measurements from the AATTCT dataset.

Stack

PyTorch LightningFastAPIResNet-18

Run the demo locally

git clone https://github.com/EngEmmanuel/face2visceral.git
cd face2visceral
pip install -r requirements.txt

# Download the model checkpoint
mkdir -p artifacts/face_to_visceral/checkpoints
curl -L https://github.com/EngEmmanuel/face2visceral/releases/download/v0.1.0/last.ckpt \
     -o artifacts/face_to_visceral/checkpoints/last.ckpt

# Start the API server
python scripts/serve/inference_api.py \
    --checkpoint artifacts/face_to_visceral/checkpoints/last.ckpt

# In another terminal, start the frontend
cd elegant && python -m http.server 5500

Then open http://localhost:5500 and upload a photo. All processing happens on your machine.

AI estimation only. Not medical advice.