Yellow Leaves, Seven Suspects: How PlantLab Got Specific About Nutrient Deficiencies
The Short Version
PlantLab now runs a specialist model after detecting any nutrient issue. Instead of “nutrient deficiency,” the API returns “potassium deficiency” or “magnesium deficiency” or whichever of the seven it actually is. Tested and validated at 99.5% accuracy on 14,182 real-world images it has not seen before. Same API, same JSON shape – no changes required on your end.
The Problem With “Nutrient Deficiency”
Ask any experienced grower what's wrong with a yellow cannabis leaf and you'll get a look that says: it depends.
Yellow leaf edges? Could be potassium deficiency. Or magnesium deficiency. Or potassium deficiency causing secondary magnesium lockout. Or nitrogen toxicity making an unexpected debut as interveinal chlorosis. Or pH off by half a point, causing any of the above at once.
The standard advice at this point is: “Add CalMag and see what happens.” Sometimes that's right. Sometimes it makes things worse. Sometimes it's right for the wrong reasons.
PlantLab's Stage 2 model was already good at detecting that a nutrient problem was present – 99%+ accuracy across all 31 conditions. But “nutrient deficiency” as a diagnosis is only half the answer. Potassium deficiency and magnesium deficiency are treated differently. Nitrogen deficiency and nitrogen toxicity are treated opposite to each other. The generic classification was accurate. It just wasn't useful enough.
What the Subclassifier Does
The new nutrient subclassifier is a second-pass specialist that runs only when Stage 2 detects a nutrient condition. Its job is narrow: take the image that triggered a nutrient flag and determine which specific nutrient is responsible.
It was trained on 200,000 images, selected specifically to represent the hard cases – the pairs of conditions that look the most alike under the camera. Not a bigger version of Stage 2. A focused model with a focused problem.
The Seven Classes
The subclassifier currently handles:
![]() |
![]() |
| Calcium deficiency — upper leaf distortion, brown spots with yellow halos, new growth first | Iron deficiency — interveinal chlorosis on young leaves; veins stay green while tissue yellows |
![]() |
![]() |
| Magnesium deficiency — interveinal chlorosis on older leaves; mobile nutrient, progresses bottom-up | Nitrogen deficiency — uniform pale yellowing from lower leaves upward; oldest growth first |
![]() |
![]() |
| Nitrogen toxicity — dark blue-green, claw-shaped tips curling down; not a deficiency, the opposite | Phosphorus deficiency — purple-red discoloration on undersides and stems, common in cold or early veg |
![]() |
|
| Potassium deficiency — brown, crispy scorched edges at leaf margins; progresses inward |
These are the seven classes that generated the most diagnostic confusion in Stage 2. They share enough visual features that a generalist model regularly gets them wrong – not randomly, but in consistent patterns.
The Confusion Pairs
The specific pairs that Stage 2 was systematically mixing up:
K ↔ Mg – Both show yellowing that progresses from lower leaves, affecting older growth. Leaf margins vs. interveinal chlorosis is the tell, but early presentations overlap.
K ↔ N – Potassium deficiency causing tip burn and nitrogen deficiency causing general yellowing both start at the bottom of the plant.
Mg ↔ N – Both are mobile nutrients that deplete oldest tissue first. The yellowing progression is similar; the pattern of which tissue goes first is what separates them.
Mg ↔ Fe – Interveinal chlorosis is the signature symptom of both. The difference is which leaves are affected (new growth for iron, old growth for magnesium), but this requires accurate growth stage context.
N deficiency ↔ N toxicity – One is too little, one is too much. The visual signatures are distinct to an experienced grower but genuinely confusing for a model trained to see both ends of the spectrum.
These aren't edge cases. They're the day-to-day diagnostic mistakes that cause growers to add CalMag to a potassium deficiency, or flush a nitrogen toxicity that needed nothing but time.
Validation
The model was validated on 14,182 real-world nutrient images – photos from actual grows, not controlled test conditions. And these are new-to-the-model photos – it has not seen them before.
- Balanced accuracy: 99.5%
- Per-class F1: All seven classes above 99.8%
- Cross-nutrient confusions: Reduced to 0.058%
For comparison, Stage 2 alone on those same 14,182 images had a 93% higher cross-nutrient error rate. The subclassifier resolves 93% of Stage 2's nutrient misclassifications.
What Changes in the API
Nothing in the request or response shape changes. Stage 2 already returns specific nutrient names — potassium_deficiency, magnesium_deficiency, and so on. What changes is how often those names are correct.
The subclassifier runs as a second pass after Stage 2 flags a nutrient condition. If it disagrees with Stage 2's classification, it overrides it. Same field, more accurate value.
To make this concrete: a plant with potassium deficiency might have previously come back as:
{
"conditions": [
{
"condition": "magnesium_deficiency",
"confidence": 0.78,
"severity": "moderate"
}
]
}
With the subclassifier in the pipeline, that same image now returns:
{
"conditions": [
{
"condition": "potassium_deficiency",
"confidence": 0.97,
"severity": "moderate"
}
]
}
No schema changes required. If your automation is already acting on nutrient condition names, it will automatically benefit from the correction.
What's Not in It Yet
Three nutrient conditions remain handled by Stage 2 only: zinc deficiency, manganese deficiency, and boron deficiency. The reason is simple – not enough quality training data to build a reliable specialist for these yet. Including them with insufficient data would reduce the accuracy of the classes that are in the model.
These will be added when the training data exists to support them.
What's Next
The nutrient subclassifier is the first piece of the reasoning layer – a set of specialist models that run after Stage 2 to provide higher-resolution diagnoses on the conditions that benefit most from it.
The broader vision: a pipeline that doesn't just tell you what's wrong, but narrows it down to the point where the corrective action is unambiguous. Potassium deficiency doesn't leave you wondering whether to add CalMag or check your VPD. It tells you what to add and how much – if the context supports it.
More on that as it ships.
PlantLab is free to try at plantlab.ai. API documentation is available for growers building automation.
Related reading: – Nitrogen Deficiency in Cannabis: A Visual Guide – Detailed identification and treatment for the most common nutrient deficiency – How PlantLab's AI Diagnoses 31 Cannabis Plant Problems in 18 Milliseconds – The full 4-stage pipeline – Why I Built PlantLab – The origin story






