This project builds a container environment monitoring pipeline for temperature and humidity prediction and a product-specific early warning system.
The workflow is:
- Train forecasting models for temperature and humidity
- Generate prediction results for multiple containers
- Evaluate prediction performance
- Apply product-specific threshold rules
- Produce 72H early warning summaries and overview figures
The system is designed for multi-container monitoring scenarios such as cold chain logistics, sensitive cargo handling, and environment-controlled transportation.
container-environment-monitoring/
├─ data/
├─ models/
├─ notebooks/
├─ outputs/
│ ├─ figures/
│ │ ├─ clothing/
│ │ ├─ electronics/
│ │ ├─ evaluation/
│ │ └─ food/
│ └─ predictions/
├─ src/
│ ├─ alert_common.py
│ ├─ alert_system_clothing.py
│ ├─ alert_system_electronics.py
│ ├─ alert_system_food.py
│ ├─ config.py
│ ├─ evaluate.py
│ ├─ plot_results.py
│ ├─ predict.py
│ ├─ train.py
│ └─ utils.py
├─ README.md
├─ requirements.txt
└─ .gitignore
The project trains predictive models for container temperature and humidity and saves:
- trained models
- prediction results
- evaluation metrics
- container-level metrics
Main outputs:
outputs/predictions/final_pred_temp_hum.csvoutputs/predictions/final_pred_temp_hum.xlsxoutputs/predictions/metrics.csvoutputs/predictions/container_metrics.csv
Prediction results are visualized at the container level to compare true vs predicted trends across multiple containers.
Main output:
outputs/figures/evaluation/
Typical figures include:
- temperature comparison by container
- humidity comparison by container
The early warning system directly uses prediction results from four containers and applies different risk thresholds for:
- clothing
- electronics
- food
Main scripts:
src/alert_system_clothing.pysrc/alert_system_electronics.pysrc/alert_system_food.py
Main outputs:
outputs/predictions/clothing_alert.csvoutputs/predictions/electronics_alert.csvoutputs/predictions/food_alert.csv
Overview figures:
outputs/figures/clothing/clothing_72h_overview.pngoutputs/figures/electronics/electronics_72h_overview.pngoutputs/figures/food/food_72h_overview.png
Each overview figure combines four containers in one dashboard and shows:
- predicted temperature curve
- predicted humidity curve
- product-specific threshold lines
- 72-hour monitoring window
The current prediction metrics are:
| Target | MAE | RMSE | R² | safeMAPE | sMAPE | WAPE |
|---|---|---|---|---|---|---|
| Temperature | 3.9001 | 4.3957 | 0.6510 | 83.7260% | 53.2499% | 37.3074% |
| Humidity | 8.7483 | 9.9609 | 0.6965 | 26.6004% | 32.6904% | 22.2807% |
These results show that:
- the model captures the overall temperature trend reasonably well
- humidity prediction remains more challenging, but still provides useful early warning signals
- the project is not only a forecasting task, but also a decision-support monitoring system
For each product type, the system:
- groups prediction results by
container_number - extracts the most recent 72 prediction points for each container
- checks whether predicted temperature and humidity exceed warning / critical thresholds
- calculates summary indicators such as:
- warning hours
- critical hours
- longest warning run
- longest critical run
- risk probability
- risk level
This design makes the project more practical than a pure forecasting demo, because the output can directly support monitoring decisions.
Used for products sensitive to heat and excessive humidity, with threshold-based monitoring for storage stability.
Used for products requiring tighter environmental control, especially for humidity-related risk.
Used for products with stricter temperature and humidity safety requirements over the monitoring horizon.
pip install -r requirements.txtpython src/train.pypython src/plot_results.pypython src/alert_system_clothing.py
python src/alert_system_electronics.py
python src/alert_system_food.py- multi-container forecasting workflow
- temperature and humidity dual-target monitoring
- product-specific early warning rules
- 72H overview visualization
- container-level evaluation outputs
- practical risk-monitoring orientation
This repository focuses on an end-to-end environment monitoring pipeline rather than only improving raw prediction accuracy.
The main contribution is combining:
- forecasting
- multi-container visualization
- threshold-based alerting
- product-specific risk interpretation
into one unified project.