How charanhu/skin_cancer_detection_mnist works
Main Components
• Client/User Interface – Represented by the HTML templates (home.html and results.html). The user interacts with the web page through a browser.
• Web Application Backend – The Flask app (app.py) serves as the controller that accepts user uploads, processes requests, and returns responses. The wsgi.py file indicates readiness for deployment (e.g., via Gunicorn on platforms like Heroku or Azure).
• CNN Model Module – The skin_cancer_detection.py file contains the CNN model definition while best_model.h5 holds the pretrained weights. This module is responsible for prediction logic.
• Training & Experimentation – Although not part of the deployed service, the notebooks (Skin_Cancer_Detection.ipynb and its copy) illustrate model training and experimentation.
• Supporting Components – Configuration files such as requirements.txt (identifying dependencies), LICENSE, Procfile to indicate deployment-specific information, and potentially deployment services (Heroku/Azure) described in the README.
Relationships and Interactions
• The client (browser) sends an image upload via the web form.
• The Flask backend (app.py) receives the image, delegates the image processing and classification task to the CNN model defined in skin_cancer_detection.py.
• The CNN module loads the best_model.h5 weights to perform prediction on the uploaded image.
• After processing, the result is fed back to the Flask app, which renders the appropriate HTML template (results page) to display the output.
• In a live deployment scenario, the wsgi.py (with Gunicorn as mentioned in requirements) interfaces with the production server to handle incoming requests.
Architectural Patterns and Design Principles
• MVC/MVT-like Separation – Although simplified, the separation of concerns is clear: the view (templates) displays the information, the controller (Flask app) routes and processes user requests, and the model (CNN module + weights) does the heavy lifting.
• Modularity and Reusability – The training aspect (notebooks) is decoupled from the production inference (Flask app using pre-trained model), making it easier to update models without disrupting the service.
• Scalability for Deployment – The inclusion of configuration files (Procfile, wsgi.py) and the use of Gunicorn indicate an architecture that can scale on platforms like Heroku or Azure.