Case Study · Intraedge Engineering Intelligence

When the honest answer is less machine learning

A 116-row dataset beat a hundred-model AI plan on a decision that outlives everyone in the room.

ClientCanadian National Railway
DomainBridge replacement hydraulics
Asset life~200 years
Reading14 minutes
§ 01The decision that outlives the room

Every railroad bridge in North America is on a clock. Steel corrodes, timber rots, concrete spalls. The hydraulic reality underneath changes as watersheds get developed, culverts silt in, and storm intensities creep upward. When a bridge reaches end of life, the railroad has to decide what replaces it.

These structures are designed to last roughly 200 years. Not the three-to-five-year horizon of a software product, not the ten-year horizon of a factory line. Two centuries.

That single fact reorders everything about how you should think about automation in this domain. A recommendation engine that is fifteen percent more efficient but four percent less defensible is not a win. A model that is fast but unexplainable is a liability, because the engineer who signs the sheet is the one who owns the consequence. And the engineer will still be accountable long after the model's training data has gone stale.

This is the story of a project where the most valuable contribution was not a better model. It was a smaller one.
§ 02The business problem, stated plainly

Canadian National Railway maintains a bridge replacement program. For every bridge approaching end of life, engineers complete an H&H chart: a Hydraulic and Hydrological survey. They collect the physical profile of the existing structure and the watershed feeding it, run the flood hydraulics, and then recommend three ranked replacement alternatives.

Each alternative is a structure type plus its dimensions. The types span a wide range: culverts from corrugated metal pipe through reinforced concrete box, and bridges from a thirty-foot single span to a 562-foot, thirty-four-span viaduct.

The ranking matters as much as the choice. First choice is the preferred engineering solution. Second and third are fallbacks, for cost, constructability, permitting, or material availability. They are not interchangeable, and the ordering carries real meaning.

CN's stated number one objective is to replace bridges with culverts wherever physically possible.

Not because culverts are better hydraulically. Because they are dramatically cheaper to build, dramatically cheaper to maintain, and dramatically simpler to construct. A culvert is a pipe or a box in an embankment. A bridge is a structure with bearings, expansion joints, deck, drainage, and a maintenance regime that never ends.

So the highest-value question in the entire program is not "what should we build?" It is:

Can this bridge become a culvert?

Answer that correctly, at scale, early, and you have moved billions of dollars of lifecycle cost across a network. Answer it wrong in the conservative direction and you build bridges you did not need. Answer it wrong in the optimistic direction and you build a culvert that overflows in year nine.

Culvert

  • Pipe or box set into embankment
  • Lower capital cost
  • Near-zero ongoing maintenance regime
  • Faster to construct
  • Preferred outcome, when physically possible

Bridge

  • Bearings, expansion joints, deck, drainage
  • Higher capital and lifecycle cost
  • Permanent inspection and maintenance obligation
  • Required when the channel is wide or hydraulically demanding
  • The expensive answer, sometimes the only answer
§ 03How we got in the room

A well-funded AI company had already attempted this. They had the client relationship. They had the data. They had a plan.

Their plan was the obvious one: train roughly one hundred parallel models, one per output parameter. A model for span length. A model for pipe diameter. A model for number of spans. A model for box rise. A hundred separate predictors, each producing one number, assembled into a recommendation.

It never shipped. And the reason it never could have shipped was sitting in the dataset the whole time.

Usable rows Not enough data to learn

A hundred models, each learning from about forty examples, with dozens of features each. That is not a machine learning system. That is a hundred overfit black boxes wearing a system's clothing. Each one would have memorised its forty rows and produced confident nonsense on row forty-one.

They could not solve it. So they called us.

That is the honest framing of the engagement, and it is the part worth repeating: an AI company brought in a competitor because their own client's problem was unsolvable with the approach they had committed to.

§ 04The mistake hiding in the framing

The failure was not a modelling failure. It was a framing failure, and it was seductive because it sounded rigorous.

"Predict all the output parameters" treats the problem as a regression task with thirty-odd targets. That is a reasonable description of the output document. It is a terrible description of the decision.

Because those thirty-odd numbers are not independent facts about the world. They are consequences of one decision plus deterministic engineering.

Once you know the structure type, the dimensions are not a prediction problem. They are arithmetic. Manning's equation, AREMA clearance requirements, standard culvert sizing formulas. You do not need forty examples to learn that a box culvert carrying a given discharge at a given slope has a computable rise. You need a formula. Physics does not need training data.

Component
Method
Why
Which structure type
Machine learning
Genuinely needs learning: no closed form, real engineering judgment, patterns in the data
What dimensions
Deterministic
Physics. Manning's, AREMA, standard sizing. No learning required
Does it pass criteria
Rules engine
CN design criteria are published thresholds, not learned patterns

