ParityLens: Preprocessing Parity Debugger

Streamlit
application badge
Created by team NeuralFoundry on September 27, 2026

Computer-vision pipelines often fail in a subtle way: the final tensor can have the correct shape and dtype, while its semantic content is wrong. A channel-order change, missing scaling step, or incorrect normalization can silently alter what the model receives, and simple structural checks may still pass. ParityLens is a developer tool for finding exactly where that preprocessing drift begins. It runs a trusted reference pipeline and a candidate serving pipeline side by side, records their outputs at five boundaries: decode, geometry, scaling, normalization, and model input, and stops at the first comparable stage where parity fails. The interface then shows the actual values, shapes, dtypes, maximum difference, source location, and defect classification. Our main demo preserves a real historical RGB/BGR bug. The reference and candidate both pass shape and dtype checks, but ParityLens detects the first semantic mismatch at decode. The recorded probe changes from [180, 120, 20] to [20, 120, 180], exposing the red/blue channel swap. IBM Bob then diagnosed the issue and produced the minimal BGR-to-RGB repair. The repaired candidate is verified again with the same frozen contract, comparator, verifier, and fixtures. ParityLens is designed for computer-vision and ML engineers moving code from experiments to serving, refactoring preprocessing code, migrating frameworks, or comparing edge and cloud pipelines. Users open the live Streamlit app, reproduce the historical bug, inspect the first failing boundary, verify the Bob repair, and explore controlled scaling and normalization failure cases. What makes ParityLens different is the combination of first-boundary localization, numerical evidence, preserved before/after provenance, and verification under unchanged checks. In our deterministic synthetic evaluation, ParityLens detected 45/45 supported defects, localized all 45 first failing boundaries, and produced 0/15 false positives on clean controls. A final shape/dtype-only baseline detected 0/45 of those defective cases. The current prototype is intentionally narrow and honest: it uses synthetic, contract-constrained inputs and does not claim production-wide coverage. Its purpose is to make hidden preprocessing mismatches inspectable, reproducible, and easier to repair.

Category tags: