Abstract
One-class novelty detection is critical for identifying anomalies in various domains, but state-of-the-art GAN-based models are often too computationally expensive for edge deployment. We introduce P-KDGAN, a progressive knowledge distillation approach that compresses these models by up to 700x while maintaining high detection accuracy. Our method utilizes a novel distillation loss and a two-step learning process to effectively transfer knowledge from a complex teacher GAN to a lightweight student.
Introduction
One-class novelty detection involves identifying anomalous data—such as network intrusions, medical anomalies, or manufacturing defects—by training a model exclusively on "normal" data. Since anomalies are rare or unknown during training, the model must learn the precise distribution of normal data to flag deviations.
Recently, Generative Adversarial Networks (GANs), particularly those employing an encoder-decoder-encoder pipeline like Ganomaly, have achieved state-of-the-art performance. However, these networks are heavily over-parameterized, requiring significant memory and computational power. This makes deployment on resource-constrained edge devices, such as IoT sensors or mobile phones, highly challenging. While Knowledge Distillation (KD) is a standard technique for compressing neural networks, applying it to complex GAN architectures remains an underexplored area.
Methodology
The authors propose Progressive Knowledge Distillation with GANs (P-KDGAN) to address these challenges. The framework builds upon the Ganomaly architecture, which uses an encoder-decoder-encoder pipeline to reconstruct images and detect anomalies based on latent vector differences.
Architecture and Distillation Loss
P-KDGAN introduces a novel distillation loss that goes beyond matching final outputs. The student generator is forced to mimic the teacher's intermediate representations by minimizing the L2 distance between their respective latent vectors ($z_1, z_2$) and the L1 distance between reconstructed images ($\hat{x}$).
Two-Step Progressive Learning
Training a student GAN alongside a teacher from scratch often leads to instability. P-KDGAN employs a two-step progressive approach:
- Step 1 (Basic Learning): The teacher GAN's weights are frozen. The student is trained to mimic the teacher using the distillation loss, establishing a baseline "knowledge reserve."
- Step 2 (Fine-Tuning): The teacher is unfrozen, and both networks are trained jointly. This stabilizes the student's training and pushes its performance closer to the teacher's.
Experiments
The method was evaluated on three standard image datasets adapted for one-class novelty detection: CIFAR-10, MNIST, and Fashion-MNIST (FMNIST). In each case, one class was treated as "normal," while the others were considered "novelties."
Key Results
P-KDGAN demonstrates that intermediate matching and progressive training are essential for successful GAN distillation.
- Massive Compression: The student networks achieved staggering reductions in parameters and FLOPs. For instance, on FMNIST, the model was compressed by 700x.
- Minimal Accuracy Loss: Despite the massive reduction in size, the performance drop was negligible. The Area Under the Curve (AUC) decreased by only 0.71% on CIFAR-10 and 0.18% on FMNIST.
- Training Stability: The distillation process acts as a regularizer. During the joint training phase, the student network exhibited less instability and, in some cases, even slightly outperformed the teacher.
Conclusion
P-KDGAN successfully bridges the gap between high-performance GAN-based novelty detection and the constraints of edge computing. By using a progressive learning strategy, the authors achieved significant compression with minimal accuracy loss. Future work may extend this framework to other heavy GAN tasks, such as high-resolution image generation and domain transfer.
Summary updated