One honest model plus deterministic math, instead of a hundred overfit ones. That reframe is the entire project. Everything after it is engineering.

§ 05Reframing the output

Once you accept that ML should only select the type, the output shape changes.

It is not a regression. It is not three independent classifiers either. Three independent classifiers can each happily predict "Box" and produce a recommendation of Box, Box, Box, which is meaningless, because you cannot offer three alternatives that are the same alternative.

The correct formulation is a top-K learning-to-rank problem.

// the actual task Given: feature vector X (hydraulic + structural profile) Return: ordered triple (c₁, c₂, c₃) Where: cᵢ ∈ C, no repeats, |C| = 11 classes c₁ = preferred alternate c₂ = second, c₃ = third

Why "Bridge" had to become three classes

In the raw data, "Bridge" covered everything from a thirty-foot single span to a 562-foot thirty-four-span viaduct. That is a hundredfold range in effective opening, and effective opening is the single most predictive feature in the dataset.

Collapsing those into one label would have forced the model to ignore the strongest signal it had. Stratification is not cosmetic here. It is what makes the model useful.

IDClassDefinition
0–5CMP · Box · Pipe · RCP · RCB · Steel PipeCulvert family
6bridge-smspan ≤ 20 ft, length < 80 ft, opening < 250 sq ft
7bridge-mdspan 20–27 ft, length 80–200 ft, opening 250–700 sq ft
8bridge-lgspan > 27 ft or complex multi-span, opening > 700 sq ft
9DVBDeck viaduct bridge (rare, site-specific)
10Steel PipeStructural steel
§ 06The two rules that do most of the work

Before any model, the data told a clear story. Two rules capture roughly 78% of the discriminative signal.

Rule one: effective opening splits culvert from bridge

Minimum Effective Opening is the cross-sectional area of flowing water the structure must pass, measured at the 100-year flood event. The separation is stark.

CohortnMedian openingMeanRange
Bridge-only recommendations26547.7 sq ft966.651.6 to 9,299
Non-bridge recommendations90125.3 sq ft239.24.2 to 2,178

A 4.4× median separation. Above roughly 150 to 200 sq ft, bridge class becomes likely. Above 500 sq ft, it is close to certain.

Rule two: span count overrides hydraulics

Here is the interesting part, and the part that pure statistics would have missed.

Fourteen cases had effective openings under 200 sq ft (small, hydraulically culvert-feasible flows) and engineers still recommended bridges.

A naive model would call those label noise. They are not noise. They are physics.

Every one of those fourteen cases involved an existing structure with two or more spans. A multi-span bridge is not an accident. It means the channel is wide, morphologically complex, and has real banks. To put a culvert there you must build embankment across that channel. The hydraulic argument is irrelevant. The geotechnical argument wins.

Drive the decision

Interactive · the two rules
Recommendation
Culvert family

The explorer above encodes the two rules literally, nothing more. The trained model adds the remaining 22% of signal by learning the refinements between these bands. Where the rules disagree with the model, the engineers win. They have forty years and the model has forty rows.

§ 07What no amount of ML would have found

Three pieces of hydraulics engineering surfaced during the engagement that fundamentally shaped the feature set. All three came from practitioners, not from analysis.

One · there are two water surface elevations

Bridge hydraulics reports two distinct water surface elevations, and they serve different purposes. Headwater is measured at the upstream bounding cross-section and is used for evaluating alternatives. Face elevation is measured at the upstream face of the bridge and is used for reporting effective area.

Water surface drops as flow approaches and enters the opening. The face elevation is always lower than headwater. The gap is drawdown. If your training data mixes headwater-derived and face-derived depths, your most important feature is silently corrupted. Nobody flagged this in the data dictionary. It took a meeting.

Two · the length paradox

This one looked like a data error for weeks. The dataset had bridges seventy feet long replaced by culverts forty feet long. Physically impossible, unless you realise they are measuring different axes.

RAILROAD ALIGNMENT CHANNEL BRIDGE LENGTH · 70 ft along the track CULVERT LENGTH · 40 ft across the channel LONGITUDINAL TRANSVERSE

They are measuring different axes. A seventy-foot bridge along the track can absolutely be replaced by a forty-foot culvert across the channel.

The modelling consequence was significant. Raw length had been treated as one predictor across both structure types. It is two incomparable quantities wearing one column name. We had to stop using raw length as a cross-type feature, derive vertical_extent = base_of_rail − channel_invert instead, and estimate culvert length at roughly four times the vertical extent plus rail width, using standard 1:2 side slopes. Default to forty feet for preliminary work.

Three · culverts go inside existing spans

The most important structural constraint, and one no model would ever infer: culverts are placed within existing bridge spans. The bridge is not demolished. No new embankment is built from scratch.

