fb.Fernando Barbosa

Learning to decide under constraints.

My master's research explored reinforcement learning for fraud prevention in crop insurance—connecting statistical signals, sequential decisions and a limited budget.

Master's in Digital Agriculture
UNICAMP · Campinas · 2021–2023

Explore the research code
Fernando at his UNICAMP thesis defense with two other participants
Thesis defense at FEAGRI / UNICAMP, Campinas, 2023.

How should a policy make a sequence of insurance decisions when each choice changes the remaining budget?

The thesis brought together my interests in economics, machine learning and decision-making. The public gym-insurance repository contains InsurEnv, an experimental environment for studying insurance-claim decisions with reinforcement learning.

Supervisor
Stanley Robson de Medeiros Oliveira
Research line
Data Science · FEAGRI / UNICAMP · 2023
Thesis title
Reinforcement Learning Applied to Fraud Prevention for Crop Insurance

A claim is also a choice about what comes next.

Approving one claim uses resources that are no longer available for the next. I explored this as a sequence of decisions: observe a case, choose an action, update the budget, and learn from the resulting signal.

Paraná · Soybean

The public sample script selects soybean records from Paraná in the processed PSR history.

2 actions

The environment represents approval and rejection, with a wallet tracking the budget and decision history.

4 context signals

Budget used, approval ratio, and Benford distances with and without the latest selected case supplement the claim features.

Inspect the sample selection ↗

Why look at the digits?

Benford’s law describes a pattern in the leading digits of many naturally occurring numerical datasets. Smaller leading digits are more common. The experiment uses distance from a Benford distribution as part of its reward design.

This first-digit chart explains the idea. The implementation uses a three-digit Benford-distance calculation. These are theoretical probabilities, not measured insurance data or research results.

Benford’s law · theoretical first-digit probabilities

P(d) = log₁₀(1 + 1/d)

Economics, statistics and learning in one decision environment.

The contribution is an inspectable experimental setup: data preparation, a budget-aware environment, a statistical reward and a DQN learning agent. It makes the assumptions behind sequential insurance decisions explicit.

Compare policies

The repository includes random-agent comparisons and DQN experiments, making a baseline part of the research design.

Read the trade-offs

Reward, budget consumption and approval history describe different aspects of the policy. They need to be interpreted together.

Establish real-world validity

Confirmed fraud labels and independent evaluation are needed before drawing conclusions about detection performance.

One budget. A sequence of choices.

A short, synthetic illustration of the budget constraint. You choose the actions; no trained agent or fraud prediction is running here.

STATEsₜ = (xₜ, bₜ, hₜ, D⁺ₜ, D⁻ₜ)
ACTIONaₜ ∈ {0, 1}
OBJECTIVEJ(π) = 𝔼π [∑ₜ γᵗ rₜ]

Conceptual notation: claim features, budget, approval history and statistical distances form the state. The policy seeks cumulative reward; this is not a measured performance result.

    From data to a decision policy.

    1. Prepare the insurance data

      The repository includes data-preparation scripts and a sample selection for soybean insurance in Paraná, Brazil.

    2. Represent the decision environment

      InsurEnv combines claim features, budget usage, approval history and statistical signals in a Gym-style environment with two actions.

    3. Define the learning signal

      The environment's reward compares Benford-distance measures for selected claim values. A wallet component tracks decisions and the available budget.

    4. Study a learned policy

      The public code includes a TensorFlow/Keras Deep Q-Network agent with experience replay, a target network and exploration, alongside scripts for random-agent comparisons and experiment analysis.

    Research you can inspect.

    Research prototype. The source links document the experimental design; no reproduced benchmark or production result is presented here.

    A personal chapter in a technical journey.

    These photographs bring the university and the defense day into the story behind the work.

    Fernando standing beside the UNICAMP campus sign
    A visit to the UNICAMP campus.
    Fernando with another participant after his thesis defense
    A moment after the thesis defense.

    Foreign direct investment in Brazil

    Two stages of research at PUC-SP: an undergraduate research project, followed by a final thesis that revisited the topic with updates and a different model.

    Explore the FDI research ↗