Skip to content

9158764767/AirTraffic-Accident-Risk-Model-Meta-Learning

Repository files navigation

AirTraffic-Accident-Risk-Model-Meta-Learning

Machine learning model for aviation accident risk prediction using ACAS and air traffic complexity data. Includes ONNX model export for deployment.

โœˆ๏ธ ONNX-Based Air Crash Probability Analysis

A Predictive Aviation Safety System using EASA ATC Public Data


๐Ÿ“Œ Abstract

This project presents a machine learning-based aviation safety system designed to estimate air crash probability using Air Traffic Control (ATC) public datasets from EASA.

The system analyzes flight path fluctuations, airspeed variations, and geographic movement patterns to identify high-risk conditions. The trained predictive models are exported using ONNX (Open Neural Network Exchange) to enable platform-independent deployment and real-time inference capability.

This work demonstrates an end-to-end pipeline from raw aviation data ingestion to deployment-ready predictive modeling.


๐Ÿท Badges

Python Scikit-Learn ONNX License Last Commit

Replace YOUR_USERNAME with your GitHub username.


๐ŸŽฏ Research Objectives

  • Analyze aviation flight path fluctuations
  • Engineer predictive safety features
  • Train accident probability classification models
  • Export models to ONNX for cross-platform compatibility
  • Identify geographic high-risk zones
  • Explore automated โ€œMaydayโ€ alert triggers

๐Ÿ“Š Dataset Description

Source: EASA Air Traffic Control Public Data

Features include:

  • Latitude
  • Longitude
  • Airspeed
  • Flight path deviation metrics
  • Traffic complexity indicators

The dataset aggregates information from multiple ATC sources.


๐Ÿง  Methodology

1๏ธโƒฃ Data Preprocessing

  • Missing value handling
  • Feature normalization
  • Removal of irrelevant variables
  • Merging ACAS + Traffic Complexity datasets

2๏ธโƒฃ Exploratory Data Analysis

  • Distribution analysis
  • Geographic trend visualization
  • Correlation analysis
  • Outlier detection

3๏ธโƒฃ Feature Engineering

  • Path instability metrics
  • Speed fluctuation indicators
  • Spatial risk mapping

4๏ธโƒฃ Model Training

  • Supervised classification approach
  • Train-test split
  • Model validation

5๏ธโƒฃ ONNX Conversion

  • Export trained model to ONNX
  • Enable inference outside Python ecosystem

๐Ÿ“ˆ Model Evaluation

To assess predictive performance, the following metrics are evaluated:

๐Ÿ”น Accuracy

Overall correctness of the model.

๐Ÿ”น Precision

Measures how many predicted high-risk cases were actually high-risk.

๐Ÿ”น Recall (Sensitivity)

Measures how many actual high-risk cases were correctly identified.

๐Ÿ”น F1-Score

Harmonic mean of Precision and Recall.

๐Ÿ”น ROC-AUC Score

Evaluates the model's ability to distinguish between safe and high-risk flights across different classification thresholds.


๐Ÿ“Š Confusion Matrix

The confusion matrix provides detailed classification breakdown:

Predicted Safe Predicted Risk
Actual Safe True Negative False Positive
Actual Risk False Negative True Positive
  • False Positives: False alarm situations
  • False Negatives: Dangerous undetected cases (critical in aviation safety)

In safety-critical systems, minimizing False Negatives is especially important.


๐Ÿ“ˆ ROC Curve Analysis

The ROC curve plots:

  • True Positive Rate (Recall)
  • False Positive Rate

A model with strong predictive power will show:

  • Curve close to top-left corner
  • AUC score close to 1.0

This ensures reliable discrimination between safe and high-risk flight conditions.


๐Ÿš€ How to Run

1๏ธโƒฃ Create Virtual Environment

python -m venv venv

2๏ธโƒฃ Activate

Windows:

venv\Scripts\activate

Mac/Linux:

source venv/bin/activate

3๏ธโƒฃ Install Requirements

pip install -r requirements.txt

4๏ธโƒฃ Execute Notebooks

  • ATC.ipynb โ†’ EDA & preprocessing
  • onnx_1.ipynb โ†’ Model training
  • ONNX_2.ipynb โ†’ Advanced risk analysis

๐Ÿ“ฆ Deployment Capability

The use of ONNX enables:

  • Cross-language inference (C++, Java, etc.)
  • Cloud deployment
  • Edge deployment
  • Real-time aviation monitoring systems

๐Ÿ”ฎ Future Work

  • Real-time streaming integration using Apache Kafka
  • Distributed processing using Apache Spark Streaming
  • Live risk monitoring dashboards
  • Automated alert system for aviation authorities
  • Integration into ATC decision support systems

๐Ÿ— Project Architecture

๐Ÿ— System Architecture

``` Raw ATC Data โ†“ Data Cleaning โ†“ EDA & Feature Engineering โ†“ ML Classification Model โ†“ ONNX Conversion โ†“ Risk Prediction & Alert Simulation ```