This is why span count is the second-strongest predictor. You are not asking how much culvert the channel can take. You are asking how many culverts fit in the openings that already exist. Typical conversion is roughly one culvert per existing span, or fewer.

The apparent exceptions (a five-span seventy-foot bridge replaced by two culverts) turned out to be relief openings: structures carrying the railroad over a swamp at required grade, with only local drainage needs. The bridge length is driven by elevation, not by flow. These are identifiable by a flat hydraulic slope and a disproportionate length to drainage area, and should be flagged for manual review rather than modelled as a pattern.

§ 08The architecture

The pipeline has one learned component and several deliberate certainties around it. That proportion is the design.

01
Input

Engineer enters the survey: existing structure geometry, watershed parameters, flood event hydraulics.

02
Feature engineering

Derive ratios that carry independent signal (freeboard, headwater ratio, opening ratio). Drop raw elevations, which are collinear above r = 0.95. Median impute with explicit missingness indicators, because the gaps are structural, not random.

03
LightGBM score-and-rank model

Produces one utility score per class across eleven classes. Top three by score becomes the ranked recommendation. The no-repeat constraint is satisfied automatically, because each class receives exactly one score.

04
Confidence gate · τ = 0.45

If maximum softmax probability falls below the threshold, the record is flagged for human review instead of auto-populated. This is not a hedge. It is what makes the system deployable.

05
Hydraulic dimension engine

Manning's equation, AREMA clearance, standard sizing tables. Everything the model deliberately did not do, computed from physics instead of guessed from data.

06
Auto-populated H&H output sheet

Three alternates with full dimensions, ready for an engineer to review and sign.

The loss function carries the domain requirement

Training uses a Plackett-Luce formulation with positional decay weights of 3, 2, 1. Getting rank one wrong costs three times as much as getting rank three wrong, which is exactly right, because the first alternate is the one that gets built.

// positional weight, not uniform L = −Σᵢ [ w₁·log P(c₁) + w₂·log P(c₂ | ¬c₁) + w₃·log P(c₃ | ¬c₁,¬c₂) ] w = [3, 2, 1]

What we rejected, and why

Approach
Verdict
Reason
Neural networks / Transformers
Rejected
At n under 200 the bias-variance tradeoff is not close. Low-capacity models win.
Autoregressive sequence prediction
Rejected
Exposure bias compounds across inference steps, and conditioning on 116 rows amplifies overfitting.
100 independent regressors
Rejected
The original plan. Combinatorially wrong output space, no rank semantics, hopelessly underdetermined at this data volume.
LightGBM score-and-rank
Chosen
Native missing-value handling, lambdarank objective built in, interpretable importances, sub-second training.
§ 09The tool the engineer actually touches

The model is not the product. The product is a desktop analysis tool where an engineer works through a backlog of bridges, one after another, and the model is invisible machinery behind a form.

The scope was set by the client's own engineer, and it was deliberately modest:

Desktop-level preliminary analysis. Quick look at five to ten bridges. Not detailed design.

That single sentence settles most of the product questions. This is a screening tool, not a design tool. It answers "is a culvert plausible here, and roughly what kind" in seconds, so an engineer can triage a portfolio before spending days on the handful that actually matter.

The minimum viable input set turned out to be surprisingly small, which is the payoff of the two-rule insight: a bridge identifier, the length with an explicit axis label, the span arrangement, the existing culvert diameter, the drainage area, and the flow rates for each return period. Everything else is either derived, redundant, or a dimension the engine computes after type selection.

The length field is an interface trap, not just a data trap

This is where the length paradox comes back as a user-experience problem. If one field called "Length" sits on a form next to a culvert recommendation, engineers will fill it with whichever length is in their head, and the model will silently receive the wrong quantity.

So stop having one field. Label bridge length explicitly as length along the railroad alignment, and culvert length explicitly as length perpendicular to the railroad alignment, with help text and ideally separate database columns so the distinction survives into the data layer instead of living only in a tooltip.

When a column name is ambiguous, the ambiguity does not stay in the data. It reappears on every screen downstream, and every user resolves it differently. Fix the name, not the label.

Stream Stats as the flow engine

The client's engineer had forty years of hydraulics experience and one strong opinion about flow data: use Stream Stats, the USGS service. His reasoning was that USGS regression data is excellent, it is one click per site, and it is far more reliable than hand-rolled curve-number and hydraulic-length calculations. For the small-stream crossings that dominate this workload, it is simply better than the alternative.

One useful side effect: once Stream Stats supplies flow data, three fields that seemed essential become redundant, because they are already baked into the regression equations. Curve number, hydraulic length, and average watershed slope. That is three fewer things to collect per bridge, which is the difference between a five-minute screen and a twenty-minute one.

