← Image Processing for EveryoneToolsInVisionLearning Center
Compression and Storage · Lesson 71

Choose Quality for the Downstream Task

A model trained on original images receives compressed copies.

Read the full lesson and open its transcript below. A narrated video will be added after production.

Lesson overview

What you will learn

A model trained on original images receives compressed copies.

  1. A practical question
  2. The useful idea
  3. Work through the example
  4. Limits and next step
01

A practical question

The inspection model was trained on clean masters, but the production camera now sends smaller compressed copies. The pictures look acceptable to a person. Does the model still find tiny scratches? We have to measure that, not assume it.

02

The useful idea

Build a held-out collection with confirmed defects and clean parts. Run the same model on original images and on each proposed compressed version. Compare defect recall, false alarms, and the kinds of marks it misses. A high average visual similarity can conceal a small but important scratch that vanished in one block.

03

Work through the example

Also compare file size and delivery time, because those are the reasons we're considering compression. If one setting saves little space but harms defect recall, it is a poor trade. Use the same source images and annotations across settings; otherwise changes in the sample can masquerade as compression effects. A tiny defect can be visible to an inspector but lost after compression. Run the same held-out detection set using untouched and compressed versions, with the detector otherwise fixed. Compare missed defects as well as a summary score. A smaller file is worthwhile only if the downstream decision still meets its requirements. Keep hard examples separate from tuning so the quality setting is chosen on evidence and tested honestly. Now check the idea on a concrete example: Compare detection recall on original and compressed validation images. A possible trap is worth naming: A visually acceptable copy can still erase the small feature the task needs. The answer follows from that evidence: Choose compression by testing the downstream task, not file size alone. Run the same detector on original and compressed validation images. List which fine defects are newly missed, not only the average score. That tells you whether the storage saving affects the actual decision.

04

Limits and next step

Record the selected encoder settings and validation results. Next, we'll make sure the original and every processing decision remain available for someone to inspect later.

Worked example

Compare detection recall on original and compressed validation images.

Knowledge check

Quick check: test your understanding

Try it yourself: Consider this case: Compare detection recall on original and compressed validation images. Explain how you would check the result. In your answer, address this limitation: A visually acceptable copy can still erase the small feature the task needs.

Check the reasoning

Choose compression by testing the downstream task, not file size alone. A visually acceptable copy can still erase the small feature the task needs.

What is the main idea behind choose quality for the downstream task?

Choose compression by testing the downstream task, not file size alone.

How is it used in the example?

Compare detection recall on original and compressed validation images.

What limitation should be checked?

A visually acceptable copy can still erase the small feature the task needs.

Further reading

Digital Image Processing, 4th edition — Rafael C. Gonzalez and Richard E. Woods.

Original ToolsInVision teaching examples. Editorial approach · Suggest a correction

Accessible referenceLesson 71 transcript320 words · Narration ready for the upcoming videoOpen transcript

The inspection model was trained on clean masters, but the production camera now sends smaller compressed copies. The pictures look acceptable to a person. Does the model still find tiny scratches? We have to measure that, not assume it.

Build a held-out collection with confirmed defects and clean parts. Run the same model on original images and on each proposed compressed version. Compare defect recall, false alarms, and the kinds of marks it misses. A high average visual similarity can conceal a small but important scratch that vanished in one block.

Also compare file size and delivery time, because those are the reasons we're considering compression. If one setting saves little space but harms defect recall, it is a poor trade. Use the same source images and annotations across settings; otherwise changes in the sample can masquerade as compression effects. A tiny defect can be visible to an inspector but lost after compression. Run the same held-out detection set using untouched and compressed versions, with the detector otherwise fixed. Compare missed defects as well as a summary score. A smaller file is worthwhile only if the downstream decision still meets its requirements. Keep hard examples separate from tuning so the quality setting is chosen on evidence and tested honestly. Now check the idea on a concrete example: Compare detection recall on original and compressed validation images. A possible trap is worth naming: A visually acceptable copy can still erase the small feature the task needs. The answer follows from that evidence: Choose compression by testing the downstream task, not file size alone. Run the same detector on original and compressed validation images. List which fine defects are newly missed, not only the average score. That tells you whether the storage saving affects the actual decision.

Record the selected encoder settings and validation results. Next, we'll make sure the original and every processing decision remain available for someone to inspect later.