- This repository hosts an Artificial Neural Network model, served via FastAPI, that predicts whether a tool is on the verge of failure or not based on it's working environment. It also predicts the most probable type of failue the tool may experience using the same information.
- The app is deployed on streamlit. Try it out here
- Dataset obtained from Kaggle
- Clone the repository
git clone https://github.com/shaloy-lewis/machine-predictive-maintenance-classification.git
cd machine-predictive-maintenance-classification
- Build and run the Docker container
docker-compose build
docker-compose up
- Access the application
http://localhost:8080
- Clone the repository
git clone https://github.com/shaloy-lewis/machine-predictive-maintenance-classification.git
cd machine-predictive-maintenance-classification
- Create and activate virtualenv
pip install virtualenv
python3.12 -m venv venv
For windows
venv/Scripts/activate.bat
For linux
source venv/bin/activate
- Install all the required packages and dependencies
pip install -r requirements.txt
- Run the server
uvicorn api:app --reload --port 8080 --host 0.0.0.0
- Access the application
http://localhost:8080
curl -X 'POST' \
'http://localhost:[hostname]/predict' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"air_temperature_k": 298.9,
"process_temperature_k": 309.1,
"rotational_speed_rpm": 2861,
"torque_nm": 4.6,
"tool_wear_min": 143,
"Type": "L"
}'
Change the hostname with the hostname given on your environment
{
"probability_of_failure": 0.999088,
"failure_type": {
"Heat Dissipation Failure": {
"probability": 0.235062
},
"Overstrain Failure": {
"probability": 0.143143
},
"Power Failure": {
"probability": 0.618992
},
"Random Failures": {
"probability": 0.0009
},
"Tool Wear Failure": {
"probability": 0.001512
}
}
}