A Python pipeline that simulates vehicle sensor measurements across a structured test catalog, detects anomalies using machine learning, and presents results in a live web dashboard.
Modern vehicles use camera, radar and lidar sensors working together to power safety systems like automatic emergency braking and lane keeping assist. Validating these systems means running structured test cases, recording exactly what each sensor reports, and finding runs that behave unexpectedly.
This project builds that workflow in software. The goal was to understand how sensor data is structured, how pass/fail criteria work in practice, and where machine learning adds value over simple rule checking.
The pipeline runs in three stages.
First, a test catalog defines 9 test cases across five ADAS functions. Each case specifies which sensors are required, what weather condition the test runs in, and the exact numerical thresholds for pass and fail.
Second, a measurement simulator generates realistic sensor signals for each test run. Ego speed has Gaussian noise around the target speed. TTC (time to collision) ramps down toward a critical event and then recovers. Lateral deviation drifts sinusoidally. Camera confidence automatically drops in rain, fog and heavy rain, because that is how real sensors behave.
Third, two anomaly detection methods run on all 45 measurement runs in parallel. Rule-based checks flag anything that crosses an explicit threshold. An IsolationForest model flags runs that are statistically unusual across 8 sensor features simultaneously, even if they passed every rule. The combination catches both known failure patterns and unexpected sensor behaviour.
adas_tool/
test_catalog.py
generate_measurements.py
analyse_results.py
run_pipeline.py
dashboard/
server.py
index.html
data/measurements/
output/
Install the dependencies:
pip install pandas numpy scikit-learn flask flask-cors
Run the full pipeline:
python run_pipeline.py
Start the dashboard:
python dashboard/server.py
Open http://localhost:5000 in your browser.
The catalog covers five ADAS functions. AEB (Automatic Emergency Braking) tests are marked P1 because a failure here is safety critical. ACC (Adaptive Cruise Control) and LKA (Lane Keeping Assist) are P2 comfort and performance functions. TSR (Traffic Sign Recognition) is P3 informational.
AEB tests measure whether the system activates before TTC drops below the threshold and whether it achieves minimum deceleration. The Euro NCAP AEB VRU test protocol defines how these tests are conducted on real vehicles (https://www.euroncap.com/en/for-engineers/protocols/).
ACC tests measure headway time and speed error. The governing standard is ISO 15622:2018, which defines performance requirements and test procedures for adaptive cruise control systems (https://www.iso.org/standard/71515.html).
LKA tests measure lateral deviation and camera confidence. The governing standard is ISO 11270:2014, which covers performance requirements and test procedures for lane keeping assistance systems (https://www.iso.org/standard/50347.html).
The rule-based layer checks four conditions: sensor confidence below 0.52, TTC above 4.5 seconds, deceleration below 3.0 metres per second squared, and lateral deviation above 0.30 metres.
The machine learning layer uses IsolationForest from scikit-learn. The algorithm isolates observations by randomly selecting a feature and then randomly selecting a split value between the maximum and minimum values of that feature. Random partitioning produces shorter paths for anomalies, so runs that isolate quickly are the outliers and runs that are harder to isolate are the normal ones. The model runs on 8 features per measurement run: ego speed, TTC, lateral deviation, minimum sensor confidence, mean sensor confidence, deceleration, run duration and number of sensors. Contamination is set to 0.12, meaning the model expects roughly 12 percent of runs to be anomalous. Full documentation at https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.IsolationForest.html.
Python 3.10, pandas, numpy, scikit-learn, Flask, vanilla JavaScript.
scikit-learn IsolationForest https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.IsolationForest.html
ISO 15622:2018 Adaptive cruise control systems https://www.iso.org/standard/71515.html
ISO 11270:2014 Lane keeping assistance systems https://www.iso.org/standard/50347.html
Euro NCAP AEB test protocols https://www.euroncap.com/en/for-engineers/protocols/
Flask documentation https://flask.palletsprojects.com
pandas documentation https://pandas.pydata.org/docs/