[Paper Review] How to Stop Off-the-Shelf Deep Neural Networks from Overthinking.
This paper identifies 'overthinking' in off-the-shelf deep neural networks—where models predict correctly before the final layer—causing computational waste and potential misclassification. It proposes the Shallow-Deep Network (SDN), which adds internal classifiers to enable confidence-based early exits, reducing average inference cost by over 50% while preserving accuracy and mitigating destructive misclassifications via a new 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
- To identify and characterize 'overthinking' in pre-trained deep neural networks, where correct predictions occur before the final layer.
- To reduce computational waste caused by unnecessary forward passes in DNNs after early correct predictions.
- To mitigate the risk of correct predictions being changed to misclassifications by the final layer, especially under adversarial conditions.
- To develop a generic, architecture-agnostic method to improve inference efficiency and robustness in existing DNNs without retraining.
Proposed method
- Introduce the Shallow-Deep Network (SDN), a generic modification that inserts internal classifiers at intermediate layers of off-the-shelf DNNs.
- Use confidence-based early exits: if an internal classifier's prediction exceeds a threshold, inference terminates early, avoiding full forward pass.
- Train the internal classifiers using knowledge distillation from the original DNN’s final layer to preserve accuracy.
- Propose a new confusion metric to quantify internal disagreements across classifiers, identifying cases likely to result in final-layer misclassifications.
- Apply SDN to four modern architectures (e.g., ResNet, DenseNet) across three image classification benchmarks to evaluate performance.
- Use adversarial backdooring attacks to test the robustness of the proposed mitigation under induced destructive behavior.
Experimental results
Research questions
- RQ1To what extent do off-the-shelf DNNs overthink, i.e., make correct predictions before the final layer?
- RQ2How much computational cost can be saved by enabling early exits based on confidence in internal classifiers?
- RQ3How frequently does the final layer change a correct prediction into a misclassification, and can this be predicted or prevented?
- RQ4Can the proposed confusion metric effectively identify internal disagreements that precede misclassifications?
- RQ5To what extent can the SDN framework be applied generically to existing DNNs without retraining?
Key findings
- Overthinking occurs in 50% of misclassifications on natural inputs, where a correct prediction is made early but changed by the final layer.
- The destructive effect of overthinking can be induced via a recent backdooring attack, demonstrating vulnerability in standard DNNs.
- SDN reduces average inference cost by more than 50% through confidence-based early exits while maintaining original model accuracy.
- The proposed confusion metric successfully identifies internal disagreements that precede final-layer misclassifications.
- The SDN framework is effective across four modern architectures and three image classification tasks, demonstrating broad applicability.
- Internal classifiers in SDN preserve accuracy and enable efficient inference without requiring retraining of the original DNN.
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.