Embed U using Swin Transformer 2 -Net method for segmenting radio frequency interference

By embedding the Swin Transformer into the U2-Net model and combining it with technologies such as the efficient multi-scale attention mechanism and feature compression module, the shortcomings of existing methods in segmenting narrowband RFI are overcome, achieving higher-precision RFI segmentation.

CN120354892BActive Publication Date: 2025-09-09KUNMING UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510847387.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-09-09
Estimated Expiration
2045-06-24

AI Technical Summary

Technical Problem

Existing radio frequency interference segmentation methods perform poorly in segmenting narrowband RFI and are prone to missed detection and false detection, affecting the integrity and accuracy of radio telescope observation data.

Method used

The Swin Transformer is embedded in the U2-Net model, combined with an auxiliary encoder and a main encoder. By introducing an efficient multi-scale attention mechanism, a spatial interaction module, a feature compression module and the Kolmogorov-Arnold network (KAN) to replace the multi-layer perceptron, the feature representation and segmentation capabilities of narrowband RFI are enhanced.

Benefits of technology

The precision and accuracy of radio frequency interference segmentation are improved, especially the segmentation performance of narrowband RFI in complex backgrounds, which reduces false detection and missed detection and improves the overall segmentation accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120354892B_ABST
    Figure CN120354892B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for embedding U 2 The method for segmenting radio frequency interference using the ‑Net method belongs to the field of radio astronomy image segmentation technology based on deep learning. The invention comprises: simultaneously inputting the time-frequency image of radio observation data into the trained ST‑U 2 The main encoder and auxiliary encoder in the Net model extract local detail features and global context information, respectively. The intermediate feature maps of the auxiliary encoder output at each stage are fused with the intermediate feature maps of the main encoder output at each stage through the relationship aggregation module in the main encoder and then input into the decoder. The decoder then outputs a predicted segmentation mask image containing the RFI area and the non-interference area. Compared to existing deep learning RFI segmentation methods, this method has significant advantages in segmenting narrowband RFI and overall segmentation accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for embedding U 2 -Net segmentation method for radio frequency interference belongs to the field of radio astronomy image segmentation technology based on deep learning. Background Art

[0002] Any unwanted signal received by a radio telescope is called radio frequency interference (RFI). The data observed by radio telescopes is crucial in radio astronomy research, but when they capture radio signals from the universe, they inevitably encounter radio frequency interference (RFI). RFI usually originates from various man-made signals, such as electromagnetic radiation from wireless communications, satellite transmissions, and other electronic devices. These interferences not only occupy an increasingly large frequency band, but also seriously affect the quality of observation data of cosmic signals, posing a great challenge to scientific research. As the sensitivity and resolution of radio telescopes increase, the problem of RFI becomes more prominent, and there is an urgent need to develop effective segmentation methods to ensure the accuracy of scientific data.

[0003] Traditional RFI segmentation methods, including singular value decomposition of time-frequency matrices, VarThreshold, and wavelet transforms, have been widely used in various types of real-world observational data and have demonstrated promising results. However, when these traditional methods were applied to actual observational data collected by the Yunnan Observatory's 40-meter radio telescope, we found that while they performed well for segmenting broadband RFI signals covering multiple frequency channels, they performed poorly for segmenting narrowband RFI signals, which occupy fewer channels and have a shorter duration. This limitation makes narrowband RFI easily missed, compromising the integrity and accuracy of the observational data.

[0004] To overcome the limitations of traditional methods, semantic segmentation of RFI images based on convolutional neural networks (CNNs) has received widespread attention in recent years and has gradually become an important tool for addressing interference issues in radio data processing. For example, early research by Akeret et al. used a U-Net architecture to segment RFI and achieved good results. Subsequently, Kerrigan et al. further designed a deep fully convolutional network (DFCN) to achieve excellent results in segmenting RFI from the Hydrogen Epoch of Reionization Array (HERA) by fusing amplitude and phase information. R-Net, trained on simulated data and then fine-tuned on real data, achieved superior performance compared to U-Net. While these methods demonstrated superior results to traditional methods on simulated data, their application to real data collected by the Yunnan Observatory's 40 m radio telescope revealed significant shortcomings in segmenting narrowband RFI signals. This was manifested in the omission of narrowband RFI and the misdetection of non-RFI as RFI, resulting in inaccurate RFI segmentation. Summary of the Invention

[0005] The present invention provides a method for embedding U 2 -Net segmentation method for RF interference to construct ST-U 2 Net model, and based on the trained ST-U 2 Net model to segment radio frequency interference in the time-frequency images of radio observation data to be predicted.

[0006] The technical solution of the present invention is:

[0007] A method of embedding U using Swin Transformer 2 -Net segmentation method for radio frequency interference, comprising the following steps:

[0008] Get the trained ST-U 2 Net model; the ST-U 2 Net model includes an auxiliary encoder based on Swin Transformer and an 2 -Net's main encoder and decoder;

