How abhijnanbc/heatguard-ai works
HeatGuard is an early-warning system that synthesizes physiologically grounded worker data, profiles worker vulnerability, trains an explainable risk model, and serves personalised predictions through an API and worker-app prototype. The graph preserves the documented phase handoffs and the sampled API-to-inference call. Some runner-to-analysis links are documented at a high level; where excerpts do not show the runtime call, those relationships are omitted rather than inferred.
Main entry points: run_phase3.py Training pipeline · run_phase2.py Profiling pipeline · run_phase1.py Data generation · app.py Prediction API
Components 20
Synthetic data
- Data generation
src/phase1_generation/run_phase1.py - PHS synthesis
src/phase1_generation/generate_synthetic.py - Data diagnostics
src/phase1_generation/visualise_phase1.py - Synthetic workers
data/workers_synthetic_5000.csv
Worker profiling
- Profiling pipeline
src/phase2_clustering/run_phase2.py - K-means profiles
src/phase2_clustering/kmeans_profiling.py - Profile diagnostics
src/phase2_clustering/visualise_phase2.py - Profiled workers
data/workers_with_clusters.csv
Risk modeling
- Training pipeline
src/phase3_modeling/run_phase3.py - XGBoost training
src/phase3_modeling/train_xgboost.py - SHAP explanations
src/phase3_modeling/shap_interpreter.py - Model evaluation
src/phase3_modeling/visualise_phase3.py - Model artifacts
models
Inference service
- Prediction API
app/api/app.py - Feature and risk inference
app/api/inference_engine.py - Deployment API
phase5/deploy/app.py - Packaged inference
phase5/deploy/inference_engine.py - Export and deployment kit
phase5/export_and_deploy.py
Worker experience
- Worker app prototype
phase5/worker_app.html
Other components
- Outdoor worker
Connections 19
- Data generation → PHS synthesis: uses generation
src/phase1_generation/run_phase1.py - Data generation → Data diagnostics: generates plots
src/phase1_generation/run_phase1.py - Data generation → Synthetic workers: writes dataset
src/phase1_generation/run_phase1.py - Synthetic workers → Profiling pipeline: feeds profiling
src/phase2_clustering/run_phase2.py - Profiling pipeline → K-means profiles: runs clustering
src/phase2_clustering/run_phase2.py - Profiling pipeline → Profile diagnostics: generates plots
src/phase2_clustering/run_phase2.py - Profiling pipeline → Profiled workers: writes profiles
src/phase2_clustering/run_phase2.py - Profiled workers → Training pipeline: feeds training
src/phase3_modeling/run_phase3.py - Training pipeline → XGBoost training: runs training
src/phase3_modeling/run_phase3.py - Training pipeline → SHAP explanations: uses explanations
README.md - Training pipeline → Model evaluation: generates evaluation
README.md - Training pipeline → Model artifacts: exports models
README.md - Model artifacts → Feature and risk inference: loads artifacts
app/api/inference_engine.py - Outdoor worker → Worker app prototype: uses app
- Worker app prototype → Prediction API: requests predictions
- Prediction API → Feature and risk inference: calls predict
app/api/app.py - Prediction API → Outdoor worker: returns risk alert
- Deployment API → Packaged inference: calls inference
phase5/deploy/app.py - Export and deployment kit → Deployment API: packages deployment