# Fast Fourier Asymmetric Context Aggregation Network:
## 3 Proposed Method
### The Context Aggregation and Decoding Stage
Since context enhancement is not required in the back area outside the clothing area, ACAM uses the clothing area binary mask to limit context attention enhancement to the clothing area to avoid content overflow:  
\[A^{\prime}_{m}=A_{m}\odot M_{c}, \tag{11}\]  
where \(A_{m}\) is the attention weight matrix composed of \(A_{i,j}\), and \(M_{c}\) is the binary mask of clothing area. Subsequently, ACAM uses \(A^{\prime}_{m}\) and the texture patch feature segments from \(f_{m-1}\) to aggregate heterogeneous features, obtaining the context-enhanced features \(F^{\prime}_{m}\). The specific operations are as follows:  
\[k_{h}=A^{\prime}_{m}\cdot\sum_{l=1}^{N_{l}}k_{l}, \tag{12}\]  
where \(k_{h}\) represents the \(h\)-th patch vector extracted from the regions outside the texture patch in \(f_{m-1}\), and \(k_{l}\) denotes the \(l\)-th patch from the regions within the texture patch in \(f_{m-1}\), where \(l\in\{1,\dots,N_{l}\},h\in\{1,\dots,N_{O}\}\). \(N_{l}\) and \(N_{O}\) are the total numbers of patches extracted from within and outside the texture patch region in \(f_{m-1}\), respectively. The context-enhanced feature \(F^{\prime}_{m}\) is ultimately obtained by concatenating \(k_{h}\) and \(k_{l}\). As shown in the upper part of Figure 2, based on [56], ACAM refines the enhanced feature \(F^{\prime}_{m}\) using a set of dilated convolutions [66] with different dilation rates, and the features refined through multi-scale processing using dilated convolutions are denoted as \(\bar{F}^{\prime}_{m}\). The specific operations are as follows:  
\[\bar{F}^{\prime}_{m}=\mathbf{Concat}(Conv_{1}(F^{\prime}_{m}),Conv_{2}(F^{ \prime}_{m}),\dots,Conv_{d}(F^{\prime}_{m}),),d\in\{1,2,\dots,D\}. \tag{13}\]  
However, although the parallel dilated convolution design provides richer scale information, it may also introduce local information loss that can impair the final feature representation. To address this, an adaptive gating mechanism is introduced in ACAM to adaptively coordinate \(F^{\prime}_{m}\) with the refined residual features \(\bar{F}^{\prime}_{m}\). Specifically, an adaptive gate value \(G_{m}\) is first obtained from \(F^{\prime}_{m}\) through standard convolution and Softmax operations. \(G_{m}\) is then used to balance the response levels of \(F^{\prime}_{m}\) and \(\bar{F}^{\prime}_{m}\), yielding the final output \(F^{A}_{m}\). The specific operation is as follows:  
\[F^{A}_{m}=G_{m}\cdot F^{\prime}_{m}\oplus(1-G_{m})\cdot\bar{F}^{\prime}_{m}, \tag{14}\]  
where \(G_{m}\) is  
\[G_{m}=\text{Softmax}\big{(}\text{Norm}\big{(}\text{Conv}\big{(}F^{\prime}_{m} \big{)}\big{)}\big{)}, \tag{15}\]  
where \(G_{m}\) represents the obtained gating weight vector, Softmax denotes the Softmax function, Norm represents normalization, and Conv denotes a learnable convolution. Finally, the context-enhanced feature \(F_{m}^{A}\) is integrated into the decoding features during the decoding phase to achieve comprehensive context modeling. Similarly, \(F_{m}^{A}\) is incorporated into the asymmetric decoding step \(\textbf{Decoder}(F_{m-1})\) to obtain richer information representations. The specific operation can be expressed as follows:  
\[\textbf{Decoder}(F_{m-1})=\textbf{Decoder}(F_{m-1})\oplus F_{m}^{A}. \tag{16}\]  
The processing of the context aggregation and decoding stage can be represented as follows:  
\[ \begin{split} F_{N-1}=\textbf{Decoder}_{1}(F_{N})\\ F_{N-2}=\textbf{Decoder}_{2}(F_{N-1})\oplus\textbf{ACAM}(F_{N},f_{N-1})\\ \ldots\\ F_{2}=\textbf{Decoder}_{N-2}(F_{3})\oplus\textbf{ACAM}(F_{4},f_{3})\\ F_{1}=\textbf{Decoder}_{N-1}(F_{2})\oplus\textbf{ACAM}(F_{3},f_{2})\\ C_{\text{gen}}=\textbf{Decoder}_{N}(F_{1}),\end{split}  \tag{17}\]  
where **ACAM** represents the context aggregation operation within the ACAM, \(\textbf{Decoder}_{i}\) denotes the decoding block based on transposed convolution, and \(C_{\text{gen}}\) represents the final generated image.