An AI-powered web application for detecting and predicting electrical faults using Machine Learning. This project combines a React + Vite frontend with a Flask backend and a Random Forest model trained on electrical measurements.
Electrical faults can lead to equipment damage, power outages, and safety risks. This project aims to automatically detect and classify electrical faults using machine learning, providing fast and reliable predictions through a modern web interface.
The system integrates:
- Machine Learning for fault prediction
- Flask REST API
- React + Vite frontend
- Real electrical datasets
- Interactive prediction interface
- Electrical fault prediction using Random Forest
- Clean and responsive React interface
- Flask REST API
- Data preprocessing and feature scaling
- Model serialization using Joblib
- Fast prediction results
- Modular project structure
AI-Based-Electrical-Fault-Detection-System
│
├── dataset
│ ├── company_data.csv
│ └── kaggle_dataset.csv
│
├── notebooks
│ └── Electric_Fault_Prediction.ipynb
│
├── simulation
│ └── Simulation.ipynb
│
├── website
│ ├── backend
│ │ ├── models
│ │ │ ├── random_forest_fault_model.pkl
│ │ │ └── data_scaler.pkl
│ │ ├── main.py
│ │ └── requirements.txt
│ │
│ ├── public
│ ├── src
│ ├── package.json
│ ├── vite.config.js
│ └── README.md
│
├── requirements.txt
├── LICENSE
└── README.md
- Random Forest
- Scikit-Learn
- Pandas
- NumPy
- Joblib
- Python
- Flask
- React
- Vite
- JavaScript
- HTML
- CSS
The model was trained using two different datasets:
- Company electrical measurements
- Kaggle electrical fault dataset
The datasets were cleaned, merged, preprocessed, and transformed before model training.
- Data Collection
- Data Cleaning
- Feature Engineering
- Data Scaling
- Model Training
- Model Evaluation
- Model Deployment
- Real-Time Prediction
Algorithm:
Random Forest Classifier
The trained model is stored inside:
website/backend/models
The scaler is also saved to ensure consistent preprocessing during prediction.
git clone https://github.com/YOUR_USERNAME/AI-Based-Electrical-Fault-Detection-System.gitcd website/backend
pip install -r requirements.txt
python main.pycd website
npm install
npm run dev- Start the Flask backend.
- Start the React frontend.
- Open the web application.
- Enter the required electrical measurements.
- Receive the predicted electrical fault.
- Real-time SCADA integration
- IoT sensor support
- Deep Learning models
- Cloud deployment
- Live monitoring dashboard
- Explainable AI (XAI)
Basmala Khaled
AI Graduate | Data Engineering & Machine Learning Enthusiast
LinkedIn: https://www.linkedin.com/in/basmala-khaled-ai10/
This project is released under the MIT License.