How Good and Bad Image Data Decide What Computer Vision Algorithms Learn

Please share to show your support


We took the leaf cluster and taught a machine two different lies about it.

A small cluster of Burning Bush leaves, several blades folded together at one stem, picked in July with part of it still green and part of it turned deep red, became our entire dataset. (A dataset is just the collection of examples an AI learns from. Ours was small on purpose: this one cluster of leaves.) We photographed it once in good daylight and once in dim indoor light, then used those two real photos to train and test a model. In good light the model saw a cluster that was 75 percent red. Fed the dim-light photo, the very same model reported 11 percent red, and it caught only 12 percent of the area that was truly red. Same leaves. Same veins. The only thing that changed was the quality of the picture we handed the machine.

This is the most important and least glamorous truth in artificial intelligence. Computer vision algorithms do not learn the world. They learn your data. If the data is good, the model looks smart. If the data is bad, the model is confidently wrong, and it will never tell you which. This article shows exactly how much damage bad image data does, measures it with the number that matters most, and tests whether the damage can be undone.

Note : This is a small cluster of two to three individual leaf blades folded together at one stem, not a single simple leaf. The distinction does not change the experiment. The same physical cluster was photographed twice under two different lighting conditions, with nothing moved, added, or removed in between, so the core comparison, good data against bad data on one unchanging object, still holds exactly as designed.

Why Data Quality, Not Model Size, Sets the Ceiling for Computer Vision Algorithms

There is a common belief in AI that a bigger or newer model will fix a system that is not working. Usually it will not. In real projects, the quality of the training pictures sets a hard limit on how good the results can be, and no amount of clever engineering lifts you past that limit. People call this “garbage in, garbage out.” It is easy to say and hard to truly feel until you watch it happen to the exact same object.

That is why we held the leaf cluster perfectly still and changed only the light. In a normal dataset you can never separate the object from the way it was photographed, because every picture is different in both ways at once. Our frozen specimen removes that confusion. It lets us change one thing, the quality of the photo, and watch what the machine does.

Background

Computer vision algorithms are increasingly trusted to read the physical world from photographs, from tracking how leaves change color through a season to spotting flaws on a production line. But these systems never see the object directly. They see light bouncing off it, and light is never constant. This raises a question every practitioner faces but rarely gets to test cleanly: how much does the quality of the image itself, separate from the object, decide what the model learns and how accurate it can be?

Core problem

When the same physical object is captured under different lighting, the pictures carry different information even though the object has not changed. Good light (direct daylight) records strong contrast, rich color, and sharp edges. Poor light (dim indoor light) lowers contrast, drains color, and adds gentle shadows that blur real boundaries and can invent false ones. A model trained or tested on these different-quality images may therefore report different results for the identical object, introducing measurement bias that has nothing to do with the object and everything to do with the data.

Objective and key questions

To measure, on a single unchanging specimen, how image data quality drives the accuracy of computer vision algorithms, by answering three questions.

  • First, how far apart are the measurable features (color richness, red-area share, edge sharpness) between good-quality and bad-quality captures of the same object?
  • Second, if these images were training and testing data, how badly would the poor-quality version mislead a model, measured by recall, the share of the truly red area the model actually catches?
  • Third, can mixing bad data into training recover the lost accuracy, and if so, how completely?

Hypothesis

Poor-quality image data will cause the model to badly under-report the color transition and to miss most of the truly red area, collapsing recall while overall accuracy still looks acceptable. We further expect that adding bad data to the training set will recover much, but not all, of the lost accuracy, because some color information is destroyed at capture and cannot be reconstructed. If both hold, the conclusion is that data quality, not model size, is the true bottleneck, and that good technique lets bad data approach good data without ever fully matching it.

The images that we compared.

What Good and Bad Data Look Like to Computer Vision Algorithms

The good photo is the leaf cluster in daylight, against a plain background. Strong contrast, rich color, sharp edges, an honest record of what the leaf actually looks like. Measured inside the leaf, color richness (saturation, on a 0 to 255 scale) reads 225.8, and the LAB color system’s a* value, (The a* value is one channel from a color system called LAB, also written CIELAB, It’s a way of describing color that splits every pixel into three separate numbers) a single number that runs from green through neutral to red, averages 22.8, solidly on the red side.

The bad photo is the same leaf cluster, photographed separately in a dim room against a dark wood background. Measured inside the leaf, saturation drops to 91.5, and the mean a* value falls to just 6.2, barely past neutral. This is a real photograph of real indoor light, not a simulation.

