Sandvik Coromant · real-time inference

Deep models inside a .NET product

LSTM, autoencoder and VAE models trained in PyTorch, exported to ONNX and run on live sensor streams inside the product, with latency monitored against the budget.

PyTorch onnx .NET runtime live sensor stream budget inference latency

What I did

Trained LSTM, autoencoder and VAE anomaly models in PyTorch on accelerometer and strain streams, exported them to ONNX, and ran them with ONNX Runtime inside the .NET application on live data, with a dashboard watching inference time. Alongside it I built statistical-limit detection (confidence bands across several sensors, built from repeated reference recordings) and ran a proof of concept comparing classical and deep models on streamed data.

The lesson

The first live result was, in my own commit message, "real-time inference works, but the result is wrong". The cause was preprocessing: tensor shapes and normalisation in C# that differed from training in Python. The lesson was to keep preprocessing identical on both sides, and the same thinking later led to the Python bridge.

These models were also the baseline that the simpler shipped detector had to beat.