[Paper Review] Shallow-Deep Networks: Understanding and Mitigating Network Overthinking
The paper introduces Shallow-Deep Networks (SDNs) which attach internal classifiers to pre-existing DNNs to illuminate how predictions evolve through the forward pass, quantify overthinking, and mitigate wasteful and destructive effects via confidence-based early exits and a confusion metric.
We characterize a prevalent weakness of deep neural networks (DNNs)---overthinking---which occurs when a DNN can reach correct predictions before its final layer. Overthinking is computationally wasteful, and it can also be destructive when, by the final layer, a correct prediction changes into a misclassification. Understanding overthinking requires studying how each prediction evolves during a DNN's forward pass, which conventionally is opaque. For prediction transparency, we propose the Shallow-Deep Network (SDN), a generic modification to off-the-shelf DNNs that introduces internal classifiers. We apply SDN to four modern architectures, trained on three image classification tasks, to characterize the overthinking problem. We show that SDNs can mitigate the wasteful effect of overthinking with confidence-based early exits, which reduce the average inference cost by more than 50% and preserve the accuracy. We also find that the destructive effect occurs for 50% of misclassifications on natural inputs and that it can be induced, adversarially, with a recent backdooring attack. To mitigate this effect, we propose a new confusion metric to quantify the internal disagreements that will likely lead to misclassifications.
Motivation & Objective
- Characterize overthinking as predictions evolve across DNN layers and identify wasteful and destructive effects.
- Propose SDN as a generic modification to add internal classifiers to pre-trained networks without changing their core weights.
- Demonstrate that SDNs can reduce inference cost via early exits and mitigate misclassifications caused by overthinking.
- Develop heuristics (confidence-based early exits and confusion analysis) to detect and mitigate overthinking in practice.
- Showcase the approach on CIFAR-10, CIFAR-100, and Tiny ImageNet across multiple CNN architectures.
Proposed method
- Attach internal classifiers (ICs) after selected layers with a feature reduction step to keep ICs scalable.
- Train ICs on pre-trained networks by IC-only training or jointly with SDN training using a weighted loss that emphasizes ICs proportionally to their relative inference cost.
- Use a mixed max-average pooling strategy for feature reduction to maintain IC efficiency.
- Define ICs at multiple depths to generate several internal predictions and a final prediction per input.
- Introduce a confusion metric based on L1 distances between internal and final predictions to analyze misalignment and predict misclassifications.
- Evaluate inference cost via FLOPs and accuracy (Top-1) across datasets and architectures.
Experimental results
Research questions
- RQ1How does prediction accuracy evolve through a CNN when augmented with internal classifiers?
- RQ2What is the prevalence and impact of overthinking (wasteful and destructive) in standard CNNs on natural datasets?
- RQ3Can SDNs reduce average inference cost without sacrificing accuracy, and can they recover performance in adversarial/backdoor scenarios?
- RQ4How effective are confidence-based early exits and the proposed confusion metric at mitigating overthinking?
- RQ5Can internal prediction disagreements illuminate sources of error and aid interpretability?
Key findings
- Internal classifiers improve or match original accuracy and reveal that most inputs could exit early, reducing inference cost by over 50% on several tasks.
- Overthinking is common: up to ~95% of inputs cause wasteful computation, and destructive misclassifications occur in up to ~50% of CNN errors on natural inputs.
- SDN-based early exits reduce average FLOPs by up to ~50–75% with no loss in accuracy and can recover accuracy in backdoored networks from 12% to 84% on malicious inputs.
- A new confusion metric based on L1 distances between final and internal predictions reliably indicates likely misclassifications and helps diagnose errors.
- Early exits can mitigate backdoor attacks by reducing the effectiveness of the attacker’s trigger, and the confusion metric provides a practical error indicator for safe operation.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.