Post-training W4A4 for camouflaged object detection
COD–TDQ
When W4A4 Breaks Camouflaged Object Detection
Token-Group Dual-Constraint Activation Quantization
4-bit weights are not the breaking point. 4-bit activations are. COD-TDQ isolates the token-local failure and preserves the weak boundary evidence that camouflage detectors need.
1 Nankai University · 2 Tianjin University of Technology · 3 A*STAR · 4 AAIS, Nankai University · 5 Nankai International Advanced Research Institute, Shenzhen Futian
The mask does not merely soften—it nearly disappears. COD-TDQ restores the signal without retraining.
01 / THE FAILURE
W4A4 is not a gentle degradation.
Holding 8-bit activations nearly preserves FP32 accuracy. Moving activations to 4 bits causes a task-specific cliff.
Weights can go to 4 bits while the mask survives. The cliff appears when activations do.
Across all four CFRN datasets, naive W4A8 averages 0.8776 Sα, close to FP32 at 0.8864. Naive W4A4 falls to 0.4448. This isolates activation precision as the dominant failure factor.
WHY DOES W4A4 BREAK COD?
A shared range silences the signal COD needs most.
Follow the failure from a background spike to a missing boundary.
Heavy-tailed background
A few background tokens carry extreme activation spikes.
Shared-range domination
The outlier dictates one clipping radius c for every token.
Coarse 4-bit step
The wider range inflates Δ = c / 7 for every token.
Boundary falls to zero
Responses inside |x| ≤ Δ/2 are rounded to exactly zero.
02 / COD-TDQ
Localize the range. Then constrain it.
COD-TDQ is a purely post-training, token-local activation quantizer. Its two components solve different parts of the same collapse loop—and only their combination consistently restores COD masks.
SHARED RANGE
one background token sets Δ for allW4A4
weak structure remains signedREMOVE CROSS-TOKEN COUPLING
Direct-Sum Token-Group
DSTG partitions each token vector into fixed-size channel groups and gives every group its own activation range. A heavy-tailed background group can no longer dictate the resolution used by unrelated boundary groups.
KEEP EACH GROUP STABLE
Dual-Constraint Range Projection
DSTG removes interference between groups, but a single group can still be heavy-tailed. DCRP projects its clipping radius against two explicit stability bounds.
ηk = Δk / σk ≤ τBound step size relative to group dispersion.
ρ0,k ≤ zrBound the fraction that collapses into zero.
03 / MECHANISM EVIDENCE
The diagnostics move in the predicted direction.
Two paper figures test the mechanism directly: DSTG reduces scale interference and boundary zeroing; DCRP reduces violations of both stability bounds.
04 / QUANTITATIVE RESULTS
Recovery holds across models and datasets.
All rows below use the paper's common evaluation pipeline. COD-TDQ and PTQ baselines are W4A4; FP32 is shown as a reference. Sα is higher-better, MAE is lower-better.
| Method | CAMO | CHAMELEON | COD10K | NC4K | ||||
|---|---|---|---|---|---|---|---|---|
| Sα | MAE | Sα | MAE | Sα | MAE | Sα | MAE | |
| FP32 reference | .876 | .042 | .912 | .019 | .870 | .022 | .888 | .030 |
| Naive W4A4 | .418 | .182 | .447 | .141 | .471 | .093 | .443 | .151 |
| RepQ-ViT strongest Sα baseline | .676 | .099 | .701 | .067 | .676 | .062 | .718 | .072 |
| COD-TDQ | .813 | .070 | .862 | .040 | .802 | .038 | .837 | .052 |
COD-TDQ improves Sα by 11.8–16.1 points over the strongest CFRN W4A4 baseline on each dataset. Full five-metric results and all baselines are in the paper.
| Method | CAMO | CHAMELEON | COD10K | NC4K | ||||
|---|---|---|---|---|---|---|---|---|
| Sα | MAE | Sα | MAE | Sα | MAE | Sα | MAE | |
| FP32 reference | .8755 | .0408 | .8985 | .0226 | .8734 | .0204 | .8929 | .0278 |
| Naive W4A4 | .4680 | .1687 | .4505 | .1400 | .5455 | .0808 | .5762 | .1201 |
| RepQ-ViT strong baseline | .7707 | .0786 | .8006 | .0467 | .7755 | .0422 | .8182 | .0515 |
| COD-TDQ | .8528 | .0502 | .8899 | .0234 | .8539 | .0245 | .8813 | .0312 |
COD-TDQ restores ESCNet to near-FP32 W4A4 accuracy on all four benchmarks; numbers are reported at full precision in supplementary Table S2.
COMPONENT CHECK · NC4K
Neither component tells the whole story alone.
On CFRN, local ranges alone remain vulnerable to heavy tails inside each group; projection alone cannot remove cross-token coupling everywhere. Together they recover the mask.
05 / QUALITATIVE RESULTS
What the numbers mean: the object comes back.
Weak contours, textured backgrounds, and low-contrast regions expose the failure most clearly. COD-TDQ tracks FP32 structure where naive W4A4 becomes fragmented or nearly blank.
06 / MEASURED DEPLOYMENT
Accuracy recovery does not erase the low-bit gain.
The paper benchmarks end-to-end CFRN inference on one NVIDIA RTX 4090 at 384 × 384, batch size 4, using the released Triton-based quantized path.
1.50× vs. FP32
FP32: 775.40 MB
FP32: 1421.31 MB
| Method | Weight / artifact ↓ | FPS ↑ | Latency ↓ | Peak memory ↓ |
|---|---|---|---|---|
| FP32 | 775.40 MB | 29.40 | 34.02 ms/img | 1421.31 MB |
| Naive W4A4 | 108.30 MB | 43.95 | 22.75 ms/img | 843.30 MB |
| RepQ-ViT | 108.15 MB | 44.18 | 22.64 ms/img | 844.67 MB |
| COD-TDQ | 108.19 MB | 44.21 | 22.61 ms/img | 834.92 MB |
07 / ABSTRACT
The paper, in brief.
Camouflaged object detection depends on evidence that aggressive activation quantization is unusually likely to erase.
COD-TDQ diagnoses a task-specific W4A4 cliff: heavy-tailed background tokens dominate a shared activation range, enlarge the quantization step, and push weak but structured boundary cues into the zero bin. Direct-Sum Token-Group scaling removes cross-token range domination; Dual-Constraint Range Projection bounds the step-to-dispersion ratio and zero-bin mass within each group. Across CAMO, CHAMELEON, COD10K, and NC4K with CFRN and ESCNet, the method improves W4A4 accuracy without retraining.
08 / CITATION & RESOURCES
Build on COD-TDQ.
Paper, code, datasets, released FP32 and quantized checkpoints, plus Chinese documentation are publicly linked below.
@inproceedings{li2026codtdq,
title={When W4A4 Breaks Camouflaged Object Detection:
Token-Group Dual-Constraint Activation Quantization},
author={Li, Tianqi and Fang, Wenyu and He, Xin and
Geng, Xue and Cheng, Xu and Liu, Yun},
booktitle={Proceedings of the European Conference
on Computer Vision},
year={2026}
}