How adarshh9/taxocapsnets works
Project type and purpose
• This is a full-stack machine-learning application (“TaxoCapsNets”) for predicting Autism Spectrum Disorder from gut microbiome data.
• It combines a data-processing & training pipeline (Python + Keras), a Flask-based model-serving backend, and a JavaScript-based frontend for interactive visualization (SHAP explainability outputs).
File structure
• Top-level folders:
• dataset/ (CSV input data)
• model/ (trained model files & pickles)
• taxoshap-backend/ (Flask server notebook)
• taxoshap-frontend/ (UI code)
• training_metrics/ (training logs & plots)
• Key files: test.py (CLI inference), demo.webm (demo video), README.md
• Patterns: clear separation of data, training, serving, and presentation layers.
README for additional insights
• “End-to-end pipeline: preprocessing → training → evaluation → explainability”
• Uses taxonomy-aware Capsule Networks + SHAP.
• Interactive frontend + backend integration.
Main components & their relationships
a. Data Layer
• Source: dataset/*.csv
• Processed by: preprocessing scripts (inside model/ or separate notebook)
b. Training Pipeline
• Input: preprocessed data
• Core: Capsule Network architecture (Keras)
• Output: capsule_model.keras, taxonomy_map.pkl, test_data.pkl
• Artifacts stored in model/
• Training logs written to training_metrics/
c. Model Serving / Backend
• Flask server (taxoshap-backend/flask_server.ipynb)
• Loads model artifacts from model/
• Exposes REST endpoints for:
• Inference (test.py can call these or use direct load)
• SHAP explainability generation
d. Frontend
• Runs in browser (taxoshap-frontend/)
• Calls backend APIs to:
• Submit sample data → get ASD prediction
• Retrieve SHAP results for interactive plots
e. CLI Test Script
• test.py: standalone inference using saved model artifacts
Architectural patterns and design principles
• Layered architecture: Data → Training → Serving → Presentation
• Separation of concerns: model artifacts are decoupled from serving and visualization
• Micro-component design: Preprocessing, Model, Explainability, Frontend all separate
• Use of standard ML ops flow (train→store→serve), with explainability integrated at serving time.
Putting it all together
• Top row (Batch Training):
[dataset CSVs] → [Preprocessing] → [Capsule Network Trainer] → [Model & Pickle Artifacts] & [Training Metrics]
• Middle row (Serving):
[Model & Pickle Artifacts] → [Flask API + SHAP Engine]
• Bottom row (Clients):
[taxoshap-frontend UI] ←→ [Flask API] ←→ [test.py CLI]