We built a compact convolutional neural network to classify human activities from radar
spectrograms, then compressed it for integer-only inference. The model recognizes
jogging, jumping, sit-ups, waving, and other activity from single-channel
64 × 64 inputs.
The compression pipeline combines ternary weights, quantized activations and biases, pruning, batch-normalization folding, and quantization-aware training. The goal was to preserve the full-precision model's accuracy while reducing its numerical precision and reliance on floating-point operations.
A full-precision model stores each weight with 32 bits. Restricting a weight to
{−1, 0, +1} allows it to be encoded with 2 bits, a 16× reduction in raw
weight storage before accounting for biases, scales, and other model data. The challenge
is retaining accuracy after introducing this low-precision constraint
[1].
The compressed model reached 98.91% mean accuracy, compared with 99.42% for the FP32 baseline.
64 × 64 × 1 spectrogram from a private radar dataset with five activity
classes.
{−1, 0, +1}, while fake quantization exposes the model to low-precision
arithmetic during training.
For each layer, a threshold determines whether a full-precision weight maps to
−1, 0, or +1. A non-negative scale factor
α preserves the magnitude of the original weight distribution while the
ternary values provide a compact representation. The extracts below show corresponding
floating-point parameters and their ternarized weights and quantized biases.
We used uniform affine quantization to approximate a real value r as
q = round(r / scale) + zero_point. During training, fake-quantization
modules simulate the rounding and clipping used at inference while the trainable
parameters remain in floating point. A straight-through estimator supplies gradients
through the non-differentiable rounding operation
[2], [3].
After pruning to approximately 45% sparsity, we folded each batch-normalization layer
into the preceding convolution. Convolution, activation, and pooling then operate on
integer values. Dyadic scales of the form s = a / 2ᵇ replace general
division with integer multiplication and bit shifting during requantization
[2], [4].
We evaluated the FP32 and compressed models using the same five cross-validation folds. The compressed model remained within 1.09 percentage points of the baseline on every fold and matched it on fold 5.
| Fold | FP32 accuracy | Compressed accuracy |
|---|---|---|
| 1 | 99.27% | 98.19% |
| 2 | 100.00% | 99.64% |
| 3 | 99.27% | 98.91% |
| 4 | 98.55% | 97.83% |
| 5 | 100.00% | 100.00% |
| Mean | 99.42% | 98.91% |
Ternarization, quantization, and pruning reduced numerical precision while limiting the mean accuracy change to 0.51 percentage points. The available evaluation measures classification accuracy; hardware latency, memory use, and energy consumption were not benchmarked.