[0009] Obtain the radio observation data to be predicted; input the time-frequency images of the radio observation data into the trained ST-U at the same time 2The main encoder and auxiliary encoder in the Net model extract local detail features and global context information respectively; the intermediate feature maps of the auxiliary encoder output at each stage in the auxiliary encoder and the intermediate feature maps of the main encoder output at each stage in the main encoder are fused through the relationship aggregation module of each stage in the main encoder and then input into the decoder; the decoder gradually restores the feature map to the original resolution through multi-level upsampling and feature fusion operations, and finally outputs the predicted segmentation mask image containing the radio frequency interference area and the non-interference area through convolution operation and Sigmoid activation function.

[0010] Furthermore, in the auxiliary encoder, the time-frequency image of the radio observation data is first divided into overlapping blocks by an image division module; then, these overlapping blocks are flattened and projected to the embedding dimension through a linear embedding layer; then, the output of the linear embedding layer is processed by four consecutive first downsampling stages and a feature compression module to obtain the output of each downsampling stage, that is, the intermediate feature map of the auxiliary encoder of each stage; the output of the four downsampling stages is used as the input of the four second downsampling stages in the main encoder; the four first downsampling stages each include a plurality of transformers connected in sequence, and the transformer is constructed by integrating the spatial interaction module into the improved Swin Transformer block, and the input of the first downsampling stage is used as the input of the spatial interaction module and the improved Swin Transformer block in the first transformer, the output of the spatial interaction module and the improved Swin Transformer block in the first transformer are added as the output of the first transformer, and the output of the first transformer is used as the input of the second transformer.

[0011] Furthermore, the improved Swin Transformer block is constructed by using the traditional Swin Transformer block as a framework and introducing KAN to replace the MLP in the traditional Swin Transformer block.

[0012] Furthermore, in the main encoder, the time-frequency image of the radio observation data is first input into the residual U-shaped structure RSU module of the first preset height, and then passes through the efficient multi-scale attention mechanism module to generate a first-scale feature map; then, the first-scale feature map is further passed through four consecutive second downsampling stages, and in the second downsampling stage, it is processed by the residual U-shaped structure RSU module and the efficient multi-scale attention mechanism module in the second downsampling stage to obtain the main encoder intermediate feature map of each stage; the main encoder intermediate feature map of each stage and the auxiliary encoder intermediate feature map of each stage are fused through the relationship aggregation module in the corresponding second downsampling stage to obtain the second, third, fourth, and fifth scale feature maps; the fifth scale feature map is used as the input of the RSU-4F module to obtain the RSU-4F output feature map; the first, second, third, fourth, and fifth scale feature maps and the RSU-4F output feature map are used as the input of the decoder.

[0013] Furthermore, in the four consecutive second downsampling stages, the height of the residual U-shaped structure RSU module in each stage decreases from input to output.

[0014] Furthermore, the residual U-shaped structure RSU module of the first preset height has the same height as the residual U-shaped structure RSU module in the second downsampling stage close to the first preset height in four consecutive second downsampling stages.

[0015] Furthermore, the ST-U 2 The Net model uses MIou as the primary evaluation indicator.

[0016] The beneficial effects of the present invention are:

[0017] This paper proposes a dual encoder structure ST-U that combines Swin Transformer and residual U-shaped structure. 2 Net model is used to segment RFI in the actual observation data captured by radio telescopes. It introduces an efficient multi-scale attention mechanism through the main encoder, strengthens the reorganization of feature channels and pixel-level relationship modeling, and improves the segmentation accuracy of RFI under complex backgrounds; the auxiliary encoder introduces a spatial interaction module and a feature compression module to enhance the model's feature representation of narrowband RFI and reduce detail loss, and uses the Kolmogorov-Arnold network KAN to replace the multi-layer perceptron MLP in the SwinTransformer to improve the model's modeling ability for narrowband RFI features; the relationship aggregation module in the main encoder fuses the intermediate features of the main encoder and the auxiliary encoder to achieve an effective combination of local details and global information of RFI. Compared with existing deep learning radio frequency interference segmentation methods, the present invention has obvious advantages in segmenting narrowband RFI and overall segmentation accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 The present invention proposes a dual-encoder structure based on ST-U 2 Net network model structure diagram;

[0019] Figure 2 It is a structural diagram of the traditional Swin Transformer and the improved Swin Transformer block of the present invention;

[0020] Figure 3 This paper uses the real observation data of the pulsar PSR J0032 +5434 observed by the 40-meter radio telescope of Yunnan Astronomical Observatory;

[0021] Figure 4 This is the experimental result diagram of the fourth group of simulations in Example 2. DETAILED DESCRIPTION

[0022] To make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other in any way.