Explainable ATC MAML Engine (SHAP)

This package contains Iteration 2 of the Air Traffic Control (ATC) Risk Prediction model, featuring MAML (Model-Agnostic Meta-Learning) and SHAP (SHapley Additive exPlanations) for decision transparency.

๐ŸŒŸ Key Features

  • MAML Meta-Learning: A model designed for rapid adaptation to new aviation sectors and traffic conditions.
  • SHAP Explainability: Deep insights into why the model classifies a flight as "High Risk".
  • ONNX Weights: Pre-trained model in an interoperable format for high-performance inference.

๐Ÿ“‚ Package Contents

  • train_v2.py: The core MAML training architecture.
  • calculate_shap_v2.py: The explainability engine that generates feature importance and sensitivity plots.
  • accident_prediction_v2.onnx: Optimized pre-trained model weights.
  • X_test_v2.npy: Representative sample data for SHAP analysis.
  • model_metrics.json: Model performance metadata and feature labels.
  • assets/: Folder containing generated SHAP bar and summary plots.
  • requirements.txt: Python dependencies.

๐Ÿš€ Getting Started

1. Install Dependencies

pip install -r requirements.txt

2. Run SHAP Explainability Analysis

To re-generate the SHAP values and visualizations:

python calculate_shap_v2.py

This will update the plots in the assets/ folder.

๐Ÿ“Š Understanding the results

### Global Importance (`v2_shap_bar.png`) Shows the overall ranking of features. For example, if **Altitude** is at the top, it means the model's risk prediction is most sensitive to flight height.

Feature Sensitivity (v2_shap_summary.png)

Shows the *direction* of influence. - **Red dots** (High value) on the right mean the feature increases risk. - **Blue dots** (Low value) on the right mean the feature increases risk.

Decision Journey (v2_shap_waterfall.png)

Shows the contribution of each feature to a **single specific prediction**. - **Positive values (Pink)**: Features that pushed the risk higher for this flight. - **Negative values (Blue)**: Features that decreased the risk for this flight. - **E[f(x)]**: The base risk level. - **f(x)**: The final predicted risk probability.

Developed for the ADAI Project - Air Traffic Control Risk Classification CC ABHISHEK HIRVE.

๐Ÿ“ Project Structure

ADAI_Proj/
โ”‚
โ”œโ”€โ”€ ATC.ipynb
โ”œโ”€โ”€ onnx_1.ipynb
โ”œโ”€โ”€ ONNX_2.ipynb
โ”œโ”€โ”€ data/
โ”œโ”€โ”€ models/
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ README.md

Iteration_2_MAML_Engine/
โ”œโ”€โ”€ data/                            # Processed datasets for meta-learning
โ”‚   โ”œโ”€โ”€ final_acas_data.csv
โ”‚   โ”œโ”€โ”€ final_dataframe_trfcomplexity.csv
โ”‚   โ””โ”€โ”€ ... (auxiliary ONNX data)
โ”œโ”€โ”€ .gitignore                       # Keeps repo clean from cache/temp files
โ”œโ”€โ”€ .ipynb_checkpoints/
โ”œโ”€โ”€ ONNX_2.ipynb                     # Main Analysis & Workflow Notebook
โ”œโ”€โ”€ README.md                        # Technical Guide for Iteration 2
โ”œโ”€โ”€ accident_prediction_v2.onnx      # Final Trained MAML Model
โ”œโ”€โ”€ build_dashboard_data_v2.py       # Dashboard Metric Generator
โ”œโ”€โ”€ calculate_metrics.py             # Precision/Recall/F1 Calculator
โ”œโ”€โ”€ extract_geo.py                   # Geo-spatial Feature Extractor
โ”œโ”€โ”€ generate_dashboard_data.py       # Main Dashboard Plotting Engine
โ”œโ”€โ”€ inject_geo_data.py               # Landing Page Data Integration
โ”œโ”€โ”€ model_metrics.json               # Performance Benchmarks
โ”œโ”€โ”€ requirements.txt                 # Dependencies (torch, onnx, etc.)
โ”œโ”€โ”€ set_complexity.py                # Complexity Configuration Utility
โ””โ”€โ”€ train_v2.py                      # Core MAML Meta-Learning Engine

๐Ÿงช Research Contribution

This project demonstrates:

  • Applied AI in safety-critical systems
  • End-to-end ML engineering pipeline
  • Aviation risk modeling
  • Model portability and deployment design
  • Practical ONNX implementation

๐Ÿ‘ค Author

Abhishek Hirve Artificial Intelligence & Machine Learning
Focused on aviation safety and applied AI systems.


๐Ÿ“œ License

This project is intended for educational and research purposes.

About

Machine learning model for aviation accident risk prediction using ACAS and air traffic complexity data. Includes ONNX model export for deployment.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors