AI/ML
Locomotion-State Classifier
- Status
- Completed
- When
- Summer 2026
- Context
- HUROTICS internship
I trained a locomotion-state classifier on hip-exoskeleton encoder data across eight trials, reaching roughly 98.7% agreement with hand-labeled ground truth.
The harder part was validating it honestly. Splitting windows randomly across trials lets adjacent strides from the same trial land in both the training and test sets, so a model can look accurate by memorizing a trial instead of generalizing across gaits. I used grouped cross-validation, holding out entire trials rather than individual windows, so every test fold was on a trial the model had never seen. It's a harder bar to clear, and the score that comes out of it means something.
How it came together
Process
- 1
Raw sensor data straight to an LLM
It hallucinated.
- 2
Pivot
The LLM designs and proposes algorithm changes; a transparent supervised ML pipeline does the classification. One-shot runs gave too few proposals, so the LLM stage became an agent.
- 3
Final architecture
17 steps, 3 stages: S1 ingest/trust, S2 ML labeling, S3 physics audit, with optional LLM agents. ExtraTrees (38 features, 400 estimators) with confidence-gated abstention.
Key decisions
ChoseProposer/verifier separation: agents propose, held-out trials decide
OverLLM classifying raw data directly
Using an LLM for large-scale IMU labeling is functionally building an algorithm, not labeling.
ChoseFixed-length windowing
OverGait-event cutting
Event cutting is circular when standing is half the vocabulary.
ChosePer-file calibration
OverCorpus-wide constants
Low cadence, postural sway, irregular gait.
ChoseMeasured columns only
OverComputed columns (cadence, stride length, GCP, admittance, PID state)
Collapsed 5 schema variants into 1 and removed firmware-version signal.
Debugging
SymptomSilent 57.3x mixing bug in shipped code.
CauseB_Gyro channels are rad/s while L/R_Gyro are deg/s despite identical naming, plus a Y/Z axis swap.
CheckedCompared channel magnitudes across files.
FixFlagged; gyro unit normalization strategy left open at handoff.
SymptomA finding looked corroborated but was not.
CheckedRe-measured the right population.
FixLesson recorded: measure, don't assert, and measure the right thing.
SymptomSubject identity unknown for most files.
CauseFilename field 2 tracks date blocks, not subjects.
FixFlagged needs_human; true subject-level CV needs human reconstruction.
Outcome
- 88 files, 5 schemas, ~477 minutesUnlabeled IMU gait data recovered into a labeled dataset.
- 0.9308 accuracy at 76.4% coverageLockbox subject (rev8); the classifier abstains on the remaining 23.6% via confidence gating.
- Stand recall ~0.58 vs walk recall ~1.00Asymmetric error; not fixable by thresholding alone; still an open problem.
- ~$2.67Total agent cost for the pipeline.
- ~98.7% agreementEarlier classifier on 8 trials of hip-exoskeleton encoder data, GroupKFold by trial to prevent leakage.