Sun Yat-sen's Tiny 15K-Parameter Trick Stops AI From Forgetting Old Tasks
A new continual learning framework adds tiny per-task batch normalization layers plus an unknown class trick to beat catastrophic forgetting with 15K extra parameters.
ProTakeaways
- New CIL framework uses task-specific batch normalization plus an unknown class per head for OOD-based task-ID prediction
- Only about 15K extra parameters per task, versus 11.2M for DynaER and 70K for MORE
- State-of-the-art on Skin8, Path16, CIFAR100, and CUB200 across multiple task splits
- Inference latency stays flat at roughly 5ms per image regardless of task count
- Task-ID accuracy stays above 68% even with 50 sequential tasks on CIFAR100
- Code available on GitHub, paper on arXiv
Training a neural network on a stream of new classes without wrecking what it already knows remains one of the messier problems in deep learning. A team from Sun Yat-sen University has proposed a class-incremental learning framework that leans on two lightweight tricks, task-specific batch normalization and an explicit unknown class for out-of-distribution detection, and manages to hit state-of-the-art on four image datasets while adding only about 15,000 trainable parameters per new task.
The paper, titled Class Incremental Learning with Task-Specific Batch Normalization and Out-of-Distribution Detection, tackles a familiar pain point. When a model learns task after task without access to old data, it suffers catastrophic forgetting, where performance on previously learned tasks declines substantially. Existing methods either freeze weights too aggressively (killing the ability to learn) or expand the network for each new task (blowing up memory).
The setup that makes CIL hard
Continual learning splits into two flavors. In task-incremental learning (TIL), the model gets told which task a test sample belongs to, so it can just pick the right classifier head. In class-incremental learning (CIL), it does not. Adapting methods from TIL to CIL remains a significant challenge, mainly because choosing the correct classifier head from multiple options to make the final prediction becomes particularly challenging without task-ID. CIL is the more realistic scenario, and it is what this paper targets.
The authors' insight is that if you can predict which task a sample belongs to, you can reuse the multi-head TIL machinery directly. That reframes the whole problem as an out-of-distribution detection question: each task-specific sub-model should recognize when a sample doesn't belong to it.
Two knobs, both small
The architecture keeps a frozen pretrained backbone (ResNet18 in most experiments) and adds two per-task components:
- Task-specific Batch Normalization layers. Instead of sharing BN statistics across tasks, each task gets its own set of scaling and shifting parameters. In the ResNet18 model, the total parameter number of all convolutional kernels is about 11 millions, but all the BN layers contain only about 15,000 parameters, so per-task copies are cheap.
- Task-specific classifier heads with an unknown class. Each head has one extra output unit representing everything not in this task. During training on task t, stored samples from previous tasks are labeled as the unknown class, teaching each head to recognize outsiders.
At inference time, task-ID prediction is refreshingly direct: run the sample through every task's sub-model and pick the head that assigns the lowest probability to its unknown class. Then run within-task prediction with that head to get the final label.

The gap between in-task and out-of-task scores is dramatic. Each task-specific module consistently assigns lower unknown class scores to its corresponding in-task samples (0.31 to 0.46) compared to out-of-task samples (0.95 to 0.96).
The alignment fix
There is a subtle problem: earlier tasks see fewer old-task samples during training (task 1 sees none), so their unknown class outputs become miscalibrated compared to later heads. The authors add an OOD Detection Alignment Stage after each new task, where a class-balanced replay memory is used to fine-tune all classifier heads simultaneously. This keeps the unknown scores comparable across heads, which is essential when you're picking a winner by lowest score.
The numbers
The method was evaluated on two medical datasets (Skin8 for dermatoscopy, Path16 for pathology) and two natural image datasets (CIFAR100 and CUB200). Averaged across all four, the proposed method reaches 57.40% Last-ACC and 71.16% Avg-ACC, compared to 52.19% and 66.99% for the next-best baselines. On CUB200 with 10 tasks, it beats the runner-up by 2 full points on Last-ACC.
More striking is the parameter efficiency. DynaER introduces 11.2M additional parameters per task, while MORE adds approximately 70K parameters for each new task, both resulting in considerable model expansion and increased computational overhead. In contrast, our method requires only 15K additional parameters per task while achieving the best average performance across four datasets.

Inference speed also stays flat. On CIFAR100 with 10 tasks, the proposed method takes 5.11 to 5.21 milliseconds per test image regardless of how many tasks have been learned, while DynaER climbs from 10.25 to 19.36 milliseconds.
Where it holds up and where it doesn't
Robustness experiments push the task count up to 50 on CIFAR100. Task-ID prediction performance shows no significant degradation across task scales, with Last-TP consistently maintained above 68% and Avg-TP sustained above 81%. Meanwhile, baselines like DER++ degrade from 66.69% to 52.83% Last-ACC over the same range.
The limitations are honest. The method still needs a memory buffer of old samples for replay, which introduces storage overhead. The BN-swapping trick is native to convolutional networks; extending it to Vision Transformers would require replacing Layer Normalization instead. And the alignment stage retrains every classifier head each round, which adds compute (though only to the lightweight heads, not the full backbone).
Practical takeaways
This is a useful recipe when:
- You have a CNN backbone you don't want to retrain from scratch
- New classes arrive in phases and you can store a handful of exemplars per class
- Parameter growth matters, for instance on edge devices or in medical deployments where model versioning is painful
- You need stable inference latency as the task count grows
The source code is on GitHub, so anyone building an incremental classification pipeline can plug in the task-specific BN and unknown-class head without a major architectural rewrite. The bigger idea, that OOD detection can serve as a clean bridge from TIL to CIL, is worth keeping in mind even if you end up using a different backbone or normalization scheme.