Part XIV: Applications, Systems, and Frontiers
Chapter 72: Frontier Research and the End-to-End Capstone

Capstone: select an application and sensing stack; define measurement and task; build acquisition and preprocessing; train a classical baseline and a modern/foundation model; evaluate generalization, uncertainty, and robustness; deploy or simulate deployment; produce a final technical and responsible-use report

"A demo persuades a room. A protocol persuades a regulator, a night-shift technician, and the version of you that has to debug this at 3 a.m."

A Seasoned AI Agent

Prerequisites

The capstone is the whole book at once, so it assumes the whole book. In practice you will lean hardest on leakage-safe splits from Chapter 5, calibration and conformal prediction from Chapter 18, a foundation model from Chapter 19 or Chapter 20, the evaluation protocols of Chapter 65, and the responsible-use frame of Chapter 70. Pick one of the seven capstone options from the chapter plan and carry it through every subsection below.

The Big Picture

Everything in this book has been a component. The capstone is the assembly: a single project that starts at a physical quantity you cannot see, ends at a decision someone acts on, and is defensible at every joint in between. The deliverable is not a leaderboard number. It is a system plus a written argument that the system does what it claims, degrades gracefully when it does not, and is safe and fair to deploy. This section is the rubric for that argument, walked joint by joint: choose the problem, build the data spine, race a classical baseline against a foundation model on one honest protocol, stress-test what survives, ship or simulate the ship, and write the report that would let a stranger trust the result.

Choose the application, the sensing stack, and a task you can measure

A capstone lives or dies on the first paragraph of its own spec. Three choices lock in before any code: the application (who acts on the output and what changes when they do), the sensing stack (which transducers, at what rates, with what known failure modes, per Chapter 2), and the task written as a function with a metric attached. "Monitor the patient" is not a task. "Classify each 10-second PPG window as atrial-fibrillation or sinus rhythm, optimizing sensitivity at a fixed 1-per-24-hour false-alarm rate" is a task: it names the input window, the label space, the operating point, and the metric that the operating point implies. The discipline here is to write the measurement model down explicitly, \(y = h(s) + \varepsilon\), so the task connects a hidden state \(s\) you care about to the raw signal \(y\) you actually get, with a noise term \(\varepsilon\) whose structure you will exploit later.

Scope ruthlessly. A good capstone task is narrow enough to evaluate rigorously in the time you have and broad enough that a classical method and a foundation model genuinely disagree. If a hand-tuned threshold already hits 99% of achievable performance, you have chosen a problem that cannot teach the classical-versus-foundation tradeoff that is the point of the exercise.

Key Insight

The metric is a modeling decision, not a reporting decision. Choosing "sensitivity at a fixed false-alarm rate" instead of "accuracy" changes which model wins, which threshold you deploy, and which failures are even visible. Decide the operating point before you see any test scores; deciding after is how a leaderboard becomes a fiction.

Build the acquisition and preprocessing spine

The data spine is the part reviewers trust least and students rush most. Acquisition means capturing raw signal with the metadata that makes it splittable: subject or machine ID, session, device serial, timestamp, and site. Those columns are not bookkeeping; they are the only defense against the leakage that inflates every naive result. Preprocessing then does the unglamorous work: resample to a common rate and align clocks (Chapter 3), filter and denoise (Chapter 6), window the stream, and, critically, fit every transform on the training split only. A normalization statistic computed over the whole dataset has already told your model about the test set.

The single most common capstone failure is the grouped split done wrong. If the same subject, machine, or recording session appears in both train and test, the model can memorize identity instead of learning the task, and the reported score is pure leakage. Split by group, verify no group crosses the boundary, and prefer a temporally forward split (train on the past, test on the future) whenever the deployment will see time move in one direction, exactly the protocol argued in Chapter 5.

In Practice: an industrial bearing-fault capstone

A student picks predictive maintenance: triaxial accelerometers on a gearbox test rig, sampled at 12 kHz, task defined as classifying each 1-second window into healthy, inner-race fault, or outer-race fault. The rig has four physical bearings. The tempting split is random windows, which scores a glorious 99.4% and is worthless, because windows from the same bearing under the same load leak across the boundary. Splitting instead by bearing and load condition (train on three bearings, test on the fourth, held-out) drops the honest score to 91%, and the eight-point gap is the finding: it is the amount of the original number that was memorized rig identity rather than learned fault physics. Everything downstream, the model race and the robustness tests, now measures something real.

Race a classical baseline against a foundation model, on one protocol

The heart of the capstone is a fair fight. Build a classical baseline first, always: hand-engineered spectral and statistical features (Chapter 8) into a gradient-boosted tree or an SVM. It is fast, interpretable, hard to beat on small data, and it sets the number the fancy model must justify beating. Then bring the modern or foundation model: fine-tune or zero-shot a pretrained time-series or sensor model such as TimesFM, MOMENT, Chronos, or Google's LSM, or train a compact transformer or state-space model from Chapter 15 and Chapter 16.

