Abstract
Traditional approaches to correcting performance gaps in Convolutional Neural Networks (CNNs) involve retraining the entire model on balanced datasets, a process that is both computationally expensive and resource-intensive. This paper presents CNNSplitter, a novel framework that treats CNNs as modular software components. By decomposing high-performing "strong" models into compressed, class-specific modules, CNNSplitter allows for the targeted patching of "weak" models. Our approach achieves significant precision improvements on target classes while reducing computational overhead, offering a sustainable alternative to full-model retraining.
1. Introduction
Deep learning models have become ubiquitous, yet their maintenance remains a significant challenge. When a deployed CNN exhibits poor performance on a specific category—such as a vehicle classifier that fails consistently on trucks—the standard industry response is to retrain the model from scratch. This "monolithic" view of AI models contrasts sharply with traditional software engineering, where bugs are addressed through localized patches rather than entire system rewrites.
Modularizing CNNs is inherently difficult due to weight sharing. In a standard architecture, neurons are densely interconnected, and specific weights often contribute to multiple feature extractions across disparate classes. Previous attempts at modularization often relied on "uncompressed" methods that merely masked weights with zeros, failing to provide actual savings in memory or computation. CNNSplitter addresses these challenges by introducing the first compressed modularization approach for CNNs.
2. Methodology: The CNNSplitter Framework
CNNSplitter identifies and extracts specific convolution kernels responsible for recognizing a particular class, creating a standalone "patch" that can be integrated into a failing model.
2.1 Search-Based Decomposition
The framework frames the identification of class-specific kernels as a search problem. It utilizes a Genetic Algorithm (GA) where individuals are represented as bit-vectors. These vectors indicate which kernel groups should be retained or discarded to maintain accuracy for a specific target class.
2.2 Optimization Strategies
To manage the high dimensionality of the search space, the authors implemented several key innovations:
- Importance-Based Grouping: Kernels are grouped based on their activation strength for the target class, reducing the number of variables the GA must optimize.
- Sensitivity-Based Initialization: The GA is initialized by focusing on "sensitive" layers—those where kernel removal causes the most significant drop in accuracy—thereby accelerating convergence.
- Pruning-Based Evaluation: To avoid the $O(N^N)$ complexity of evaluating all module combinations, the authors utilize a pruning strategy that decomposes the $N$-class task into smaller binary sub-tasks, reducing complexity to $O(N^2)$.
2.3 The Patching Mechanism
Once a module is extracted from a strong model, it is deployed in parallel with the weak model. The system normalizes the outputs of both the original model and the patch to ensure a fair comparison. If the patch identifies a sample as belonging to the target class with high confidence, its prediction replaces that of the weak model.
3. Experimental Setup
The researchers evaluated CNNSplitter using two representative architectures: SimCNN and ResCNN. The evaluation spanned three standard benchmarks:
- CIFAR-10: Used to train the initial "strong" models.
- CIFAR-100: Subsets were used to simulate "weak" models (e.g., underfitted or overfitted scenarios).
- SVHN (Street View House Numbers): Used to test the generalizability of the modules across different image domains.
4. Results and Discussion
4.1 Efficiency and Compression
CNNSplitter successfully produced highly efficient modules. On average, the extracted patches retained only 56.76% of the original kernels. This structural change resulted in a 57.0% reduction in Floating Point Operations (FLOPs), demonstrating that the modules are significantly more lightweight than the parent models.
4.2 Performance Gains
Patching weak models led to substantial performance recoveries:
- Precision: Average improvement of 12.54% on target classes.
- Recall: Average improvement of 2.14%.
- Collateral Benefits: Interestingly, the accuracy of non-target classes improved by 1.18%. This suggests that the high-precision patches help the overall system correctly reject samples that the weak model would have otherwise misclassified into the target category.
5. Conclusion and Future Work
CNNSplitter demonstrates that CNNs can be effectively modularized and patched, mirroring software maintenance workflows. By extracting the specific "knowledge" of a strong model into a compressed module, developers can fix specific model failures without the cost of full retraining.
While the method currently requires a pre-existing "strong" model, it opens new avenues for model composition and reuse. Future research may extend this modular approach to more complex tasks such as object detection and semantic segmentation, further bridging the gap between deep learning and modular software engineering.
Summary updated