# Fast Fourier Asymmetric Context Aggregation Network:
## 3 Proposed Method
### The Context Aggregation and Decoding Stage  
In the context aggregation and decoding stage, we integrate the proposed ACAM into the decoding process to aggregate multi-stage heterogeneous features, achieving more comprehensive contextual relationship interaction. We utilize \(N\) decoding blocks, \(\mathbf{Decoder_{i}}\), \(i\in\{1,2,\ldots,N\}\), constructed by stacking transposed convolutions, batch normalization, and ReLU activation function in sequence. Next, a detailed explanation of the proposed ACAM will be presented. Since texture patches provide limited information guidance, generating clothing content that aligns semantically with these texture patches becomes challenging, especially when the texture patches are small. To ensure the model can fully utilize the information from texture patches and generate semantically consistent image content under varying patch sizes, we propose a novel Asymmetric Context Aggregation Mechanism (ACAM). The ACAM is designed based on our consideration of the characteristics of heterogeneous feature representations: compared to the features in the decoding stage, those in the encoding stage demonstrate a superior capacity for accurately capturing the initial guiding information as the progressive processing of features inevitably leads to a certain degree of representation loss. In contrast, decoding features, through the FF-CDRB blocks, establish preliminary global relationships, providing a more comprehensive interpretation of the fused multi-source features. Therefore, ACAM first constructs global contextual attention using decoding features and extracts initial guidance information representations from the multi-scale features of the encoding stage. It then uses the constructed attention scores to complete the aggregation of encoding and decoding features. It is important to highlight that we observed suboptimal performance when constructing ACAM using cross-stage features of the same size. We believe the primary reason lies in the shared commonalities in information representation among features of identical size, which results in less expressive information compared to features of heterogeneous sizes. Based on this observation, we utilize cross-stage heterogeneous-sized features to implement ACAM. Specifically, the features from the decoding stage are denoted as \(F_{m},m\in\{N,N-1,\ldots,1\}\), where \(F_{N}\) represents the deepest features, and \(F_{N}\)=\(f_{R}^{F}\). As shown in the upper part of Figure 2, ACAM first extracts patches from the decoding stage features \(F_{m}\) and calculates the cosine similarity between these patches:  
\[\text{Sim}_{i,j}=\Bigg{\langle}\frac{k_{i}}{\|k_{i}\|},\frac{k_{j}}{\|k_{j}\|} \Bigg{\rangle}, \tag{8}\]  
where \(k_{i}\) and \(k_{j}\) are the \(i\)-th and \(j\)-th patch vectors extracted from \(F_{m}\), respectively, and \(\|k_{i}\|\) and \(\|k_{j}\|\) represent the Euclidean norms of \(k_{i}\) and \(k_{j}\), respectively. \(Sim_{i,j}\) is the cosine similarity fraction between \(k_{i}\) and \(k_{j}\). Considering that the encoding stage features contain semantic representations of the sketch, ACAM focuses on aligning the global information in \(F_{m}\) with the texture content in \(f_{m-1}\) to more effectively utilize the limited texture information in the texture patches. Specifically, ACAM uses the texture patch region mask \(M_{t}\) to obtain the cosine similarity scores between the internal and external segments of the texture patches in the feature map:  
\[\text{Sim}^{\prime}_{i,j}=\text{Sim}_{i,j}\odot P_{M}, \tag{9}\]  
where \(P_{M}\) is the patch vector extracted from \(M_{t}\), and \(\odot\) represents element-wise multiplication. Then, Softmax is applied to the \(\text{Sim}^{\prime}_{i,j}\) to obtain the attention weight vector \(A_{i,j}\):  
\[A_{i,j}=\frac{e^{\text{Sim}^{\prime}_{i,j}}}{\sum_{i=1}^{H}e^{\text{Sim}^{ \prime}_{i,j}}}, \tag{10}\]  
where \(H\) is the total number of patches extracted from \(F_{m}\).