[0023] Example 1: Figure 1-Figure 4 As shown, according to the first aspect of the embodiment of the present invention, a method for embedding U using SwinTransformer is provided. 2 -Net segmentation method for radio frequency interference, including: obtaining the trained ST-U 2 Net model; the ST-U 2 Net model includes auxiliary encoder based on Swin Transformer, 2 -Net's main encoder and decoder; obtain the radio observation data to be predicted; input the time-frequency images of the radio observation data into the trained ST-U 2The main encoder and auxiliary encoder in the Net model extract local detail features and global context information respectively; the auxiliary encoder intermediate feature map output by each stage in the auxiliary encoder and the main encoder intermediate feature map output by each stage in the main encoder are fused through the relationship aggregation module of each stage in the main encoder and then input into the decoder; the decoder gradually restores the feature map to the original resolution through multi-level upsampling and feature fusion operations, and finally outputs the predicted segmentation mask image containing the radio frequency interference area and the non-interference area through convolution operation and Sigmoid activation function. The model of the present invention uses the Swin Transformer module as an auxiliary encoder to generate a segmentation mask image based on the U 2 -Net's main encoder injects multi-scale contextual prior information, which effectively makes up for the shortcomings of existing methods in extracting narrowband RFI features. By constructing a dual-encoder structure, it can fuse the local details and global features of RFI, and ultimately achieve improved RFI segmentation performance in time-frequency images of complex radio observation data.

[0024] Furthermore, in the auxiliary encoder, the time-frequency image of the radio observation data is first divided into overlapping 8×8 blocks by the image partitioning module Patch Partition, and the overlap rate is set to 50% to ensure that feature maps with pixel continuity and semantic correlation are obtained; then, these overlapping blocks are flattened and projected to the embedding dimension through a linear embedding layer; then, the output of the linear embedding layer is processed by four consecutive first downsampling stages and a feature compression module to obtain the output of each downsampling stage, that is, the intermediate feature map of the auxiliary encoder of each stage; the output of the four downsampling stages is used as the input of the four second downsampling stages in the main encoder; the four first downsampling stages each include a plurality of transformers connected in sequence, and the transformer is constructed by integrating the spatial interaction module into the improved Swin Transformer block, and the input of the first downsampling stage is used as the input of the spatial interaction module and the improved Swin Transformer block in the first transformer, and the outputs of the spatial interaction module and the improved Swin Transformer block in the first transformer are added as the output of the first transformer, and the output of the first transformer is used as the input of the second transformer (that is, as the spatial interaction module (SIM) and the improved Swin Transformer in the second transformer). The output of the spatial interaction module and the improved SwinTransformer block in the second transformer are added as the output of the second transformer, and the output of the second transformer is used as the input of the third transformer), and so on, and the output of the last transformer is used as the input of the feature compression module.

[0025] Furthermore, if Figure 2 As shown ( Figure 2(a) is the traditional Swin Transformer block, Figure 2 (b) is an improved Swin Transformer block). The improved Swin Transformer block uses the traditional Swin Transformer block as the framework and introduces KAN to replace the MLP in the traditional Swin Transformer block, so as to improve the model's ability to characterize radio frequency interference signals through a more flexible activation function.

[0026] In the traditional Swin Transformer block structure, including LN, MLP and alternating use of window multi-head self-attention (W-MSA) and shifted window multi-head self-attention (SW-MSA), based on this structure, the present invention considers the following aspects for the prediction of radio frequency interference:

[0027] First, to address the problem of extracting subtle features and accurately segmenting narrowband RFI in complex backgrounds, this paper introduces the Kolmogorov-Arnold Network (KAN) to replace the traditional MLP. Unlike the MLP, which uses fixed activation functions at its nodes, the KAN employs a learnable activation function for its weights. By configuring an adjustable network size and piecewise polynomial order, KAN can generate a fine activation grid within the range [-1, 1]. Furthermore, KAN parameterizes each weight using a univariate spline function, thus eliminating its reliance on linear weights. This nonlinear weight representation significantly improves the model's ability to express complex functional relationships. Due to its lightweight structure, KAN can achieve or even exceed the accuracy of traditional MLPs with smaller network sizes. Furthermore, as the network expands, KAN's accuracy improves faster than that of MLPs, enabling higher segmentation accuracy at a lower computational cost. Based on these design principles, the present invention replaces the MLP with the KAN to further enhance the model's ability to extract and segment narrowband RFI in complex backgrounds.

[0028] Secondly, while the traditional Swin Transformer block structure effectively reduces memory overhead by establishing relationships between image patches and employing a strategy of alternating windowed attention (W-MSA) and shifted windowed attention (SW-MSA), this modeling approach somewhat weakens its global modeling capabilities. Furthermore, due to the small spatial footprint and weak features of narrowband RFI, some spatial information is required to help the model learn its characteristics. Therefore, this paper employs a spatial interaction module (SIM module) to enhance spatial information exchange and encode more accurate spatial information. The SIM module uses 3 × 3 convolutions with a dilation ratio of 2 to reconstruct the spatial structure of the input features and compress the channel dimension to optimize technical efficiency. The SIM module introduces two spatial dimensions and extracts vertical and horizontal statistical features of the reconstructed features through global average pooling. This module not only focuses on the association between labels but also models the relationships between pixels, thereby enhancing the applicability of the Swin Transformer module for image segmentation tasks. Subsequently, the statistical features are used to generate a position-sensitive attention map using the tensor product method. Finally, the attention map is added to the output of the traditional Swin Transformer block as the output of the transformer.

