﻿# Clipping invalid generated boxes can conceal the original generator defect

A practical investigation of clipping invalid generated boxes can conceal the original generator defect, with explicit observations, control cases and evidence limits.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/field-synthetic-albumentations-input-clip-generator-defect-ledger/
Language: en

## The generated-data scenario

A detector-data generator occasionally places boxes outside the intended image or reverses their extents. Its augmentation adapter clips and filters inputs, then reports that all exported boxes are valid. That report describes surviving outputs, not generator correctness. The investigation asks whether repair and exclusion erased the evidence needed to locate a faulty placement rule and understand which examples disappeared.

## The generation mechanism

Albumentations documents preprocessing that can clip input boxes before optional invalid-box filtering, followed by transformations and further filtering. The inspected source likewise shows clipping before removal. Current documentation and the inspected source use differing names for some interface options, so pin the actual installed interface. The causal mechanism is the processing order, not an assumption that every spelling is interchangeable.

## Define the dataset contract

Define raw generated geometry, permitted repair, exclusion and final training geometry separately. Preserve stable box identities, class associations and rejection reasons. Decide which out-of-bounds values are expected from intentional partial visibility and which violate the scene-generation contract. A valid survivor must not silently replace the raw record in diagnostics, because it cannot explain the severity or frequency of original defects.

## A step-by-step protocol

Create fixtures for a valid box, intended partial visibility, reversed extents and a fully outside box. Capture geometry before entering augmentation, then observe clipping, removal and final output by identity. Verify associated class labels after filtering. Inspect the actual recorded options and package revision. Compare raw-defect counts with final acceptance counts instead of using only an exception-free export as the success condition.

## Evidence required for acceptance

Acceptance requires a lineage table from every input box to an accepted target or an explicit exclusion. Retain original extents and transformations so a reviewer can distinguish harmless boundary clipping from missing objects. Examine whether repaired examples changed the intended dataset composition. A final bounds check remains useful, but it cannot reconstruct boxes or class associations that preprocessing already discarded.

## Failure cases and limits

Permissive repair can be a deliberate dataset policy, especially for partially visible objects. This article does not require rejecting every box crossing an image edge. It requires making repair observable and matching the training target definition. Visibility thresholds, rotated boxes and later transformations need additional controls. No generator defect rate or detector improvement is claimed without an actual reviewed dataset and declared denominator.

## Primary references and related reading

Record pre-clipping box defects before a forgiving augmentation path repairs or removes them. [Albumentations box clipping and invalid filtering order](https://albumentations.ai/docs/api-reference/albumentations/core/bbox_utils/); [Albumentations box preprocessing implementation](https://raw.githubusercontent.com/albumentations-team/albumentations/main/albumentations/core/bbox_utils.py).

The proposed investigation of albumentations input clip generator defect ledger is a proposed dataset-contract review; no production dataset was generated or evaluated. Related reading: [Pillow EXIF orientation: transform image annotations with the pixels](/journal/data-guide-image-exif-box-coordinate/); [Dataset taxonomy migration: label IDs, SKOS mappings and changed class meaning](/journal/data-guide-label-taxonomy-version-mapping/).
