Skip to content

nutkung1/FinalProjectCPE393

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš—βš‘ Electric Vehicle Analysis MLOps Platform

A simple machine learning project that can identify electric cars from photos and predict their driving range. Built with modern MLOps practices for easy deployment and maintenance.

Slides: https://www.canva.com/design/DAGov1yV9Io/-zcjeiMGXPw5jMRL8jtWPQ/edit?utm_content=DAGov1yV9Io&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton

Reports: https://docs.google.com/document/d/17qlmMI8Ot_4nT88Cjn9gaF8pYKDIK8VX0XQatznHP2U/edit?usp=sharing

Project Front End: https://finalprojectcpe393.streamlit.app/

πŸ” Project Overview,

This MLOps platform combines computer vision and predictive modeling to analyze electric vehicles. Built with a modern tech stack including Streamlit, Apache Kafka, AWS RDS, and containerized with Docker, it demonstrates end-to-end machine learning operations from data ingestion to model deployment. The system features continuous integration/deployment through GitHub Actions and monitors performance with MLflow, making it both a practical tool and a showcase of MLOps best practices.

alt text

🌟 What This Project Does

πŸ“Έ Car Recognition: Upload a photo of an electric car and get the make/model

πŸ“Š Range Prediction: Enter car details and get predicted driving range

πŸ–₯️ Easy Web Interface: Simple web app to use both features

πŸ€– Real-Time Data Ingsetion with Apache kafka and AWS RDS

πŸ€– Automated Everything: Automatic testing, building, and deployment

πŸ—οΈ How It Works (Simple Version)

What each part does:

Web Interface: Where users interact (like a website)

API Server: Handles requests and runs AI models

AI Models: One recognizes cars, one predicts range

Kafka: real-time data ingestion

Database: Stores car data

Automation: Keeps everything running smoothly

πŸ“ Project Files (What's What)

πŸ“‚ Main Files

β”œβ”€β”€ app.py # The website users see

β”œβ”€β”€ model_server.py # The brain that runs AI models

β”œβ”€β”€ requirements.txt # List of needed software

β”œβ”€β”€ Dockerfile.model # Instructions to package the AI brain

β”œβ”€β”€ Dockerfile.app # Instructions to package the website

πŸ“‚ AI Models

β”œβ”€β”€ ml_model/ # Trained AI models stored here

└── notebooks/ # Where we experiment and clean data

πŸ“‚ Automation

β”œβ”€β”€ .github/workflows/ # Automatic testing and deployment

β”œβ”€β”€ airflow/ # Scheduled tasks (like model updates)

└── tests/ # Code that checks if everything works

πŸ“‚ Data

β”œβ”€β”€ data/ # Electric vehicle information

└── kafka/ # Real-time data processing (advanced)

Real-Time Data Ingestion

alt text alt text

πŸš€ Getting Started (Easy Way)

What You Need

Docker (software that packages applications)

Git (for downloading code)

Step 1: Clone the repository:

git clone https://github.com/nutkung1/FinalProjectCPE393.git
cd FinalProjectCPE393

Step 2: Download Library

pip install -r requirements.txt

Step 3: Start Everything Apache Kafka

  cd kafka
  docker-compose start -f docker-compose.kafka.yaml up

Airflow Docker-compose (Airflow + MLFlow)

  docker-compose start -f docker-compose.airflow.yaml up

BackEnd

   python model_server.py
   ngrok 8000

Step 4: Use the App

Open your browser to http://localhost:8501 or https://finalprojectcpe393.streamlit.app/

Upload a car photo or enter car details

Get instant predictions!

πŸ”§ What the AI Can Do

  1. Recognize Cars from Photos Send a photo, get back:

  2. Predict Driving Range Enter car details, get range prediction:

πŸ§ͺ Quality Assurance

The project automatically:

βœ… Tests all code before deployment

βœ… Checks code quality and style

βœ… Builds and packages everything correctly

βœ… Reports any problems immediately

πŸ—οΈ Apache Airflow and MLFlow

alt text alt text alt text

πŸ“Š How Good Are the AI Models?

Car Recognition (ConvNeXTv2)

Accuracy: 95 %

Speed: Identifies cars in under 1 second alt text

Range Prediction (XGBoost)

Average Error: Β±15 miles

Reliability: Works for 95% of electric vehicles alt text

Residual MLP

MAE: 0.54

MSE: 5.19 alt text

πŸ”„ Automatic Operations (MLOps Magic)

What Happens When You Update Code:

Code Check: Automatically tests your changes

Quality Check: Makes sure code follows best practices

Build: Creates new versions of the app

Deploy: Updates the live application

Monitor: Watches for any problems

Scheduled Tasks:

Daily: Check for new car data

Weekly: Retrain models with the latest information

Monthly: Performance reports

πŸ› οΈ For Developers

Local Development

Adding New Features

Make changes to the code

Run tests: pytest

Push to GitHub

Automatic deployment handles the rest!

🎯 Why This Architecture?

Simple but Powerful:

Each part does one job well Easy to fix problems Can handle lots of users Automatically stays up-to-date Benefits for Users:

Fast predictions Always available Accurate results Easy to use Benefits for Developers:

Easy to maintain Automatic testing Quick deployments Clear code organization

πŸš€ Production Features

High Availability: App stays running even if one part fails

Auto-Scaling: Handles more users automatically

Monitoring: Alerts if anything goes wrong

Security: Protects user data and prevents attacks

Backup: Regular data backups for safety

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages