AIoT Predictive Maintenance is a web app that predicts machine failure risk in real time from live sensor readings. It uses a Random Forest classifier trained with scikit-learn, achieving around 93% overall accuracy, to flag whether a machine is likely to fail based on its current operating conditions — helping catch problems before they cause downtime.
Feed it temperature, speed, torque, and tool wear readings, and it returns a prediction, a failure probability, and a plain-language status.
- 🎛️ Live sensor input form (machine type, temperature, speed, torque, tool wear)
- 🤖 Real-time failure prediction via a trained Random Forest model
- 📊 Failure probability score with a color-coded risk gauge
- 🚦 Status indicator: Normal / Watch / Alert
- ⚡ Fast, lightweight FastAPI backend
| Layer | Technology |
|---|---|
| Frontend | HTML, CSS, JavaScript |
| Backend | FastAPI |
| Model | scikit-learn — Random Forest classifier |
| Dataset | AI4I 2020 Predictive Maintenance Dataset |
| Accuracy | ~93% |
| Deployment | Render |
aiot-predictive-maintenance/
├── models/
│ ├── maintaince_model.pkl
│ └── preprocessor.pkl
├── static/
│ ├── script.js
│ └── style.css
├── templates/
│ └── index.html
├── Dockerfile
├── README.md
├── app.py
├── requirements.txt
└── schemas.py
-
Clone the repository
git clone https://github.com/httpsanjay/iot-predictive-maintenance-model.git cd iot-predictive-maintenance-model -
Create a virtual environment and install dependencies
python -m venv venv source venv/bin/activate pip install -r requirements.txt -
Run the app
uvicorn app:app --reload
-
Open http://localhost:8000 in your browser
⚠️ Note: The includedDockerfileisn't fully working yet — a fix is on the way. For now, run the app locally with the steps above, or use the live deployment linked at the top of this README.
Request body
{
"Type": "L",
"Air temperature [K]": 298.1,
"Process temperature [K]": 308.6,
"Rotational speed [rpm]": 1500,
"Torque [Nm]": 40.5,
"Tool wear [min]": 120
}Response
{
"prediction": 0,
"failure_probability": 34.1,
"status": "No maintenance required"
}| Field | Type | Description |
|---|---|---|
Type |
string | Machine quality variant — L, M, or H |
Air temperature [K] |
float | Ambient air temperature |
Process temperature [K] |
float | Process temperature |
Rotational speed [rpm] |
int | Spindle rotational speed |
Torque [Nm] |
float | Applied torque |
Tool wear [min] |
int | Cumulative tool wear time |
prediction |
int (0/1) | 1 if the model classifies this as a failure case |
failure_probability |
float (0–100) | Model's confidence that the machine will fail |
status |
string | Human-readable status shown in the UI |
Licensed under the MIT License.
Made with 🩷 by Sanjay