The rule that makes the comparison honest: one protocol, one split, one metric, computed in one pass. Both models see identical windows, identical folds, and the identical held-out test set they never touched during selection. A win only counts if it is large enough to clear the confidence interval and consistent across folds. Report the classical number even when the foundation model wins; report it especially when it does not, because "the 20-line baseline matched the 200-million-parameter model" is one of the most useful results a capstone can produce.

import numpy as np
from sklearn.metrics import roc_auc_score

def paired_eval(clf_scores, fm_scores, y_true, n_boot=2000, seed=0):
    """Same test set, same labels: bootstrap the AUROC gap between two models."""
    rng = np.random.default_rng(seed)
    n = len(y_true)
    gaps = np.empty(n_boot)
    for b in range(n_boot):
        idx = rng.integers(0, n, n)                 # resample TEST windows, paired
        a = roc_auc_score(y_true[idx], clf_scores[idx])
        f = roc_auc_score(y_true[idx], fm_scores[idx])
        gaps[b] = f - a                             # foundation minus classical
    lo, hi = np.percentile(gaps, [2.5, 97.5])
    print(f"AUROC gap (FM - classical): {gaps.mean():+.3f}  95% CI [{lo:+.3f}, {hi:+.3f}]")
    print("verdict:", "FM wins" if lo > 0 else "no significant difference")
    return gaps

# clf_scores, fm_scores, y_true come from ONE forward pass on the SAME held-out split
A paired bootstrap over the shared held-out test set. Because both models are scored on the identical windows, resampling the same indices for both preserves the pairing and yields a confidence interval on the gap, not on either model alone. If the interval straddles zero, the foundation model has not earned its deployment cost, and that is a reportable, publishable outcome.

The code above is the arbiter of the race: it turns "the transformer got 0.94 and the tree got 0.92" into a defensible claim about whether the two points differ at all once test-set sampling noise is accounted for.

Library Shortcut

Zero-shot foundation-model inference collapses the entire feature-engineering plus training pipeline. With MOMENT via HuggingFace, an embedding-and-classify baseline is about 6 lines instead of the roughly 120 a hand-built spectral pipeline plus training loop takes: model = MOMENTPipeline.from_pretrained("AutonLab/MOMENT-1-large", model_kwargs={"task_name":"embedding"}), then emb = model(x_enc=windows).embeddings feeds a linear probe. The library handles patching, normalization, and the pretrained backbone; you supply the windows and a logistic-regression head. Keep the classical baseline anyway, since the shortcut only tells you what a big model does, not whether you needed one.

Evaluate generalization, uncertainty, and robustness

A single test score is a claim about one distribution. A capstone must defend three separate properties. Generalization: does performance hold on data from an unseen subject, site, device, or time period? Report the grouped and forward-in-time results, and treat any distribution-shift or out-of-distribution degradation with the test-time-adaptation lens of Chapter 66. Uncertainty: is the model's confidence trustworthy? Produce a reliability diagram and an expected-calibration-error number, and wrap the predictions in a conformal set (Chapter 18) so that a stated 90% coverage is an empirically verified 90%. A well-calibrated 85%-accurate model is often more deployable than an overconfident 90%-accurate one.

Robustness: what happens under the sensor failures that Chapter 2 promised would occur? Perturb the test set deliberately: add band-limited noise, drop a channel, shift the sampling rate, inject a stuck-at value, and simulate the spoofing attacks of Chapter 68. A model whose accuracy falls off a cliff when one accelerometer axis saturates is not ready, no matter its clean-data score. Plot performance as a function of perturbation magnitude; the slope of that curve is your robustness result.

Research Frontier

As of 2026 the honest evaluation of sensor foundation models is itself unsettled. Zero-shot claims for TimesFM, MOMENT, Chronos, and Google's Large Sensor Model (LSM) are frequently contaminated by pretraining-set overlap with popular benchmarks, so a "zero-shot" win can be silent memorization. There is no agreed leakage audit for pretraining corpora, no standard robustness suite for physical sensor perturbations, and calibration under distribution shift remains an open problem. A frontier-quality capstone treats these gaps as its contribution: state exactly what your held-out set guarantees, and what it cannot.

Deploy or simulate deployment, then write the report

A model that never leaves a notebook has not been evaluated on the thing that matters: latency, memory, power, and drift on the target. If you can deploy, do it to a real edge device and measure end-to-end inference time and energy, using the optimization toolkit of Chapter 59. If you cannot, simulate deployment faithfully: quantize the model, run it under the target's compute and memory ceiling, replay a live-ordered stream (never shuffled), and log the latency and confidence of every decision as if a technician were watching. Either way you produce an operational curve, not a single accuracy point.

