Inspiration
Existing travel insurance is a black box: flat-rate premiums that ignore the massive variance in flight disruption risk across different airports, routes, seasons, and weather patterns. A January JFK-to-LAX trip through a winter storm corridor is fundamentally riskier than an August SFO-to-SEA hop, yet legacy insurers charge the same $15. We asked: what if we treated the US aviation system as a network and priced insurance the way it actually behaves? Graph theory tells us that disruptions at hub airports cascade through the system. Historical BTS data tells us which routes are delay-prone. Live weather data tells us what's happening right now. We combined all three into a single actuarial pricing engine that produces fair, explainable, per-trip premiums in under 2 seconds.
What it does
AeroRisk is a network-aware, ML-driven B2C travel insurance pricing engine. Enter any US airport pair and travel month, and it returns a personalized insurance premium backed by a full actuarial breakdown.
Under the hood, it models the entire US aviation system as a graph of 348 airports and 3,400+ routes, then combines five risk signals, airport traffic centrality, route congestion, historical delay/cancellation rates, seasonal weather corridors, and mechanical risk, into a single TripRisk score. Three GradientBoosting models trained on 7M 2024 BTS flight records predict the probability of severe delay (>3hr) and cancellation for any origin-destination pair. These feed into a proper actuarial gross premium formula with LAE, catastrophe loading, reinsurance, and affordability caps: producing realistic $8–55 premiums that differentiate risk the way the aviation network actually behaves.
The platform ships three interfaces: a consumer-facing Next.js app for instant quotes, a Streamlit analytics dashboard for exploring risk across the network, and a FastAPI backend powering both. A built-in What-If simulator lets users stress-test scenarios: crank up congestion at a hub or worsen weather along a corridor and watch the premium respond in real time.
How we built it
Data layer: Ingested 7M rows of 2024 Bureau of Transportation Statistics on-time performance data. Extracted per-airport delay profiles (avg departure delay, cancellation rate, weather delay, NAS delay) and per-route statistics across 348 airports and 3,400+ route-carrier pairs.
Graph layer: Built a NetworkX graph where nodes are airports and edges are routes. Computed degree centrality, betweenness centrality, and PageRank to quantify each airport's structural importance and cascade risk.
Risk model: Designed a 5-component weighted TripRisk score, airport traffic (15%), route congestion (20%), weather (15%), historical delay (40%), mechanical (10%), normalized to [0, 1].
ML layer: Trained 3 GradientBoosting models (scikit-learn) on 23 features per flight, origin/destination airport stats, cyclical month encoding, distance, weather risk, congestion risk, to predict severe delay probability, cancellation probability, and expected delay minutes.
Weather layer: Integrated the Open-Meteo Historical Archive API to fetch monthly climate profiles (temperature, precipitation, snowfall, wind, WMO severe weather codes) for origin, destination, and en-route waypoints sampled along the great-circle path via spherical linear interpolation.
Pricing layer: Full actuarial gross premium formula with LAE (8%), risk load (10%), catastrophe load (5%), reinsurance (3%), bounded by a $7 floor and 15%-of-ticket affordability cap. Ticket prices estimated via the Amadeus API with distance-based fallback.
Frontend: Three interfaces, a Next.js 16 / React 19 / Tailwind CSS consumer app with quote, simulator, and dashboard pages; and a FastAPI REST backend with auto-generated Swagger docs.
Challenges we ran into
Class imbalance: Only ~1.8% of flights have severe (>3hr) delays and ~2.1% are cancelled. Required careful threshold calibration and PR-AUC evaluation alongside ROC-AUC to avoid a model that just predicts "no disruption" for everything.
Weather-hub interaction: A storm at a small regional airport is far less impactful than the same storm at ORD. We modeled this with an exponential interaction factor to capture the nonlinear amplification — severe weather at a high-centrality hub drives disproportionately more cascading disruptions.
Keeping premiums realistic: Early iterations produced premiums of $200+ for high-risk routes. Real domestic travel delay insurance costs $8–55. Required iterating on benefit structures, loading ratios, and affordability caps to match market reality while preserving risk differentiation.
Reproducibility: Built a golden test suite that freezes expected values (TripRisk, component scores, premiums) for a JFK→LAX January trip, so any formula change is immediately caught.
Accomplishments that we're proud of
Built a full actuarial pricing pipeline, not a toy multiplier, but the real gross premium formula with LAE, catastrophe loading, reinsurance, and bounded affordability caps that produces market-realistic premiums. The ML models generalize to unseen airport pairs via airport-level features (centrality, delay stats) rather than memorizing specific routes, any pair of US airports gets a meaningful prediction. En-route weather sampling along the great-circle path catches corridor risk that endpoint-only models completely miss. A MIA→BOS flight through a Carolina nor'easter is priced accordingly. The What-If simulator lets users stress-test congestion spikes and weather shifts and see the premium respond in real time, making the pricing transparent rather than a black box. End-to-end from raw BTS CSV to quoted premium in a single python main.py run, with golden tests ensuring reproducibility across every code change.
What we learned
Graph centrality is a powerful risk signal. Airports with high betweenness centrality (like ORD, ATL, DFW) are structurally important, disruptions there cascade to hundreds of downstream flights. Incorporating this into pricing was a key differentiator versus naive delay-based models. Actuarial pricing is non-trivial. Real insurance premiums aren't just P(event) × payout. The formula requires Loss Adjustment Expenses, catastrophe loading, reinsurance costs, and expense ratios, getting this right was essential for producing premiums that match real-world market rates. ML and formulas complement each other. Our GradientBoosting models predict disruption probabilities with ROC-AUC > 0.78, but the actuarial formula provides the guardrails and interpretability that make the output trustworthy. En-route weather matters. A flight from MIA to BOS might depart clear skies but fly through a nor'easter over the Carolinas. Sampling weather along the great-circle path captures corridor risk that endpoint-only models miss.
What's next for AeroRisk
Real-time weather integration: Move from historical monthly averages to live forecast data (NOAA GFS / Open-Meteo Forecast API) so premiums reflect what's actually happening in the next 48 hours. International expansion: Extend the graph beyond US domestic to include major international hubs and transatlantic/transpacific routes using OAG or Eurocontrol data. Dynamic claims processing: Build an automated claims pipeline that monitors flight status APIs and triggers payouts automatically when a covered disruption is detected, no paperwork needed. Airline-level risk factors: Incorporate carrier-specific reliability data (fleet age, on-time ranking, codeshare complexity) as additional ML features for finer-grained pricing. Mobile app: Ship a React Native consumer app with push notifications for pre-trip risk alerts and one-tap insurance purchase at booking time.
Built With
- 16
- 19
- api
- css
- fastapi
- networkx
- next.js
- numpy
- open-meteo
- pandas
- python
- react
- recharts
- scikit-learn
- streamlit
- tailwind
- typescript
Log in or sign up for Devpost to join the conversation.