Modern supply chains depend on stable demand patterns for effective inventory planning and operational efficiency. Sudden and unexpected changes in demandβsuch as sharp spikes or dropsβcan lead to stock-outs, excess inventory, financial losses, and operational disruptions.
This project implements an Intelligent Demand Anomaly Detection System that identifies abnormal demand behavior from large-scale time-series data. Instead of forecasting demand, the system focuses on monitoring demand stability and detecting deviations from normal patterns using time-series analysis and machine learning.
To detect unusual demand patterns in time-series sales data and classify them as potential anomalies using statistical techniques and unsupervised machine learning models.
- Learn normal demand behavior from historical data
- Continuously monitor demand over time
- Automatically detect and flag:
- Sudden demand spikes
- Unexpected demand drops
- Irregular demand fluctuations
These anomalies can indicate potential supply chain risks or operational issues.
The project uses a large synthetic dataset designed to simulate real-world supply chain demand behavior.
Dataset Columns
dateβ Daily timestampdemandβ Observed demand value
- Python
- Pandas, NumPy
- Matplotlib, Seaborn
- Scikit-learn
- Statsmodels
- Jupyter Notebook
- Git & GitHub
- Time-series data analysis
- Trend and seasonality decomposition
- Feature engineering (lag features, rolling mean, rolling standard deviation)
- Unsupervised anomaly detection
- Isolation Forest algorithm
- Data-driven business interpretation
- Data Generation β Creation of large-scale daily demand data
- Data Cleaning β Handling missing values and preparing time-series structure
- Exploratory Data Analysis (EDA) β Understanding demand trends and variability
- Time-Series Analysis β Decomposition into trend, seasonality, and residuals
- Feature Engineering β Lag-based and rolling statistical features
- Anomaly Detection β Detection of abnormal demand using Isolation Forest
- Visualization & Interpretation β Highlighting anomalies and extracting insights
- Approximately 3% of demand observations were identified as anomalies
- Detected anomalies correspond to sudden demand spikes and drops
- Rolling statistics significantly improve anomaly detection accuracy
- Isolation Forest effectively detects anomalies without labeled data
This system functions as an early warning mechanism for supply chain operations by:
- Enabling proactive inventory adjustments
- Reducing losses due to demand shocks
- Improving operational planning and responsiveness
- Supporting real-time monitoring of demand stability
- Clone the repository:
git clone https://github.com/<your-username>/Intelligent-Demand-Anomaly-Detection-System.git
cd Intelligent-Demand-Anomaly-Detection-System
## π Project Structure
Intelligent-Demand-Anomaly-Detection-System/
β
βββ data/
β βββ large_demand_data.csv
β
βββ notebooks/
β βββ 01_data_generation.ipynb
β βββ 02_data_cleaning.ipynb
β βββ 03_eda.ipynb
β βββ 04_time_series_analysis.ipynb
β βββ 05_anomaly_detection.ipynb
β
βββ README.md