AI-NLP / IN-PROGRESS

BananaVision — K-Means & MDP

Move from defect observation to structured sorting decisions.

STACK
PythonpandasNumPyscikit-learn
STATUS

in progress

BananaVision perception, clustering and decision pipeline
01 / CONTEXT

Context

Plantations du Haut-Penja produces bananas for export, subject to strict quality requirements. On the packing line, every fruit must be inspected to decide whether it is accepted, downgraded or rejected.

However, this inspection is mainly visual: it depends on each operator's judgement, leading to variation between inspectors and inconsistent results. Yet a sorting error has a cost, whether a batch is rejected for export or compliant fruit is wrongly discarded. This academic AI project therefore explores how to structure this decision to make it more consistent, accounting for uncertainty and the consequences of each choice.

IMG-BANANA-01 · CONTEXT

BananaVision — context

Step 01 / 06 · Paused

Export bananas, strict quality standards.

01 · SITUATION02 · IMPLICATIONS03 · FRICTION04 · NEEDExport lineHAUT-PENJAVisual inspectionOPERATORSSorting decisionACCEPT · DOWNGRADE · REJECTDiverging verdicts⚠ SUBJECTIVITYCost of errors⚠ REJECTED BATCH · LOST FRUITStructured decisionUNCERTAINTY · COSTS
Paused6 nodes · 6 links · Hover a node
  • Actor / entity
  • Component / data
  • Friction point
  • Need
Hover or select a component to see its role and connections.
From the field to the need: the situation behind the project.
02 / PROBLEM

Problem

How can fruit features and defect families be used to recommend a consistent sorting action, accounting for uncertainty and the cost of each decision?

03 / SOLUTION

Solution

Design of a decision-support pipeline combining perception, classification, clustering and sequential decision-making, to go from a fruit image to a sorting recommendation. Images are turned into features and analysed by classification and clustering modules; a decision model then evaluates the consequences of possible actions.

IMG-BANANA-02 · SOLUTION

BananaVision — solution

Step 01 / 06 · Paused

Diverging verdicts and costly errors.

01 · PROBLEM02 · BUILD03 · HOW IT WORKS04 · OUTCOMEDiverging verdicts⚠ SUBJECTIVECost of errors⚠ UNCERTAINTYFeature extractionIMAGESK-MeansDEFECT FAMILIESMDPVALUE · POLICY ITERATIONSorting policy✓ RECOMMENDATION
Paused6 nodes · 6 links · Hover a node
  • Team module
  • My contribution
  • Friction point
  • Outcome
Hover or select a component to see its role and connections.
Elements in blue are my personal contribution; the rest was built by the project team.
04 / CONTRIBUTION

Contribution

Team project. I developed two modules:

  • K-Means, which groups observations by their features, without predefined labels, to reveal defect families. It is not a supervised classifier.
  • The Markov Decision Process (MDP), which models sorting as a decision under uncertainty (states, actions, transition probabilities, rewards). I implemented its resolution with Value Iteration and Policy Iteration to derive a sorting policy.

Classification, interface and pipeline integration were handled by the rest of the team.

05 / FEATURES

Features

  • Images are preprocessed and their visual features extracted (team).
  • Supervised classification is planned, with a Naive Bayes baseline and a CNN (team).
  • K-Means groups observations into interpretable defect profiles.
  • The MDP compares possible actions: accept, redirect or hold for manual inspection.
  • Value Iteration and Policy Iteration each compute a policy, allowing the two methods to be compared.
  • The project also analyses data bias and the social impact of automation.
06 / ARCHITECTURE

Architecture

A fruit image is first converted into usable features. Classification indicates the likely defect type, while K-Means places the observation in a group of similar profiles. This information defines the fruit's state in the MDP. From the defined transitions and rewards, Value Iteration and Policy Iteration compute the most beneficial action for each state, which becomes the sorting recommendation.

IMG-BANANA-03 · ARCHITECTURE

BananaVision — overall architecture

Step 01 / 07 · Paused

Images are preprocessed (team).

01 · INPUT02 · PERCEPTION03 · ANALYSIS04 · MODEL05 · SOLVING06 · OUTPUTImages / observationsFRUITSPreprocessingFEATURESSupervised classificationIN PROJECT BRIEFK-MeansCLUSTERSMDP modelSTATES · ACTIONS · REWARDSValue IterationVALUESPolicy IterationPOLICYSorting guidance✓ ACCEPT · REDIRECT · HOLD
Paused8 nodes · 9 links · Hover a node
  • Actor / entity
  • Team module
  • My contribution
  • Outcome
Hover or select a component to see its role and connections.
Elements in blue are my personal contribution; the rest was built by the project team.
07 / STACK

Stack

Python, pandas, NumPy, scikit-learn.

To verify: exact module libraries. MobileNetV2 and EfficientNet-B0 are project-brief recommendations, not confirmed trained models.

08 / BENEFITS

Benefits

  • Sorting decisions rely on an explicit model rather than individual judgement alone.
  • Defect families emerge from the data, without prior labelling.
  • The cost of each sorting error is built into the recommendation.
  • The approach accounts for uncertainty and the human impact of automation.
EDITORIAL NOTE

This case study distinguishes the overall project scope from my personal contribution. No undocumented result or metric is presented.