How sgnovice/disease-detection-using-chest-xrays works
Main Components
• User Interface / Frontend:
– This is represented by the HTML templates (index.html, result.html) and static assets (CSS in static/styles) that form the user-facing side of the application.
– The web pages allow users to upload chest X-ray images and view prediction results.
• Web Application / Backend:
– This is implemented in app.py and potentially supplemented by commons.py.
– It acts as the controller which receives requests (from the client's browser), handles routing, and interacts with the inference module.
• Inference / Deep Learning Engine:
– Encapsulated by inference.py, this module loads the deep learning model(s) (e.g., DenseNet161 with custom activations such as β-Mish, Mila, and others) and runs the image data through the model to obtain predictions.
– It handles pre-processing steps (like image resizing, random rotations, flips, and conversion to tensor format) before passing images to the model.
• Configuration & Deployment Components:
– Deployment configuration files like Procfile, app.json, runtime.txt, and requirements.txt indicate that the project is set up for deployment on platforms like Heroku or similar PaaS.
– These files and settings should be noted as part of the deployment and runtime environment.
Relationships and Data Flow
• The Web Server then interacts with the “Inference Engine” (inference.py), passing the preprocessed image data. The engine performs the prediction using the deep learning model.
• The response – including disease classification results – flows back through the web server to the front-end, which then renders the result on the web page.
Architectural Patterns & Design Principles
• The project follows a clear separation of concerns: the frontend (UI templates and styling) is distinct from the backend logic (Flask-based routing in app.py) and the deep learning inference (inference.py).
• Use of orchestration between components using client-server communication patterns.
• That deep learning preprocessing is integrated into the server pipeline—this is important given the care detailed in the README regarding data augmentation and preprocessing.
Relevant Technologies and Frameworks
• Python (Flask for the web server).
• PyTorch (for deep learning model implementation).
• HTML/CSS (for the frontend UI).
• Deployment technologies such as Heroku (indicated by Procfile and app.json).
• Libraries for image processing and pre-processing.
Emphasized Elements
• Clear Labels: Each module (UI, Backend, Inference Engine, Deployment Configurations) must be clearly labeled.
– The client-side (web browser with HTML/CSS).
– The application server using Flask (app.py, commons.py).
– The inference engine (inference.py with integrated deep learning model and processing logic).
– Configuration/deployment components (Procfile, app.json, runtime.txt, requirements.txt).
This design should serve as a comprehensive blueprint for understanding, deploying, and eventually extending the system (for example, to include federated learning on Raspberry Pi devices or mobile interfaces as mentioned in the README’s future work section).