Abstract
As convolution has empowered many smart applications, dynamic convolution further equips it with the ability to adapt to diverse inputs. However, the static and dynamic convolutions are either layout-agnostic or computation-heavy, making it inappropriate for layout-specific applications, e.g., face recognition and medical image segmentation. We observe that these applications naturally exhibit the characteristics of large intra-image (spatial) variance and small cross-image variance. This observation motivates our efficient translation variant convolution (TVConv) for layout-aware visual processing. Technically, TVConv is composed of affinity maps and a weight-generating block. While affinity maps depict pixel-paired relationships gracefully, the weight-generating block can be explicitly over-parameterized for better training while maintaining efficient inference. Although conceptually simple, TVConv significantly improves the efficiency of the convolution and can be readily plugged into various network architectures. Extensive experiments on face recognition show that TVConv reduces the computational cost by up to 3.1× and improves the corresponding throughput by 2.3× while maintaining a high accuracy compared to the depthwise convolution. Moreover, for the same computation cost, we boost the mean accuracy by up to 4.21%. We also conduct experiments on the optic disc/cup segmentation task and obtain better generalization performance, which helps mitigate the critical data scarcity issue.
Introduction
Standard convolutional neural networks (CNNs) are built on the principle of translation equivariance. This property allows a single filter to slide across an entire image, detecting features regardless of their location. While this is ideal for general object detection—where a target might appear anywhere in a frame—it is inefficient for layout-specific tasks. In applications like face recognition, medical imaging (e.g., MRI or fundus photography), and industrial inspection, the structural layout of the image is largely fixed. Using the same filter to process the top-left corner of a face as the center is computationally redundant.
Existing "dynamic convolutions" attempt to solve this by generating input-dependent filters. However, these methods are often too computationally expensive for real-time or mobile applications because they must re-calculate filters for every new image. TVConv (Translation Variant Convolution) offers a middle ground: it provides the flexibility of location-aware filters with the efficiency of static convolutions.
The TVConv Architecture
TVConv is designed to capture the unique spatial relationships of layout-aware tasks through two primary components:
- Affinity Maps: These are learnable, compact maps that represent the semantic relationships between different regions of the image layout. They allow the model to understand the global structure of the target domain.
- Weight-Generating Block: This internal block expands the affinity maps into a full set of convolution weights for every spatial position.
A key innovation of TVConv is its handling of inference. Because the layout of the target domain (e.g., a human face) is consistent across the dataset, the weight-generating block only needs to run once during initialization. The resulting location-specific weights are cached in memory. During inference, the model simply fetches these pre-computed filters, achieving speeds comparable to standard lightweight convolutions while maintaining spatial awareness.
Exploiting Statistical Regularity
The fundamental motivation for TVConv stems from a critical observation regarding variance in layout-specific datasets. In these domains, the variance within a single image (spatial variance) is high, as different regions contain distinct features (e.g., eyes vs. mouth). Conversely, the variance between different images (cross-image variance) is remarkably low, as the relative positions of these features remain stable across the dataset.
TVConv exploits this by sharing weights across images while allowing them to vary across pixels. This approach also enables "over-parameterization for free": the weight-generating block can be complex and heavy during training to produce high-quality filters, without impacting the model's runtime performance on edge devices.
Experimental Results
Face Recognition
The researchers evaluated TVConv using the CASIA-WebFace dataset and benchmarks like LFW and AgeDB-30. When integrated into MobileNetV2, TVConv achieved a 3.05x reduction in computational complexity (MACs) while maintaining high accuracy. On hardware like the Raspberry Pi 4, this translated to a 2.3x improvement in throughput. In low-complexity scenarios, TVConv outperformed standard depthwise convolutions by up to 4.21% in mean accuracy.
Medical Imaging
In optic disc and cup segmentation tasks, TVConv demonstrated superior generalization. When tested on data from clinical centers not seen during training, TVConv-based models proved more robust than standard architectures. This suggests that by learning the "global geometry" of the eye, the model becomes less sensitive to local texture variations that differ between hospitals.
Conclusion and Future Work
TVConv provides a highly efficient solution for layout-aware visual processing, significantly reducing computational overhead without sacrificing performance. Its primary limitation is a reliance on fixed input resolutions and alignment. Future research may explore the integration of Spatial Transformer Networks to allow affinity maps to dynamically align with inputs, or combining TVConv with dynamic biases to better handle environmental variations like lighting and expression.
Summary updated