Retinitis Pigmentosa (RP) Detector — Mobile ML App
Tags: Mobile ML · React Native · Expo · TensorFlow.js · Computer Vision · Healthcare AI
This project explores automated detection of Retinitis Pigmentosa (RP) from retinal images using deep learning, with a focus on low-cost, accessible screening. The trained model is deployed inside a cross-platform mobile app that runs inference on user-provided images.
RP diagnosis typically requires access to specialized equipment (e.g., ERG, visual field testing, genetic testing, and/or clinical retinal photography). This project investigates whether an image-based model can provide a fast, inexpensive signal that could be useful for triage or screening workflows (research/educational use only).
What I Built
- A deep learning classifier for RP vs. non-RP retinal images (transfer learning with MobileNet)
- Evaluation using both a train/validation/test split and 10-fold cross validation
- A mobile app (Expo / React Native) that loads a TFJS model and performs on-device inference
- Optional ensemble inference by averaging predictions across multiple cross-validation models
Model + Results (from the accompanying write-up)
- Dataset: 258 normal + 258 RP images (Tsukazaki Optos Public Dataset)
- Train/val/test split: 70% / 15% / 15%
- Approximate test metrics (avg over trials): ~90% accuracy, ~0.89 F1, ~97% specificity
- 10-fold CV: ~96% mean accuracy (reported)
How the App Works
The app allows users to either take a photo or select one from the gallery, then runs the following pipeline:
- Convert the input image to JPEG (ensures decoding works reliably across formats).
- Decode to a tensor and resize to 224×224.
- Normalize pixels to [0, 1] and add a batch dimension.
- Run inference with TensorFlow.js and display RP Present / No RP + confidence.
Repository Contents
predict.js— image preprocessing + TFJS inference + UImodel.json+ shard files — exported TensorFlow.js model weightsfinal_model.py— training / export pipeline (Python)App.js,app.json,babel.config.js— app scaffolding/config
Links
Disclaimer
This project is for research and educational purposes only. It is not a medical device and is not intended for clinical diagnosis or treatment decisions.