7.9.7. Motor Bearing Fault
Motor bearing fault detection identifies bearing failure modes from 3-axis vibration data. The example folder provides both a supervised classification example and an anomaly detection example (train on healthy data only).
Example folder: examples/motor_bearing_fault
(GitHub)
7.9.7.1. Overview
Task: multi-class classification (
task_type: motor_fault) and autoencoder anomaly detectionApplication: predictive maintenance for motors
Dataset: 3-axis accelerometer vibration data from bearing experiments (
variables: 3)Models:
CLS_1k_NPU(default),MotorFault_model_1_ttoMotorFault_model_3_t;AD_Linear/AD_500_NPUfor anomaly detection
7.9.7.2. Fault Classes
The classification dataset contains normal operation plus five fault types: contaminated lubricant, erosion, flaking, no lubrication and localized defect (6 conditions in total).
7.9.7.3. Available Configurations
Config file |
Device |
Model |
Dataset / feature extraction |
|---|---|---|---|
|
F28P55 |
|
|
|
MSPM0G5187 |
|
|
|
F28P55 |
|
|
|
MSPM0G5187 |
|
|
7.9.7.4. Running the Example
Install Tiny ML ModelZoo first (Installation, Quickstart), then run from the
tinyml-modelzoo folder:
# F28P55
./run_tinyml_modelzoo.sh examples/motor_bearing_fault/config.yaml
# MSPM0G5187
./run_tinyml_modelzoo.sh examples/motor_bearing_fault/config_MSPM0.yaml
See Running Examples for all launchers, for example:
run_tinyml_modelzoo.bat examples\motor_bearing_fault\config.yaml
run_tinyml_modelzoo.bat examples\motor_bearing_fault\config_MSPM0.yaml
7.9.7.5. Configuration (config.yaml)
common:
task_type: motor_fault
target_device: F28P55
dataset:
dataset_name: motor_fault_example_dsk
data_processing_feature_extraction:
feature_extraction_name: Input256_FFTBIN_16Feature_8Frame_3InputChannel_removeDC_2D1
variables: 3
training:
model_name: CLS_1k_NPU
batch_size: 256
training_epochs: 20
testing: {}
compilation: {}
Feature extraction takes 256-sample frames from each of the 3 axes, computes the FFT, removes DC, bins to 16
features per frame and concatenates 8 frames (384 features, laid out as 2D input per channel). Frequency
domain binning is well suited to bearing faults because the fault types have distinct frequency signatures.
The MSPM0 config instead uses raw 128-sample frames and downsamples the 313 kHz capture
(sampling_rate: 313000 to new_sr: 3130).
7.9.7.6. Models
Model |
Approx. parameters |
Description |
|---|---|---|
|
1,000 |
Baseline motor fault model |
|
2,000 |
Improved |
|
4,000 |
Highest accuracy of the three |
|
1,000 / 2,000 / 4,000 |
Generic NPU models ( |
7.9.7.7. Results from the 1.5.0 Test Run
From the automated 1.5.0 config test logs (default settings):
Config |
Test accuracy |
AUC ROC |
|---|---|---|
|
95.35% |
0.987 |
|
72.26% |
0.957 |
|
F1 score 99.95% |
not applicable |
The lower accuracy of the MSPM0 config reflects the 4-bit weight quantization and raw-input features used by
that config; adjust the quantization bit widths, epochs or model size if you need more accuracy. The
config_anomaly_detection_MSPM0.yaml config failed in that test run, so no result is reported for it.
7.9.7.8. Multi-Class Evaluation
For the 6-class problem examine the confusion matrix (which faults are confused) and the one-vs-rest ROC curves. The figures below come from the 1.4.0 version of this page and are illustrative only.
One-vs-rest multi-class ROC curves
Distribution of class score differences
7.9.7.9. Dataset Quality Analysis
Set gof_test: True (with frame_size: 256) in data_processing_feature_extraction to run the
Goodness of Fit analysis, which produces plots that show class separability for different transform
combinations.
7.9.7.10. Anomaly Detection Variant
If you only have healthy data, use config_anomaly_detection.yaml
(task_type: generic_timeseries_anomalydetection). The model is an autoencoder trained on normal vibration
only; faults are detected as a high reconstruction error. The dataset has 36 normal files and 180 anomaly
files (216 files, three test motors). Normal data is split 60/30/10 into train, validation and test.
The anomaly example readme_anomaly_detection.md reports, at threshold mean + 4.5 * std (10.52):
false positive rate 0.00%, recall 100% (all 180 fault samples detected), precision 100% and F1 100%.
Reconstruction error: normal vs. fault conditions
7.9.7.11. Practical Considerations
Vibration patterns depend on sensor placement: train with the same mounting position as in deployment.
Include different motor speeds, load conditions and temperatures.
Early-stage faults have subtle signatures; include different severity levels if available.
7.9.7.12. Next Steps
Your own data: Classification Dataset Format
Deploy to a device: CCS Integration Guide, Deploying a ModelZoo Run to an SDK Example (Golden-Vector Check)