§ 10The data reality

Honesty about the constraints is what makes the rest of the document credible.

116Aligned input/output rows
~40Usable after completeness filter
38Raw input columns
~22Surviving engineered features

Missingness is structured, not random. Fifty-year flood columns are roughly forty percent missing, hundred-year twenty-five percent, two-hundred-year twenty percent, structural metadata thirty-five percent. Pre-2010 surveys disproportionately lack fifty-year calculations. This is MNAR (missing not at random), so imputation must not pretend the gaps are arbitrary.

Collinearity to handle. Top of Rail, Low Chord, and Ground Elevation correlate above 0.95. They are co-located measurements. Raw values carry no independent information; only the differences do. Drop the levels, keep the differentials.

Validation. Five-by-five repeated stratified k-fold. No fixed holdout, because at 116 rows a holdout wastes twenty-three samples and produces high-variance estimates.

MetricTargetWhy it is the right metric
NDCG@3> 0.85Headline metric. Rank-weighted, penalises rank-one errors hardest.
MRR> 0.80How high does the correct label land?
Top-1 accuracy> 0.75Is the primary recommendation right?
Top-3 recall> 0.90Is the right answer somewhere in the list?
Per-class F1> 0.60Catches silent failure on rare classes.

Three paths from 116 to 500

The current data supports a functional prototype on dominant classes. It is not enough for reliable performance on the rare culvert families.

Historical H&H charts across divisions. The cheapest and highest-quality path. Current data covers the Gulf, Central, Delta, Beaumont, Bogalusa, Yazoo, Hammond, and McComb subdivisions. The documentation practice is presumably consistent network-wide.

Physics simulation for synthetic augmentation. HEC-RAS or HY-8 can generate valid input-output pairs by sweeping drainage area, slope, and return period over representative channel cross-sections. This is legitimate augmentation specifically because the underlying relationships are deterministic. You are not inventing patterns, you are sampling the physics.

Domain-adaptive pretraining on public data. Federal bridge inspection records and the National Bridge Inventory hold hydraulic parameters for thousands of structures. No replacement labels, but the feature distributions are real.

§ 11Where this generalises

Strip away the specifics and the pattern is this:

When a domain expert's output looks like thirty numbers, it is usually one judgment plus thirty calculations. Find the judgment. Automate that. Compute the rest.

This shows up constantly in applied AI work.

Underwriting

The decision is the risk tier. The premium is arithmetic off a rate table.

judgment → calculation
Clinical triage

The decision is the acuity band. The protocol is a published ladder.

judgment → calculation
Manufacturing setpoints

The decision is the recipe family. The parameters are process physics.

judgment → calculation
Structural engineering

The decision is the member type. The sizing is code tables.

judgment → calculation

In every one of those, a team that tries to learn all the outputs will produce a fragile system that cannot be defended. A team that learns the one judgment and computes the rest produces something an expert will actually use.

The signal that you are about to get this wrong is almost always the same: someone proposes one model per output column. That phrasing is the tell.

§ 12The transferable checklist

For anyone facing a similar engagement.

  1. Count the usable rows before you count the features. 116 rows became forty. That single number should determine your entire modelling ambition.
  2. Separate judgment from calculation. Ask the domain expert what they actually decide, and what they compute after deciding. Automate only the first.
  3. Talk to the person with forty years of experience. Two of the three critical insights here were invisible in the data and obvious to the engineer.
  4. Distrust single column names. Length meant two different measurements. Headwater-to-diameter ratio was storing elevations in feet. Columns lie.
  5. Build the confidence gate first. A model that says "I don't know" is worth ten that never do.
  6. Keep the human sign-off explicit. On assets that outlive their designers, auditability is not a feature, it is the licence to deploy.
  7. Ship the prototype narrow. Dominant classes done well beats all classes done badly.
§ 13Where it stands

Delivered: full technical feasibility study, a revised eleven-class taxonomy with hydraulic justification, feature importance analysis validated against engineering judgment, production architecture, database schema requirements, and a nine-week roadmap to production pilot.

Blocked on data access: the single most important feature, Minimum Effective Opening at the hundred-year event, does not exist in the production database. It lives only in the source H&H charts. Populating it is the highest-leverage action in the entire project, and it is a schema change plus backfill, not an ML problem.

Next: data preparation and label re-annotation, a baseline model with cross-validated NDCG@3, an ablation study to confirm effective opening and span count are the true drivers, then the deterministic dimension engine.

The target: structure type selection in seconds instead of days, with engineering auditability intact and a human in the loop wherever the model is not confident.

A hundred models learning from forty examples cannot compete with one honest model, two hydraulic rules, and the willingness to do the arithmetic.