Post-training W4A4 for camouflaged object detection

CODTDQ

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.

Tianqi Li1 Wenyu Fang1 Xin He2 Xue Geng3 Xu Cheng2 Yun Liu1,4,5,*

1 Nankai University · 2 Tianjin University of Technology · 3 A*STAR · 4 AAIS, Nankai University · 5 Nankai International Advanced Research Institute, Shenzhen Futian

THE W4A4 CLIFFCFRN · NC4K · Sα
FP320.888
Naive W4A40.443
COD-TDQ0.837

The mask does not merely soften—it nearly disappears. COD-TDQ restores the signal without retraining.

41.6 → 14.2%zeroed boundary activations
+11.8–16.1 ptsSα over strongest CFRN W4A4 baselines
1.50×measured throughput vs. FP32
108.19 MBCFRN deployment artifact

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.

CFRN · NC4KPaper Table 1
FP32baseline
.888Sα
W8A8naive PTQ
.887Sα
W4A84-bit weights
.882Sα
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.

01

Heavy-tailed background

A few background tokens carry extreme activation spikes.

02

Shared-range domination

The outlier dictates one clipping radius c for every token.

03

Coarse 4-bit step

The wider range inflates Δ = c / 7 for every token.

04

Boundary falls to zero

Responses inside |x| ≤ Δ/2 are rounded to exactly zero.

Figure 1. On CFRN/NC4K, naive W4A4 widens the normalized clipping range, inflates Δ, and raises zero-bin mass ρ0; the target mask collapses with it.

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 all
01DSTGDirect-Sum Token-Group
02DCRPDual-Constraint Range Projection

W4A4

weak structure remains signed
01

REMOVE 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.

x = k xkgroup size g = 32 in all reported experiments
02

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.

C1

ηk = Δk / σk ≤ τBound step size relative to group dispersion.

C2

ρ0,k ≤ zrBound the fraction that collapses into zero.

Method overview. COD-TDQ applies token-group range selection before uniform signed W4A4 quantization. The projection uses one shared setting across datasets and both backbones: g = 32, τ = 1.0, zr = 0.2.

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.

FIG. 02DSTG / RANGE INTERFERENCE
Token-group scaling suppresses background-driven range inflation. The fraction of zeroed boundary activations falls from 41.6% under naive W4A4 to 14.2% with COD-TDQ.
FIG. 03DCRP / CONSTRAINT VIOLATIONS
Groups exceeding C1 drop from 72.60% to 0.00%. Groups with pre-projection ρ0 above zr drop from 98.36% to 20.87% under COD-TDQ statistics.

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.

CFRN results from main paper Table 2
MethodCAMOCHAMELEONCOD10KNC4K
SαMAESαMAESαMAESα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.

COMPONENT CHECK · NC4K

Neither component tells the whole story alone.

Naive W4A4.443

DSTG only.451

DCRP only.435

DSTG + DCRP.837

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.

MAIN PAPER QUALITATIVECFRN + ESCNET
Each example uses two rows for CFRN and ESCNet. COD-TDQ retains thin structure and complete foreground regions; naive W4A4 frequently produces sparse fragments.

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× RTX 4090384² inputbatch 4CFRN
THROUGHPUT44.21images / second

1.50× vs. FP32

LATENCY22.61ms / image
ARTIFACT108.19MB

FP32: 775.40 MB

PEAK GPU MEMORY834.92MB

FP32: 1421.31 MB

CFRN runtime efficiency from main paper Table 5
MethodWeight / artifact ↓FPS ↑Latency ↓Peak memory ↓
FP32775.40 MB29.4034.02 ms/img1421.31 MB
Naive W4A4108.30 MB43.9522.75 ms/img843.30 MB
RepQ-ViT108.15 MB44.1822.64 ms/img844.67 MB
COD-TDQ108.19 MB44.2122.61 ms/img834.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.

REPOSITORY BIBTEX
@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}
}

Scroll or pinch to inspect the full-resolution figure.