TL;DR
PATNet introduces a novel "Partial visual ATtention" (PAT) mechanism that combines the high-speed efficiency of partial convolutions with the representational power of visual attention. By utilizing the "untouched" channels in a partial convolution to perform low-cost attention operations, PATNet achieves significantly higher accuracy than FasterNet while maintaining—and often improving—inference throughput on both CPUs and GPUs.
What Problem Does This Paper Address?
In the quest for efficient neural networks, researchers have long relied on Depthwise Convolution (DWConv). While DWConv reduces theoretical computation (FLOPs), it suffers from high memory access costs, which slows down actual inference speed (throughput).
The recent FasterNet attempted to solve this using Partial Convolution (PConv), which applies standard convolution to only a subset of input channels and leaves the rest as an identity mapping. While PConv is incredibly fast, it has a "lazy" side: the untouched channels don't interact with their neighbors, leading to limited feature extraction and lower accuracy compared to more complex models. The authors of this paper asked: Can we use those idle channels to add "intelligence" (attention) without losing the speed of PConv?
Methods
The core innovation is the Partial visual ATtention (PAT) mechanism. Instead of simply ignoring the channels not processed by the convolution, PAT applies efficient attention mechanisms to them in parallel. The authors developed three specific blocks:
- PAT_ch (Partial Channel-Attention): This replaces standard Squeeze-and-Excitation (SE). While traditional SE only uses the mean of channels, PAT_ch uses an enhanced Gaussian approach, calculating both the mean and variance. This captures the global distribution of the untouched channels more effectively.
- PAT_sp (Partial Spatial-Attention): Integrated into the MLP (Multi-Layer Perceptron) layers, this uses a simple $1 \times 1$ convolution and a Hard-Sigmoid activation to weight spatial features. Crucially, this can be fused with existing layers during inference to keep the cost near zero.
- PAT_sf (Partial Self-Attention): In the final stage of the network, the authors use a partial self-attention mechanism to capture long-range dependencies (global receptive field), following the "MetaFormer" design philosophy.
By combining these, they created the PATNet family, ranging from "Tiny" (T0) to "Large" (L) variants.
Datasets
The authors evaluated PATNet on two primary industry-standard benchmarks:
- ImageNet-1K: Used for image classification performance (1.3 million training images).
- MS-COCO 2017: Used for downstream tasks, specifically object detection and instance segmentation, using PATNet as a backbone for a Mask R-CNN detector.
Key Insights and Ideas
- Redundancy is an Opportunity: The "identity" channels in partial convolutions are often considered redundant. This paper treats that redundancy as "free" bandwidth to insert global context via attention.
- Gaussian Statistics Matter: Most channel attention modules only look at the average value of a feature map. By including the standard deviation (variance), the model gains a much richer "fingerprint" of the channel's information without a significant increase in math.
- Parallelism over Serial Processing: Unlike traditional models that stack convolution and then attention, PATNet runs them side-by-side on different channel splits. This aligns better with how modern GPUs handle parallel workloads, leading to higher throughput.
- Late-Stage Depth: The authors found that doubling the depth of the final stage (Stage 4) significantly boosted accuracy with almost no impact on overall latency, challenging previous design conventions that kept stage depths more uniform.
Key Results
PATNet consistently outperforms both pure CNNs (like FasterNet) and hybrid ViTs (like MobileViT) across various scales:
- Accuracy vs. Speed: PATNet-T2 achieved 80.2% Top-1 accuracy on ImageNet-1K. This is 1.3% higher than FasterNet-T2, yet it runs with 25% higher GPU throughput and 24% lower CPU latency.
- Efficiency: Compared to the popular Swin-T, PATNet-S achieves similar accuracy (82.1%) but with significantly fewer FLOPs and much higher throughput on Nvidia V100 GPUs.
- Downstream Tasks: When used for object detection on COCO, PATNet-S outperformed FasterNet-S by 2.8 box mAP, proving that the features learned via partial attention generalize well to complex tasks like localization.
Limitations and Future Work
While the paper demonstrates impressive results on standard hardware (Nvidia V100, AMD MI250, and standard CPUs), the authors do not extensively discuss performance on edge-specific AI accelerators (like TPUs or NPUs), where memory tiling strategies might interact differently with partial operations.
The authors suggest that the concept of "partial attention" isn't limited to computer vision and could potentially be applied to Natural Language Processing (NLP) or Large Language Models (LLMs) to reduce the quadratic complexity of standard self-attention mechanisms. Exploring PAT in the context of generative AI remains an open and promising direction.
Summary updated