A lightweight network model based on linear attention for image segmentation
Through a lightweight network model based on linear attention, combined with LPT-Net and feature extraction module, it solves the problem of high computational complexity in the existing technology, achieves efficient foreign object image segmentation in dark environments, and meets the needs of coal gangue separation. Real-time needs of scene selection.
Patent Information
- Application Number
- CN202311181185.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-13
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2043-09-13
AI Technical Summary
The existing image segmentation algorithm based on the attention mechanism has high computational complexity in a dim underground environment and is difficult to meet the needs of real-time foreign object image segmentation. The reasoning accuracy is not high, making it difficult to achieve efficient segmentation in coal gangue sorting scenarios.
Using a lightweight network model based on linear attention, through the LPT-Net coal gangue image segmentation network model, using the encoder-decoder structure, combined with Patch Embedding, LPT-block, MSA1 and MSA2 modules, feature extraction and global attention are performed Calculation, reducing computational complexity and improving reasoning speed.
While maintaining high accuracy, it significantly reduces computational complexity, improves inference speed, meets the real-time segmentation requirements of coal gangue sorting scenarios, and achieves efficient foreign object segmentation in dark and dusty environments.
Smart Images

Figure CN117237630B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision recognition technology, and in particular to an image segmentation method based on a lightweight network model of linear attention. Background Art
[0002] Image segmentation is one of the important research contents of computer vision and has a wide range of applications in the fields of autonomous driving, medical image analysis, human-computer interaction, etc. However, in the actual coal gangue sorting scene, the lighting conditions, dust and fog pollution, background complexity, complex and variable target size, and the demand for sorting efficiency have more stringent requirements on the segmentation accuracy and inference speed of the algorithm.
[0003] Existing image segmentation algorithms can be divided into traditional image segmentation algorithms and image segmentation algorithms based on deep learning. Traditional image segmentation algorithms require manual feature definition and rely on manual design experience. They cannot generate corresponding target features based on environmental features. Image segmentation methods based on deep learning can adaptively extract high-dimensional features of targets through neural networks, and have better segmentation effects and environmental adaptability than traditional algorithms. Image segmentation methods based on deep learning can be further divided into image segmentation methods based on convolutional neural networks and image segmentation methods based on attention mechanisms.
[0004] The image segmentation method based on convolutional neural network has low computational complexity and fast reasoning speed, but the reasoning accuracy is not high due to insufficient target feature extraction capability, and it is difficult to accurately segment a large number of gangue fragments with different scales in a dim underground environment. The image segmentation method based on attention mechanism has higher reasoning accuracy and can effectively achieve the segmentation of foreign objects in the underground environment, but the image segmentation method algorithm based on attention mechanism in the prior art itself has high computational complexity and is difficult to meet the real-time foreign object image segmentation requirements underground. Therefore, there is a need for a lightweight foreign object image segmentation method based on attention mechanism, which can reduce computational complexity and improve reasoning speed while maintaining the high accuracy of the attention algorithm to meet the needs of gangue segmentation in actual production processes. Summary of the invention
[0005] In view of this, the present invention provides an image segmentation method based on a lightweight network model of linear attention to solve the above technical problems.
[0006] An image segmentation method based on a lightweight network model of linear attention, comprising the following steps:
[0007] Step S1: Collect gangue data from underground coal mining environment in a dark and dusty environment, perform foreign body labeling on the collected data, and construct a gangue sorting dataset GSTD (Gangue Sorting Task Dataset);
[0008] Step S2: construct an LPT-Net coal gangue image segmentation network model. The coal gangue image segmentation network model is an encoder-decoder structure. The encoder structure is LPT-backbon, i.e., LPT backbone network, which is used for target feature extraction and downsampling operations;
[0009] Step S3: The input image first passes through the Patch Embedding module to perform high-dimensional expansion on the original information, and then performs LPT-block calculation. LPT-block is the core calculation module of the encoder, which is used for target feature extraction and global attention calculation. One LPT-block calculation is called a calculation cycle, and one downsampling and the corresponding complete calculation cycle are called a stage. Two L-MSA calculations are performed in one calculation cycle, one MSA1 calculation and one MSA2 calculation. The calculation order is L-MSA, MSA2, L-MSA, MSA1, to achieve global information exchange;
[0010] Step S4: The linear attention L-MSA calculation method uses pixels as the basic unit, expands the feature map by line, and splices it in depth. Then, through the full connection operation, it outputs three times the volume of the original feature map and cuts it into three parts according to the original feature map volume. Two of them perform matrix multiplication operations and execute Softmax function for activation. The output result and the other one perform matrix multiplication operations again and are activated by Softmax again to obtain the output feature map. The feature map expanded by line is restored to the size of the original feature map in shape through the inverse operation to obtain the output result;
[0011] Step S5: MSA2 calculation is to expand the feature map with 2×8 as a basic calculation unit, and then perform the same calculation operation as L-MSA after splicing in depth;
[0012] Step S6: MSA1 calculation is to first perform a padding operation on the upper and lower ends of the feature map to fill invalid information and adjust the shape of the feature map, and then perform the same operation as MSA2 calculation. After the shape restoration operation is completed, the invalid information is removed. The encoder includes four stages. Except for the first stage, the Patch Embedding module is used to perform downsampling operations. The other stages use the Patch Merging module for downsampling. This module divides a feature map into four parts by sampling at intervals of one pixel, and splices them in depth. Finally, the depth is halved by a full connection, thereby completing the size requirements of halving the height and width of the feature map and doubling the depth, and realizing the downsampling operation;
[0013] Step S7: Train the LPT-Net coal gangue image segmentation network model on the coal gangue sorting dataset GSTD, and perform segmentation after training to generate the final prediction result.
[0014] Furthermore, the gangue sorting dataset GSTD is constructed by collecting videos in real coal production sites, and then processed by frame extraction and manual screening. Foreign objects are identified as gangue, anchors, wooden boards, sacks, and plastic hoses. The image size of the input image is 614×614, with three RGB color channels.
[0015] Furthermore, in the above step S2, the decoder selected is Uperhead.
[0016] Furthermore, in the above step S2, the data needs to undergo an image reconstruction operation before being input into the encoder, so as to adjust the pixel values to between 0 and 1 and conform to the normal distribution as a whole, and scale the size to 512×512 for subsequent operations.
[0017] Furthermore, in the above step S3, the Patch Embedding module performs high-dimensional expansion of the original information through a 1×1 convolutional layer and an LN layer.
[0018] Furthermore, in the above step S4, the L-MSA calculation module adopts a linear attention calculation method, and the size of a single calculation unit is H×1. Therefore, the single attention calculation complexity formula for the global feature map is:
[0019] Ω(L-MSA)=4hwC 2 +2hw 2 C
[0020] Where Ω represents the computational complexity of the module, h and w refer to the height and width of the computing unit respectively, C refers to the number of channels of the feature map, and the computational complexity of a single attention calculation by the computing unit is in square relationship with the size of the computing unit.
[0021] Furthermore, in the above steps S5 and S6, the calculation unit shape used by the attention interactors MSA1 and MSA2 is fixed to 2×8, and the number of rows for which MSA1 performs additional padding operations compared to MSA2 is negligible compared to the global calculation complexity. Therefore, for the attention interactor, the formula for the single calculation amount of the global feature map is:
[0022] Ω(MSA1 / 2)=4hwC 2 +2ShwC
[0023] Where S represents the computational unit size of MSA1 and MSA2.
[0024] Compared with the prior art, the image segmentation method based on the lightweight network model of linear attention provided by the present invention realizes the feature extraction of a single row based on the linear attention calculation method designed by the attention mechanism, expands the feature map in units of lines, and splices it in depth. After that, through the full connection operation, an output three times the volume of the original feature map is made and cut into three parts according to the volume of the original feature map. Two of them are subjected to matrix multiplication operation, and the Softmax function is executed for activation. The activated output result and the other one are subjected to matrix multiplication operation again and the feature map is activated again through the Softmax function. After obtaining the output result, the feature map expanded by row is restored to the size of the original feature map in shape by the reverse operation. MSA1 and MSA2 cooperate with each other, and the information exchange between the rows of the feature map is realized by adjusting the shape of the feature map, but there is an information gap between each row in units of 8 pixels. This information gap can be compensated by the L-MSA module. The three modules cooperate with each other to realize the global information exchange of the feature map, thereby effectively improving the feature extraction ability of the model. At the same time, the linear calculation method can reduce the computational complexity compared to the rectangular calculation method, thereby greatly improving the reasoning speed of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A flowchart of an image segmentation method based on a lightweight network model of linear attention provided by the present invention.
[0026] Figure 2 for Figure 1 Schematic diagram of coal gangue data collection using an image segmentation method based on a lightweight network model with linear attention.
[0027] Figure 3 for Figure 1 Schematic diagram of the coal gangue dataset annotation status of the image segmentation method based on the linear attention lightweight network model.
[0028] Figure 4 for Figure 1 Schematic diagram of the overall network framework of the image segmentation method based on a lightweight network model based on linear attention.
[0029] Figure 5 for Figure 1 Schematic diagram of the loop structure of LPT-Backbone, an image segmentation method based on a lightweight network model with linear attention.
[0030] Figure 6 This is a comparison chart of the expansion methods of the LPT receptive field of the classic receptive field in the existing technology and the image segmentation method based on the lightweight network model of linear attention.
[0031] Figure 7 for Figure 1 Comparison of visualization results of image segmentation methods based on linear attention lightweight network models. DETAILED DESCRIPTION
[0032] The specific embodiments of the present invention are further described in detail below. It should be understood that the description of the embodiments of the present invention herein is not intended to limit the protection scope of the present invention.
[0033] like Figure 1 As shown, it is a flow chart of an image segmentation method based on a lightweight network model of linear attention provided by the present invention. The image segmentation method based on a lightweight network model of linear attention comprises the following steps:
[0034] Step S1: Collect coal gangue data in underground coal mining environment in a dark and dusty environment. Figure 2 As shown in the figure, the collected data is annotated with foreign objects. Figure 3 , construct the gangue sorting dataset GSTD, and propose the LPT-Net gangue image segmentation network model. The gangue sorting dataset GSTD is collected from videos in real coal production sites, and is constructed after frame extraction and manual screening. The main foreign objects identified are gangue, and the other foreign objects include anchors, wooden boards, sacks, and plastic hoses. The image size of the input image is 614×614, with three RGB color channels.
[0035] Step S2: The network model of gangue image segmentation is an encoder-decoder structure. The encoder structure is LPT-backbon, i.e., LPT backbone network, which is mainly used for target feature extraction and downsampling operations. The data needs to undergo an image reconstruction operation before entering the encoder to adjust the pixel value to between 0 and 1 and conform to the normal distribution as a whole, and scale the size to 512×512 for subsequent operations. The decoder selected is Uperhead, which is a general feature decoder that can be used with various encoders to achieve feature fusion and result prediction. The encoder uses an effective hierarchical structure in its overall structure, which includes one high-dimensional expansion, four calculation cycles, and three downsampling operations. Each calculation cycle is similar, and only the size of the feature map has changed to a certain extent, which is achieved by the downsampling module.
[0036] Step S3: The input image first passes through a Patch Embedding module to perform high-dimensional expansion on the original information. This module is implemented through a 1×1 convolutional layer and an LN layer, and then the LPT-block calculation is performed. The full name of the LN layer is LayerNorm, which normalizes and standardizes the features of each sample to ensure the distribution consistency of each sample feature. LPT-block is the core computing module of the encoder, and is a module used for target feature extraction and global attention calculation. One LPT-block calculation is called a calculation cycle, and one downsampling and the corresponding complete calculation cycle are called a stage. In one calculation cycle, we perform two L-MSA calculations, one MSA1 calculation and one MSA2 calculation. The calculation order is L-MSA, MSA2, L-MSA, MSA1 to achieve global information exchange. In each MSA calculation, we cooperate with MLP to design a unique small calculation module, namely LN-MSA-LN-MLP, such as Figure 5 As shown in the left part, MLP refers to a general feature classifier, which is implemented by two fully connected layers and two activation functions. This calculation module can more effectively extract feature information of a single row or between rows and improve the quality of global information exchange.
[0037] Step S4: The linear attention L-MSA calculation method uses pixels as the basic unit, expands the feature map by row, and splices it in depth. After that, through the full connection operation, an output three times the volume of the original feature map is made and cut into three parts according to the original feature map volume. Two of them are subjected to matrix multiplication operation and activated by Softmax function. The output result is subjected to matrix multiplication operation with the other one and activated by Softmax again to obtain the output feature map. The feature map expanded by row is restored to the size of the original feature map in shape through the inverse operation to obtain the output result.
[0038] Step S5: The attention interactors MSA1 and MSA2 are used to make corrections and adjustments to the problem of insufficient row information exchange in the pure L-MSA algorithm. The MSA2 calculation is to expand the feature map with 2×8 as a basic calculation unit, and then perform the same calculation operation as L-MSA after splicing in depth, that is, multiple splicing in depth, and then through the full connection operation, make an output three times the volume of the original feature map and cut it into three parts according to the original feature map volume. Perform matrix multiplication operation on two of them, and execute Softmax function for activation. The output result and the other one perform matrix multiplication operation again and activate through Softmax again to obtain the output feature map, and restore the shape of the feature map expanded by row to the size of the original feature map through the inverse operation to obtain the output result;
[0039] Step S6: The calculation of MSA1 first performs a padding operation on the upper and lower ends of the feature map to fill invalid information and adjust the shape of the feature map. Then, the same operation as the MSA2 calculation is performed, and the invalid information is removed after the shape restoration operation is completed. In one stage, except for the first stage using the Patch Embedding module to perform downsampling operations, the other stages use the Patch Merging module for downsampling. This module divides a feature map into four parts by sampling at intervals of one pixel, and splices them in depth. Finally, the depth is halved by a full connection, thereby completing the size requirements of halving the height and width of the feature map and doubling the depth, and realizing the downsampling operation. The coal gangue image segmentation network model has three different versions constructed according to the volume requirements, namely LPT-T, LPT-S, and LPT-B. The specific parameter information is shown in Table 1.
[0040] Table 1 Parameter settings of architecture variants
[0041]
[0042] Step S7: Train the LPT-Net coal gangue image segmentation network model on the coal gangue sorting dataset GSTD, and perform segmentation after training to generate the final prediction result.
[0043] Refer to the attached drawings in the specification Figure 5 , which is different from the receptive field of the traditional hierarchical attention algorithm, the LPT-backbon encoder has a unique way to expand the receptive field, such as Figure 6 As shown in the figure, as the network level goes deeper, the overall receptive field of the network model gradually expands with each information interaction. Each derivation of the receptive field is expanded along the block that interacts with the previous receptive field. Figure 6 As shown on the left, its perception range is expanded in a rectangular shape. The receptive field expansion method proposed in this application, which combines the linear attention mechanism with the attention interaction mechanism, is expanded in a linear manner. Compared with the rectangular receptive field expansion method, the linear expansion method is faster than the rectangular receptive field expansion method, and only a shallower model depth is required to achieve the receptive field range of deep rectangular expansion. This is the root of the computational advantage of the LPT algorithm model.
[0044] Compared with the traditional attention calculation method, LPT has a computing power advantage in achieving the same information interaction. For the traditional multi-head attention calculation, its computational complexity is related to the length of the input sequence. For the rectangular calculation unit, the global computational complexity of its feature map is shown in formula (1):
[0045] Ω(MSA)=4hwC 2 +2(hw) 2 C (1)
[0046] In formula (1), Ω represents the computational complexity of the module, h and w refer to the height and width of the computational unit respectively, and C refers to the number of channels of the feature map. The computational complexity of a single attention calculation by a computational unit is proportional to the square of the size of the computational unit.
[0047] The L-MSA calculation module of the present invention adopts a linear attention calculation method, and the size of a single calculation unit is H×1. Therefore, the single attention calculation complexity of the global feature map is shown in formula (2):
[0048] Ω(L-MSA)=4hwC 2 +2hw 2 C (2)
[0049] For the attention interactors MSA1 and MSA2 proposed in the present invention, the computing unit shape they use is a fixed 2×8, and the number of rows for which MSA1 performs additional padding operations compared to MSA2 is negligible compared to the global computational complexity. Therefore, for the attention interactor, the single computation amount for the global feature map can be calculated by formula (3).
[0050] Ω(MSA1 / 2)=4hwC 2 +2ShwC(3)
[0051] S in formula (3) is 2×8=16, which is a parameter that can be changed and represents the computing unit size of MSA1 and MSA2. The specific setting can be determined by the model construction requirements. In the LPT-Net in this implementation, this value is constant at 16.
[0052] We can calculate the computational complexity required in one computation cycle of LPT-Net as shown in formula (4).
[0053] Ω(LPT-Block)=2(W(L-MSA)+W(MSA1 / 2))=16hwC 2 +4hw 2 C+4ShwC(4)
[0054] Compared with the traditional rectangular attention calculation method, the computing power saved by LPT in one calculation cycle is as shown in formula (5).
[0055] 2Ω(MSA)-(Ω(L-MSA)+Ω(MSA1 / 2))=3(M 2 -2w)hwC(5)
[0056] The computing power advantage of LPT-Net over traditional attention algorithms can be reflected in formula (5), which reduces the computational complexity and thus greatly improves the algorithm's reasoning speed.
[0057] Refer to the attached figure for the visualization results of LPT-Net's foreign body segmentation Figure 7 . Gangue is the main foreign matter output in coal gangue sorting, and its proportion in the entire data set is relatively large. Therefore, the result comparison is divided into two types, one is the comparison of gangue segmentation accuracy, and the other is the comparison of global foreign matter segmentation accuracy. The experimental data of gangue segmentation effect are shown in Table 2. In the table, IoU refers to the intersection over union ratio of the predicted object and the true value, and Acc refers to the prediction accuracy. Both are inference accuracy indicators. The larger the value, the higher the inference accuracy. FPS is the number of inference images per second, which is used to evaluate the model inference speed. The larger the value, the faster the inference speed. #Param refers to the number of model parameters, and FLOPs (G) refers to the model complexity. Both are used to evaluate the model volume. The smaller the value, the smaller the volume.
[0058] Table 2 Semantic segmentation results of gangue targets by classic algorithm and LPT on GSTD
[0059]
[0060]
[0061] LPT-T has the best inference speed among all models, nearly half the speed of the second-best MobileNetV3, far outperforming other models. In terms of inference speed, the LPT model can basically maintain a high level, which is comparable to the classic attention calculation model, and there is no excessive loss of accuracy while increasing the calculation speed.
[0062] The global foreign body segmentation accuracy performance is shown in Table 3, where IoU refers to the intersection over union ratio of the predicted object and the true value, and Acc refers to the prediction accuracy. Both are inference accuracy indicators, and the larger the value, the higher the inference accuracy. C1 represents the background, C2 represents the anchor, C3 represents the board, C4 represents the rubber hose, and C5 represents the sack. In order to ensure the fairness of the comparison, the average intersection over union ratio mIoU and the average accuracy mAcc are used to evaluate the overall performance of the network.
[0063] Table 3 Results of the classic algorithm and LPT in distinguishing background information and other impurities in the GSTD task
[0064]
[0065] In terms of overall performance, LPT performs very well in global foreign body segmentation, and can effectively segment most foreign body information while performing efficient reasoning.
[0066] Compared with the prior art, the image segmentation method based on the lightweight network model of linear attention provided by the present invention realizes the feature extraction of a single row based on the linear attention calculation method designed by the attention mechanism, expands the feature map in units of lines, and splices it in depth. After that, through the full connection operation, an output three times the volume of the original feature map is made and cut into three parts according to the volume of the original feature map. Two of them are subjected to matrix multiplication operation, and the Softmax function is executed for activation. The activated output result and the other one are subjected to matrix multiplication operation again and the feature map is activated again through the Softmax function. After obtaining the output result, the feature map expanded by row is restored to the size of the original feature map in shape by the reverse operation. MSA1 and MSA2 cooperate with each other, and the information exchange between the rows of the feature map is realized by adjusting the shape of the feature map, but there is an information gap between each row in units of 8 pixels. This information gap can be compensated by the L-MSA module. The three modules cooperate with each other to realize the global information exchange of the feature map, thereby effectively improving the feature extraction ability of the model. At the same time, the linear calculation method can reduce the computational complexity compared to the rectangular calculation method, thereby greatly improving the reasoning speed of the algorithm.
[0067] The above are only preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modification, equivalent substitution or improvement within the spirit of the present invention is included in the scope of the claims of the present invention.
Claims
1. An image segmentation method based on a lightweight network model with linear attention, comprising the following steps: Step S1: Collect coal gangue data from underground coal mining environment in a dark and dusty environment, perform foreign body labeling on the collected data, and construct a coal gangue sorting data set GSTD; Step S2: construct an LPT-Net coal gangue image segmentation network model. The coal gangue image segmentation network model is an encoder-decoder structure. The encoder structure is LPT-backbon, i.e., LPT backbone network, which is used for target feature extraction and downsampling operations; Step S3: The input image first passes through the Patch Embedding module to perform high-dimensional expansion on the original information, and then performs LPT-block calculation. LPT-block is the core calculation module of the encoder, which is used for target feature extraction and global attention calculation. One LPT-block calculation is called a calculation cycle, and one downsampling and the corresponding complete calculation cycle are called a stage. Two L-MSA calculations are performed in one calculation cycle, one MSA1 calculation and one MSA2 calculation. The calculation order is L-MSA, MSA2, L-MSA, MSA1, to achieve global information exchange; Step S4: The linear attention L-MSA calculation method uses pixels as the basic unit, expands the feature map by line, and splices it in depth. Then, through the full connection operation, it outputs three times the volume of the original feature map and cuts it into three parts according to the original feature map volume. Two of them perform matrix multiplication operations and execute Softmax function for activation. The output result and the other one perform matrix multiplication operations again and are activated by Softmax again to obtain the output feature map. The feature map expanded by line is restored to the size of the original feature map in shape through the inverse operation to obtain the output result; Step S5: MSA2 calculation is to expand the feature map with 2×8 as a basic calculation unit, and then perform the same calculation operation as L-MSA after splicing in depth; Step S6: MSA1 calculation is to first perform a padding operation on the upper and lower ends of the feature map to fill invalid information and adjust the shape of the feature map, and then perform the same operation as MSA2 calculation. After the shape restoration operation is completed, the invalid information is removed. The encoder includes four stages. Except for the first stage, the Patch Embedding module is used to perform downsampling operations. The other stages use the Patch Merging module for downsampling. This module divides a feature map into four parts by sampling at intervals of one pixel, and splices them in depth. Finally, the depth is halved by a full connection, thereby completing the size requirements of halving the height and width of the feature map and doubling the depth, and realizing the downsampling operation; Step S7: Train the LPT-Net coal gangue image segmentation network model on the coal gangue sorting dataset GSTD, and perform segmentation after training to generate the final prediction result.
2. The image segmentation method based on a lightweight network model of linear attention according to claim 1, characterized in that: In the above step S1, the gangue sorting dataset GSTD is constructed by collecting videos in real coal production sites, and then processed by frame extraction and manual screening. Foreign objects are identified as gangue, anchors, wooden boards, sacks, and plastic hoses. The image size of the input image is 614×614, with three RGB color channels.
3. The image segmentation method based on a lightweight network model of linear attention according to claim 1, characterized in that: In the above step S2, the decoder selected is Uperhead.
4. The image segmentation method based on a lightweight network model of linear attention according to claim 1, characterized in that: In the above step S2, the data needs to undergo an image reconstruction operation before being input into the encoder, so as to adjust the pixel value to between 0 and 1 and conform to the normal distribution as a whole, and scale the size to 512×512 for subsequent operations.
5. The image segmentation method based on a lightweight network model of linear attention according to claim 1, characterized in that: In the above step S3, the Patch Embedding module performs high-dimensional expansion of the original information through a 1×1 convolutional layer and an LN layer.
6. The image segmentation method based on a lightweight network model of linear attention according to claim 1, characterized in that: In the above step S4, the L-MSA calculation module adopts a linear attention calculation method, and the size of a single calculation unit is H×1. Therefore, the single attention calculation complexity formula for the global feature map is: Ω(L-MSA)=4hwC 2 +2hw 2 C Where Ω represents the computational complexity of the module, h and w refer to the height and width of the computing unit respectively, C refers to the number of channels of the feature map, and the computational complexity of a single attention calculation by the computing unit is in square relationship with the size of the computing unit.
7. The image segmentation method based on a lightweight network model of linear attention according to claim 1, characterized in that: In the above steps S5 and S6, the calculation unit shape used by the attention interactors MSA1 and MSA2 is fixed to 2×8, and the number of rows for which MSA1 performs additional padding operations compared to MSA2 is negligible compared to the global calculation complexity. Therefore, for the attention interactor, the formula for the single calculation amount of the global feature map is: Ω(MSA1 / 2)=4hwC 2 +2ShwC Where S represents the computational unit size of MSA1 and MSA2.
Citation Information
Patent Citations
Polyp segmentation method based on lightweight network model and reverse attention module
CN114627137A
Transform-based reference image segmentation method
CN114821050A
Medical image segmentation method and system based on semi-supervision and Transformers
CN114882047A
Cross-species target detection method based on cross-layer feature fusion and linear attention optimization
CN116246147A
