# FA-VTON: A Feature Alignment-Based Model for Virtual Try-On
## 4 Methods
### Feature Extraction Module (FEM)
#### 4.2.1 Feature Alignment Module (FAM)  
The recursive downsampling operations operated by the FPN often have spatial misalignments between the upsampled high-dimensional feature map and the corresponding low-dimensional feature map. Consequently, the simplistic feature fusion methods used by the traditional FPN, such as element-wise addition or channel-wise concatenation, can adversely affect the boundary perception of the target object.  
However, regardless of whether it is for person or garment feature extraction, errors in boundary perception can significantly impact the subsequent warping stage. Errors in extracting the edges of a person can lead to incorrect shaping of garments. Similarly, boundary perception errors in garment feature extraction can result in the loss of garment details or erroneous retention of back fabric.  
Figure 5: The structure of the person FEM. The garment FEM has the same structure with different inputs. The dashed box represents the structure of the FASM, consisting of the FAM and FSM.  
In this paper, we use a Feature Alignment Module to adjust the upsampled feature map by learning offsets to align various sampling positions. Specifically, we adjust the upsampled feature \(P_{i}^{up}\) based on spatial positional information provided by \(\hat{\mathcal{C}}_{i-1}\). We represent spatial positional information using a 2D feature map, where each offset value can be viewed as the two-dimensional spatial displacement distance between each point in \(P_{i}^{up}\) and its corresponding point in \(\hat{\mathcal{C}}_{i-1}\).  
The specific structure of the FAM is illustrated in Figure 6a.  
Figure 6a shows the workflow of the FAM. Prior to feature fusion, the upsampled feature map \(P_{i}^{up}\) is aligned with its reference feature map \(\hat{\mathcal{C}}_{i-1}\). This alignment involves normalizing the upsampled feature \(P_{i}^{up}\) based on the spatial position information provided by \(\hat{\mathcal{C}}_{i-1}\). Additionally, \(K\) denotes convolutional kernels at \(K\) sampled positions, and \(C\) represents feature channel numbers. \(\Delta_{i}\) represents the offset to be learned for the convolutional kernels. Feature alignment can be mathematically described.  
Learn offsets from upsampled and downsampled feature maps as follows:  
\[\Delta_{i}=f_{offset}\Big{(}\Big{[}\hat{\mathcal{C}}_{i-1},P_{i}^{up}\Big{]} \Big{)}, \tag{1}\]  
then, apply offsets to the downsampled feature map \(P_{i}^{up}\) for alignment as follows:  
\[\hat{P}_{i}^{up}=f_{align}\Big{(}P_{i}^{up},\triangle_{i}\Big{)}, \tag{2}\]  
where \(\Big{[}\hat{\mathcal{C}}_{i-1},P_{i}^{up}\Big{]}\) denotes the concatenation of \(\hat{\mathcal{C}}_{i-1}\) and \(P_{i}^{up}\), providing spatial disparities between the upsampled and corresponding bottom-up features. \(f_{offset}(\cdot)\) represents learning offset from spatial disparities \(\Delta_{i}\), and \(f_{align}(\cdot)\) is the function aligning features with learned offsets. \(f_{offset}(\cdot)\) and \(f_{align}(\cdot)\) are \(3\times 3\) deformable convolutions [36]. Deformable  
Figure 6: The structure of the FAM and FSM. (**a**) The workflow of the Feature Alignment Module (FAM). Aligning \(P_{i}^{up}\) by learning the spatial position offsets \(\Delta_{i}\) of \(\hat{\mathcal{C}}_{i-1}\) and \(P_{i}^{up}\); (**b**) the workflow of the Feature Selection Module (FSM).  
convolutions adjust convolutional sampling positions based on offsets, aligning features \(P_{i}^{up}\) according to spatial distances between \(\hat{C}_{i-1}\) and \(P_{i}^{up}\).