Skip to content

isumenuka/NailHealth-AI-Mobile-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ NailHealth AI - Mobile Disease Detection App

Project Banner Platform License

AI-powered mobile app that detects systemic diseases through nail photo analysis

Demo Video β€’ Documentation β€’ Report Issue


🎯 Project Overview

NailHealth AI uses Google's Health AI Developer Foundations (HAI-DEF) models to detect serious diseases through nail signs captured via smartphone camera. The app provides instant clinical explanations and disease predictions.

πŸ”¬ Medical Capabilities

Detects 7 nail conditions indicating systemic diseases:

  • White Nails (Terry's Nails) β†’ Liver disease, kidney disease, diabetes
  • Blue Nails β†’ Oxygen deficiency, lung disease, heart failure
  • Clubbing β†’ Lung cancer, COPD, heart disease
  • Spoon Nails (Koilonychia) β†’ Iron deficiency anemia
  • Black Lines β†’ Melanoma, trauma, endocarditis
  • Psoriasis β†’ Psoriatic arthritis, metabolic syndrome
  • Onychogryphosis β†’ Poor circulation, fungal infection

πŸ—οΈ Architecture

2-Model AI Pipeline

πŸ“± User Photo
    ↓
☁️ Hugging Face Inference API
    ↓
πŸ€– Model 1: MedSigLIP (Fine-tuned)
   β†’ Classifies nail sign type
    ↓
πŸ€– Model 2: MedGemma 4B (Fine-tuned)
   β†’ Generates clinical explanation
   β†’ Predicts diseases
   β†’ Recommends actions
    ↓
πŸ“Š JSON Response β†’ Mobile App

Tech Stack

Component Technology
Mobile App React Native + Expo
Backend API Flask (Python)
Cloud Hosting Hugging Face Inference Endpoints
ML Models MedSigLIP + MedGemma 4B
Storage Hugging Face Hub
Training Kaggle GPU (Tesla T4)

πŸ“ Repository Structure

NailHealth-AI-Mobile-App/
β”œβ”€β”€ πŸ“± mobile-app/          # React Native Expo app
β”‚   β”œβ”€β”€ App.js              # Main app component
β”‚   β”œβ”€β”€ app.json            # Expo configuration
β”‚   β”œβ”€β”€ package.json        # Dependencies
β”‚   └── assets/             # Images, icons
β”‚
β”œβ”€β”€ πŸ”§ api-server/          # Flask API for model inference
β”‚   β”œβ”€β”€ app.py              # API endpoints
β”‚   β”œβ”€β”€ Dockerfile          # Container configuration
β”‚   β”œβ”€β”€ requirements.txt    # Python dependencies
β”‚   └── models/             # Fine-tuned model checkpoints
β”‚
β”œβ”€β”€ πŸ“š docs/                # Documentation
β”‚   β”œβ”€β”€ SETUP_GUIDE.md      # Local setup instructions
β”‚   β”œβ”€β”€ DEPLOYMENT_GUIDE.md # Cloud deployment steps
β”‚   └── ARCHITECTURE.md     # Technical architecture
β”‚
β”œβ”€β”€ πŸ““ notebooks/           # Training notebooks
β”‚   β”œβ”€β”€ medsiglip_training.ipynb
β”‚   └── medgemma4b_training.ipynb
β”‚
└── πŸ“‹ README.md            # This file

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Python 3.10+
  • Hugging Face account
  • Expo account (free)
  • Smartphone (iOS/Android)

1. Clone Repository

git clone https://github.com/isumenuka/NailHealth-AI-Mobile-App.git
cd NailHealth-AI-Mobile-App

2. Setup Mobile App

cd mobile-app
npm install
npx expo start

Scan QR code with Expo Go app on your phone.

3. Setup API Server (Local Testing)

cd api-server
pip install -r requirements.txt
python app.py

API runs at http://localhost:8080

4. Deploy to Hugging Face

See HUGGING_FACE_SETUP.md for detailed steps.

  1. Create a model repository on Hugging Face
  2. Upload your model files
  3. Create an Inference Endpoint
  4. Use the provided URL in your app

πŸ“± Mobile App Features

Current Features βœ…

  • πŸ“Έ Camera integration with photo capture
  • πŸ”„ Real-time image upload to API
  • πŸ€– AI-powered nail disease classification
  • πŸ“Š Clinical explanation generation
  • πŸ₯ Disease probability ranking
  • πŸ“‹ Recommended medical tests
  • 🎨 Professional medical UI design
  • ⚑ Expo Go instant testing
  • πŸ“± Cross-platform (iOS + Android)

Coming Soon πŸ”œ

  • πŸ“œ Disease history tracking
  • πŸ“ˆ Progress monitoring over time
  • 🌍 Multi-language support
  • πŸ”” Appointment reminders
  • πŸ“€ PDF report export
  • πŸ‘¨β€βš•οΈ Doctor consultation booking

πŸ› οΈ Development

Mobile App Development

cd mobile-app

# Start development server
npm start

# Run on specific platform
npm run android  # Android emulator
npm run ios      # iOS simulator
npm run web      # Web browser

API Server Development

cd api-server

# Run with auto-reload
export FLASK_ENV=development
python app.py

# Build Docker image locally
docker build -t nailhealth-api .
docker run -p 8080:8080 nailhealth-api

Model Training

Training notebooks are in notebooks/ folder:

  1. MedSigLIP Fine-tuning: Nail image classification
  2. MedGemma 4B Fine-tuning: Clinical explanation generation

Both trained on Kaggle with Tesla T4 GPU (free tier).


πŸ“Š Performance Metrics

Metric Value
Nail Sign Classification Accuracy 91.2%
F1-Score (Weighted) 0.89
API Response Time ~2.1 seconds
App Load Time <1 second
Supported Image Formats JPG, PNG
Max Image Size 5 MB

Model Details

MedSigLIP Fine-tuned

  • Base: google/medsiglip-448
  • Parameters: 400M
  • Training: LoRA (Low-Rank Adaptation)
  • Dataset: 700+ nail images (custom collected)

MedGemma 4B Fine-tuned

  • Base: google/medgemma-4b-it
  • Parameters: 4B
  • Training: Instruction fine-tuning
  • Dataset: 250+ clinical text pairs

🌐 Deployment Options

Recommended: Hugging Face Inference Endpoints

We recommend using Hugging Face Inference Endpoints for the easiest setup without managing complex cloud infrastructure.

  • βœ… No Google Cloud required
  • βœ… specific hardware selection (CPU/GPU)
  • βœ… Auto-scaling (including scale-to-zero to save money)
  • βœ… secure & private

πŸ‘‰ Follow the Hugging Face Setup Guide to get started.


πŸ“– Documentation

Document Description
SETUP_GUIDE.md Complete local development setup
HUGGING_FACE_SETUP.md Cloud deployment instructions
ARCHITECTURE.md Technical architecture details

πŸ”‘ Environment Variables

Mobile App (mobile-app/.env)

API_URL=https://your-api-url.run.app
ENVIRONMENT=production

API Server (api-server/.env)

MODEL_PATH=/app/models
PORT=8080

πŸ“ˆ Roadmap

Phase 1: MVP βœ… (Completed)

  • MedSigLIP fine-tuning
  • MedGemma 4B fine-tuning
  • Flask API development
  • React Native mobile app
  • Hugging Face deployment
  • Basic UI/UX

Phase 2: Enhancement πŸ”„ (In Progress)

  • Improve classification accuracy to 95%+
  • Add disease history tracking
  • Implement user authentication
  • Create admin dashboard
  • Multi-language support

Phase 3: Scale πŸ“… (Planned)

  • Clinical validation study
  • Regulatory compliance (FDA/CE)
  • Doctor consultation integration
  • App Store publication

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open Pull Request

πŸ“œ License

This project uses models from Google's Health AI Developer Foundations (HAI-DEF):

  • MedSigLIP: Apache 2.0 License
  • MedGemma 4B: Apache 2.0 License

Project License: Apache 2.0


⚠️ Medical Disclaimer

IMPORTANT: This application is for educational and research purposes only.

  • ❌ NOT a substitute for professional medical advice
  • ❌ NOT approved by FDA or medical authorities
  • ❌ NOT for clinical diagnosis
  • βœ… Use only as a screening tool
  • βœ… Always consult licensed healthcare professionals

πŸ™ Acknowledgments

  • Google Health AI: For HAI-DEF models (MedSigLIP, MedGemma)
  • Kaggle: For free GPU resources
  • Expo Team: For amazing mobile development framework
  • Medical Community: For nail disease datasets and research

πŸ“ž Contact

Developer: K.G.I Enuka
GitHub: @isumenuka
Twitter: @ezsumm
Website: isumenuka.me

Project Link: https://github.com/isumenuka/NailHealth-AI-Mobile-App


⭐ Star this repo if you find it helpful!

Made with ❀️ by K.G.I Enuka

About

Fine-tune Google's MedSigLIP for nail disease classification using custom nail image datasets. Includes optimized Google Colab notebook for training on nail conditions (white nails, blue nails, clubbing, spoon nails, melanoma, psoriasis, onychogryphosis).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors