├── Predictive maintenance PPT.pptx ├── README.md ├── app.py ├── data_preprocessing.ipynb ├── engine_data.csv └── hhmodel.pkl /Predictive maintenance PPT.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iDharshan/ML-Based-Vehicle-Predictive-Maintenance-System-with-Real-Time-Visualization/1d66756b7f0fba698022b278afb04d207c638160/Predictive maintenance PPT.pptx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ML-Based Vehicle Predictive Maintenance System with Real-Time Visualization 2 | 3 | ## Overview 4 | 5 | This project implements AI-driven predictive maintenance for vehicles, leveraging machine learning techniques to forecast maintenance needs based on real-time sensor data. The system preprocesses sensor data for reliability, utilizes Gradient Boosting Machine (GBM) models for prediction, and integrates a web application interface for real-time data visualization and predictions. The goal is to enable proactive fleet management, reduce costs, and ensure efficient transportation by predicting maintenance probability, estimating maintenance dates in advance, and providing probability percentages for potential part failures. 6 | 7 | ## Features 8 | 9 | - Collects real-time sensor data from vehicles. 10 | - Preprocesses sensor data for reliability. 11 | - Utilizes GBM machine learning model for predictive maintenance. 12 | - Integrates a web application interface using Streamlit for real-time data visualization and predictions. 13 | - Predicts maintenance probability based on model output. 14 | - Estimates maintenance date 2-3 weeks in advance. 15 | - Provides probability percentage for potential part failure. 16 | - Enhances predictive accuracy and allows proactive intervention. 17 | - Facilitates timely maintenance scheduling to minimize downtime. 18 | 19 | ## Benefits 20 | 21 | - Performing maintenance regularly ensures optimal vehicle performance. 22 | - Optimizes resources and prevents emergency repairs before embarking on long journeys. 23 | - Enhances safety for both drivers and passengers. 24 | - Improves supply chain efficiency by reducing unexpected breakdowns. 25 | - Increases customer satisfaction by ensuring reliable transportation services. 26 | 27 | ## Repository Contents 28 | 29 | - **engine_data.csv/**: Contains the dataset used for training the machine learning model. 30 | - **data_preprocessing/**: Includes the code for the GBM machine learning model. 31 | - **app.py**: Streamlit code for the web application interface deployment. 32 | 33 | ## Usage 34 | 35 | 1. Clone the repository: `git clone ` 36 | 2. Navigate to the project directory: `cd ` 37 | 3. Install dependencies: `pip install -r requirements.txt` 38 | 4. Run the Streamlit application: `streamlit run app.py` 39 | 5. Access the web interface via the provided URL. 40 | 41 | ## Contributors 42 | 43 | - Dharshan A 44 | - Pravin R F 45 | - Rishikaandh Devadoss 46 | - Abinayaa M K 47 | 48 | ## Contact 49 | 50 | For questions or inquiries, please contact dharshanathi21@gmail.com. 51 | -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | import streamlit as st 2 | import pickle 3 | import numpy as np 4 | 5 | # Load the trained model (replace 'model.pkl' with your actual file name) 6 | with open('model.pkl', 'rb') as file: 7 | model = pickle.load(file) 8 | 9 | # Define the customized ranges for each feature based on dataset statistics 10 | custom_ranges = { 11 | 'Engine rpm': (61.0, 2239.0), 12 | 'Lub oil pressure': (0.003384, 7.265566), 13 | 'Fuel pressure': (0.003187, 21.138326), 14 | 'Coolant pressure': (0.002483, 7.478505), 15 | 'lub oil temp': (71.321974, 89.580796), 16 | 'Coolant temp': (61.673325, 195.527912), 17 | 'Temperature_difference': (-22.669427, 119.008526) 18 | } 19 | 20 | # Feature Descriptions 21 | feature_descriptions = { 22 | 'Engine rpm': 'Revolution per minute of the engine.', 23 | 'Lub oil pressure': 'Pressure of the lubricating oil.', 24 | 'Fuel pressure': 'Pressure of the fuel.', 25 | 'Coolant pressure': 'Pressure of the coolant.', 26 | 'lub oil temp': 'Temperature of the lubricating oil.', 27 | 'Coolant temp': 'Temperature of the coolant.', 28 | 'Temperature_difference': 'Temperature difference between components.' 29 | } 30 | 31 | # Engine Condition Prediction App 32 | def main(): 33 | st.title("Engine Condition Prediction") 34 | 35 | # Display feature descriptions 36 | st.sidebar.title("Feature Descriptions") 37 | for feature, description in feature_descriptions.items(): 38 | st.sidebar.markdown(f"**{feature}:** {description}") 39 | 40 | # Input widgets with customized ranges 41 | engine_rpm = st.slider("Engine RPM", min_value=float(custom_ranges['Engine rpm'][0]), 42 | max_value=float(custom_ranges['Engine rpm'][1]), 43 | value=float(custom_ranges['Engine rpm'][1] / 2)) 44 | lub_oil_pressure = st.slider("Lub Oil Pressure", min_value=custom_ranges['Lub oil pressure'][0], 45 | max_value=custom_ranges['Lub oil pressure'][1], 46 | value=(custom_ranges['Lub oil pressure'][0] + custom_ranges['Lub oil pressure'][1]) / 2) 47 | fuel_pressure = st.slider("Fuel Pressure", min_value=custom_ranges['Fuel pressure'][0], 48 | max_value=custom_ranges['Fuel pressure'][1], 49 | value=(custom_ranges['Fuel pressure'][0] + custom_ranges['Fuel pressure'][1]) / 2) 50 | coolant_pressure = st.slider("Coolant Pressure", min_value=custom_ranges['Coolant pressure'][0], 51 | max_value=custom_ranges['Coolant pressure'][1], 52 | value=(custom_ranges['Coolant pressure'][0] + custom_ranges['Coolant pressure'][1]) / 2) 53 | lub_oil_temp = st.slider("Lub Oil Temperature", min_value=custom_ranges['lub oil temp'][0], 54 | max_value=custom_ranges['lub oil temp'][1], 55 | value=(custom_ranges['lub oil temp'][0] + custom_ranges['lub oil temp'][1]) / 2) 56 | coolant_temp = st.slider("Coolant Temperature", min_value=custom_ranges['Coolant temp'][0], 57 | max_value=custom_ranges['Coolant temp'][1], 58 | value=(custom_ranges['Coolant temp'][0] + custom_ranges['Coolant temp'][1]) / 2) 59 | temp_difference = st.slider("Temperature Difference", min_value=custom_ranges['Temperature_difference'][0], 60 | max_value=custom_ranges['Temperature_difference'][1], 61 | value=(custom_ranges['Temperature_difference'][0] + custom_ranges['Temperature_difference'][1]) / 2) 62 | 63 | # Predict button 64 | if st.button("Predict Engine Condition"): 65 | result, confidence = predict_condition(engine_rpm, lub_oil_pressure, fuel_pressure, coolant_pressure, lub_oil_temp, coolant_temp, temp_difference) 66 | 67 | 68 | # Explanation 69 | if result == 0: 70 | st.info(f"The engine is predicted to be in a normal condition. As the Confidence level of the machine is : {1.0 - confidence:.2%}") 71 | else: 72 | st.warning(f"Warning! Please investigate further,As the Confidence level of the machine is : {1.0 - confidence:.2%}") 73 | 74 | # Reset button 75 | if st.button("Reset Values"): 76 | st.experimental_rerun() 77 | 78 | # Function to predict engine condition 79 | def predict_condition(engine_rpm, lub_oil_pressure, fuel_pressure, coolant_pressure, lub_oil_temp, coolant_temp, temp_difference): 80 | input_data = np.array([engine_rpm, lub_oil_pressure, fuel_pressure, coolant_pressure, lub_oil_temp, coolant_temp, temp_difference]).reshape(1, -1) 81 | prediction = model.predict(input_data) 82 | confidence = model.predict_proba(input_data)[:, 1] # For binary classification, adjust as needed 83 | return prediction[0], confidence[0] 84 | 85 | if __name__ == "__main__": 86 | main() 87 | -------------------------------------------------------------------------------- /hhmodel.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iDharshan/ML-Based-Vehicle-Predictive-Maintenance-System-with-Real-Time-Visualization/1d66756b7f0fba698022b278afb04d207c638160/hhmodel.pkl --------------------------------------------------------------------------------