Skip to content

luuuisc/fleetVision-ML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚚 FleetVision AI — Smart Fleet Monitoring & Predictive Maintenance

Empowering data-driven fleet operations through intelligent automation, real-time analytics, and predictive maintenance powered by AI.


🧩 Problem Statement

Fleet operations across logistics, transportation, and delivery industries face critical challenges:

  • Inefficient monitoring of vehicles in real-time.
  • Reactive maintenance, resulting in costly downtime.
  • Fragmented data systems, preventing comprehensive analysis of fleet health.
  • Lack of predictive insights, leading to unexpected failures and financial losses.

FleetVision AI emerges as a solution that integrates telemetry, automation, and AI analytics into a single platform. By capturing sensor data in real time and applying machine learning for anomaly detection and predictive maintenance, FleetVision AI helps organizations reduce operational costs, prevent mechanical failures, and increase safety and efficiency.


⚙️ Stack Overview

Stack: FastAPI (REST API) · MySQL 8 · SQLAlchemy · Streamlit (Dashboard) · scikit-learn (IsolationForest) · Docker

Layer Technology Description
Backend API FastAPI + SQLAlchemy High-performance REST endpoints for data ingestion and model training
Database MySQL 8 Reliable telemetry storage with structured schema
Machine Learning scikit-learn Isolation Forest for anomaly detection and maintenance forecasting
Frontend Dashboard Streamlit + Plotly + Folium Interactive web dashboard with real-time KPIs, maps, and alerts
Infrastructure Docker Compose Fully containerized environment for reproducibility
Simulation Python Synthetic GPS and sensor telemetry generator

✅ Core Features

  • 📡 Real-time telemetry ingestion via REST API.
  • 🧠 AI-driven anomaly detection with Isolation Forest.
  • 🗺️ Interactive dashboard: live map, performance KPIs, and time-series analytics.
  • ⚙️ On-demand model retraining (/train endpoint).
  • 🧰 Telemetry simulator (speed, temperature, fuel, GPS).
  • 🐳 Docker Compose deployment (MySQL, API, Dashboard).

▶️ Quick Start (Docker)

# 1. Enter the project directory
cd fleetvision

# 2. Build and run all services
docker compose up --build

# 3. Open the dashboard
http://localhost:8501

# 4. (Optional) Run the simulator locally
pip install -r simulator/requirements.txt
python simulator/simulate.py --api http://localhost:8000 --vehicles 3 --interval 1.5

The backend automatically creates the required MySQL tables on startup. Database persistence is ensured through the dbdata Docker volume.


🔌 REST API Overview

Method Endpoint Description
GET /health Check API status
POST /ingest Send telemetry data
GET /vehicles Retrieve active vehicle IDs
GET /telemetry?vehicle_id=TRUCK-01&limit=200 Fetch recent telemetry records
POST /train Retrain anomaly detection model

Example /ingest Payload

{
  "vehicle_id": "TRUCK-01",
  "timestamp": "2025-10-08T18:00:00Z",
  "lat": 19.4326,
  "lon": -99.1332,
  "speed": 45.2,
  "engine_temp": 88.5,
  "fuel_level": 78.9,
  "accel": 0.12
}

🧠 Machine Learning

  • Model: Isolation Forest (n_estimators=200, contamination=0.05).
  • Features: speed, engine_temp, fuel_level, accel.
  • Score normalization: decision_function → [0,1]; scores > 0.6 indicate anomalies.
  • Retraining: available through /train endpoint, using stored telemetry data.

📊 Future Enhancements

  • 🔄 Integration with TimescaleDB for advanced time-series analysis.
  • ⚡ Async job handling via Celery + Redis.
  • 📲 Real-time alerts through Twilio SMS/WhatsApp or email.
  • 🤖 Predictive maintenance using XGBoost and Prophet models.
  • 🔐 Authentication (JWT) and multi-organization architecture.

🧾 License

This project is licensed under the MIT License.


👥 Credits

Developed by Luis Ángel Pérez Castro 📍 Mechatronics Engineer & Fullstack AI Developer (UNAM – Facultad de Ingeniería)

Contributors welcome — whether you’re interested in machine learning, automation, or full-stack development, you can help expand FleetVision AI into a robust platform for intelligent fleet management.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors