This project focuses on the detection of bearing faults utilizing the wavelet scattering method. Classification of bearing conditions is performed using a Support Vector Machine (SVM) classifier based on features extracted from the wavelet scattering transform.
The classifier takes input from four different bearing conditions (normal, inner race fault, outer race fault, and ball fault) and classifies them with high accuracy.
# clone the repositoiry
git cloene https://gitlab.fel.cvut.cz/kawasrik/dit-project.git
cd dit-project# create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`# install dependencies
pip install -r requirements.txt download the dataset from Normal Baseline Data and 12k Drive End Bearing Fault Data and place it in the data/ directory.
The directory structure should look like this:
data/
└── mat/
├── training/
│ ├── ball/
│ │ ├── b007_0_118.mat
│ │ └── ...
│ ├── inner/
│ │ ├── ir007_2_107.mat
│ │ └── ...
│ ├── normal/
│ │ └── normal_0_97.mat
│ └── outer/
│ ├── or007@12_0_156.mat
│ └── ...
├── validation/
│ ├── ball/
│ ├── inner/
│ ├── normal/
│ └── outer/
└── test/
├── ball/
├── inner/
├── normal/
└── outer/
- To train the model and evaluate its performance, run:
python3 main.pyOutput (example):
Extracting scattering features...
X_train_s is ready.
Scattering feature shape: (1997, 126)
X_val_s is ready.
Scattering feature shape: (1882, 126)
X_test_s is ready.
Scattering feature shape: (2233, 126)
Validation:
precision recall f1-score support
0 1.00 1.00 1.00 471
1 1.00 1.00 1.00 469
2 1.00 1.00 1.00 589
3 1.00 1.00 1.00 353
accuracy 1.00 1882
macro avg 1.00 1.00 1.00 1882
weighted avg 1.00 1.00 1.00 1882
Confusion Matrix:
[[471 0 0 0]
[ 0 469 0 0]
[ 0 0 589 0]
[ 0 0 0 353]]
Test:
precision recall f1-score support
0 1.00 1.00 1.00 471
1 1.00 0.84 0.91 469
2 0.91 1.00 0.96 824
3 1.00 1.00 1.00 469
accuracy 0.97 2233
macro avg 0.98 0.96 0.97 2233
weighted avg 0.97 0.97 0.96 2233
Confusion Matrix:
[[471 0 0 0]
[ 0 392 77 0]
[ 0 0 824 0]
[ 0 0 0 469]]
- To visualize the example signals and scattering coefficients, run:
python3 transform_viz.pyOutput (example):
- To visualize the signals transformed by Wavelet scattering transformation using PCA, run:
python3 visualize.pyproject/
├── src/ # helper libraries
├── docs/ # Presentation and report
├── data/ # Dataset directory (you need to create this)
├── main.py # Main script to run training and evaluation
├── transform_viz.py # Script for visualizing example signals and scattering coefficients
├── visualize.py # Script for PCA visualization of transformed signals
├── requirements.txt # List of dependencies
└── README.md # Project documentation
Riku Kawasaki




