A field guide · part five / when the features learn themselves
Every page so far built features by hand: a spectrum here, a residual there, an envelope, a threshold. Neural networks make a different bet. Given enough examples, they learn the features themselves, discovering the filters, the memory and the attention that a human engineer would otherwise design. This part opens the box and runs the machinery, training real networks in the page as you watch.
Section 01
The earlier parts of this series were a catalogue of hand-built features. Someone who understood bearings decided that an envelope spectrum was the right lens; someone who understood control decided that an innovation sequence was the right residual. That expertise is precious, and where it exists it is hard to beat. Neural networks earn their place exactly where it runs out: when the signal is high-dimensional, the fault is subtle, or nobody yet knows which feature matters.
A neural network is a stack of simple adjustable functions, trained by showing it examples and nudging its millions of small parameters until its output matches the truth. The nudging is the whole story, and it has a single engine, gradient descent, which this part starts with and then dresses in the four architectures that dominate time-series work: convolutions that learn filters, recurrence that learns memory, autoencoders that learn what normal looks like, and attention that learns where to look. Every simulation here computes the real thing in your browser, no recordings, so you can watch a network actually learn.
Fifth in a series
This is the methodological companion to the operational arc. Where Sensory Data and Forecasting engineered features and models by hand, this part lets the network find them. The lessons of the earlier parts do not disappear; the best systems usually feed hand-built features into a learned model, marrying domain knowledge to capacity.
Section 02
Strip a neural network to its core and you find one idea repeated. Each parameter has a knob; turning it changes the output and so changes the error. Backpropagation computes, for every knob at once, which way and how hard to turn it to reduce the error, and gradient descent takes a small step in that direction. Repeat a few thousand times and the network has shaped itself to the data.
The simulation below is a genuine network, one input, a layer of tanh units, one output, learning to reproduce a waveform from scratch by full gradient descent, training live as you watch the fit improve and the loss fall. The controls expose the three levers that decide whether learning succeeds: too few hidden units and the network underfits, unable to bend into the shape; too high a learning rate and it diverges; raise the noise and watch a large network start to overfit, chasing the noise instead of the signal.
Section 03
Part one designed filters by hand: a smoother here, a band-pass there, a matched template for bearing impacts. A convolutional network learns those filters instead. Its core operation is the one part one used for matched filtering, sliding a short kernel along the signal and taking a dot product at every position, but the kernel's coefficients are parameters, trained until they detect whatever discriminates the classes in the data.
The simulation runs a genuine 1D convolution, then the two operations that make it a network layer: a ReLU that keeps only positive responses, and max-pooling that summarises each neighbourhood by its strongest activation, shrinking the signal while keeping what fired. Switch the kernel between a smoother, an edge detector and an impact-matched template, and watch the feature map light up where the kernel resonates. A trained network discovers the impact template on its own; here you can hand it the answer and see why it works.
Section 04
Convolutions see a fixed window. To carry information across an arbitrarily long sequence, a network needs memory, and a recurrent network supplies it by keeping a hidden state that it updates at every step and feeds back into itself. The simulation runs the essential recurrence, a hidden state that blends its previous value with the new input, which is a genuine one-unit recurrent network and the seed of every fancier variant.
One knob, the recurrent weight, sets how much past the state retains, and so sets the effective memory length: near zero the unit just echoes the input, near one it integrates over a long horizon. The simulation also searches for the recurrent weight that best predicts the next sample, a tiny act of learning, and marks it. Real LSTM and GRU cells replace this single fixed knob with learned gates that decide, per step and per feature, what to remember and what to forget, which is how they hold information across hundreds of steps without it decaying away.
Section 05
Faults are rare, and labelled faults rarer still. An autoencoder sidesteps the problem by learning only what normal looks like. It squeezes each input through a narrow bottleneck and then tries to reconstruct it; trained on healthy data alone, it becomes good at rebuilding healthy patterns and bad at rebuilding anything else. The reconstruction error then doubles as an anomaly score, large exactly when the input does not resemble the training distribution.
The simulation makes this exact and genuine. Healthy windows of vibration live near a low-dimensional subspace; the autoencoder's job is to find that subspace and project onto it. A linear autoencoder provably learns the same subspace as principal component analysis, so the simulation computes the principal components of the healthy data directly and reconstructs through a bottleneck of the size you choose. Feed it a healthy window and the reconstruction overlays the input; inject an anomaly and the reconstruction cannot follow it, and the error climbs past the alarm line.
Section 06
Recurrence carries memory forward but smears it; by the time a distant event matters, its trace has faded. Attention, the mechanism behind transformers and the foundation models part two mentioned, takes a different route. Instead of a single rolling state, it lets every position look directly at every other position and decide, with a learned similarity, how much each one matters right now.
The simulation computes genuine self-attention over a short sequence. Each step is given a small query and key; their dot products, passed through a softmax, become the attention weights, how strongly the step doing the looking attends to each step being looked at. The heatmap shows the full matrix, and the selected row shows where one position focuses. Here the queries and keys are simple fixed features so the mechanism is visible; a real transformer learns these projections, but the move is the same: attend most to the past that most resembles the present.
Section 07
A network that runs in a data centre is one thing; one that must run on a microcontroller bolted to a motor is another. Part one's edge pattern, keep the raw data local and send only the conclusion, demands that the model fit in kilobytes and run in milliseconds. The dominant tool is quantization: storing the weights not as 32-bit floating point but as 8-bit, or fewer, integers.
The simulation quantizes the parameters of a small model that reconstructs a waveform, rounding each weight to one of a limited set of levels and rebuilding the output. At 8 bits the quantized output is visually indistinguishable from the original at a quarter of the size, which is why INT8 is the workhorse of embedded inference. Drop toward 3 or 2 bits and the reconstruction visibly degrades as the levels grow too coarse to represent the weights. The readout tracks the model size and the error, the tradeoff every edge deployment has to price.
Section 08
Neural networks reward data and punish carelessness in ways the hand-built methods do not. These are the lessons that decide whether a learned model is an asset or a liability in a monitoring system.
The one-sentence summary
A neural network is a feature learner, not a magic box, so spend your effort on honest data, honest splits and honest baselines, let the network earn its complexity against the hand-built methods that came before it, and remember that everything the earlier parts taught about leakage, calibration and the edge applies with more force, not less, once the features are learned.
Section 09
References point to further study; the explanations and simulations above are written and implemented from first principles rather than drawn from any single source.