## 2 Pixel-Level Equalized Memory Matching Network
### Feature Similarity Matching  
In semi-supervised video target segmentation methods, only the segmentation mask of the first frame is given, and the target is segmented in all the remaining frames of the video. The existing SVOS methods are most often based on feature similarity matching, in which embedded features of the reference frame are compared with those of the query frame. It is necessary for VOS to perform pixel-level feature matching to ensure that the information located in localized regions is captured. We first review the process of feature similarity matching. The image of frame \(i\) and its features are denoted by \(I^{i}\in R^{H0\times W0\times 3}\) and \(X^{i}\in R^{H\times W\times C}\), respectively. The predicted mask and the mask after downsampling are denoted by \(M^{i}\in R^{H0\times W0\times Z}\) and \(m^{i}\in R^{H\times W\times 2}\), containing the background and foreground channels. Given \(X^{i}\), \(X^{k}\), and \(m^{k}\), \(M^{i}\) can be obtained, where \(k\in[0\), \(i-1]\) refers to a reference frame. In order to mine the relation between reference frame and query frame, that is, to obtain the best match between them, the reference frame mask is transferred to the query frame, and the query frame mask is predicted. First, similarity computation is performed. If \(p\) and \(q\) are the positions of individual spatial pixels in the reference frame and query frame features, then the similarity score can be expressed as follows:  
\[S(p,q)=\frac{N(X^{k}_{p})\cdot N(X^{k}_{q})+1}{2}, \tag{1}\]  
where \"\(\cdot\)\" and \(N\) indicate the matrix inner product and channel L2 normalisation, respectively. In order to be in the same range as the scores of the mask, linear normalisation is applied to transform the similarity scores to be in the range of 0 to 1. Then the similarity matrix \(S\in R^{H^{\prime}W^{\prime}\times HW}\) can be calculated. After reshaping the reference frame mask, the similarity matrix \(S\) is multiplied with it to enhance the target information, as in (2). \[ \begin{split} S_{BG}&=S\otimes M^{k}_{0}\\ S_{FG}&=S\otimes M^{k}_{1}\end{split}  \tag{2}\]  
where \(\otimes\) denotes Hadamard product. Next, the \(S_{BG}\) and \(S_{FG}\) are subjected to a query maximization operation to obtain the foreground and background matching scores. By concatenating them along the channel, the final matching score map of frame \(i\) can be represented as \(S^{i}\in[0,1]^{H\times W\times 2}\). The visualization flowchart is shown in Figure 1a. From the above surjective matching process, it can be seen that the query frame matches some pixels of specific spatial positions in the reference frame, without considering the best match with the reference frame. Thus, there will be cases where some reference frame pixels are not referenced, and some pixels are referenced multiple times. The method is robust to scale and appearance variations but is also susceptible to background interference. Bijective matching differs from traditional surjective matching by conducting a reference-wise top \(K\) operation before identifying the optimal matches between the query frame and the reference frame, thereby eliminating background distractors from the selection process, as shown in Figure 1b. To ensure that all connected pixels are uniformly distributed, only the largest \(K\) scores in the query frame are maintained, and the rest are excluded. Replace the similarity score of the missing connection with the minimum value in each pixel of the reference frame. The query frame can refer to the reference frame if and only if the query frame is selected by at least one reference frame pixel. This shows that, compared with surjective matching, the implementation of the bijective matching algorithm is more strict so as to ensure the information transfer between the two frames is more reliable.