Nothing was edited, degraded, or artificially adjusted. Two honest photos of one leaf, taken under two real conditions. Also read on Computer Vision Algorithms at https://www.geeksforgeeks.org/computer-vision/computer-vision-algorithms/

The Method: How We Tested the Computer Vision Algorithms, and Why

Alignment check

The alignment problem, and how we solved it.

Our two real photos differ in more than lighting. They were shot in separate sessions, against different backgrounds, at different distances, with the leaf sitting at a different angle in each frame. That meant we could not simply compare the same pixel position across both photos, because that position might land on the leaf in one photo and on the background in the other.

We solved this by aligning the two photos before any comparison, warping the indoor photo so the same physical point on the leaf lines up with the daylight photo. Our first attempt used a standard technique, matching small distinctive visual points between the two images. It failed: the dim indoor photo carries too little visual detail for that method to find reliable matches, and it distorted the leaf’s size by nearly double. We switched to aligning by the leaf’s own outline instead, its center, tilt, and size, which only needs the leaf’s silhouette rather than fine texture, and worked well. The final alignment overlap scored 0.905 out of a possible 1.0, which we treat as solid and trustworthy.

Labeling. We labeled the cluster’s true state once, only from the good daylight photo, into three groups: green, transitioning, and red. Those labels are the ground truth, the leaf’s real condition, and they never change. We only kept leaf pixels where both photos overlapped after alignment, so every labeled pixel had a valid, corresponding partner in both images.

The model. In the companion notebook, the model is a small neural network called MobileNetV2, using a shortcut called transfer learning: starting from a network already trained on millions of everyday photos and teaching it only the last small piece it needs for our leaf task. This is the smart move when we have little data, because the network already understands basic shapes, edges, and colors. To get fully checked numbers for this article, we ran the identical three-part test with a simpler, faster method called a Random Forest, which reaches the same conclusion. The lesson does not depend on which model we pick. It depends on the data, which is exactly the point.

The measure: recall. Plain accuracy can hide the failure we care about, so we lead with a number called recall. Recall answers one blunt question: out of all the leaf that is truly red, how much did the model actually catch? A model that misses most of the red can still score a decent accuracy, simply because it got the green parts right. Recall does not let that slide. It counts the misses.

Open Note: Only the Random Forest half of that comparison has actually been run and independently verified. The MobileNetV2 path exists, ready to run, inside the accompanying notebook, but its results have not yet been executed or confirmed. Until that step is completed, the article’s claim that the finding holds regardless of model choice rests on reasoning about how the two models should behave, not on a second, independently verified result.

What the Numbers Showed

We trained and tested three ways, using the two real photos throughout.The results are dramatic.

Leaf data
image 28

And the full breakdown by class, since red is not the only story:

image 29

Test one, real daylight on both sides. Recall is nearly perfect, and the reported red area, 75.5 percent, sits right on the true value. This is the ceiling. A model trained and tested on clean pictures does exactly what you hoped.

Test two, trained on real daylight, tested on the real indoor photo.

picture trained in daylight. Model learning. computer vision

This is what happens when you build a model on clean, well-lit pictures and then point it at a real, ordinary dim room. Red recall does not just drop, it nearly disappears, falling from 1.00 to 0.12. The model now catches only about one in eight of the truly red pixels and reports the leaf as 11 percent red instead of 75. Look at the transitioning column: recall there is still a deceptively healthy 0.83. A model that looked mostly fine on an averaged score has, in fact, almost completely stopped detecting the one thing that mattered most.

Test three, trained on both real photos together, tested on the real indoor photo.

This picture shows what the model decided for every part of the leaf once it had learned from both lighting conditions, not just one. The leaf’s outline is filled with flat colors representing the model’s verdict for each spot: red means the model called that area “fully turned,” yellow means “still transitioning,” and green means “still green.” No photograph shows through underneath, this is a pure result map on a plain background, showing only the model’s decisions.

Earlier, when the model had only ever seen the bright daylight photo during training, it failed badly on the dim indoor photo. Most of the leaf came out yellow and green in that test, because the model didn’t recognize the faded, dim-light red for what it was and called it something else instead.

Here, everything changes. Once the model was also shown what red looks like under dim light during training, not just under daylight, red returns across nearly the entire leaf. Red recall, the share of truly red leaf area the model actually caught, jumped from 0.12 up to 0.96 simply by adding that one missing example into training.

