How andrewkimutai/skin-care-connect works
1. Purpose and scope
- This repository implements a skin disease image classification system for the HAM10000 dermoscopy dataset.
- The core output is a 7-class prediction model packaged for interactive use in a small application.
2. Main runtime boundary
- The production-facing part appears to be the Streamlit app in app/streamlit_app.py.
- It likely serves as the user interface for uploading/choosing an image, invoking inference, and displaying the predicted disease class.
3. Inference subsystem
- app/ai_model.py is the inference layer that wraps model loading and prediction logic.
- It likely consumes image data from the Streamlit UI and returns class probabilities or a predicted label.
- This layer is the boundary between the UI and the trained model artifact.
4. Model artifacts
- The trained deep learning models are stored under models/:
- skin_disease_model.h5
- skin_disease_model_best.h5
- These .h5 files strongly suggest a Keras/TensorFlow model format.
- The “best” variant is probably the checkpoint selected for deployment or evaluation.
5. Training subsystem
- models/model_training.py is the training pipeline.
- It likely loads preprocessed HAM10000 data, trains the classifier, and writes model artifacts to models/.
- models/model_evaluation.py evaluates the trained model and produces metrics/reports.
6. Data preprocessing boundary
- The preprocessing/ package is responsible for preparing raw dataset inputs before training.
- preprocessing/organize_ham10000.py likely restructures the HAM10000 dataset into the expected folder/layout or metadata format.
- preprocessing/data_preprocessing.py likely handles normalization, resizing, class balancing, label encoding, or train/validation splitting.
- This preprocessing stage sits between the raw dataset and model training.
7. Persistence layer
- app/database.py plus the presence of app.db and a root-level app.db indicate the project uses SQLite for local persistence.
- The database is probably used to store application-side records such as predictions, user activity, or metadata rather than model state.
- This is a separate boundary from the ML model itself.
8. Data flow from dataset to prediction
- Raw HAM10000 data enters the preprocessing layer.
- Preprocessed data feeds model training/evaluation.
- Training produces .h5 model files.
- The Streamlit app loads a saved model through ai_model.py.
- User-provided dermoscopic images are passed through inference and displayed back to the user, with optional persistence in SQLite.
9. External dependencies and infrastructure
- The project is Python-based and includes requirements.txt plus .python-version, so the environment is managed explicitly.
- The deep learning stack is likely centered on TensorFlow/Keras; the UI layer uses Streamlit.
- The system appears fully local/self-contained, with no obvious cloud services or external APIs in the repository.
10. Documentation and deliverables
- The documentation/ folder contains project reports, presentation materials, and a classification report.
- These files support the model-development lifecycle and indicate the repository includes both code and project artifacts for academic/reporting purposes.
11. Testing / validation
- The test/ directory exists, but no files are visible in the tree.
- Architecturally, this suggests a place for unit/integration tests around preprocessing, model loading, or inference, even if coverage is minimal or not shown.
12. Suggested architectural diagram framing
- Draw three main layers: data preparation, model training/evaluation, and application/inference.
- Add SQLite persistence as a side component connected to the app layer.
- Treat the .h5 files as the deployable model artifact bridging training and inference.
Main entry points: streamlit_app.py Streamlit App · ai_model.py AI Model · data_preprocessing.py Prep Pipeline · model_training.py Train Model
Components 16
Preprocessing
Dataset preparation and cleanup before model training.
- HAM10000 · Source dermoscopy dataset used for classification.
- Organize Data · Restructures or prepares the HAM10000 dataset layout.
preprocessing/organize_ham10000.py - Prep Pipeline · Core data preprocessing for resizing, encoding, splitting, or balancing.
preprocessing/data_preprocessing.py
Modeling
Training, evaluation, and saved model artifacts.
- Train Model · Trains the skin disease classifier and writes model artifacts.
models/model_training.py - Evaluate Model · Measures model performance and produces evaluation output.
models/model_evaluation.py - Best Model · Deployment-oriented trained model artifact in HDF5 format.
models/skin_disease_model_best.h5 - Model File · Saved trained classifier artifact in HDF5 format.
models/skin_disease_model.h5
Application
Streamlit interface, inference, and local persistence.
- Streamlit App · Interactive interface for uploading images and showing predictions.
app/streamlit_app.py - AI Model · Loads the trained model and returns predicted classes or probabilities.
app/ai_model.py - SQLite DB · Application-side SQLite storage for records or metadata.
app/app.db - DB Access · Database helper layer used by the application.
app/database.py
Documentation
Project reports and presentation materials.
- README · Top-level project overview and usage notes.
README.md - Docs README · Documentation index and supporting notes.
documentation/README.md - Report · Classification report and project deliverables.
documentation/classification_report.txt - Presentation · Project presentation deck.
documentation/presentation.pptx - Code PDF · Compiled code or project PDF deliverable.
documentation/code.pdf
Connections 16
- HAM10000 → Organize Data: organize · Raw HAM10000 data is organized into a training-ready structure.
- Organize Data → Prep Pipeline: prepare · Organized dataset feeds preprocessing.
- Prep Pipeline → Train Model: train · Preprocessed data is used to train the classifier.
- Prep Pipeline → Evaluate Model: validate · Preprocessed data is also used for evaluation.
- Train Model → Model File: save · Training writes a deployable model artifact.
- Train Model → Best Model: checkpoint · Training may also produce the best-performing checkpoint.
- Best Model → Evaluate Model: load · Evaluation can consume the selected best model.
- Best Model → AI Model: load · Inference layer loads the saved model artifact.
- Model File → AI Model: load · Alternative saved model artifact available to inference.
- Streamlit App → AI Model: predict · Streamlit app sends user images to the inference layer.
- AI Model → Streamlit App: result · Predictions are returned to the UI for display.
- Streamlit App → DB Access: store · Application may persist prediction or user records.
- DB Access → SQLite DB: write · Database helper reads and writes the SQLite file.
- DB Access → Streamlit App: query · Stored records can be retrieved for the app interface.
- README → Streamlit App: document · Top-level README describes the main application flow.
- Docs README → Report: organize · Documentation folder groups project deliverables.