A machine learning project for predicting bearing health and damage conditions using vibration signals and operational parameters.
This project combines machine learning with a full-stack web application to predict bearing conditions and diagnose potential failures. The system analyzes operational data including speed, torque, and force measurements, along with vibration signal files to classify bearing health status.
-
Bearing Health Classification: Predicts three severity levels:
- Healthy - No fault detected, bearing operating normally
- Light Damage - Early-stage damage or artificially-induced faults (EDM, drilling, engraving)
- Heavy Damage - Advanced deterioration or fatigue damage requiring immediate attention
-
Fault Location Detection: Identifies where damage occurs:
- Inner Ring (IR)
- Outer Ring (OR)
- Outer Ring + Inner Ring (OR+IR)
- No fault location
-
Damage Type Classification: Categorizes damage as:
- Drilling
- EDM (Electrical Discharge Machining)
- Engraving
- Fatigue
- Plastic Deformation
- None
-
Interactive Web Interface: Modern React-based frontend for easy prediction and visualization
bearing-project/
├── Backend/
│ └── main.py # Flask API for model predictions
├── frontend/ # React + Vite web application
│ ├── src/
│ │ ├── App.jsx # Main application component
│ │ ├── App.css # Styling
│ │ ├── index.css # Tailwind CSS imports
│ │ └── main.jsx # React entry point
│ ├── public/ # Static assets
│ ├── vite.config.js # Vite configuration
│ └── package.json # Frontend dependencies
└── README.md
- Python with Flask REST API
- Machine Learning: Scikit-learn with LabelEncoder for multi-class classification
- Data Format: .mat files (MATLAB format) for vibration signal input
- React 19 - UI framework
- Vite - Build tool and dev server
- Tailwind CSS - Utility-first CSS framework
- React Hooks - State management
- Modern CSS - Custom styling with CSS variables
- Python 3.8+
- Node.js 16+ and npm
- Git
-
Navigate to the Backend directory:
cd bearing-project/Backend -
Install Python dependencies:
pip install -r requirements.txt
-
Run the Flask server:
python main.py
The API will be available at http://localhost:5000 by default.
-
Navigate to the frontend directory:
cd bearing-project/frontend -
Install dependencies:
npm install
-
Run the development server:
npm run dev
The application will be available at http://localhost:5173 (or another port if 5173 is in use).
- For production build:
npm run build
Returns the configuration including severity levels, location classes, and damage types to keep frontend and backend in sync.
Response:
{
"severity_meta": { ... },
"location_classes": ["IR", "None", "OR", "OR+IR"],
"damage_classes": ["Drilling", "EDM", "Engraving", "Fatigue", "None", "Plastic Def."]
}Predicts bearing condition from a .mat file and operational parameters.
Request:
file: .mat vibration signal file (multipart/form-data)speed_rpm: Motor/bearing speed in RPM (number)torque_Nm: Torque in Newton-meters (number)force_N: Force in Newtons (number)
Response:
{
"severity": {
"code": 0,
"label": "Healthy",
"description": "No fault detected. Bearing operating normally.",
"color": "#00ff9d",
"recommendation": "Continue standard monitoring schedule."
},
"location": "None",
"damage_type": "None",
"confidence": 0.95
}- Start both backend and frontend servers (in separate terminals)
- Open the web interface at
http://localhost:5173 - Select operational parameters:
- Speed (RPM)
- Torque (Nm)
- Force (N)
- Upload a .mat vibration signal file by dragging or clicking
- Click "Predict" to get the bearing health assessment
- Review results including severity, damage location, and recommendations
The machine learning model uses:
- LabelEncoder for categorical features (location, damage type)
- Severity classification with three levels (Healthy, Light Damage, Heavy Damage)
- Multi-output prediction for comprehensive bearing diagnostics
The model maps predictions to human-readable labels and provides actionable recommendations based on detected conditions.
Run ESLint on the frontend:
npm run lint- ✅ Full-stack application
- ✅ Backend ML API
- ✅ Interactive React frontend
- ✅ Vibration signal processing
- ✅ Multi-class bearing diagnostics
This project is provided as-is for educational and research purposes.
Contributions are welcome! Please feel free to submit issues or pull requests to improve the project.
For questions or suggestions, please open an issue in the repository.