FarmRisk IQ
Published: June 2026
FarmRisk IQ: Agricultural Insurance Analytics & In-Browser Litigation Risk Prediction
Instead of sending data to a remote server, the artificial intelligence runs entirely inside the user’s web browser. This makes the tool lightning-fast, secure, and highly cost-effective to operate. It gives insurance adjusters a simple color-coded warning—ranging from Low to Critical risk—so they can route complicated claims to legal experts before costs spiral.
Beyond predicting lawsuits, the dashboard helps executives monitor the company’s overall financial health. It includes visual charts that track profits, pinpoint which weather events (like droughts or freezes) cause the most damage, and run stress tests to ensure the company has enough reserve money to survive catastrophic farming disasters.
Introduction & Project Motivation
Domain Integration
The primary business objective of this build is to demonstrate a production-ready solution that aligns with the advanced analytics frameworks championed by industry leaders like ValueMomentum. Specifically, this pipeline mirrors the architecture required to achieve a 15% reduction in legal spend by routing high-risk claims to specialized adjusters before costs escalate.
Data Synthesis & Domain Modeling
Q1 2026Engineered a synthetic agricultural insurance dataset calibrated to USDA Risk Management Agency benchmarks, capturing nuanced livestock and crop perils.
Model Training & ONNX Conversion
Q2 2026Trained a LightGBM model utilizing class-weight balancing and exported it as a portable ONNX binary for client-side execution.
Dashboard Integration
Q2 2026Developed the SvelteKit frontend, integrating Apache ECharts for visualization and ONNX Runtime Web for zero-latency inference.
LLM & FHIR Enhancements
FuturePlanning integration of a local LLM for unstructured notes and SMART on FHIR for electronic health records.
Tech Stack & Architecture
Frontend Framework
Data Visualization
Machine Learning
Hosting & Pipeline
Core Systems Integration (Guidewire & Duck Creek)
Avoiding Microservice Friction
By compiling the LightGBM model into the Open Neural Network Exchange (ONNX) format, this pipeline completely bypasses the need for a microservice API. The ONNX file acts as a portable binary. In a Guidewire integration, the model can be deployed directly into the UI layer or a localized edge node. This means when an adjuster inputs FNOL data, the prediction executes client-side with zero latency, eliminating network failure points and server scaling costs.
Methodology & Data Pipeline
Because agricultural insurance data is highly proprietary, I engineered a synthetic dataset calibrated precisely to the USDA Risk Management Agency (RMA) 2022 Annual Report benchmarks. The pipeline generated 15,000 individual claims across 8 lines of business, anchored to a baseline earned premium of $13.8B and a 2022 loss ratio of 97.7%.
Feature Engineering & Domain Logic
The litigation risk model relies on biologically and operationally grounded features. For example, livestock claims involve injury variables that drastically alter litigation probabilities compared to standard crop yield failures.
View Source Code
Click to expand interactive code modal
Model Training & Export
I utilized LightGBM due to its superior handling of tabular insurance data. The model was trained with 300 trees and a maximum depth of 6, utilizing class-weight balancing to handle the ~4:1 ratio of standard to litigated claims. The model achieved a 5-fold CV AUC of 0.700 and a Test AUC of 0.722.
View Source Code
Click to expand interactive code modal
Dashboard Components & Interactive Analysis
1. Claims Intelligence & FNOL Litigation
This section monitors the influx of claims and deploys the AI model.
- FNOL Heatmap: Tracks submission volume by month and day of the week, allowing claims managers to optimize staffing during peak harvest or weather events.
- Live ONNX Scorer: Users can manually adjust input parameters (e.g., Claim Amount, Days to Report). The WASM-backed ONNX engine instantly recalibrates the litigation probability, outputting a discrete routing decision (LOW, MEDIUM, HIGH, CRITICAL) for adjusters.
1. Claims Intelligence
2. Underwriting Precision
This segment evaluates portfolio profitability across geographic and coverage variables.
- Risk Score vs. Loss Ratio Scatter: Visualizes individual segment performance. Bubble size dictates policy count, while the color (green/amber/red) instantly identifies unprofitable cohorts (Loss Ratio > 100%).
- Submission Funnel: Tracks the conversion pipeline from initial submission to in-force policies, identifying bottlenecks in the quoting process.
2. Underwriting Precision
3. Actuarial Analytics
Agricultural insurance develops faster than long-tail liability lines. This page provides actuarial visualization for reserving.
- Loss Development Triangle: Utilizes the chain-ladder method. Users can track how claims from a specific accident year develop over a 6-year lag. For instance, my calibrated data shows 72% of ultimate losses are paid in year 1.
- Reserve Adequacy: A gauge tracking whether current IBNR (Incurred But Not Reported) reserves meet the industry benchmark of ~94%.
3. Actuarial Analytics
4. Portfolio Stress Test
This tool handles capital adequacy planning against catastrophic events.
- Scenario Sliders: Users manipulate parameters for Drought Frequency, Claims Inflation, and Fraud Rate Deltas.
- Real-Time Simulation: Adjusting the sliders instantly recalculates the Stressed Combined Ratio and Solvency Margin. If the simulated drought mimics 2012 severity, the interface actively displays whether current capital remains adequate or enters a stressed state.
4. Portfolio Stress Test
Results & Conclusion
Results
Claims Intelligence Dashboard
Live ONNX Scorer instantly recalibrates litigation probability and outputs a discrete routing decision (LOW, MEDIUM, HIGH, CRITICAL) for adjusters.
Underwriting Precision
Visualizes individual segment performance. Bubble size dictates policy count, color instantly identifies unprofitable cohorts.
Actuarial Analytics
Utilizes chain-ladder method to track how claims develop. Identifies whether IBNR reserves meet industry benchmarks.
Future Directions
To scale this prototype into an enterprise-grade application, the following enhancements are planned:
- MLOps Feedback Loop: Implementation of automated score distribution monitoring. The system will track week-over-week score drift and trigger a LightGBM retraining pipeline when the AUC drops below a 0.68 threshold on newly labeled data.
- Generative AI for Adjudication: Integrating a local LLM to parse unstructured adjuster notes and automatically extract the
injury_flagandmulti_perilboolean values before feeding them into the ONNX scorer. - FHIR Integration: For livestock claims involving veterinary interventions, parsing electronic health records via SMART on FHIR to dynamically assess disease-based peril risk.