image-classification Β· basics 4Γ—4 Occlusion Map Β· 16 live passes WASM q8 Β· 29.54 MB License: Apache-2.0

Inside ConvNeXt V2: Occlusion Sensitivity Heatmap & Crop Scale

Because ConvNeXt V2 runs in ~221 ms on CPU WASM, we can probe its spatial 7Γ—7 receptive fields directly: slide a 56Γ—56 occlusion patch across a 4Γ—4 grid (16 real forward passes), measure how much the top-1 ImageNet-1k probability drops at each cell, and compare crop_pct: 0.875 center framing against full-frame and tight 60% crops.

1 Β· Live 4Γ—4 sliding-patch occlusion heatmap

Pick a starter photo or upload/drop/paste your own. Each pass masks one 56Γ—56 spatial cell of the 224Γ—224 input and re-runs ConvNeXt V2 Tiny to measure which regions drive its top-1 decision.

Initialising model loader…

Low impact Critical patch (large score drop)

Click any cell after running to inspect that masked pass.

Target class–
Baseline score–
Peak patch drop–
Label flips (of 16)–
Mean pass ms–
NaN / invalid0

Selected cell details appear here after running.

4Γ—4 patch sensitivity ranking (sorted by target-class probability drop)
Cell 56Γ—56 region Occluded score Score drop Occluded Top-1 Inspect
Run the 4Γ—4 occlusion sweep to populate patch sensitivity scores.

2 Β· Center-crop vs full-frame aspect scale comparison

ConvNextImageProcessor crops the central 87.5% square before resizing to 224Γ—224. Compare what happens when ConvNeXt V2 sees that default center crop, the uncropped full frame, or a tight 60% crop.

Run the crop comparison (or run the occlusion sweep) to compare all three scales.

See inside the code

Show the code β€” convnext-core.mjs: computeOcclusionGrid() & computeOcclusionSaliency()
Show the code β€” convnext-core.mjs: computeFramingModes() (87.5% center vs full-frame vs 60%)
Show the code β€” worker.js: classifyImage() (off-main-thread allScores classification)

References