Resilient Forecaster demonstrates how machine learning models can be vulnerable to data poisoning attacks and how defensive mechanisms can restore model performance.
We simulate an attack on an LSTM-based stock price prediction system and measure:
- π Performance degradation due to poisoning.
- π‘ Recovery after applying statistical defense.
Machine learning models rely heavily on clean training data. If an attacker manipulates training labels, the model learns incorrect patterns.
Can we detect and recover from data poisoning using automated defense?
The workflow follows a modular pipeline:
- Raw Stock Data: Ingested via
yFinance. - Preprocessing: Scaling and sequence creation (Time-Series Windows).
- Execution: Clean Training β Poisoned Training β Defended Training.
- Comparison: Evaluation via Mean Squared Error (MSE).
- Python (Core Language)
- TensorFlow / Keras (Deep Learning)
- NumPy & Pandas (Data Manipulation)
- Scikit-learn (Preprocessing)
- Matplotlib (Visualization)
- yFinance (Stock Data)
Resilient_Forecaster/
βββ src/
β βββ attacker.py # Poisoning logic
β βββ defender.py # Restoration logic
β βββ model_lstm.py # LSTM architecture
β βββ data_loader.py # Data fetching
βββ main.py # Main pipeline
βββ README.md # Documentation