FarmRisk IQ

Published: June 2026

Risk Management & AnalysisVeterinary & AgriculturePredictive ModelingRecommendation Systems

FarmRisk IQ: Agricultural Insurance Analytics & In-Browser Litigation Risk Prediction

Summary

FarmRisk IQ is a web-based dashboard designed for agricultural insurance companies. Its main feature is a smart litigation risk calculator. When a farmer files a crop or livestock claim, this tool instantly predicts if the claim will turn into an expensive legal dispute.

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

Drawing on my extensive background in veterinary medicine and biology, the underlying logic, peril thresholds (such as disease vectors and livestock injury flags), and feature selection are derived directly from my own domain expertise.

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.

1

Data Synthesis & Domain Modeling

Q1 2026

Engineered a synthetic agricultural insurance dataset calibrated to USDA Risk Management Agency benchmarks, capturing nuanced livestock and crop perils.

2

Model Training & ONNX Conversion

Q2 2026

Trained a LightGBM model utilizing class-weight balancing and exported it as a portable ONNX binary for client-side execution.

3

Dashboard Integration

Q2 2026

Developed the SvelteKit frontend, integrating Apache ECharts for visualization and ONNX Runtime Web for zero-latency inference.

4

LLM & FHIR Enhancements

Future

Planning integration of a local LLM for unstructured notes and SMART on FHIR for electronic health records.

Tech Stack & Architecture

Frontend Framework


SvelteKit 2 + adapter-static. File-based routing allows clean URLs; static export eliminates server costs.

Data Visualization


Apache ECharts 5. High-performance rendering for heatmaps, loss triangles, and scatter plots.

Machine Learning


ONNX Runtime Web 1.17. Runs a ~640KB litigation risk predictor natively in the browser.

Hosting & Pipeline


Firebase Hosting for CDN, Google Colab (Python) for LightGBM training and ONNX export.

Core Systems Integration (Guidewire & Duck Creek)

Avoiding Microservice Friction

A common failure point in insurance analytics is the friction between data science environments and core transactional systems like Guidewire PolicyCenter/ClaimCenter or Duck Creek.

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.

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.


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

Loading claims data…

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

Loading underwriting data…

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

Loading actuarial data…

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

Loading stress test data…

Results & Conclusion

Results

FarmRisk IQ proves that heavy, latency-prone API architectures are not strictly necessary for deploying complex decision-support AI in the insurance industry. By moving the LightGBM inference directly into the browser via ONNX, the application achieves zero-latency scoring at FNOL. The dashboard translates raw probabilities into actionable routing directives—the exact mechanism required to drive user adoption among claims adjusters and underwriters.

Future Directions

To scale this prototype into an enterprise-grade application, the following enhancements are planned:

  1. 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.
  2. Generative AI for Adjudication: Integrating a local LLM to parse unstructured adjuster notes and automatically extract the injury_flag and multi_peril boolean values before feeding them into the ONNX scorer.
  3. FHIR Integration: For livestock claims involving veterinary interventions, parsing electronic health records via SMART on FHIR to dynamically assess disease-based peril risk.


© Dr. Balaji Ramanathan

Enhanced by JavaScript • Based on Slick Portfolio