CoolFace
Apppublic

ziadmostafa/Road-Accidents-Severity-Analysis

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
App README

Road Accidents Severity Analysis

Road Safety Data Science Machine Learning

๐Ÿ“ Project Description

This project analyzes road traffic accident (RTA) data to identify patterns and factors that contribute to accident severity. Using machine learning models, we predict the severity of accidents based on various factors such as driver characteristics, vehicle conditions, road features, and environmental conditions.

The insights from this analysis can help:

  • โ€”Identify high-risk scenarios for road accidents
  • โ€”Recommend preventive measures to reduce accident severity
  • โ€”Support traffic management and road safety policies
  • โ€”Raise awareness about factors contributing to severe accidents

๐Ÿ” Dataset

The dataset contains over 12,000 records of road traffic accidents with 32+ features including:

  • โ€”Driver information (age, gender, experience, education)
  • โ€”Vehicle details (type, service years, defects)
  • โ€”Road conditions and features
  • โ€”Environmental factors (weather, light conditions)
  • โ€”Accident details (collision type, vehicles involved, casualties)
  • โ€”Accident severity (target variable)

๐Ÿš€ Features

  • โ€”Comprehensive Data Analysis: Explore patterns and relationships in road accident data
  • โ€”Interactive Visualizations: 8+ interactive charts to understand accident factors
  • โ€”Predictive Modeling: Machine learning models to predict accident severity
  • โ€”User-friendly Interface: Input accident details to get severity predictions
  • โ€”Feature Importance Analysis: Understand which factors most influence accident severity

๐Ÿ› ๏ธ Installation & Setup

  1. 1.Clone the repository:
  1. 1.Install dependencies:
bash
   pip install -r requirements.txt
  1. 1.Run the Jupyter notebook to train models:
bash
   jupyter notebook Road_Accidents_Severity_Analysis.ipynb
  1. 1.Launch the Streamlit app:
bash
   streamlit run app.py

๐Ÿ”ง Technologies Used

  • โ€”Data Processing: Pandas, NumPy
  • โ€”Visualization: Plotly, Cufflinks
  • โ€”Machine Learning: Scikit-learn
  • โ€”Web Application: Streamlit
  • โ€”Other Tools: Jupyter Notebook, Python

๐Ÿ“ Project Structure

road-accidents-severity/
โ”œโ”€โ”€ Road_Accidents_Severity_Analysis.ipynb  # Analysis & model training
โ”œโ”€โ”€ app.py                                  # Streamlit application
โ”œโ”€โ”€ RTA Dataset.csv                         # Dataset
โ”œโ”€โ”€ requirements.txt                        # Dependencies
โ”œโ”€โ”€ README.md                               # Project documentation
โ”œโ”€โ”€ best_accident_severity_model.pkl        # Trained model
โ”œโ”€โ”€ label_encoders.pkl                      # Saved encoders
โ””โ”€โ”€ scaler.pkl                              # Saved scaler

๐Ÿ”ฎ Future Improvements

  • โ€”Incorporate geographic data for spatial analysis
  • โ€”Implement more advanced models (e.g., XGBoost, neural networks)
  • โ€”Add time series analysis to identify temporal patterns
  • โ€”Develop a mobile app for on-the-go predictions
  • โ€”Include more interactive features in the dashboard

๐Ÿ‘ฅ Contributors