A production-ready vibration fault classification system using MiniRocket for real-time machinery health monitoring
Features โข Installation โข Usage โข Performance โข Dashboard โข Documentation
This project implements an advanced industrial fault detection system for vibration data analysis, achieving 99.98% accuracy on multi-axis vibration signals. The system uses MiniRocket (Random Convolutional Kernel Transform) combined with Ridge Classification for fast and accurate fault diagnosis.
| Metric | Value |
|---|---|
| Test Accuracy | 99.98% ๐ |
| Training Time | 2.5 minutes |
| Model Size | 1.7 MB |
| Classes | 4 (Normal, Unbalance, Misalignment, Bearing) |
| Inference | <1 second |
- ๐ฏ World-Class Accuracy: 99.98% test accuracy on fault detection
- โก Ultra-Fast Training: Model trains in ~2.5 minutes
- ๐ Real-Time Inference: Sub-second predictions on new vibration data
- ๐ Interactive Dashboard: Beautiful Streamlit-based web interface with analytics
- ๐ Multi-Axis Support: Handles X, Y, Z axis vibration data (1024 timesteps ร 3 channels)
- ๐ง 4-Class Detection: Normal, Unbalance, Misalignment, Bearing fault detection
- ๐พ Lightweight Model: 1.7 MB model deployable on edge devices
- ๐ญ Production Ready: Complete ML pipeline with preprocessing, training, and deployment
mms_fault_classification/
โโโ src/
โ โโโ models/
โ โ โโโ minirocket.py # MiniRocket classifier implementation
โ โโโ data_loader.py # CSV data loading utilities
โ โโโ preprocessing.py # Data normalization & feature engineering
โโโ scripts/
โ โโโ train_minirocket.py # Model training script
โ โโโ visualize_results.py # Results visualization
โโโ pages/
โ โโโ 1_๐ฏ_Prediction.py # Live fault prediction interface
โ โโโ 2_๐_Analytics.py # Model performance analytics
โ โโโ 3_๐_Data_Explorer.py # Dataset exploration & visualization
โ โโโ 4_โน๏ธ_About.py # Project documentation
โโโ dashboard/
โ โโโ utils/
โ โโโ predictor.py # Fault prediction utilities
โ โโโ visualizations.py # Chart and plot generators
โโโ models/
โ โโโ minirocket/ # Trained models (99.98% accuracy)
โ โโโ minirocket_model.pkl
โ โโโ label_encoder.pkl
โ โโโ scaler.pkl
โ โโโ metadata.json
โโโ dataset/
โ โโโ phase_2_3/ # Vibration fault data
โโโ requirements.txt # Python dependencies
git clone https://github.com/atharvajoshi01/mms-fault-classification.git
cd mms-fault-classificationpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtstreamlit run streamlit_app.pyThe dashboard will open in your browser at http://localhost:8501
Dashboard Features:
- ๐ Home: Overview and key metrics
- ๐ฏ Prediction: Upload CSV files for real-time fault classification
- ๐ Analytics: Detailed model performance analysis and confusion matrices
- ๐ Data Explorer: Dataset statistics and sample visualizations
- โน๏ธ About: Technical documentation and deployment guide
python scripts/train_minirocket.pypython scripts/visualize_results.pyOverall Metrics:
- Test Accuracy: 99.98% (4,311/4,312 correct predictions)
- Training Time: 154 seconds (~2.5 minutes)
- Model Size: 1.7 MB
- Dataset: 21,559 samples (17,247 train / 4,312 test)
- Kernels: 10,000 random convolutional kernels
Per-Class Performance:
| Fault Type | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| Bearing Fault | 100.00% | 100.00% | 100.00% | 1,080 |
| Misalignment | 100.00% | 100.00% | 100.00% | 1,081 |
| Normal | 99.91% | 100.00% | 99.95% | 1,075 |
| Unbalance Fault | 100.00% | 99.91% | 99.95% | 1,076 |
Weighted Average: 99.98% Precision | 99.98% Recall | 99.98% F1-Score
What is MiniRocket? MiniRocket (Minified ROCKET) is a state-of-the-art time series classification algorithm that uses random convolutional kernels to transform raw time series data into highly discriminative features.
Model Configuration:
- Transform: 10,000 random convolutional kernels
- Feature Space: 29,988 features (from 1024ร3 input)
- Classifier: Ridge Regression (ฮฑ=1.0)
- Preprocessing: StandardScaler (Z-score normalization)
Input Vibration Signals:
- Shape: (1024, 3) - 1024 timesteps ร 3 channels (X, Y, Z axes)
- Sampling: Time-series vibration data from tri-axial accelerometers
- Data Type: Float32 (amplitude values)
- Normalization: Z-score standardization across features
CSV Format:
timestamp, axis, amplitude_1, amplitude_2, ..., amplitude_1024
1234567890, X, 0.123, -0.456, ...
1234567890, Y, 0.234, -0.567, ...
1234567890, Z, 0.345, -0.678, ...
The Streamlit-based dashboard provides a comprehensive interface for model interaction and analysis:
- Real-time model performance metrics
- Key achievements overview
- Fault class descriptions
- Quick start guide
- File Upload: Drag-and-drop CSV support
- Real-Time Classification: Instant fault detection with confidence scores
- Batch Prediction: Process multiple samples simultaneously
- Visualizations: Interactive vibration signal plots
- Recommendations: Actionable maintenance suggestions based on predictions
- Export: Download predictions as CSV
- Performance Metrics: Accuracy, precision, recall, F1-score
- Confusion Matrix: Interactive heatmap visualization
- Class-wise Analysis: Detailed per-class performance breakdowns
- Training History: Time, samples, and parameter information
- Dataset Statistics: Sample counts, class distributions
- Signal Visualization: Plot individual vibration samples
- Class Balance: Visual analysis of dataset composition
- Sample Browser: Explore training data interactively
- Complete technical documentation
- Model architecture details
- Performance analysis and interpretation
- Deployment guidelines (STM32, industrial PLCs)
- Future roadmap and next steps
This fault classification system is designed for industrial predictive maintenance scenarios:
- Manufacturing Equipment: Monitor rotating machinery (motors, pumps, fans)
- Power Generation: Turbine and generator health monitoring
- Oil & Gas: Pump and compressor fault detection
- HVAC Systems: Commercial building equipment monitoring
- Automotive: Assembly line machinery diagnostics
- Prevent Unplanned Downtime: Early fault detection prevents catastrophic failures ($10K-$50K per hour in lost production)
- Optimize Maintenance: Shift from reactive to predictive maintenance schedules
- Reduce Costs: Minimize emergency repairs and extend equipment lifespan
- Improve Safety: Detect critical faults before they become safety hazards
Lightweight Design: Models are <2 MB, making them ideal for edge deployment:
- STM32 Microcontrollers: ARM Cortex-M based MCUs
- Raspberry Pi: Local monitoring stations
- Industrial PLCs: Siemens, Allen-Bradley, etc.
Deployment Guide: See the About page in the dashboard for detailed STM32 deployment instructions.
- AWS Lambda: Serverless inference
- Azure ML: Enterprise-scale deployment
- Google Cloud Run: Containerized deployment
- Modbus TCP/RTU: Direct PLC communication
- OPC UA: Industrial automation protocol
- REST API: HTTP-based integration
- Real-time Streaming: Continuous vibration monitoring with streaming data
- Additional Faults: Expand to cavitation, looseness, electrical faults
- Alert System: Email/SMS notifications for critical faults
- Historical Trending: Track fault progression over time
- Multi-Asset Monitoring: Centralized dashboard for multiple machines
- Mobile App: iOS/Android app for on-the-go monitoring
- AutoML: Automated model retraining with new data
src/: Core ML algorithms and data processingscripts/: Training pipelines and utilitiesdashboard/: Streamlit web applicationmodels/: Trained model artifacts and metadatadataset/: Training and validation data
- Create new module in appropriate directory (
src/,scripts/, ordashboard/) - Follow existing code style and documentation patterns
- Update README and dashboard documentation
- Test thoroughly before committing
See requirements.txt for full dependency list. Key packages:
scikit-learn >= 1.0.0: Machine learningsktime >= 0.11.0: Time series analysis (MiniRocket)streamlit >= 1.20.0: Dashboard frameworkplotly >= 5.0.0: Interactive visualizationspandas >= 1.3.0: Data manipulationnumpy >= 1.21.0: Numerical computing
If you use this project in your research or production systems, please cite:
@software{mms_fault_classification,
title={MMS Fault Classification System: Industrial Predictive Maintenance with MiniRocket},
author={Atharva Joshi},
year={2025},
url={https://github.com/atharvajoshi01/mms-fault-classification},
description={Production-ready vibration fault classification achieving 99.98% accuracy}
}MIT License - see LICENSE file for details.
Atharva Joshi
- ๐ง Email: atharvaj2112@gmail.com
- ๐ผ LinkedIn: linkedin.com/in/atharvajoshi01
- ๐ GitHub: github.com/atharvajoshi01
- ๐ Location: New York, USA
- MiniRocket Algorithm: Based on the paper "MINIROCKET: A Very Fast (Almost) Deterministic Transform for Time Series Classification" by Dempster et al.
- scikit-learn & sktime: Excellent ML and time series libraries
- Streamlit: Amazing framework for data science dashboards
โญ If you find this project useful, please consider giving it a star on GitHub! โญ
Built with โค๏ธ using: Python โข scikit-learn โข sktime โข Streamlit โข NumPy โข Pandas โข Plotly