Skip to content

Lossy Compression Profile

Declared loss-and-fidelity contract — instantiates Round-Trip Code Alignment

Declares in advance which distinctions a lossy encoding is allowed to throw away and which must survive the round trip, turning "good enough" into a measurable fidelity contract.

When a round trip is intentionally lossy — the decoded form is never meant to equal the original bit-for-bit — the danger is not corruption but silent, unbudgeted loss: a distinction the sender assumed would survive quietly vanishes. A Lossy Compression Profile is the declared contract that closes that gap. Ahead of any encoding, it names the distinctions that must return intact (the fidelity invariants), states how much of everything else may be discarded (the loss budget), and fixes the metric by which "still faithful enough" is judged. Its defining move — the one that separates it from every sibling — is that it treats loss as a decision made up front and written down, not a side effect of whichever codec someone happened to pick. It does not detect damage after the fact, nor test that a round trip held; it specifies, in advance, what a faithful round trip is even allowed to mean.

Example

A hospital's radiology archive must store years of imaging cheaply, so it adopts lossy compression — but not blindly. Before turning anything on, the department writes a Lossy Compression Profile. For chest CT it declares the invariant that diagnostically relevant structures must remain distinguishable to a reading radiologist, budgets loss to roughly a 10:1 ratio, and specifies that fidelity is judged not by raw pixel error but by whether findings stay detectable — a diagnostically lossless standard.[1] For mammography, whose fine microcalcifications are exactly the sort of distinction aggressive compression erodes, the profile forbids lossy encoding altogether.

The profile is stored alongside the images (real archives use standards like DICOM and JPEG 2000 to carry such parameters), so a clinician opening a scan five years later knows precisely what was preserved and what was budgeted away — and the archival pipeline that does the encoding has an explicit target it must satisfy, rather than a vague instruction to "compress a lot."

How it works

The profile is built by interrogating the consumer's task, not the codec:

  • Enumerate and classify distinctions. Walk the content and sort each kind of distinction into "must survive" (an invariant) or "discardable within budget."
  • Pick a fidelity metric that tracks the task. Choose how "survived" is measured — and prefer a metric tied to what the content is for (can the finding still be read?) over one that merely looks tidy (pixel-level error).
  • Set the budget as a bound on that metric, per content class if classes differ, and state the conditions under which lossy is disallowed entirely.
  • Publish it as the codec's contract. The profile governs the encoder; any codec chosen must be shown to meet it, never the reverse.

Tuning parameters

  • fidelity metric — pixel-level error vs. perceptual similarity vs. task-based detectability. Task-based metrics are the most meaningful and the hardest to measure; a cheap proxy can look reassuring while missing what matters.
  • loss-budget tightness — how much degradation is permitted. Tighter protects fidelity but surrenders the storage or bandwidth savings that motivated compression.
  • invariant granularity — a blanket rule vs. per-region or per-field carve-outs (protect a region of interest, drop the margins). Finer control fits the content better but costs specification effort.
  • per-class profiles — one profile for everything vs. distinct profiles per content class. More classes fit each better; each adds governance.
  • audit hook — whether the profile merely declares the contract or also mandates sampling to confirm the encoder met it. Adds assurance, costs pipeline work.

When it helps, and when it misleads

Its strength is that it converts loss from an accident into a governed choice: downstream consumers can trust exactly what survived, and "silent lossy" surprises — the field nobody noticed was gone — are designed out.

Its central failure mode is the metric–task gap: a fidelity metric that looks satisfied while the distinction the consumer actually needed has been quietly erased, so the contract certifies a fidelity that isn't there. The invariant list is also only as good as the foresight that wrote it — an unanticipated distinction falls straight through the budget. The classic misuse is writing the profile after an aggressive codec has been chosen, to retroactively bless the loss already baked in rather than to constrain it. The discipline that guards against this is to derive the invariants from the consumer's task, validate the metric against that same task, and keep the profile governing the codec instead of trailing it.

How it implements the components

  • loss_budget — the profile is the budget: the explicit, quantified bound on how much may be discarded, per content class.
  • compression_policy — it states the governing policy the encoder must obey — what may be dropped, under what conditions, and where lossy is forbidden.
  • fidelity_invariants — it names the distinctions that must survive and the metric that certifies they did.

It does not implement the encode/decode machinery itself (encoder_function, decoder_function) — that is the Parser/Emitter Pair and Codec Specification — nor after-the-fact integrity detection (error_detection_layer, Checksum or Hash Validation) or the tests that confirm the invariants held (round_trip_test_set, Round-Trip Property Test).

  • Instantiates: Round-Trip Code Alignment — it supplies the fidelity contract the whole lossy round trip is measured against.
  • Sibling mechanisms: Codec Specification · Round-Trip Property Test · Compatibility Matrix · Checksum or Hash Validation · Schema Registry · Canonicalization Rule · Decode Error Taxonomy · Golden Test Vectors · Migration Adapter · Parser/Emitter Pair · Version Negotiation Handshake

Notes

A lossy profile makes the round trip deliberately non-identity, which trips up the obvious test: a naïve decode-equals-original check will "fail" by design. Whatever verifies this round trip must check the profile's declared invariants, not bit-equality — the profile is what tells the Round-Trip Property Test what "faithful" means here.

References

[1] Diagnostically lossless (a.k.a. visually lossless) is the real distinction in medical imaging between compression that is mathematically exact and compression that merely preserves all clinically relevant information. It is the canonical case of a fidelity metric defined by the consumer's task rather than by bit-identity, which is why the profile leads with it.