Can an existing model hear which fault a compressor has?
An exploratory baseline on 1,800 one-second recordings of one air compressor in 8 states (healthy + 7 faults).
Yes, on this dataset, when you show it a few examples. With 5 labelled clips per fault, the best existing model (FISHER, a model pre-trained on industrial sounds) names the right fault % of the time, and % with 10 clips. Simple hand-built sound features are close behind at %.
Without examples it does not work: naming the fault "zero-shot" scored % (Gemini 3.1 Pro) and % (CLAP), against 12.5% for a random guess.
It works as "learn from a few examples of each fault", not as "recognise faults it has never been shown". Every clip here comes from one compressor in one lab, so the next test is a second machine.
2 · The setup in one glance
One compressor, eight states, 1-second clips
The data is the public IIT Kanpur air-compressor dataset: a single-stage reciprocating compressor recorded with one microphone in one lab, 225 clips per state, each 1 second long. Seven faults were deliberately introduced one at a time.
Models compared
- Handcrafted features: classic signal processing (band energies, MFCCs, spectral statistics). No neural network.
- General audio models (pre-trained on everyday sounds, used frozen): BEATs, Dasheng, CLAP.
- Industrial-signal models (pre-trained on machine sounds and vibration): FISHER, ECHO.
- Zero-shot (no examples at all): CLAP matched against a text description of each fault, and Gemini 3.1 Pro, an audio-capable large language model, which hears the clip with the list of 8 states and picks one.
"Frozen" means no model was re-trained. Each model turns a clip into a numeric fingerprint, and a small standard classifier (logistic regression or SVM) learns the faults from the labelled examples.
3 · Listen
What each state sounds like
One clip per state, picked automatically as the most typical-sounding recording of its class (closest to the class's average spectrum). Each clip is 1 second; under the spectrogram, brighter means louder at that frequency. Headphones help: the differences are subtle.
4 · What it gets right
How many labelled examples does it take?
Five examples per fault is enough for %; one example gives %.
Macro accuracy (each fault weighted equally), mean of 10 random draws of training clips; everything not drawn is the test set. Logistic regression on each model's frozen fingerprints. Hover or tap the chart for exact values (± standard deviation).
Show the numbers as a table
Accuracy vs cost
What "cost" means here. It is the cloud computing bill for listening to one compressor for one month. We assume each compressor sends a 1-second sound clip once a minute, which is clips a month. So " per compressor per month" is the same as about for every 1,000 clips.
It counts the analysis only, not microphones, internet or storage. It also assumes enough compressors to keep a server busy: one CPU server costs a month and, with handcrafted features, keeps up with about compressors. Gemini is a pay-per-clip service, so it has no server.
Does it need a GPU? No. Every method here runs on an ordinary 4-core CPU server. FISHER takes ms to analyse a 1-second clip, and even the slowest model (CLAP) takes ms, while each compressor sends only one clip a minute. A GPU only lowers the cost once there are enough compressors to keep it busy: a GPU server costs a month, so for FISHER it only beats CPU servers above about compressors. If one is ever needed, the smallest cloud GPU is plenty: we measured on an NVIDIA T4 (16 GB), and the largest model used GB of its memory.
Up is more accurate; left is cheaper. The cost axis is logarithmic: each step is 10× more expensive. Accuracy uses 5 labelled examples per fault; the two zero-shot methods (hollow circles) use none. Handcrafted features need no GPU, so they stay on a CPU server. Hover or tap a point for details.
How fast is the answer?
What "real time" means here. The system listens to 1 second of sound, then works out which state the compressor is in. The answer appears about 1 second after the sound starts, and the next second of sound can be checked straight away, so the compressor is checked every second, continuously.
Time from the start of the sound to the answer. Every bar includes the 1 second of listening (light part); the dark part is the analysis. Median of 100 clips, each analysed on its own, as a live system would.
Measured by latency_bench.py on recorded clips: this laptop, and a Kaggle cloud machine (4 vCPU + NVIDIA T4) for FISHER,
because its model files could not be downloaded on the laptop. Gemini's time is the median response time of the 160 calls in the zero-shot test.
The analysis has not yet been run from a live microphone.
Four ways of testing. 5-fold CV trains on 80% of all clips (the published paper's protocol). Few-shot k=5 trains on just 5 clips per state. Block split trains on the first 70% of recordings and tests on the last 30%, to check that neighbouring recordings aren't leaking answers. Zero-shot gets no examples (160-clip subset).
5-fold CV and block split: SVM. Few-shot: logistic regression. Full results, including kNN and every k, are in results.csv.
5 · What it gets wrong
Where the best model slips
Rows: the actual state. Columns: what the model said. Diagonal = correct. Shading = share of that row.
Why these mix-ups make sense. The confusions come in two families: valve faults with each other (LIV, LOV, NRV) and mechanical faults with each other (Bearing, Flywheel, Piston). The most-confused classes sound almost identical on average: Bearing and Flywheel's average spectra are only dB apart, about the same as the spread between clips of a single state. Healthy is – dB away from every fault, which is why it is never confused.
Listen to the mistakes
All clips this model got wrong in the draw above. Every one of them is still closer to its own class's average sound than to the class it was mistaken for, so they look like borderline recordings, not mislabelled files.
6 · Can it identify useful problems on its own?
Naming the fault without examples
No. Without examples, both approaches are at chance: % (Gemini) and % (CLAP) vs 12.5% for guessing.
Telling which fault it is works well, but only after the model has been shown labelled examples of each fault (section 4). The question here is whether a model can name a fault it has never been shown. Two attempts:
- CLAP compares the sound against a text description of each state ("an air compressor with a leaking inlet valve", …).
- Gemini 3.1 Pro heard each clip together with the list of 8 states and a one-line description of each, and had to pick one. The prompt was identical for every clip. Its written reasons sound plausible ("rhythmic metallic tapping…"), but they don't match the actual fault. The result is a confident, articulate, wrong answer.
Gemini's full confusion matrix (50 kHz, 160 clips)
Rows: actual state. Columns: Gemini's answer. Bottom row: how often each answer was given.
7 · Caveats
Why "~100%" is less impressive than it sounds
- One compressor, one lab, one microphone. Every result is "telling apart recordings from the same machine". Nothing here shows that a model trained on this data works on another compressor, room or microphone. Whether it does is the most important open question, and it is untested.
- Near-100% is expected on this dataset. The original paper reports ~99.8% with classic features; our hand-built features also reach 100% under 5-fold CV. Because the task is this easy, the dataset can only show what pre-trained models add when labels are scarce (1–3 examples per fault).
- Each fault was probably recorded in its own session. The label is therefore tangled up with everything else about that session (background noise, microphone placement, tank pressure). The block split rules out drift within a session, but this data can't separate "the fault" from "the day it was recorded".
- Sample rate. The files don't state it. We concluded 50 kHz (each file = 1 s): the original recordings are documented at 50 kHz, and the compressor's piston rhythm then works out to ~440 rpm, a normal speed (16 kHz would imply an implausible ~140 rpm). We ran every pre-trained model under both 50 kHz and 16 kHz. The conclusions didn't change, only the ranking: the general audio models score a few points higher when the clip is read as 16 kHz (played slower), while FISHER is best at 50 kHz. Use the toggle in section 4 to compare.
- A recording artefact. of the 1,800 files contain a click at exactly the same sample (the midpoint), where two segments seem to have been joined (none in Healthy). It makes those clips slightly harder to classify, not easier, so it doesn't inflate the scores.
- What failed or was skipped. FISHER initially failed to load with the current version of the
transformerslibrary. It ran after pinning an older version, with no change to the model. EAT was not run (the brief allowed either Dasheng or EAT; Dasheng was used). I compared the misclassified clips by their spectra rather than by ear.
8 · Next steps
Promising, with one test to run first
- The approach that works is "enrolment": record a handful of examples of each known fault on a machine, and the system recognises them from then on. Healthy vs faulty is rock-solid; "which valve" is the weakest part.
- Test transfer next: record a second compressor (or the same one on another day, with the microphone moved). Train on this data plus a few clips from the new setting, then test on the rest. If accuracy holds, the method generalises. If it collapses, the ~100% here only meant "this machine, this session".
- Test on real fault data: maintenance logs matched to recordings would show whether real-world faults are as separable as seeded lab faults.
- Zero-shot is not a viable route (section 6), and an LLM's explanations of diagnoses it can't make are not reliable.
- Compute is not the obstacle. The models are small and run in real time on a laptop. Across many compressors the analysis costs cents per compressor per month (see accuracy vs cost); microphones, connectivity and storage will cost more than the analysis.
Cost assumptions: one 1-second clip per compressor per minute; servers planned at 50% of their measured speed; AWS on-demand list prices (c7i.xlarge CPU server, g4dn.xlarge T4 GPU server) and Google's Gemini list price, checked 2026-10-29. Speeds were measured on a Kaggle 4-vCPU machine and T4 GPU (handcrafted features: on a laptop core). Every row is in cost_at_scale.csv.
9 · Method & reproducibility
How to re-run it
All code, results and the full technical write-up are in the repository: github.com/Jivraj-18/machine-sound-diagnosis (REPORT.md).
python features_handcrafted.py --sr 50000 # handcrafted features (CPU) python embed_pretrained.py --raw cache/raw.npz # pre-trained embeddings (GPU; ran on a Kaggle T4) python zeroshot_clap.py python zeroshot_gemini.py --sr 50k # needs a Gemini API key python evaluate.py # results.csv, confusion matrices, misclassified clips python analyze_misses.py && python cost_estimate.py && python build_site.py
- Protocols: 5-fold stratified CV; few-shot with k = 1, 3, 5, 10 clips per class (kNN and logistic regression, 10 random draws, the same draws for every model); block split by recording number; zero-shot on a fixed subset of 20 clips per class. Metric: macro (class-balanced) accuracy.
- Versions: analysis on Python 3.11 with scikit-learn 1.9.1, librosa 0.11.0, numpy 2.2.6; embeddings on torch 2.11.0 and transformers 5.16.1
(FISHER: transformers 4.57.1). Full pins are in
requirements.txtandrequirements-gpu.txt. - Model checkpoints: BEATs iter3+ AS2M, Dasheng-base, CLAP
laion/larger_clap_general, ECHO-small (yucongzh/echo-small-0824), FISHER-small (jiangab/FISHER-small-0723), Geminigemini-3.1-pro-preview. - Audio on this page is resampled from 50 kHz to 48 kHz for browser playback; nothing audible is lost (the recordings contain nothing above ~15 kHz).