[0029] Thirdly, the traditional Swin Transformer constructs a transformer by flattening and projecting image blocks or merging adjacent 2×2 image blocks and performing linear processing. However, these methods often easily cause the loss of a large amount of details and structural information, which limits the segmentation of dense and small-scale objects. Given that narrow-band RFI also has dense and small-scale characteristics. Therefore, the present invention introduces a feature compression module (FCM) in the downsampling process of the image block to avoid the above problems, thereby improving the segmentation effect of narrow-band RFI objects. FCM adopts a dual-branch collaborative design: the first branch expands the receptive field through hierarchical dilated convolution to extract the features of narrow-band RFI; the second branch adopts a soft pooling operation based on exponential weighting to retain more details of the feature map after downsampling. By performing channel alignment and element-level fusion on the outputs of the two branches, FCM can effectively enhance the segmentation effect of narrow-band RFI.

[0030] Furthermore, in the main encoder, the time-frequency image of the radio observation data is first input into the residual U-shaped structure module (RSU module with a height of 7), and then passes through the efficient multi-scale attention mechanism module to generate a first-scale feature map; then, the first-scale feature map is further passed through four consecutive second downsampling stages, and in the second downsampling stage, it is processed by the residual U-shaped structure module and the efficient multi-scale attention mechanism module in the second downsampling stage to obtain the main encoder intermediate feature map of each stage; the main encoder intermediate feature map of each stage and the auxiliary encoder intermediate feature map of each stage are fused through the relationship aggregation module in the corresponding second downsampling stage to obtain the second, third, fourth, and fifth-scale feature maps; the fifth-scale feature map is used as the input of the RSU-4F module to obtain the RSU-4F output feature map; the first, second, third, fourth, and fifth-scale feature maps and the RSU-4F output feature map are used as the input of the decoder.

[0031] Furthermore, in the four consecutive second downsampling stages, the height of the residual U-shaped structure RSU module in each stage decreases from the input to the output (i.e., RSU-7, RSU-6, RSU-5, and RSU-4 from the input to the output).

[0032] Furthermore, the residual U-shaped structure RSU module of the first preset height is the same as the height of the residual U-shaped structure RSU module in the second downsampling stage of the residual U-shaped structure RSU module close to the first preset height in four consecutive second downsampling stages (that is, the height of the residual U-shaped structure RSU module of the first preset height is 7).

[0033] By applying the above technical solution, it can be seen that the innovation of the main encoder of the present invention is: 2 -Net, we introduce the well-known efficient multi-scale attention mechanism module (EMA module) and relationship aggregation module (RAM module). The following are further explanations of each module:

[0034] First, models based on channel or spatial attention mechanisms have been widely used in segmentation tasks. However, traditional methods typically rely on channel dimensionality reduction to model cross-channel relationships, which can hinder the extraction of deep visual features. Furthermore, existing attention mechanisms suffer from a trade-off between computational complexity and feature preservation, making it difficult to efficiently capture both local and global features. To this end, this paper introduces an EMA module to reduce computational complexity while preserving the expressive power of global features, thereby better supporting the RFI segmentation task in this study. First, EMA remaps some channels of input features to the batch dimension, allowing the network to efficiently model cross-channel information interactions within different sub-feature groups. During the feature extraction stage, EMA employs parallel 1×1 and 3×3 convolutional branches for cross-channel information interaction and local spatial feature extraction, respectively. The 1×1 branch focuses on cross-channel information interaction, utilizing global average pooling to encode long-range dependencies in the horizontal and vertical directions. The 3×3 branch, on the other hand, focuses on extracting local spatial features, enhancing multi-scale feature modeling capabilities through a larger receptive field. EMA then uses a cross-space learning mechanism to fuse the feature maps of the two parallel branches using matrix dot products. It also employs global average pooling to capture pixel-level pairing relationships, thereby strengthening feature relevance globally. Finally, the fused features are weighted using a sigmoid activation function to calculate attention weights, which are then applied to the input feature map to generate the EMA output.

[0035] Second, while the CNN-based main encoder can extract rich local features in the spatial dimension through convolution kernels, it lacks explicit modeling of relationships between channel dimensions. Existing CNN-based encoders primarily rely on the local perception of convolution kernels in the spatial dimension, but still lack explicit modeling of relationships between channel dimensions. This limitation can lead to feature representation confusion when similar distribution patterns appear in different channels. This can reduce the model's discriminative ability and cause the model to mistakenly detect non-RFI as RFI. To address this issue, the present invention introduces a RAM module. The RAM module first extracts channel dependencies from global features from the auxiliary encoder intermediate features and incorporates them into the intermediate features extracted by the main encoder. Furthermore, RAM incorporates deformable convolution and soft pooling operations to adapt to the diverse morphology of segmented objects, further refining the main encoder's feature extraction. Specifically, RAM first applies deformable convolution and channel-dimensional transformation to the outputs of the main and auxiliary encoders, respectively, to generate geometrically robust features. Average pooling, max pooling, and soft pooling are then used to quantify the importance of auxiliary encoder features in the channel dimension. Channel attention weights are then generated through a cascade of fully connected layers. Finally, the attention weight is element-wise multiplied with the main encoder feature processed by deformable convolution, and then element-wise added with the auxiliary encoder output feature after 1×1 convolution to obtain the output feature of RAM.

