5.6.15Machine Learning (Aerospace Applications)

Aerospace ML applications — fault detection, system identification

1,773 words8 min readdifficulty · medium

WHY does aerospace need ML here?


Part 1 — Fault Detection

WHAT is a residual? (derive it)

Let a healthy system be modelled by predictor y^\hat{y}. For a true measurement yy:

r=yy^r = y - \hat{y}

Why this works from first principles: if the model is good and the system is healthy, y^y\hat y \approx y, so r0r \approx 0 (only sensor noise remains). A fault changes the physics, so y^\hat y (built on healthy physics) no longer matches yy, and rr grows. We monitor rr, not yy directly — this cancels out the known dynamics and leaves only the "surprise."

HOW do we threshold noise vs fault?

Noise is random. Under healthy conditions, model residuals are roughly rN(0,σ2)r \sim \mathcal{N}(0,\sigma^2). We standardise:

z=rμσz = \frac{r - \mu}{\sigma}

Declare a fault when z>τ|z| > \tau. Choosing τ=3\tau = 3 gives (from the normal CDF) a false-alarm rate of about 0.27%0.27\% per sample.

Figure — Aerospace ML applications — fault detection, system identification

Part 2 — System Identification

Deriving least-squares SysID from scratch

Model a discrete linear system (an ARX model — AutoRegressive with eXogenous input):

yk=a1yk1++anykn+b1uk1++bmukmy_k = a_1 y_{k-1} + \dots + a_n y_{k-n} + b_1 u_{k-1} + \dots + b_m u_{k-m}

Stack the past values into a regressor row φk=[yk1,,ukm]\varphi_k^{\top} = [\,y_{k-1},\dots,u_{k-m}\,] and unknowns θ=[a1,,bm]\theta = [a_1,\dots,b_m]^{\top}. Then yk=φkθy_k = \varphi_k^{\top}\theta. Over NN samples:

y=Φθ,Φ=[φ1φN]\mathbf y = \Phi\,\theta, \qquad \Phi = \begin{bmatrix}\varphi_1^\top\\ \vdots \\ \varphi_N^\top\end{bmatrix}

WHY least squares? Data is noisy, so no exact θ\theta solves this. We choose θ\theta minimising squared prediction error:

J(θ)=k(ykφkθ)2=yΦθ2J(\theta) = \sum_k (y_k - \varphi_k^\top\theta)^2 = \|\mathbf y - \Phi\theta\|^2

HOW to minimise — derive the normal equations. Expand and differentiate: J=yy2θΦy+θΦΦθJ = \mathbf y^\top\mathbf y - 2\theta^\top\Phi^\top\mathbf y + \theta^\top\Phi^\top\Phi\,\theta Jθ=2Φy+2ΦΦθ=0\frac{\partial J}{\partial \theta} = -2\Phi^\top\mathbf y + 2\Phi^\top\Phi\,\theta = 0


Common mistakes (steel-manned)


Feynman

Recall Explain to a 12-year-old

Imagine you know your friend always walks to school in about 20 minutes. That "20 minutes" is your model. One day they take 40 — the difference (the residual) is a surprise, so you guess something went wrong (fault detection). And if you watched them many days and figured out the rule "time = distance ÷ speed," you just identified the system from data instead of being told the rule. Computers on airplanes do exactly this with vibrations and temperatures.


Flashcards

What is a residual in fault detection?
The difference r=yy^r=y-\hat y between measured output and model prediction; near zero when healthy, grows under faults.
Why monitor residuals instead of raw sensor values?
Residuals subtract out known/expected dynamics, leaving only the "surprise," so normal operating variation isn't mistaken for a fault.
Why does the Mahalanobis distance use Σ1\Sigma^{-1}?
It rescales by each direction's variability and de-correlates sensors, catching faults that break inter-sensor relationships even if each channel is in-range.
State the least-squares (normal-equation) estimate for SysID.
θ^=(ΦΦ)1Φy\hat\theta=(\Phi^\top\Phi)^{-1}\Phi^\top\mathbf y.
Derive the normal equations in one line.
Minimise yΦθ2\|\mathbf y-\Phi\theta\|^2; set J/θ=2Φy+2ΦΦθ=0ΦΦθ=Φy\partial J/\partial\theta=-2\Phi^\top\mathbf y+2\Phi^\top\Phi\theta=0\Rightarrow\Phi^\top\Phi\,\theta=\Phi^\top\mathbf y.
What is an ARX model?
AutoRegressive with eXogenous input: yk=aiyki+bjukjy_k=\sum a_i y_{k-i}+\sum b_j u_{k-j}, a linear model of output from past outputs and inputs.
Why can too many ARX terms hurt?
Overfitting — extra parameters fit noise, lowering training error but worsening generalisation; validate / use AIC/BIC.
For zN(0,1)z\sim\mathcal N(0,1), why is τ=3\tau=3 common?
P(z>3)0.27%P(|z|>3)\approx0.27\%, a low per-sample false-alarm rate while still catching real deviations.
How do fault detection and SysID connect?
SysID gives the healthy predictor y^=φθ^\hat y=\varphi^\top\hat\theta; residuals from it are thresholded for fault detection.

Connections

Concept Map

feeds

feeds

core trick

predicts

standardise

compare against

fault if exceeded

multi-sensor version

distributed as

gives

fits model via

produces

Flight sensor data stream

Fault detection

System identification

Residual r = y minus yhat

Healthy predictor yhat

Standardised score z

Threshold tau equals 3

Mahalanobis distance D squared

Chi-squared distribution

Least-squares regression

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, aircraft ek aisi machine hai jo udte waqt lagataar data banati rehti hai — vibration, temperature, pressure sab. Fault detection ka core idea simple hai: pehle hum ek "healthy model" banate hain jo predict karta hai ki normal condition me sensor ka reading kya hona chahiye (y^\hat y). Phir actual reading yy me se prediction ghata dete hain — isko residual r=yy^r = y - \hat y bolte hain. Agar sab theek hai to rr almost zero rehta hai (sirf noise), lekin jab koi part kharab hota hai to physics change ho jaati hai aur rr badhne lagta hai. Bas usko threshold se compare karo — z-score z>3|z|>3 hua to alarm bajao.

System identification ka matlab hai data se system ka equation nikalna, textbook physics se nahi. Real UAV kabhi bhi wind-tunnel model se exactly match nahi karta, isliye hum flight ka input-output data lekar model fit karte hain. ARX model use karte hain: aaj ka output = past outputs + past inputs ka linear combination. Noise ki wajah se exact solution nahi milta, isliye hum squared error minimise karte hain aur seedha normal equation θ^=(ΦΦ)1Φy\hat\theta=(\Phi^\top\Phi)^{-1}\Phi^\top\mathbf y mil jaata hai.

Sabse important baat — ye dono ek hi pipeline ke do hisse hain. Pehle least squares se healthy model identify karo, phir usi model se residuals nikaal kar fault detect karo. Yaad rakhne ka trick: I-R-T (Identify, Residual, Threshold).

Aur ek galti mat karna: bada raw reading dekh ke ghabra mat jaana. High thrust pe temperature high hona to normal hai! Fault tab hai jab relationship toote — isiliye multi-sensor case me Mahalanobis distance (Σ1\Sigma^{-1} ke saath) use karte hain jo sensors ke beech ke correlation ko bhi check karta hai.

Test yourself — Machine Learning (Aerospace Applications)

Connections