# ODGNet: Robotic Grasp Detection Network Based on Omni-Dimensional Dynamic Convolution
## 3 Method
### Network Architecture
#### 3.2.1 Omni-Dimensional Dynamic Convolutional Layer  
In the feature extraction stage of the encoder, omni-dimensional dynamic convolution is introduced in this paper in order to improve the feature extraction capability. The core idea of ODConv is to transform fixed convolutional kernel parameters into learnable dynamic parameters that can be adapted to different input features. ODConv is a dynamic convolution that utilizes a multidimensional attention mechanism to learn the four complementary attention types of the convolution kernel along the four dimensions of the kernel space in a parallel manner [11]. It is defined as follows:  
\[y=\left(\alpha_{w1}\odot\alpha_{f1}\odot\alpha_{c1}\odot\alpha_{s1}\odot W_{1} +...+\alpha_{wm}\odot\alpha_{fn}\odot\alpha_{cn}\odot\alpha_{sn}\odot W_{n} \right)*x \tag{5}\]  
where \(x\in\mathbb{R}^{h\times w\times c_{in}}\) denotes the input features and \(y\in\mathbb{R}^{h\times w\times c_{out}}\) denotes the output features; \(W_{i}\in\mathbb{R}^{k\times k\times c_{in}\times c_{out}}\) denotes the \(i^{th}\) convolutional kernel; \(\alpha_{wi}\in\mathbb{R},\alpha_{fi}\in\mathbb{R}^{c_{out}}\), \(\alpha_{ci}\in\mathbb{R}^{c_{in}}\) and \(\alpha_{si}\in\mathbb{R}^{k\times k}\) denote the attention weights computed along the dimension of the number of convolution kernels, the dimension of the output channel, the dimension of the input channel, and the dimension of the kernel space for \(W_{i}\), respectively; \(\odot\) is the Hadamard product [32], representing the multiplication of the matrix elements at the corresponding positions and denoting multiplication operations in different dimensions along the kernel space; \(*\) denotes a convolution operation. Figure 3 illustrates the process of Hadamard product operations for the four attention weights with the convolution kernel in ODConv.  
The four attention weights are computed with the multi-head attention module \(\pi_{i}(x)\). The multi-head attention module \(\pi_{i}(x)\) is shown in Figure 4. Firstly, the input \(\chi\) is subjected to channel-wise Global Average Pooling (GAP) to obtain the feature vector with the length of \(c_{in}\). Then, the feature vector is mapped to a low-dimensional space by a fully connected (FC) layer and ReLu activation function to reduce the complexity of the model. Finally, the normalized attention parameters (\(\alpha_{wi},\alpha_{fi},\ \alpha_{ci},\ \alpha_{si}\)) are generated by fully connected layers and softmax or Sigmoid functions in the four branching heads.  
Omni-dimensional dynamic convolution utilizes this multidimensional attention mechanism and a parallel strategy to learn the complementary attention of the convolutional kernels of all four dimensions of the convolutional layer along the kernel space, which can significantly enhance the feature extraction capability of the basic convolutional operations. In this paper, feature extraction of the input image is performed by three consecutive omni-dimensional dynamic convolutional layers, each of which contains an omni-dimensional dynamic convolution with four kernels, a batch normalization operation, and a ReLu activation function.