The Cataract Prediction System is a deep learning-powered web application designed to detect and classify cataracts from eye images. This system uses an EfficientNetB0 model trained on eye fundus images to provide accurate predictions for cataract detection, helping healthcare professionals make informed decisions.
- AI-Powered Detection: Utilizes EfficientNetB0 deep learning model for accurate cataract prediction
- User Authentication: Separate registration and login for patients and medical staff
- Image Upload: Easy-to-use interface for uploading eye images
- Real-time Predictions: Instant analysis and classification results
- Dashboard Interface: Clean and intuitive dashboard for viewing results
- Responsive Design: Works seamlessly across different devices
- Python 3.x: Core programming language
- Flask: Web framework
- TensorFlow/Keras: Deep learning framework
- EfficientNetB0: Pre-trained model architecture
- HTML5: Structure
- CSS3: Styling
- JavaScript: Interactive functionality
- Bootstrap (implied): Responsive design
- SQLite/MySQL: User credentials and data storage
- EfficientNetB0: Transfer learning model
- Model Size: 47.8 MB
- Format: HDF5 (.h5)
Cataract-prediction-system/
β
βββ .vscode/ # VS Code configuration
βββ model/ # Trained model directory
β βββ efficientnet_b0_model.h5
βββ static/ # Static files (CSS, JS, Images)
β βββ auth.js
β βββ BabyYodaGroguGIF.gif
β βββ eye.png
β βββ style.css
β βββ user_cred.sql
βββ templates/ # HTML templates
β βββ dashboard.html
β βββ index.html
β βββ login.html
β βββ signup_patient.html
β βββ signup_staff.html
βββ uploads/ # User uploaded images
β βββ download.jpg
β βββ image_2.jpeg
β βββ image3-1.png
βββ venv/ # Virtual environment
β βββ Include/
β βββ Lib/
β βββ Scripts/
βββ .gitignore # Git ignore file
βββ app.py # Main Flask application
βββ demo.py # Demo/testing script
βββ LICENSE # License file
βββ README.md # Project documentation
βββ requirements.txt # Python dependencies
- Python 3.7 or higher
- pip (Python package installer)
- Virtual environment (recommended)
- Clone the repository
git clone https://github.com/yourusername/Cataract-prediction-system.git
cd Cataract-prediction-system- Create a virtual environment
# Windows
python -m venv venv
venv\Scripts\activate
# macOS/Linux
python3 -m venv venv
source venv/bin/activate- Install required packages
pip install -r requirements.txt- Set up the database
# Initialize the database using the SQL file in static folder
# Or let the application create it automatically on first run- Download the trained model
- Ensure
efficientnet_b0_model.h5is in themodel/directory - The model file should be approximately 47.8 MB
Based on the project structure, the key dependencies include:
Flask==2.3.0
tensorflow==2.13.0
keras==2.13.0
numpy==1.24.0
Pillow==10.0.0
werkzeug==2.3.0
opencv-python==4.8.0
scikit-learn==1.3.0
pandas==2.0.0
matplotlib==3.7.0Note: Check requirements.txt for the complete and exact version list
- Start the Flask server
python app.py- Access the application
- Open your web browser
- Navigate to
http://localhost:5000orhttp://127.0.0.1:5000
-
Registration
- Choose between Patient or Staff signup
- Fill in required credentials
- Create account
-
Login
- Enter your credentials
- Access the dashboard
-
Upload Image
- Navigate to the prediction section
- Upload an eye fundus image (JPG, JPEG, PNG)
- Submit for analysis
-
View Results
- See prediction results on the dashboard
- View confidence scores
- Download or save results
- Base Model: EfficientNetB0 (pre-trained on ImageNet)
- Transfer Learning: Fine-tuned for cataract detection
- Input Size: 224x224x3 (RGB images)
- Output: Binary or multi-class classification
- Training Dataset: Eye fundus images with cataract annotations
The model has been trained to classify:
- Normal eye (no cataract)
- Cataract-affected eye
- Severity levels (if applicable)
Expected accuracy metrics should be documented based on your validation results
The system works with eye fundus images showing:
- Normal retinal images
- Images with various stages of cataract
- Different types of cataracts (cortical, nuclear, posterior subcapsular)
The uploads/ folder contains example images:
download.jpg: Cataract example 1image_2.jpeg: Fundus image exampleimage3-1.png: Cataract example 2
- Password hashing for user credentials
- Session management for logged-in users
- Secure file upload validation
- SQL injection prevention
- CSRF protection
-
Index Page (
index.html)- Landing page with system introduction
- Quick access to login/signup
-
Login Page (
login.html)- Secure authentication
- Error handling
-
Signup Pages
signup_patient.html: Patient registrationsignup_staff.html: Medical staff registration
-
Dashboard (
dashboard.html)- Upload interface
- Prediction results
- User profile management
Run the demo script to test model predictions:
python demo.pyThis will test the model with sample images and display results.
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Rohit Kumar - [https://github.com/Rohit8024]
- Ranjeet Kumbhar - [https://github.com/RanjeetKumbhar01]
- EfficientNet model creators (Google Research)
- Medical datasets providers
- Open-source community
- Healthcare professionals for domain expertise
- EfficientNet Paper
- Flask Documentation
- TensorFlow Documentation
- Medical literature on cataract detection
Note: This is a medical assistance tool and should not replace professional medical diagnosis. Always consult with qualified healthcare professionals for medical decisions.