[0036] In addition, it should be noted that the present invention uses the traditional U 2 -Net is the framework of the RSU module, whose main RSU module combines the hierarchical feature aggregation capability of the U-shaped codec structure with the efficient feature transfer mechanism of residual learning. In the encoding stage, the RSU module extracts local details through multi-layer convolution and gradually integrates global context information to enhance feature expression capabilities. In the decoding stage, a cross-level feature splicing and convolution refinement strategy is adopted to reconstruct the spatial boundaries of the target with higher precision. Compared with the classic CNN architecture (such as VGG, ResNet and DenseNet) that mainly relies on small convolution kernels for feature extraction, the symmetric encoding and decoding characteristics of the RSU module effectively alleviate the receptive field limitation problem of shallow networks, making it more robust to background noise in the RFI segmentation task of radio observation data.

[0037] Furthermore, the decoder is composed of RSU-4, RSU-5, RSU-6 and RSU-7 decoding modules respectively; the fifth scale feature map and the RSU-4F output feature map are spliced ​​and upsampled as the input of the RSU-4 decoding module, the fourth scale feature map and the output of the RSU-4 decoding module are spliced ​​and upsampled as the input of the RSU-5 decoding module, the third scale feature map and the output of the RSU-5 decoding module are spliced ​​and upsampled as the input of the RSU-6 decoding module, the second scale feature map and the output of the RSU-6 decoding module are spliced ​​and upsampled as the input of the RSU-7 decoding module, the first scale feature map and the output of the RSU-7 decoding module are spliced ​​and upsampled to obtain the original scale radio time-frequency feature map; each of the decoding modules, the RSU-4F output feature map and the original scale radio time-frequency feature map are first processed through a 3×3 The convolution layer is used for processing, and then up-sampled by bilinear interpolation to restore its resolution to the prediction mask of the size of the time-frequency image of the original input radio observation data. The prediction mask is spliced ​​and processed through a 1×1 convolution and Sigmoid activation function. It is then passed through the segmentation head to predict the category of each pixel, and finally the predicted segmentation mask image containing the interference area and the non-interference area is output.

[0038] It should be noted that "-4, -5, -6, -7" in the RSU-4, RSU-5, RSU-6, and RSU-7 decoding modules indicate heights of 4, 5, 6, and 7. "-4F" in the RSU-4F decoding module indicates the use of dilated convolution to prevent feature loss due to further downsampling of the feature map, and the height is 4.

[0039] By applying the above technical solution, it can be seen that the present invention adopts a dual encoder structure to take into account the segmentation tasks of both significant broadband RFI and narrowband RFI in the image. The auxiliary encoder introduces a spatial interaction module and a feature compression module to enhance the feature representation of narrowband RFI and reduce detail loss, respectively, thereby improving the segmentation accuracy of small narrowband RFI; in addition, the multi-layer perceptron (MLP) in the traditional SwinTransformer is replaced by (KAN) to enhance the modeling capability of narrowband RFI features. The main encoder is committed to accurately extracting significant broadband RFI features in radio observation images during the downsampling process, which is crucial to the overall segmentation performance. The main encoder enhances feature representation through an efficient multi-scale attention (EMA) mechanism, reorganizes channel information, captures pixel-level relationships, and improves segmentation accuracy under complex backgrounds; further, the introduced relationship aggregation module fuses the features of the two encoders to achieve the purpose of more accurately segmenting narrowband RFI in radio observation data and reducing the false detection of non-RFI as RFI.

[0040] According to a second aspect of an embodiment of the present invention, a method for embedding a U 2 -Net segmentation radio frequency interference device, including: an acquisition module for acquiring the trained ST-U 2 Net model; the ST-U 2 Net model includes auxiliary encoder based on Swin Transformer, 2 -Net's main encoder and decoder; a prediction module for obtaining the radio observation data to be predicted; for simultaneously inputting the time-frequency images of the radio observation data into the main encoder and the auxiliary encoder to extract local detail features and global context information respectively; the auxiliary encoder intermediate feature maps output by each stage in the auxiliary encoder and the main encoder intermediate feature maps output by each stage in the main encoder are fused through the relationship aggregation module of each stage in the main encoder and then input into the decoder; the decoder gradually restores the feature map to the original resolution through multi-level upsampling and feature fusion operations, and finally outputs the predicted segmentation mask image containing the radio frequency interference area and the non-interference area through convolution operation and Sigmoid activation function.

[0041] According to a third aspect of an embodiment of the present invention, a processor is provided, wherein the processor is used to run a program, wherein the program executes any one of the above-mentioned methods of using Swin Transformer to embed U 2 -Net method for segmenting radio frequency interference.

[0042] Example 2: Using Swin Transformer to embed U 2 -Net segmentation method for radio frequency interference, comprising the following steps:

