Introduction
Deep learning models, particularly large Convolutional Neural Networks (CNNs), are increasingly deployed in edge-cloud collaborative environments. In these systems, an edge device captures data and transmits it to a powerful cloud server for inference. However, a significant challenge arises when these models encounter Out-of-Distribution (OOD) data—samples that differ fundamentally from the training set. Standard CNNs often exhibit overconfidence in such cases, leading to wasted communication bandwidth and cloud compute on doomed inferences.
EARLIN (EARLy OOD detection for Collaborative INference) addresses this by introducing a lightweight OOD detector that operates on the shallow layers of pretrained CNNs. By identifying and dropping unknown data at the edge, EARLIN optimizes resource usage without requiring model retraining or prior exposure to OOD datasets.
The EARLIN Framework
The core innovation of EARLIN lies in its ability to perform effective OOD detection using only a small fraction of the original model. By splitting a pretrained CNN at an early stage (e.g., the 5th layer of a ResNet-34), the system can make a "drop or send" decision with minimal local computation.
Methodology
The EARLIN pipeline consists of four primary stages:
- Feature Extraction: The input image passes through the shallow edge model to generate a set of 2D feature maps.
- Indexed-Pooling: To manage the high dimensionality of the feature space, EARLIN selects the top 50% most informative feature maps. Information content is determined by the aggregate variance of each map across the In-Distribution (ID) training set.
- Max-Pooling: The selected maps are downsampled into a compact feature vector.
- Centroid Distance Calculation: During training, a single centroid is calculated for all ID data in the reduced feature space. During inference, the Euclidean distance between a new sample's feature vector and this centroid is measured. Samples exceeding a predefined threshold (calibrated to retain 95% of ID data) are flagged as OOD and discarded.
Key Insights and Feature Separation
A fundamental premise of EARLIN is that shallow layers capture sufficient salient properties—such as basic textures and edges—to distinguish between domains. This avoids the need for deep, semantic features typically required for classification but unnecessary for domain detection.
Furthermore, the use of variance as a proxy for information allows for effective feature compression. By focusing on channels that define the "normal" distribution, the system becomes robust to noise while remaining computationally efficient. Interestingly, the system's overall accuracy improves as the ratio of OOD samples in the environment increases, as it prevents the cloud model from making confident misclassifications.
Experimental Results
EARLIN was evaluated using various architectures (DenseNet, ResNet, VGG) on ID datasets like CIFAR-10/100 and OOD datasets including TinyImageNet, LSUN, and iSUN.
- Detection Performance: EARLIN achieved exceptional True Negative Rates (TNR). For a DenseNet model trained on CIFAR-10, it successfully identified 99.30% of LSUN OOD samples and 97.50% of TinyImageNet samples.
- Comparative Analysis: The framework consistently outperformed state-of-the-art methods such as ODIN, Mahalanobis distance, and DeConf, notably without requiring input preprocessing or OOD exposure during training.
- Efficiency Gains: In prototype testing, dropping an OOD sample at the edge saved approximately 234ms of end-to-end latency (comprising 186ms of communication and 48ms of cloud compute), compared to a local computation cost of only 33ms.
Conclusion and Future Work
EARLIN demonstrates that early-layer OOD detection is a viable and highly efficient strategy for collaborative inference. While the current 95% True Positive Rate threshold results in a 5% drop of valid ID samples, the overall resource savings in OOD-heavy environments are substantial. Future research will focus on adaptive, context-aware OOD detection to dynamically balance cost and accuracy based on real-time environmental demands.
Summary updated