OJOS-AI / README.md
Sharad9084's picture
Update README to accurately reflect OJOS AI 5-disease model and features
ed6525c
|
Raw
History Blame Contribute Delete
4.55 kB
---
title: OJOS AI
emoji: πŸ‘οΈ
colorFrom: green
colorTo: blue
sdk: docker
app_port: 7860
pinned: false
---
# πŸ‘οΈ OJOS AI β€” Advanced Eye Disease Detection Web App
A state-of-the-art deep learning web application that detects and classifies multiple eye diseases with **96.69% validation accuracy** using fine-tuned Convolutional Neural Networks (CNNs). Equipped with a premium glassmorphic dark-mode UI.
---
## 🎯 Key Features
- **Multi-Disease Classification**: Detects 5 distinct conditions:
- πŸ‘οΈ **Cataract**
- ⚠️ **Diabetic Retinopathy**
- πŸ”΄ **Glaucoma**
- πŸ‘“ **Myopia**
- βœ… **Healthy Eye**
- **High Performance**: Achieves **96.69% accuracy** on clinical validation datasets.
- **Advanced Preprocessing**: Uses LAB color space **CLAHE (Contrast Limited Adaptive Histogram Equalization)** to enhance contrast in retinal/eye images, matching clinical standards.
- **Premium User Interface**: Dark glassmorphic theme with sliding login/signup panel, drag-and-drop upload, scanning progress animation, and multi-probability confidence charts.
- **Robust Authentication**: Fully integrated SQLite database system for secure user registration and login session management.
- **Keras 3 Runtime Compatibility**: Includes a custom monkeypatch to bypass quantization config parameters when loading legacy `.h5` model files.
---
## πŸ› οΈ Tech Stack
- **Backend**: Python, Flask, SQLite3
- **Deep Learning**: TensorFlow / Keras (EfficientNetV2 backbone)
- **Computer Vision**: OpenCV, Pillow (PIL)
- **Frontend**: HTML5, Vanilla CSS3 (Glassmorphism, Neon Accents, CSS Keyframes)
- **Deployment**: Docker, Hugging Face Spaces (Git LFS)
---
## πŸš€ How to Run Locally
### 1. Prerequisites
Ensure you have Python 3.9+ installed. Install the required libraries:
```bash
pip install tensorflow opencv-python numpy pillow flask
```
### 2. Clone the Repository
```bash
git clone https://github.com/Sharad9084/OJOS-AI.git
cd OJOS-AI
```
### 3. Run the Application
```bash
python app.py
```
Open [http://localhost:5000](http://localhost:5000) in your web browser.
---
## πŸ“ Project Structure
```
OJOS-AI/
β”œβ”€β”€ best_eye_disease_model.h5 # Fine-tuned EfficientNetV2 multiclass model (Git LFS)
β”œβ”€β”€ class_indices.json # Mapping of class names to model indices
β”œβ”€β”€ app.py # Core Flask server and prediction pipeline
β”œβ”€β”€ database.py # SQLite database utility functions
β”œβ”€β”€ requirements.txt # Python dependencies
β”œβ”€β”€ Dockerfile # Containerization config for Hugging Face Spaces
β”œβ”€β”€ Procfile # Web process config
β”œβ”€β”€ static/
β”‚ β”œβ”€β”€ css/
β”‚ β”‚ └── style.css # Premium glassmorphic styling sheet
β”‚ β”œβ”€β”€ logo.png # Custom circular eye logo
β”‚ └── uploads/ # Directory for temporary preview images
└── templates/
β”œβ”€β”€ home.html # Main landing page
β”œβ”€β”€ login.html # Login & signup portal
β”œβ”€β”€ prediction.html # Real-time scan and multi-probability results
β”œβ”€β”€ about.html # Team / info page
└── diseases_info.html # Visual medical encyclopedia
```
---
## πŸ’‘ How It Works
### 1. Image Preprocessing & Contrast Enhancement
Retinal images can have inconsistent illumination. To normalize this:
- The input image is converted to the **LAB color space**.
- **CLAHE** is applied on the L-channel (lightness) to enhance local contrast without over-amplifying noise.
- The image is merged back, converted to RGB, and resized to **300x300**.
- EfficientNetV2 normalization (`preprocess_input`) is applied.
### 2. Inference & Classification
- The preprocessed image is passed into `best_eye_disease_model.h5`.
- The model outputs logits/probabilities for all 5 target categories.
- The front-end renders a interactive bar chart displaying the confidence percentage for every condition.
---
## βš•οΈ Medical Compliance & Disclaimer
- **Screening Tool Only**: This application is designed as an assistive screening tool. It does not replace professional medical diagnosis, advice, or treatment by a qualified ophthalmologist.
- **Data Privacy**: Images uploaded are saved temporarily on the server for visualization and are not shared.
---
## πŸ“ž Contact & Support
Developed by **Sharad Sharma** (sharmasharad9794@gmail.com).
⭐ **If you found this project helpful, please star the repository!**