ONNX Inference

Inference is the step where a trained model looks at a recording and returns a class. Deepsona runs models in the ONNX format, which is the common export target of PyTorch, TensorFlow, scikit-learn and ML.NET — so a model trained by your data-science team can be dropped into Deepsona without conversion work or a matching framework installation.

Supported model format

ItemSupport
Model file.onnx — classification and regression graphs
InputA single float tensor; 2-D, 3-D and 4-D shapes are handled, dynamic dimensions included
OutputFirst output tensor, read as a flat list of per-class scores
Audio inputWAV, HEAD HDF (mono or multi-channel)
ComputeCPU by default; DirectML GPU acceleration optional
Models exported with a symbolic batch_size dimension are recognised and handled — you do not need to re-export with a fixed batch size.

Loading a model and reading its signature

In Step 1 — Load Model, browse to the .onnx file. As soon as it loads, the status line reports the detected signature, for example:

Input: [1,1,16000] -> Output: [1,10] (10 classes) [batch]

Read it as: the model wants one batch of one channel with 16000 samples, and answers with 10 class scores. Use this to sanity-check two things before you go further — that the class count matches the number of labels you are about to enter, and that the expected input length is compatible with your recordings.

Automatic input shape matching

Measurement data rarely has exactly the shape a model was exported with. Deepsona adapts the data to the model instead of asking you to reshape anything, following the model's declared input shape:

Declared inputHow your data is mapped
[batch, channels, samples]Channels are used as recorded; each channel is truncated or zero-padded to the required length
[batch, samples]Channels are mixed down to mono, then truncated or zero-padded
[batch, 1, time, frequency]A spectrogram (colour map) is resampled by bilinear interpolation to the required time × frequency grid
1-D feature curveA level-vs-time or feature-vs-time curve is passed through, truncated or padded to length
Anything elseData is flattened into the required element count

Dynamic dimensions (declared as unknown in the model) are filled with the actual data dimensions: the leading dimension becomes the batch, the middle one the channel count, and the trailing one the sample count.

Data source Waveform (WAV / HDF) Spectrogram / colour map Feature curve vs. time Shape matching mixdown / pad / truncate resample / normalise ONNX model CPU or GPU Scores The model's declared input shape decides how the data is adapted — no manual reshaping

Input normalisation

If the model was trained on normalised inputs, apply the same normalisation at inference time. Three modes are available:

ModeTransformUse when
NoneValues passed through unchangedThe model was trained on raw physical values
Min-Max(x − min) / (max − min)Training scaled each recording into a 0…1 range
Standard(x − mean) / (L2 / √N)Training used zero-mean, unit-scale inputs

Normalisation is computed and applied per channel. Choosing a mode that differs from the one used in training is one of the most common causes of a model that "works in Python but not here".

GPU acceleration

Tick GPU (DirectML) in Step 1. DirectML works with any DirectX 12 capable graphics card, so no vendor-specific toolkit installation is required. If the device is unavailable, the model quietly runs on the CPU instead — inference never fails just because a GPU is missing.

GPU acceleration pays off most for large convolutional models and long batch runs. For small models on short recordings the CPU path is often just as fast, because the time is dominated by file reading.

Post-processing: activations, temperature, Top-K

Models output raw numbers (logits). Post-processing turns them into readable confidences. The options in Step 3 — Settings are applied in a fixed order: Sigmoid → Temperature → Winner Takes All → SoftMax.

OptionEffectTypical use
Sigmoid 1 / (1 + e−x) Multi-label models, where several classes may be true at once
SoftMax (ReLU) max(0, x) / Σ max(0, x) Default. Normalises positive scores to sum to 100 %
Winner Takes All One-hot at the highest score Hard pass/fail output, no confidence gradation wanted
Temperature Scores divided by T (0.1…5.0) T < 1 sharpens the distribution, T > 1 softens an over-confident model
Top-K Keeps only the K highest classes Models with hundreds of classes; 0 shows all
Post-processing changes how scores are displayed, never which class actually has the highest raw model output. If you use the confidence value as a release threshold, keep the post-processing settings fixed — changing Temperature after a threshold has been agreed silently moves the acceptance point.

Class labels

Enter labels comma-separated in the same order as the model's output neurons, for example OK, Whine, Knock, Rub. If you supply fewer labels than the model has classes, the remainder are filled in as Class_4, Class_5… If you supply none, all classes are numbered. Labels affect display and CSV export only; they never alter the prediction.

Reading the result

A single classification returns four things:

The shape of the per-class list is the diagnostic information. A clean single peak means the model is confident. Two classes close together mean the recording sits on a boundary and deserves a listen. A flat distribution across all classes usually means the input does not resemble the training data at all — check the recording length, channel, and normalisation mode.

Batch inference and CSV export

Step 5 — Batch Classify applies the loaded model to a whole file list. Add WAV or HDF files, press Run Batch and follow the progress bar; each row reports file name, predicted label, confidence and status. Files that cannot be read are marked in their own row and do not stop the run. Export CSV writes the columns File, PredictedLabel, Confidence, Status, ready for a spreadsheet or a quality database.

Model Zoo

The Model Zoo is a catalogue of well-known pre-trained acoustic models, kept outside the installation package so the software stays small. Models live in %LocalAppData%\Deepsona\Models; where a download source is configured they can be fetched on demand with a progress indication, otherwise place the .onnx file into that folder manually and it is picked up.

ModelSizePurpose
PANNs-CNN14~80 MBGeneral sound event classification, 527 classes
YAMNet~14 MBLightweight sound event classifier, 521 classes — good for quick screening
VGGish~280 MBProduces 128-dimensional embeddings rather than classes

Embeddings are a compact numerical fingerprint of a sound. They are useful when you have very few labels: compare two recordings by the cosine similarity of their embeddings to search an archive "by sound", or use embeddings as the input features of a small classifier trained on a handful of samples. The embedding front end uses a standardised log-Mel spectrogram (64 Mel bands, 25 ms frames, 10 ms hop, 125…7500 Hz), which matches the convention these public models expect.

Running inference inside a processing pipeline

AI classification is also available as a regular analysis node, so it can sit in a pipeline next to FFT, loudness and order analysis and be applied to a whole pool of files. The node accepts these parameters:

ParameterMeaningDefault
OnnxModelPathPath to the model file (required)—
ClassLabelsComma-separated class namesnumbered
UseSigmoidApply sigmoidfalse
UseSoftMaxApply SoftMaxtrue
UseWTAApply Winner Takes Allfalse
NormalizationNone / MinMax / StandardNone

The node produces a per-class score curve, a single value carrying the winning label and its confidence, and a log listing every class with both its post-processed and raw score — all of which can be picked up by the report tools.

Troubleshooting

SymptomLikely cause
All classes get almost the same scoreInput does not resemble training data — check recording length, channel selection and normalisation mode
Model always answers with the same classTraining set was heavily imbalanced, or the wrong label order was entered
Confidence is always 100 %Winner Takes All is enabled — switch it off to see the gradation
Class count does not match the labelsRead the signature line in Step 1 and align the label list with it
Results differ from the training frameworkNormalisation mode or input length differs from the training front end
GPU seems to have no effectNo DirectX 12 device available; the CPU path was used silently
Related: AI Acoustic Classification (overview) · Annotation & Training · Anomaly Detection

© 2026 Deepsona. All Rights Reserved.