File size: 7,042 Bytes
318674b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | \begin{figure*}
\centering
\includegraphics[width=1.0\textwidth]{imgs/mobilenetv2.pdf}
%\caption{Comparison among Res18, Res18-Ewp. Res18-Gate-ReLU and Res18-Gate-GELU.}
\label{bpgg}
\vspace{-6mm}
\caption{Comparison among different variants of MobileNetv2.
Different architectures respond differently to specific frequency component.
To ensure an informative comparison, we select representative frequency thresholds tailored to each model where we set $r$ to $10$. Additional results under other threshold configurations and other based models are included in the supplementary material.
%and EfficientFormer-v2 (Eformerv2)
%for MobileNetv2 and $\{ 4, 8\}$ for %EfficientFormer-v2 respectively.
%All the variants shows almost same training curves and very close testing curves of the raw data where the difference is lower than $0.03$ on average. In this case, a difference value of $0.1$ can be seen as a significant change.
%When accuracy falls below $15\%$, it can be considered close to the random selection, suggesting that neural networks struggle to learn from this particular frequency range.
%For a better view, we only put curves of two variants in a single image for figures a, b and c. Also, we plot all curves in a single plot and highlighted the most upper curves for each images in (d) to have a comprehensive
%understanding.
}
\label{lgw_comparison}
\end{figure*}
\section{Gating Mechanism Network (GmNet)}
\label{sec:method}
\subsection{Rethinking Current Lightweight Model Architectures From A Frequency Perspective}
\begin{wrapfigure}{r}{0.4\textwidth}
\vspace{-7mm}
\centering
\includegraphics[width=0.85\linewidth]{imgs/arch1.png}
\vspace{-4mm}
\caption{{\bf GmNet architecture}. GmNet adopts a traditional hybrid architecture, utilizing convolutional layers to down-sample the resolution and double the number of channels at each stage.
%Several blocks are repeated to extract features.
}
\vspace{-7mm}
%\includegraphics[width=0.8\linewidth]{egfigure.eps}
\label{arch-main}
\end{wrapfigure}
Before introducing our proposed network, we first investigate the importance of capturing high-frequency information in efficient architectures by modifying existing efficient models to incorporate Gated Linear Units (GLUs).
Specifically, we select one representative architecture: the pure CNN-based MobileNetV2 \cite{sandler2018mobilenetv2}.
%and the transformer-based EfficientFormer-V2 \cite{li2023rethinking}.
We replace the activation functions in their MLP blocks with a simple GLU. Detailed architectural modifications are provided in the appendix.
As shown in Fig. \ref{lgw_comparison}, {we present the testing accuracy curves under the frequency threshold $r=10$.}
Our results demonstrate that integrating GLUs improves classification accuracy on high-frequency components.
%under different threshold settings.
Notably, this improvement in high-frequency classification also correlates with a gain in overall performance.
Furthermore, we observe that using GELU as the activation function within the GLUs enhances performance on low-frequency components, though it has a relatively minor effect on overall accuracy.
These findings suggest that effectively modeling high-frequency information is more crucial for improving the performance of lightweight neural networks.
It underscores the critical role of frequency-aware design in the lightweight networks.
Moreover, we also conduct similar experiments on the transformer-based model EfficientFormer-V2 \cite{li2023rethinking} which can be found in the appendix.
%Incorporating activation functions with favorable frequency characteristics, such as GLUs, offers a promising direction to mitigate the performance gap between lightweight and full-sized models.
\subsection{Architecture of GmNet}
%The advantages of learning more from high-frequencies have been investigated by many works in various tasks [].
To address the limitation of low-frequency bias for current lightweight network designs, our
proposed method named as GmNet integrates a simple gated linear unit into the block as illustrated in
Fig. \ref{arch-main}.
GmNet offers both conceptual and practical advantages on encouraging the model to learn
from a broader range of frequency regions, especially the high-frequency domain.
%Building on the intuitive exploration of the gated linear unit (GLU), This enables XX to efficiently leverage high-frequency information.
GmNets employ an extremely streamlined model architecture, carefully designed to minimize both parameter count and computational speed, making them particularly suitable for deployment in resource-constrained environments.
We incorporate two depth-wise convolution layers with kernel sizes of $7\times 7$ at the beginning and
end of the block respectively to facilitate the integration of low- and high-frequency information.
At the core of the block, we have two $1\times 1$ convolution layers and a simple gated linear unit.
We use the ReLU6 as the activation function.
%Unlike existing methods that often rely on complex structures,
% Using such simple structure is mainly for better building a self-reinforcing gating mechanism.
%ReLU6 can not only emphasize the higher frequency components since it has discontinuous higher derivatives, but also it can limit the amplitudes and energy of the high-frequency components with limiting the max values.
% the details are listed in Table \ref{variants}.
GmNet uses a simplified GLU structure for two reasons: (1) to keep the model as
lightweight as possible, reducing computational load; and (2) ensuring that high-frequency signals can be better enhanced without adding any additional convolutional or fully connected layers within the GLU.
%There are two main purposes of employing the simplest GLU architecture: (1) Improving the model efficiency
%Additionally, a layer scaler is placed at the end of the block to regulate frequency amplitudes, effectively reducing high-frequency noise while enhancing the useful frequency range.
%Different from StarNet \cite{ma2024rewrite}, which employs two separate FC layers for element-wise multiplication, our method simplifies this process with a single FC layer before the GLU.
%Besides the purpose of improving the model efficiency, the simplest GLU architecture whic also enhances the model’s capability to extend the frequency spectrum and emphasize high-frequency components form the feature perspective. We have
Furthermore, our gate unit is more interpretable, aligning with our analysis of GLUs in the frequency domain.
%We also provide experimental evidence demonstrating that this simplified structure is indeed the most effective and efficient.
Experimental results and ablation studies consistently demonstrate the superiority of our model, validating its design in accordance with our GLU frequency domain studies.
We also show that the simplest structure achieves the optimal trade-off between efficiency and effectiveness.
|