## 2 Methods
### Vision Transformer Layer  
In a ViT layer, an input feature map is first partitioned into a fixed number of non-overlapping patches. These patches are subsequently linearly embedded into a flattened vector, which serves as the input token for the transformer. A learnable positional encoding is added to the input token to incorporate spatial information. The encoded input tokens are then fed through a series of ViT layers, each comprising a MSA and a MLP. The MSA enables the model to capture long-range dependencies among input tokens, while the MLP refines the features extracted by the MSA. LN is applied within the ViT layers to stabilize the training process and promote model convergence. The basic ViT-based layer pipeline is shown in Figure 2c, and is described by the following six steps:  
1. The process of tokenization converts the input image \(x\) of dimensions \(H\times W\) into a sequence of flattened 2D patches denoted \(\{x_{i}^{p}\in\mathbb{R}^{P^{2}\cdot C}\}_{i=1,\ldots,N}\). Each patch measures \(P\times P\), and \(N=\frac{H\times W}{P^{2}}\) accounts for the total number of image patches, thereby defining the input sequence length. 2. These patches are subsequently mapped onto vectors \(x^{p}\) in a latent \(D\)-dimensional embedding space using a trainable linear projection. To capture the spatial information inherent in the patches, learnable position embeddings are added to the patch embeddings, as follows: \[z^{0}=[x_{1}^{p}E;x_{2}^{p}E;\ldots;x_{N}^{p}E]+E_{\text{pos}}\] (1) In this expression, \(E\in\mathbb{R}^{(P^{2}\cdot C)\times D}\) represents the patch embedding projection, \(E_{\text{pos}}\in\mathbb{R}^{N\times D}\) is the position embedding, and \(z^{0}\) provides the feature map input to the first ViT layer. 3. Comprising \(L\) layers, each incorporating an MSA and a MLP, the transformer encoder's output from the \(l^{th}\) layer is illustrated as \[z_{l}^{\prime}=\text{MSA}(\text{LN}(z_{l-1}))+z_{l-1}\] (2) \[z_{l}=\text{MLP}(\text{LN}(z_{l}^{{}^{\prime}}))+z_{l}^{{}^{\prime}}\] (3) where \(\text{LN}(\cdot)\) stands for the layer normalization operator, and \(z_{l}\) stands for the encoded image. 4. The MLP is a fully connected feedforward neural network that consists of multiple layers of nodes. In the proposed NR-UNet, the MLP refines the features extracted  
Figure 3: The adaptive denoising learning strategy during training. Predictions get generated through conventional training. Labels with higher prediction losses are more likely to be considered as noisy. ADL detects and removes a specific number of labels deemed as noisy during training. Precise (in blue) and imprecise (in green) labels get classified and, if imprecise, discarded. by the MSA mechanism. The MLP involves two linear layers interspersed with a GELU activation function [35], defined as  
\[\text{MLP}(z_{l}^{{}^{\prime}})=\text{Linear}_{2}(\text{GELU}(\text{Linear}_{1}( z_{l}^{{}^{\prime}}))) \tag{4}\]  
In this equation, \(\text{Linear}_{1}\) and \(\text{Linear}_{2}\) denote the first and second linear layers. The subsequent MSA is composed of multiple self-attention heads that operate in parallel to capture different aspects of the input tokens. Each self-attention head calculates attention scores employing Query (\(Q\)), Key (\(K\)), and Value (\(V\)) matrices, which are derived from the input tokens via linear transformations:  
The matrices Query (\(Q\)), Key (\(K\)), and Value (\(V\)) are derived from the input tokens \(z_{l}^{{}^{\prime}}\) through linear transformations:  
\[Q=z_{l}^{{}^{\prime}}W_{Q},\quad K=z_{l}^{{}^{\prime}}W_{K},\quad V=z_{l}^{{}^ {\prime}}W_{V} \tag{5}\]  
where \(W_{Q}\), \(W_{K}\), and \(W_{V}\) are learnable weight matrices [21]. The attention scores are computed by taking the dot product of the \(Q\) and \(K\) matrices, subsequently scaling and normalizing through softmax:  
\[\text{Attention}(Q,K,V)=\text{softmax}\left(\frac{QK^{\top}}{\sqrt{d_{k}}} \right)V \tag{6}\]  
where \(d_{k}\) denotes the dimensionality of the Key vectors.