# rohithgg/vehicle-maintain-ai-predict architecture

> Architecture diagram of the GitHub repository rohithgg/vehicle-maintain-ai-predict, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rohithgg/vehicle-maintain-ai-predict
- Repository: https://github.com/rohithgg/vehicle-maintain-ai-predict

## Overview

##### Main Components
- Data Collection & Simulation:
- Sensor data uplift via CSV (vehicle_telemetry_data.csv) and the simulation environment using Airsim (referenced in AirsimAPI.py).
- Data Processing:
- Files like py1.pfm and the CSV data indicate data preprocessing and preparation steps.
- The use of NumPy files (X_seq.npy and y_seq.npy) shows preprocessed sequences used in training or predictions.
- Machine Learning Model:
- The supervised learning model is saved as bike_health_model.h5 and bike_health_model.keras.
- This component is responsible for predictive maintenance and engine health monitoring.
- Autopilot & Driver Assistance:
- autopilot.py implements components for autonomous driving.
- monitor.py and server_read.py likely handle real-time monitoring and interfacing with the simulation.
- External/System Integration:
- Although not explicitly shown with dedicated directories, the README mentions IoT sensor integrations and mobile-based interfaces for displaying predictions and sensor data.

##### Relationships and Interactions between Components
- Data flows from sensors (or simulated sensors via Airsim) into the Data Collection layer.
- The collected data is then processed and formatted, feeding into the ML model for prediction.
- The ML model outputs maintenance alerts or engine health statuses that are fed into the Autopilot or ABS systems.
- There is real-time monitoring to continuously relay data between the simulation (Airsim) and the user interface (mobile/sensor dashboard).
- Server_read.py might be used to relay data between the backend engine (model, monitor) and the frontend display components.

##### Architectural Patterns and Design Principles
- Separation of concerns: Each file serves a distinct role (data collection, processing, modeling, simulation, monitoring).
- Modular design: Components (ML model, autopilot, simulation API) can be individually developed, tested, and later integrated.
- Real-time data flow: Emphasis on continuous sensor data to facilitate driving assistance and predictive maintenance.

##### Relevant Technology Stack Elements
- Programming Language: Python.
- Machine Learning Frameworks: TensorFlow/Keras (given .h5 and .keras files), possibly with Scikit-learn.
- Data Handling: NumPy for sequence data processing (X_seq.npy and y_seq.npy).
- Simulation: Airsim for vehicle and sensor simulation.
- Additional tools referenced: Jupyter Notebook for initial analysis/training.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Data Collection & Simulation"
        DC1["Vehicle Telemetry CSV"]
        DC2["AirsimAPI (Simulation)"]
    end

    subgraph "Data Processing"
        DP1["Preprocessing Script (py1.pfm)"]
        DP2["Sequence Data: X_seq.npy"]
        DP3["Sequence Data: y_seq.npy"]
    end

    subgraph "Machine Learning Model"
        ML1["Bike Health Model (bike_health_model.h5)"]
        ML2["Bike Health Model (bike_health_model.keras)"]
        ML_Final["Prediction Output"]
    end

    subgraph "Autopilot & Driver Assistance"
        AD1["Autopilot System (autopilot.py)"]
        AD2["Monitoring Interface (monitor.py)"]
        AD3["Server Read Interface (server_read.py)"]
    end

    DC1 -->|"data"| DP1
    DC2 -->|"sim_data"| DP1

    DP1 -->|"processed"| DP2
    DP1 -->|"processed"| DP3

    DP2 -->|"prepped"| ML1
    DP3 -->|"prepped"| ML2

    ML1 -->|"combine"| ML_Final
    ML2 -->|"combine"| ML_Final

    ML_Final -->|"predicts"| AD1
    ML_Final -->|"predicts"| AD2
    ML_Final -->|"predicts"| AD3

    AD2 -->|"feedback"| DC2
    AD3 -->|"feedback"| DC2

    click DC1 "https://github.com/rohithgg/vehicle-maintain-ai-predict/blob/master/Predictive-Maintenance-for-Vehicle-Engine-Health-Using-Telemetry-Data-main/vehicle_telemetry_data.csv"
    click DC2 "https://github.com/rohithgg/vehicle-maintain-ai-predict/blob/master/Predictive-Maintenance-for-Vehicle-Engine-Health-Using-Telemetry-Data-main/AirsimAPI.py"
    click DP1 "https://github.com/rohithgg/vehicle-maintain-ai-predict/blob/master/Predictive-Maintenance-for-Vehicle-Engine-Health-Using-Telemetry-Data-main/py1.pfm"
    click DP2 "https://github.com/rohithgg/vehicle-maintain-ai-predict/blob/master/Predictive-Maintenance-for-Vehicle-Engine-Health-Using-Telemetry-Data-main/X_seq.npy"
    click DP3 "https://github.com/rohithgg/vehicle-maintain-ai-predict/blob/master/Predictive-Maintenance-for-Vehicle-Engine-Health-Using-Telemetry-Data-main/y_seq.npy"
    click ML1 "https://github.com/rohithgg/vehicle-maintain-ai-predict/blob/master/Predictive-Maintenance-for-Vehicle-Engine-Health-Using-Telemetry-Data-main/bike_health_model.h5"
    click ML2 "https://github.com/rohithgg/vehicle-maintain-ai-predict/blob/master/Predictive-Maintenance-for-Vehicle-Engine-Health-Using-Telemetry-Data-main/bike_health_model.keras"
    click AD1 "https://github.com/rohithgg/vehicle-maintain-ai-predict/blob/master/Predictive-Maintenance-for-Vehicle-Engine-Health-Using-Telemetry-Data-main/autopilot.py"
    click AD2 "https://github.com/rohithgg/vehicle-maintain-ai-predict/blob/master/Predictive-Maintenance-for-Vehicle-Engine-Health-Using-Telemetry-Data-main/monitor.py"
    click AD3 "https://github.com/rohithgg/vehicle-maintain-ai-predict/blob/master/Predictive-Maintenance-for-Vehicle-Engine-Health-Using-Telemetry-Data-main/server_read.py"

    classDef dataCollection fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef dataProcessing fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef ml fill:#ABEBC6,stroke:#148F77,stroke-width:2px;
    classDef autopilot fill:#F5B7B1,stroke:#922B21,stroke-width:2px;

    class DC1,DC2 dataCollection;
    class DP1,DP2,DP3 dataProcessing;
    class ML1,ML2,ML_Final ml;
    class AD1,AD2,AD3 autopilot;
```