The final deliverable is two documents fused into one. The technical report states the task, the data spine and its splits, the model race with its confidence intervals, and the three-property evaluation, each claim backed by an artifact a reader could regenerate. The responsible-use report (framed by Chapter 70) states the intended use and the out-of-scope uses, the subgroup performance breakdown (does it work as well across skin tones, machine types, or sites?), the privacy posture of the sensor data, the known failure modes, and the human-in-the-loop safeguard. A capstone without the second document is an experiment; with it, it is a system someone could responsibly ship.

Lab 72

Execute the full capstone on one chosen option (wearable activity-plus-anomaly monitoring, industrial predictive maintenance, smart-building occupancy, a radar/lidar/depth prototype, multi-sensor mobile-robot fusion, an environmental early-warning network, or a sensor-language monitoring agent). Deliver, in order: (1) a one-page spec fixing the application, sensing stack, task function, and operating-point metric; (2) an acquisition-and-preprocessing notebook with a verified grouped, forward-in-time split and all transforms fit on train only; (3) a classical baseline and a foundation-model or modern deep model scored on one shared held-out set, compared with the paired bootstrap above; (4) a generalization, calibration (reliability diagram plus conformal coverage), and robustness (perturbation-sweep) evaluation; (5) a real or simulated edge deployment with a latency-and-energy measurement; and (6) a combined technical and responsible-use report, every headline number traceable to a saved artifact. Grade yourself against the rubric in this section: a missing confidence interval, a leaked split, or an absent responsible-use section each fails the capstone regardless of the accuracy achieved.

Exercise

Take any dataset you have used in an earlier chapter and deliberately construct the leaky version and the honest version of the same experiment. Split it randomly by window, record the score, then re-split by group and forward-in-time, and record the score again. Compute the gap. Then attack robustness: drop one channel at test time and measure the additional drop for each model. Write the two-sentence entry that would appear in your responsible-use report explaining what the leaked number would have led a deployer to wrongly believe.

Self-Check

  1. Why must the operating-point metric be fixed before any test scores are seen, and what goes wrong if it is chosen afterward?
  2. A foundation model beats the classical baseline by 0.02 AUROC. What single computation decides whether that gap is real, and what would make you deploy the baseline anyway?
  3. Name the three properties a capstone evaluation must defend beyond a clean-data test score, and give one concrete measurement for each.

What's Next

This is the last section of the last chapter, so what comes next is your own project and the shelf of references behind it. In Contents, the appendices supply the reusable scaffolding: the datasets and benchmarks catalogue, the evaluation-metrics reference, the toolchain guide, and the notation glossary that turn the capstone rubric above into a repeatable practice. The book ends where a working sensory-AI engineer begins: with a physical quantity, an honest protocol, and a report you would sign.

Bibliography

Sensor and Time-Series Foundation Models

Das, A., Kong, W., Sen, R., and Zhou, Y. (2024). A Decoder-Only Foundation Model for Time-Series Forecasting (TimesFM). ICML.

The reference zero-shot forecaster; a natural foundation-model contender for capstones with a forecasting or horizon-anomaly framing.

Goswami, M., Szafer, K., Choudhry, A., et al. (2024). MOMENT: A Family of Open Time-Series Foundation Models. ICML.

Open-weights model with an embedding mode ideal for the linear-probe classical-versus-foundation race in the capstone.

Ansari, A. F., Stella, L., Turkmen, C., et al. (2024). Chronos: Learning the Language of Time Series. TMLR.

Tokenizes time series for a language-model backbone; a strong, easily-fine-tuned baseline foundation model for sensor streams.

Narayanswamy, G., Liu, X., Ayush, K., et al. (2024). Scaling Wearable Foundation Models (LSM). arXiv.

Google's Large Sensor Model on wearable data; the canonical reference for the wearable-monitoring capstone option.

Evaluation, Uncertainty, and Robustness

Angelopoulos, A. N., and Bates, S. (2023). A Gentle Introduction to Conformal Prediction and Distribution-Free Uncertainty Quantification. Foundations and Trends in ML.

The practical guide to the coverage-guaranteed prediction sets the capstone uses to make its confidence claims verifiable.

Guo, C., Pleiss, G., Sun, Y., and Weinberger, K. Q. (2017). On Calibration of Modern Neural Networks. ICML.

Establishes reliability diagrams and expected calibration error, the tools for the capstone's uncertainty section.

Hendrycks, D., and Dietterich, T. (2019). Benchmarking Neural Network Robustness to Common Corruptions and Perturbations. ICLR.

The template for a perturbation-sweep robustness suite; adapt its corruption-severity axis to sensor failure modes.

Responsible Deployment and Reporting

Mitchell, M., Wu, S., Zaldivar, A., et al. (2019). Model Cards for Model Reporting. FAT*.

The structure for the capstone's responsible-use report: intended use, out-of-scope use, and subgroup performance.

Gebru, T., Morgenstern, J., Vecchione, B., et al. (2021). Datasheets for Datasets. Communications of the ACM.

The companion discipline for documenting the capstone's data spine: provenance, collection, and known biases.