[0043] S1. Observational data from the 40-meter radio telescope at the Yunnan Observatory in southwest China, collected between September 2016 and October 2022, covers three different pulsars: PSR J0332+5434, J00358+5413, and J0437-4715. Observational data with a sub-integral score greater than 90 and a channel count greater than 128 were selected for analysis, resulting in a total of 1,383 time-frequency image samples and corresponding labels. To ensure fair and scientific data partitioning, the training, validation, and test sets were randomly divided in a 7:2:1 ratio: 970 samples were used for model training, 276 samples for model validation, and 138 samples for model testing. It should be noted that in the training, validation, and test sets, each time-frequency image contains both useful pulsar signals and unwanted radio frequency interference signals, while the corresponding masked label images only annotate the radio frequency interference signal.

[0044] For example, the time-frequency image of PSR J0332+5434 is as follows: Figure 3 As shown, from Figure 3 It can be seen that RFI is brighter than background noise or astronomical signals.

[0045] S2, build Figure 1 The ST-U shown 2 Net model; ST-U 2 The .Net network was built using the PyTorch framework and trained using the AdamW optimizer with a weight decay parameter of 1e-4. The initial learning rate was set to 0.001, and a warmup strategy was introduced at the beginning of training, gradually increasing the learning rate from a small value to 0.001 via linear growth over the first two epochs. After the warmup phase, the learning rate was dynamically adjusted by a custom scheduler based on training progress, gradually decreasing to improve model convergence efficiency and final performance. Furthermore, the training process supports mixed-precision training, which effectively improves computational efficiency and reduces graphics memory usage. In the experiments, the training batch size was set to 4, and the data augmentation strategy included resizing images to 256×256 pixels, performing random horizontal flips (with a probability of 0.5), and normalization. The model was trained for a maximum of 500 epochs, with performance evaluated on the validation set every 10 epochs. The model weights that performed best in terms of the MIoU metric on the validation set were retained for subsequent testing. All experiments are run on an NVIDIA GeForce RTX 4050 6-GB GPU.

[0046] In order to enhance the model's ability to segment RFI, the present invention chooses to use the BCE loss function. Expressed as:

[0047]

[0048] in, L is the total loss, n is the number of categories output by the network, Represents output With the goal The binary cross entropy loss.

[0049] The present invention uses F1 score, recall rate (Recall), precision rate (Precision) and MIou to evaluate model performance. These four evaluation indicators are based on the confusion matrix, which contains four elements: true positive (TP), false positive (FP), true negative (TN) and false negative (FN). For each category, Iou is defined as the intersection of the predicted value and the true value, calculated as follows:

[0050]

[0051] The F1 score is calculated as follows:

[0052]

[0053] Recall is calculated as follows:

[0054]

[0055] Precision is calculated as follows:

[0056]

[0057] Where MIou represents the average value of Iou of all categories.

[0058] S3. Simulation Description: The following simulations all use the training set in Example S1 to train the model. The time-frequency images used during training are uniformly scaled to 256×256 pixels. The model is trained for a maximum of 500 epochs. Model performance is evaluated on the validation set every 10 epochs, and the results are recorded for each round. The model with the best MIoU performance on the validation set is selected as the optimal model and used in subsequent simulation tests.

