How owais-kamdar/retinal-fundus-disorder-detection works
Main Components
• User Interface: The Streamlit web application (main.py) that users interact with.
• Data Management: The directories holding the dataset:
• data/raw: Stores the original retinal images.
• data/processed: Contains pre-processed data used by the traditional ML approach.
• data/outputs: Holds any outputs, possibly from experiments or prediction results.
• Classification Approaches: Three distinct pipelines, each implemented as its own module:
• Naïve Rule-Based Classifier: Found in scripts/naive (main_test.py and model.py). Uses image features like edge density, brightness, and optic disc detection for classification.
• Deep Learning (EfficientNet-B4): Found in scripts/deep (model.py) together with the corresponding pretrained or fine-tuned model stored as mobilenetv3.pth in the models/ directory.
• Model Artifacts: The models directory hosts pre-trained weights and pipeline artifacts for both traditional and deep learning approaches.
• Notebooks: The experimentation and exploratory analysis documents (EDA.ipynb, naive_eva.ipynb) which give insights into data analysis and evaluation but are not part of the final runtime architecture.
Relationships and Data Flows
• Data Flow:
• User uploads an image via the Streamlit UI.
• The front-end (main.py) then dispatches the image to the different classification pipelines.
• Each approach (naïve, traditional, deep) processes the image separately:
▪ The naïve approach uses rule-based calculations.
▪ The traditional ML approach applies preprocessing (feature extraction, PCA) before the SVM model predicts.
▪ The deep learning module processes the input through the EfficientNet-based CNN.
• Results from all classifiers are then consolidated and displayed to the user through the UI.
• Data and Model Dependencies:
• Pre-processing scripts (setup.sh and scripts like make_dataset.sh) ensure that raw data is prepared (data/processed) for the machine learning pipelines.
• Model artifacts are loaded from the models directory during inference or training.
Architectural Patterns and Technologies
• Separation of Concerns: Differentiated pipelines for each classification approach allow for independent development, testing, and evaluation.
• Modular Design: The clear segregation in the file structure (scripts/naive, scripts/traditional, scripts/deep) reflects a modular approach.
• Integration: The Streamlit application acts as a unifying layer that integrates results from all three approaches.
• Technologies and Libraries:
• Python is the main language.
• SVM model leveraging scikit-learn (likely) for the traditional approach.
• Deep learning framework support for EfficientNet, possibly using PyTorch (indicated by the .pth extension and GPU/TPU requirement).
• Utility and setup scripts for environment configuration (setup.sh) and dependency management (requirements.txt, packages.txt).
Final Checklist
• Each component (UI, naive classifier, traditional ML classifier, deep learning classifier, data management, model repository) must be clearly marked.
• Aspects such as pre-processing steps, model training/inference, external dataset locations, and deployment scripts (setup.sh).