Downloads · 30 days
0
resoajoe/bearing-fault-nano
bearing-fault-nano is a audio classification model from resoajoe. Use it for the audio classification task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
46,964 parameters. 188 KB. Which rolling-element bearing fault does this vibration signature resemble — outer race, inner race, ball, or none?
Downloads · 30 days
0
Access
Public
Updated Sep 3, 2026
Repo size
391 KB
Likes
0
Public
Click a slice to open those files.
.pt199 KB · 49%
From the Hugging Face model README
46,964 parameters. 188 KB. Which rolling-element bearing fault does this vibration signature resemble — outer race, inner race, ball, or none?
Built to test a thesis: if one 47K architecture spans a camera, a microphone and an accelerometer, then "nano model" is a method, not a computer-vision trick. It is the same network as this project's image models, fed a spectrogram.
Domain measured / deployment domain tested: measured on synthesised vibration signatures; deployment domain: no real machine tested, ever. (Fifth line of the card standard, added 2026-09-02: a number is only as good as the domain it was measured in.)
This is a MAINTENANCE-OPERATIONS screening aid. It reports that a vibration signature is consistent with a fault class, so a human can schedule an inspection.
It must not be used to certify machine health or to gate a safety decision. It has never been validated on a real machine, it cannot see load, temperature, lubrication or history, and a bearing can fail in ways this does not model. Do not place it anywhere a missed detection causes harm.
Not a diagnosis. Fault classes are named for the frequency families they match, not for a confirmed physical defect.
Fault frequencies follow standard kinematics — for shaft rate f_r, n elements, and
r = (d/D)·cos α:
| class | frequency | distinguishing structure |
|---|---|---|
| outer race | BPFO = (n/2)(1−r)·f_r | periodic impacts, constant amplitude |
| inner race | BPFI = (n/2)(1+r)·f_r | impacts modulated at shaft rate |
| ball | BSF = (D/2d)(1−r²)·f_r | impacts modulated at cage rate |
| healthy | — | shaft harmonics only |
Each impact excites a structural resonance, modelled as a decaying sinusoid burst, so the envelope carries the class — which is why this sits where a nano model wins and a scalar loses. Shaft rate, element count, geometry ratio, resonance, decay and impact jitter are all randomised.
1,600 held-out examples, SNR −6 to +12 dB, chance 0.250:
| accuracy | |
|---|---|
| nano model | 0.943 |
| best single scalar, fitted in-sample | 0.463 |
| majority | 0.250 |
Per-class recall: healthy 0.980 · outer race 0.925 · inner race 0.938 · ball 0.927.
By SNR — the number that matters, since a real installation sets it:
| SNR | −6…−2 dB | −2…+2 | +2…+6 | +6…+12 |
|---|---|---|---|---|
| accuracy | 0.790 | 0.955 | 1.000 | 0.998 |
Below about −2 dB it degrades. Mount the accelerometer well.
import numpy as np, cv2, onnxruntime as ort
from scipy import signal
SR = 12000
CLASSES = ["healthy", "outer_race", "inner_race", "ball"]
sess = ort.InferenceSession("bearing_fault.onnx", providers=["CPUExecutionProvider"])
def spec(x): # x: 1 s of accelerometer data at 12 kHz
f, t, S = signal.stft(x, SR, nperseg=512, noverlap=384)
P = np.log10(np.abs(S) + 1e-8)
P = (P - P.mean()) / (P.std() + 1e-8) # per-window standardise: absolute level is ignored
return cv2.resize(P.astype(np.float32), (64, 64), interpolation=cv2.INTER_AREA)
print(CLASSES[int(sess.run(None, {"input": spec(x)[None,None]})[0][0].argmax())])
The per-window standardisation is required — the model is deliberately blind to absolute amplitude, so it responds to structure rather than to how hard you clamped the sensor.
5,200 train / 1,600 test windows · 4 conv layers (16→32→48→64) · Adam 3e-3 · 22 epochs.
Same architecture as resoajoe/alarm-nano, resoajoe/depth-nano and
resoajoe/camera-motion-nano, unchanged.
ONNX vs PyTorch, both CPU: max relative logit difference 2.5e-07, 100% argmax agreement.
Measured on a Jetson AGX Orin. ONNX Runtime sizes its intra-op thread pool to the CPU core count, and those workers spin-wait between inferences. Running two 47K-parameter models this way left ~18 threads busy-waiting at ~10.6% of a core each — about 1.9 cores burned continuously to run inferences that take 0.28 ms. A model this small cannot use intra-op parallelism at all.
so = ort.SessionOptions()
so.intra_op_num_threads = 1
so.inter_op_num_threads = 1
so.execution_mode = ort.ExecutionMode.ORT_SEQUENTIAL
so.add_session_config_entry("session.intra_op.allow_spinning", "0")
sess = ort.InferenceSession("bearing_fault.onnx", sess_options=so, providers=["CPUExecutionProvider"])
Measured effect on the same workload: idle CPU 192% → 16.5% of one core, active 231% → 88%, thread count 45 → 22, throughput unchanged. On edge hardware this is the difference between "runs alongside everything else" and "saturates the machine".
Every margin quoted here is against a stated baseline, because a margin without one is not a measurement. The baseline is the best single-threshold classifier over ten cheap statistics, fitted optimistically:
mean · std · lapvar · hf (high-frequency energy ratio) · grad (Sobel magnitude) ·
entropy · centre_edge · radial_slope · row_fft_peak · col_fft_peak
The last four are spatially aware, added after an earlier six-statistic baseline — all global aggregates — was found to systematically overstate model value on spatially structured tasks. A baseline that cannot see where anything is loses to a CNN by default. On one test task that flaw inflated an apparent margin from +0.060 to +0.261.
Two questions are asked with it, and they disagree:
Where this card quotes a single scalar figure without qualification, it is the in-sample one.
Fully synthetic, generated from published bearing kinematics. No proprietary machine data, no personal data.