[0059] The first set of simulations: To evaluate the proposed ST-U 2 Net model and the performance of its modules, the present invention will 2-Net was used as the baseline model for ablation experiments on the dataset. In addition, it was compared with the ST-UNet model that proposed SIM, FCM and RAM (that is, the architecture of the auxiliary encoder based on Swin Transformer and the main encoder and decoder based on residual network and RAM is adopted. The difference from the model of the present invention is that the transformer in the auxiliary encoder integrates the spatial interaction module into the traditional Swin Transformer block for construction, and the main encoder and decoder adopt the architecture based on residual network and RAM). Then a structure was built to encode the features of the main encoder and auxiliary encoder of each stage by element-by-element addition to obtain the output features of each stage. This structure is referred to as STRSU (that is, the auxiliary encoder based on Swin Transformer, the main encoder based on U 2 -Net's main encoder and decoder architecture is different from the model of the present invention in that the entire auxiliary encoder uses the traditional Swin Transformer, and the main encoder and decoder use the traditional U 2 -Net). STRSU is compared with the baseline model and ST-UNet model on the above mentioned evaluation indicators. The experimental results are shown in Table 1. 2 -Net based on the introduction of Swin Transformer STRSU compared to the ST-UNet based on the residual network can effectively improve the baseline model U 2 -Net for RFI segmentation performance. In addition, the dual encoder architecture aggregates more information that is beneficial to RFI segmentation through hierarchical levels.

[0060] Table 1 Ablation experiments of dual encoder structure on datasets

[0061]

[0062] Second set of simulations: The ablation experiments conducted in this phase aimed to explore the impact of introducing the SIM, FCM, and RAM modules into the STRSU architecture on segmentation performance. The experimental results are shown in Table 2 (the highest score for each metric is marked in bold).

[0063] Table 2 Ablation experiments of SIM, FCM, and RAM modules on the dataset

[0064]

[0065] The experimental results shown in Table 2 illustrate (since the present invention is aimed at segmentation tasks, and the most important indicator reflecting segmentation performance is MIou, for the convenience of discussion, the present invention mainly focuses on MIou). With the introduction of SIM, FCM and RAM modules, the segmentation performance of the model gradually improves. Specifically, when the SIM module was introduced in STRSU, MIou increased by 1.6%. After the FCM module was introduced, MIou increased by 2.0%. After the RAM module was introduced, MIou increased by 1.1%. When the SIM and FCM modules were introduced at the same time, MIou increased by 2.2%. When the SIM and RAM modules were introduced at the same time, MIou increased by 2.3%. When the FCM and RAM modules were introduced at the same time, MIou increased by 2.2%. Finally, when the SIM, FCM and RAM modules were introduced at the same time, MIou increased by 2.5%.

[0066] The experimental results above show that the combined use of the SIM, FCM, and RAM modules in the STRSU architecture significantly improves segmentation performance, particularly in key metrics such as MIou, Precision, and F1. Based on this finding, in subsequent ablation experiments, we treat the SIM, FCM, and RAM modules as a single integrated module for improving model segmentation performance, and refer to it as the Spatial Feature Aggregation Module (SFAM).

[0067] The third set of simulations: The experimental results on the effects of EMA and KAN are shown in Table 3. Among them, the highest score of each indicator is marked in bold (for the same reason as above, this set of simulations mainly focuses on MIou.). After the EMA module was introduced after the RSU output of each stage of the main encoder of the STRSU structure, MIou was improved by 2.3%. This result shows that EMA can enhance the ability of STRSU to extract local features of RFI, thereby improving its segmentation performance. Furthermore, after introducing SFAM and EMA modules into STRSU at the same time, MIou was improved by 2.9%. This shows that the introduction of EMA in the existing network structure can enhance the segmentation ability of the model. The above ablation experiments verified the effectiveness of the EMA module in improving segmentation performance.

[0068] After replacing MLP with KAN, STRSU improved MIou by 1.9%. This result shows that KAN helps enhance the segmentation ability of STRSU. Furthermore, after introducing SFRM and KAN modules simultaneously in STRSU, MIou improved by 2.5%. The above ablation experiments verified the effectiveness of the KAN module in improving segmentation performance. In addition, after introducing KAN and EMA modules in STRSU at the same time, MIou improved by 3.7%. Finally, SFRM, EMA and KAN were applied to STRSU at the same time. This complete configuration enabled the model to achieve the best performance in both MIou and Recall evaluation indicators, and the Precision and F1 achieved the second best performance. Among them, MIou, Recall, Precision and F1 improved by 4.0%, 4.7%, 2.4% and 3.7%.

[0069] Table 3 Ablation experiments of the introduced modules on the dataset

[0070]

[0071] The fourth set of simulations: The proposed ST-U 2 Net is compared with a variety of existing methods, focusing on evaluating the performance of these models in RFI segmentation tasks. The compared models include U 2 -Net, EMSCA-UNet and DCA-MSFF-UNet as well as MS-TransUNet based on Transformer architecture. It is worth noting that MS-TransUNet adopts the serial structure of CNN and Transformer in the encoding stage, while ST-U 2 Net uses a parallel structure.

[0072] Table 4 shows the evaluation indicators of the above models in the RFI segmentation task. The experimental results show that ST-U 2 Net outperforms other models in MIou, Recall, Precision and F1 scores. 2 -Net adopts an innovative U-shaped structure to learn multi-scale features to achieve high-precision image segmentation. Experimental data show that ST-U 2 Net outperforms U in RFI multi-scale feature aggregation 2- Net. with U 2- Net compared to ST-U 2The MIou, Recall, Precision and F1 of the UNet were improved by 4.9%, 7.7%, 2.4% and 5.4% respectively. MS-TransUNet is based on TransUNet and uses a multi-scale convolutional attention mechanism. The performance of MS-TransUNet is better than that of UNet in all evaluation indicators. 2- Compared with MS-TransUNet, ST-U 2 Net improved MIou, Recall, Precision and F1 by 3.0%, 5.8%, 1.5% and 3.9% respectively. The results show that the proposed dual encoder structure outperforms the serial model of Transformer and CNN in the RFI segmentation task. DCA-MSFF-UNet is an RFI segmentation model that combines dual cross attention mechanism with multi-scale features. Experimental results show that the RFI segmentation performance of DCA-MSFF-UNet is better than that of U 2- Net and MS-TransUNet. However, compared with DCA-MSFF-UNet, ST-U 2 The MIou, Recall, Precision and F1 of the EMSCA-UNet were improved by 2.5%, 3.7%, 0.5% and 2.3% respectively. EMSCA-UNet adopts a dual attention mechanism and continuously integrates spatial information from low-level features through skip connections. Experimental data show that the RFI segmentation performance of EMSCA-UNet is better than that of U 2 -Net, DCA-MSFF-UNet and MS-TransUNet. However, compared with EMSCA-UNet, ST-U 2 Net improves MIou, Recall, Precision and F1 by 2.1%, 3.0%, 0.1% and 1.7% respectively.

[0073] Table 4 Comparison of segmentation results with other methods

[0074]

[0075] Figure 4 Show the prediction results of all segmentation methods in Table 4 ( Figure 4 (a) shows the original visibility time-frequency image; (b) shows the ST-U 2 Net prediction results; (c) represents U 2-Net prediction results; (d) represents the EMSCA-UNet prediction results; (e) represents the MS-TransUNet prediction results; (f) represents the DCA-MSFF-UNet prediction results; (g) represents the true label of (a); (h) represents the difference map between (b) and (g); (i) represents the difference map between (c) and (g); (j) represents the difference map between (d) and (g); (k) represents the difference map between (e) and (g); (l) represents the difference map between (f) and (g)). The first column of the figure shows the visibility data and its corresponding true labels respectively. From the second column to the last column, the output mask of the above model and the difference map between the output mask of the above model and the true label are described. We use the difference map to more intuitively show the difference between the predicted masks and the true labels of different models. The specific method is to calculate the difference between the output mask of GT and the corresponding model and take the absolute value. The yellow area in the difference map represents the absolute value of the difference between the predicted mask and the true label. From Figure 4 It can be seen from these difference graphs that the output mask of the proposed model has the smallest difference with the true label. 2 Net not only outperforms other methods in evaluation indicators, but also shows stronger narrowband RFI segmentation ability and lower misjudgment rate in the difference map, which is in line with expectations.

[0076] The specific embodiments of the present invention are described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in this field without departing from the scope of the present invention.

Claims

1. A method of embedding U using Swin Transformer 2 -Net method for segmenting radio frequency interference, characterized in that, include: Get the trained ST-U 2 Net model; the ST-U 2 The Net model includes an auxiliary encoder based on Swin Transformer and an 2 -Net's main encoder and decoder; Obtain the radio observation data to be predicted; input the time-frequency images of the radio observation data into the trained ST-U at the same time 2 The main encoder and auxiliary encoder in the Net model extract local detail features and global context information respectively; the intermediate feature maps of the auxiliary encoder output at each stage of the auxiliary encoder and the intermediate feature maps of the main encoder output at each stage of the main encoder are fused through the relationship aggregation module of each stage in the main encoder and then input into the decoder; The decoder gradually restores the feature map to the original resolution through multi-level upsampling and feature fusion operations, and finally outputs a predicted segmentation mask image containing the RF interference area and the non-interference area through convolution operations and Sigmoid activation functions; In the auxiliary encoder, the time-frequency image of the radio observation data is first divided into overlapping blocks by an image division module; then, these overlapping blocks are flattened and projected to the embedding dimension by a linear embedding layer; then, the output of the linear embedding layer is processed by four consecutive first downsampling stages and a feature compression module to obtain the output of each downsampling stage, that is, the intermediate feature map of the auxiliary encoder of each stage; the output of the four downsampling stages is used as the input of the four second downsampling stages in the main encoder; the four first downsampling stages each include a plurality of transformers connected in sequence, and the transformer is constructed by integrating a spatial interaction module into an improved Swin Transformer block, and the input of the first downsampling stage is used as the input of the spatial interaction module and the improved Swin Transformer block in the first transformer, the outputs of the spatial interaction module and the improved Swin Transformer block in the first transformer are added as the output of the first transformer, and the output of the first transformer is used as the input of the second transformer; In the main encoder, the time-frequency image of the radio observation data is first input into the residual U-shaped structure RSU module of the first preset height, and then passes through the efficient multi-scale attention mechanism module to generate the first-scale feature map; then, the first-scale feature map is further processed through four consecutive second downsampling stages. In the second downsampling stage, it is processed by the residual U-shaped structure RSU module and the efficient multi-scale attention mechanism module in the second downsampling stage to obtain the intermediate feature map of the main encoder of each stage; the intermediate feature map of the main encoder of each stage is fused with the intermediate feature map of the auxiliary encoder of each stage through the relationship aggregation module in the corresponding second downsampling stage to obtain the second, third, fourth and fifth scale feature maps; the fifth scale feature map is used as the input of the RSU-4F module to obtain the RSU-4F output feature map; the first, second, third, fourth and fifth scale feature maps and the RSU-4F output feature map are used as the input of the decoder.

2. Embedding U using Swin Transformer according to claim 1 2 -Net method for segmenting radio frequency interference, characterized in that, The improved Swin Transformer block is constructed based on the traditional Swin Transformer block and introduces KAN to replace the MLP in the traditional Swin Transformer block.

3. The method of embedding U using Swin Transformer according to claim 1 2 -Net method for segmenting radio frequency interference, characterized in that, In the four consecutive second downsampling stages, the height of the residual U-shaped structure RSU module in each stage decreases from input to output.

4. The method of embedding U using Swin Transformer according to claim 1 2 -Net method for segmenting radio frequency interference, characterized in that, The residual U-shaped structure RSU module of the first preset height is the same as the height of the residual U-shaped structure RSU module in the second downsampling stage close to the first preset height in four consecutive second downsampling stages.

5. The method of embedding U using Swin Transformer according to claim 1 2 -Net method for segmenting radio frequency interference, characterized in that, The ST-U 2 The Net model uses MIou as the primary evaluation indicator.

Citation Information

Patent Citations

  • Crop classification method based on U-Net and Transform

    CN119206301A

  • Medical image segmentation method based on KAN network

    CN119399223A