The leaf itself never changed between these two tests. Its true condition stayed exactly the same throughout. Only the training data changed, and that alone was enough to flip the model’s answer from “barely any red” back to “mostly red,” now closely matching the true figure of 75.4 percent.

An Honest Limitation: What the Green Class Reveals

Look again at the full breakdown table. Green recall never recovered. It sits at 0.37 in both indoor tests, before and after mixing in bad data. That did not happen because of lighting. It happened because our alignment, while good at 0.905 overlap, is not perfect, and green is only 3.5 percent of the leaf, a thin sliver along one edge. A small misalignment that barely touches the large red and transitioning regions can meaningfully scramble a strip that thin.

We are reporting this openly rather than hiding it, because it demonstrates something important in its own right: a real-world experiment carries its own measurement noise on top of the effect you are trying to study. The red finding is large, consistent, and far bigger than any plausible alignment error, so we trust it fully. The green number is a limitation of our method, not a discovery about lighting, and a careful reader deserves to know the difference.

Can Computer Vision Algorithms Recover From Bad Data? The Honest Answer

You might think test three solves everything, that mixing in bad data makes the two conditions equal. It gets close, and that is the useful part, but the honest answer to whether they become truly identical is no.

The recovery worked only because we also gave the model good data and a correct answer key to learn from. Even then, macro recall reached only 0.67 against a ceiling of 0.99, and that gap traces to real trade-offs, not just alignment noise. Transitioning recall fell from 0.98 to 0.68 even as red recall climbed. Gains in one class came paired with losses in another. That gap is not a settings problem you can tune away.

Some of it is physical: when dim light drains the color from a photograph, part of that color information is gone before the camera ever records it, and no model can rebuild information that was never captured. You can teach a model to make smarter guesses about a faded red. You cannot make it recover a signal that no longer exists.

So the realistic promise is not that good technique makes bad data equal to clean data. It is that good technique lets bad data get close, while a real gap remains. Anyone who tells you that cleanup steps fully erase a data-quality problem is selling something physics does not allow.

Why This Matters for Every Computer Vision Algorithm, Not Just Leaves

Swap the leaf for anything a camera judges for a living. A tumor on a scan from a low-contrast machine. A defect on a factory line under flickering light. A person crossing the road at dusk. In each case the object is real and right there, but bad photo conditions quietly strip away the evidence of it before the AI even runs. The computer vision algorithms then report high confidence and low recall, and no error is ever raised.

This changes where you should spend your effort. Teams reach for a bigger model when the results disappoint, but our two real photos show the limit was set the moment each picture was taken. The work that pays off most is earlier, at the camera: collect pictures across the full range of real conditions, mix the ugly ones in instead of throwing them out, include a reference card so the software can correct the color, and check recall for each category so a crash in one group cannot hide behind a healthy average.

Good data is not the boring chore you finish before the interesting AI work begins. It is the AI work. Our camera saw one leaf and, depending only on the quality of the picture, taught the machine that it was mostly red or barely red at all. The leaf never changed. The data did, and the model believed whatever the data told it. Also read “Recall Value” at https://journals-times.com/2026/07/10/99-9-isnt-safe-why-recall-value-is-the-real-metric-for-safety-critical-ai/

Appendix:

The experiment runs free in Google Colab, using two real photographs of the same leaf: one in daylight, one in dim indoor light. Each photo is independently segmented with GrabCut, seeded by a central rectangle covering 84 percent of the frame. Because the two photos differ in background, distance, and leaf angle, they are aligned before comparison using the leaf silhouette’s center, orientation, and scale, found through principal component analysis on each segmentation mask, rather than through visual feature matching, which failed on the low-texture indoor photo.

Alignment quality is measured as the overlap (intersection over union) between the two leaf masks after warping; our run scored 0.905. Ground-truth labels are drawn once from the daylight photo using the LAB color system’s a* channel: green below 0, transitioning 0 to 15, red above 15, applied only to pixels where both photos overlap after alignment. Pixels are split into disjoint train and test halves.

The notebook model is MobileNetV2 via transfer learning; the verified metrics reported here use a Random Forest of 60 trees on LAB, HSV, and Laplacian-texture features, with the a* feature withheld so the model cannot trivially copy the labels. Recall is reported per class, with red recall as the headline metric and green recall flagged as sensitive to residual alignment error.

Check Code here

Please share to show your support

Leave a Reply

Up ↑

Discover more from E-JOURNAL TIMES MAGAZINE

Subscribe now to keep reading and get access to the full archive.

Continue reading