← All projects

Predictive Maintenance from Twelve Observations (M.Sc. Coursework)

Deep learning coursework predicting an engine's remaining useful life from temperature readings, with grouped cross-validation against data leakage. The clear result is that a four-parameter linear model matched the neural network.

  • Python
  • TensorFlow
  • Keras
  • scikit-learn
  • NumPy
  • pandas
  • SciPy
  • Jupyter

In short

  • Task: predict how many operating hours an engine has left, its remaining useful life, from the temperatures of its three segments, in a fictional scenario set by the course
  • Challenge: only twelve observations, made up of six patterns measured twice, so a model can look accurate just by recognising a pattern it has already seen
  • Result: with validation that prevents leakage, the best neural network was accurate to about four operating hours, level with a four-parameter linear regression, while models trained on the raw images did far worse on unseen patterns

The data

The graded project for the Machine Learning & Deep Learning course in my M.Sc. programme. The dataset is a single image of twelve engines, each drawn with its segments coloured by temperature and labelled with its remaining hours, from 3 to 100. The temperatures are read out of the image by code rather than typed in by hand: each segment is located and its colour matched against the calibration scale in a perceptual colour space, and the extracted values were checked against an independently read ground truth.

Evaluation first

  • Grouped cross-validation: each fold holds out one pattern, so both measurements of it are always tested together. A random split would leave every test engine’s twin in the training data in about three splits out of four, which is data leakage by another name.
  • No shortcut through identifiers: the row and pattern IDs correlate almost perfectly with the target, so only temperature features ever reach a model.
  • A noise floor: the two measurements of a pattern have identical inputs but slightly different labels, so no model can get closer than 1.25 hours on average. Every result is read against that floor.
  • A ceiling for some model families: when an edge pattern is held out, its label lies outside every training label. Nearest-neighbour models, decision trees and networks with bounded outputs cannot predict beyond that range, which caps them before training starts.

Models

  • Tabular network: designed from that ceiling rather than by habit. A small network with bounded activations cannot extrapolate on its own, so it runs beside a linear branch, with strong regularisation on the non-linear part. It has forty-four parameters, deliberately few for twelve observations.
  • Image models: a convolutional network trained on the engine images directly, and transfer learning from a frozen pretrained network, to test whether learned features could replace the extracted temperatures.
  • Baselines: mean prediction, linear and ridge regression, nearest neighbours and a decision tree, all run through one shared evaluation module so that no notebook could use a different split.

Results

Predicting the average for every engine is off by about 35 hours. The best network was off by about four, level with the four-parameter linear regression: the gap between them was smaller than the network’s own variation across random seeds. The regularisation that made the network good was the regularisation that switched off its non-linear branch, so on this data a linear model is enough.

The convolutional network came close to the tabular models when a pattern’s twin was in the training data, and was several times worse when the pattern was genuinely unseen; neither more capacity nor transfer learning closed that gap. The image models also overestimated short remaining lives, which is the dangerous direction for a maintenance decision.

Reproducibility

  • Seeds and deterministic operations are set in one place, and two runs produce identical predictions. A run with a different seed has to differ, and does, so the check can fail.
  • The final notebook rebuilds four models from scratch and reproduces the stored results exactly.

Limitations

Twelve observations of six patterns is not a basis for a real maintenance system. Every held-out pattern lies outside the range covered by the training data, so every reported figure measures extrapolation. The scenario is fictional: this shows an evaluation method, not a model to trust with a real engine.