How lokesh89414/eye-disease-detection works
Project type and purpose
• This is a static AI-powered web application that runs entirely in the browser.
• Purpose: Let users upload retinal images and get real-time eye disease predictions (Diabetic Retinopathy, Glaucoma, Cataracts) using a CNN model via TensorFlow.js.
File structure
Top-level files:
• index.html, prediction.html, about-disease.html – entry points for landing, prediction UI, and info pages
• script.js – client-side logic (loads model, runs inference, generates report)
• style.css – UI styling
• model.json, weights.bin, labels.txt, metadata.json – TensorFlow.js model artifacts and labels
• keras_model.h5, training.ipynb – offline training assets
• requirements.txt – Python dependencies for training (TensorFlow, NumPy, Pillow, OpenCV)
No backend folder—serving happens via a static file server (e.g., python -m http.server).
Extract insights from README
• Frontend: HTML5/CSS3/ES6 JavaScript
• AI: TensorFlow.js & Teachable Machine for in-browser inference
• Offline training: Jupyter notebook with Keras, export to TF.js format
• Features: real-time analysis, confidence scores, PDF report export, mobile-responsive UI
a. Main components
1. User Browser (Client)
2. Static Web Host (serves HTML/CSS/JS & model files)
3. TensorFlow.js Inference Engine (runs the CNN in-browser)
4. Model Artifacts Storage (model.json, weights.bin, labels.txt)
5. Offline Training Pipeline
– Data Source (retinal image dataset)
– Preprocessing (OpenCV/Pillow)
– Model Training Environment (Jupyter + Keras)
– Model Conversion (to TF.js)
6. PDF Report Generator (client-side JS or library)
b. Relationships & data flows
• Within Browser: script.js loads model.json via TensorFlow.js → processes uploaded image → outputs predictions → passes results to PDF generator & UI renderer
• Offline Pipeline separate: dataset → preprocessing → Keras training → export to model.json/weights.bin → upload to Static Web Host
c. Architectural patterns & principles
• Client-side ML inference (edge inference)
• Separation of concerns:
• Static content hosting vs
• Offline training pipeline
• Single-page or multi-page static app with modular JS
• Model artifact versioning via metadata.json
d. Key technologies & libraries
• HTML5, CSS3, JavaScript (ES6+)
• TensorFlow.js, Teachable Machine
• Python (TensorFlow/Keras), NumPy, Pillow, OpenCV (offline)
• Data visualization (Plotly/Matplotlib in notebook)
• PDF export library (e.g., jsPDF)