Image segmentation method and system based on step feature fusion and attention mechanism
By using an image segmentation method based on step feature fusion and attention mechanism, the problems of insufficient segmentation accuracy and slow speed in existing technologies are solved, and more accurate and refined image segmentation is achieved, especially in the segmentation of large-scale targets and edge targets.
Patent Information
- Application Number
- CN202310290297.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-21
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2043-03-21
AI Technical Summary
Existing technologies suffer from insufficient segmentation accuracy and slow speed in image segmentation, especially in the segmentation of large-scale targets and edge targets.
An image segmentation method based on step feature fusion and attention mechanism is adopted. Local and global features are extracted through the trained image segmentation network, and feature enhancement is performed by dual-channel attention mechanism. Combined with step feature fusion and deconvolution processing, details of objects with different shapes are captured.
It achieves more accurate and refined image segmentation results, improves the segmentation perfection of large-scale targets and the segmentation accuracy of edge targets, and increases the segmentation speed.
Smart Images

Figure CN116309622B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image segmentation, in particular to an image segmentation method and system based on step feature fusion and attention mechanism. BACKGROUND
[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute the prior art.
[0003] Semantic segmentation, as a classic computer vision problem, involves taking some raw data as input and converting them into masks with highlighted regions of interest, where each pixel in the image is assigned a class ID according to the object it belongs to. Researching the semantic segmentation of images has important application significance for image restoration, and semantic segmentation technology has important application value for medical images, autonomous driving, satellite remote sensing, etc. Semantic segmentation gathers image parts belonging to the same target together to solve this problem, thereby expanding its application field.
[0004] Deeplabv1 modifies the VGG16 network to use deconvolution to solve the contradiction between the receptive field and the step length. Deeplabv2 uses a fully connected layer, which also introduces a lot of calculations. Deeplabv3 uses ResNet-101 as the main network, which improves the segmentation accuracy but reduces the segmentation speed. The feature extraction and feature repair of Deeplabv3+ are not enough. SUMMARY
[0005] In order to solve the problems of the prior art, the present application provides an image segmentation method and system based on step feature fusion and attention mechanism, which produces more accurate and fine segmentation results.
[0006] In a first aspect, the present application provides an image segmentation method based on step feature fusion and attention mechanism;
[0007] The image segmentation method based on step feature fusion and attention mechanism comprises:
[0008] Obtaining an image to be segmented;
[0009] Inputting the image to be segmented into the trained image segmentation network to output an image segmentation result;
[0010] The trained image segmentation network is used for feature extraction on the image to be segmented, and first local features, second local features and global features are extracted respectively, the global features are subjected to feature enhancement by using a double-channel attention mechanism, the enhanced global features and the second local features are subjected to step feature fusion, the features after the step feature fusion are subjected to decoding processing, and an image segmentation result is obtained, in the decoding processing, the features after the fusion are subjected to upsampling processing by using bilinear upsampling, the upsampling processing result is concatenated with the first local features, the concatenated result is subjected to deconvolution processing, different shape object details are captured by using deconvolution, and finally the deconvolution processing result is subjected to upsampling processing, and the image segmentation result is obtained.
[0011] In a second aspect, the present application provides an image segmentation system based on step feature fusion and attention mechanism.
[0012] The image segmentation system based on step feature fusion and attention mechanism comprises:
[0013] An acquisition module configured to acquire an image to be segmented.
[0014] A segmentation module configured to input the image to be segmented into the trained image segmentation network, and output an image segmentation result; wherein the trained image segmentation network is used for feature extraction on the image to be segmented, and first local features, second local features and global features are extracted respectively, the global features are subjected to feature enhancement by using a double-channel attention mechanism, the enhanced global features and the second local features are subjected to step feature fusion, the features after the step feature fusion are subjected to decoding processing, and an image segmentation result is obtained, in the decoding processing, the features after the fusion are subjected to upsampling processing by using bilinear upsampling, the upsampling processing result is concatenated with the first local features, the concatenated result is subjected to deconvolution processing, different shape object details are captured by using deconvolution, and finally the deconvolution processing result is subjected to upsampling processing, and the image segmentation result is obtained.
[0015] In a third aspect, the present application further provides an electronic device comprising:
[0016] a memory for non-transiently storing computer readable instructions; and
[0017] a processor for running the computer readable instructions,
[0018] When the computer readable instructions are run by the processor, the method of the first aspect is executed.
[0019] In a fourth aspect, the present application also provides a storage medium, which stores non-transitorily computer readable instructions, wherein the non-transitory computer readable instructions, when executed by a computer, implement the method of the first aspect.
[0020] In a fifth aspect, the present application also provides a computer program product comprising a computer program for implementing the method of the first aspect when executed on one or more processors.
[0021] Compared with the prior art, the present application has the following beneficial effects:
[0022] The present application makes three improvements to the Deeplabv3+ network, namely, the stepwise feature fusion, the attention mechanism and the rich feature module.
[0023] The stepwise feature fusion realizes the fusion of semantic information and representation information, and produces more accurate and fine segmentation results.
[0024] The attention mechanism can make large-scale target segmentation more perfect, and realize the mutual enhancement of feature information between pixels by using the channel attention mechanism and the spatial attention mechanism, so that the edge target can be segmented more accurately.
[0025] The rich feature module uses the deconvolution layer and the bilinear up-sampling module to restore the size of the feature map, which can capture details of different shapes and produce more fine segmentation results. BRIEF DESCRIPTION OF DRAWINGS
[0026] The drawings constituting a part of the specification of the present application are used to provide a further understanding of the present application, and the illustrative embodiments of the present application and the description thereof are used to explain the present application, and do not constitute an improper limitation on the present application.
[0027] Figure 1 Figure 1 is a complete structure diagram of image segmentation of embodiment one;
[0028] Figures 2(a), 2(b) and 2(c) are internal structure diagrams of the Entry flow network, the Middle flow network and the Exit flow network of embodiment one;
[0029] Figures 3(a), 3(b) and 3(c) are double-channel attention mechanism modules of embodiment one;
[0030] Figure 4 Figure 4 is an internal structure diagram of the spatial pyramid pooling module (ASSP, Atrous Spatial Pyramid Pooling) with a hollow convolution of embodiment one;
[0031] Figures 5(a)-5(i)A schematic diagram of the image segmentation result of Example 1. DETAILED DESCRIPTION
[0032] It should be noted that the following detailed description is exemplary in nature and is intended to provide further description of the application. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0033] It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments in accordance with the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0034] The embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0035] All data of the present embodiment are obtained on the basis of compliance with laws and regulations and user consent, and legal application of the data.
[0036] Semantic segmentation technology not only belongs to the research field of computer science, but also is a frontier research field involving medical imaging, autonomous driving, satellite remote sensing and other disciplines. Semantic segmentation technology will have very important research significance and application value.
[0037] Deeplabv3+ is an excellent segmentation network, which mainly consists of three parts: (1) the backbone network for extracting features from the input image, i.e. DeepLabV3 network (2) ASPP module for solving multi-scale problem. (3) Decoder part, used to aggregate features for prediction. In DeepLabv3+, only the features extracted from the first Xception module and the ASPP module are fused. By observation, the distance between the first block of Xception and the ASPP module is close to 65 layers, and it is inevitable that the resolution will disappear in the middle. Therefore, simple feature restoration and fusion is not conducive to the segmentation effect of deep network. On the other hand, the edge target segmentation in Deeplabv3+ is not accurate.
[0038] Example 1
[0039] The present embodiment provides an image segmentation method based on step feature fusion and attention mechanism;
[0040] The image segmentation method based on step feature fusion and attention mechanism comprises:
[0041] S101: acquiring an image to be segmented;
[0042] S102: inputting the image to be segmented into a trained image segmentation network, and outputting an image segmentation result;
[0043] The trained image segmentation network is used for feature extraction of the image to be segmented, and first local features, second local features and global features are extracted respectively, the global features are enhanced by a double-channel attention mechanism, the enhanced global features and the second local features are stepwise feature fused, and the fused features are decoded, in the decoding process, the fused features are up-sampled by bilinear up-sampling, the up-sampled result is concatenated with the first local features, the concatenated result is deconvoluted, the deconvolution is used to capture the details of objects of different shapes, and finally the deconvoluted result is up-sampled to obtain the image segmentation result.
[0044] Further, as shown in Figure 1 The trained image segmentation network comprises:
[0045] a sequentially connected encoder and decoder;
[0046] The encoder comprises a sequentially connected Xception model, a double-channel attention mechanism module (CBAM, Convolutional Block Attention Module), an atrous spatial pyramid pooling module (ASSP) with a spatial pyramid pooling module (ASSP), an adder and a first convolutional layer;
[0047] The Xception model comprises a sequentially connected Entry flow network, a first Middle flow network, a second Middle flow network, a third Middle flow network, a fourth Middle flow network, a fifth Middle flow network, a sixth Middle flow network, a seventh Middle flow network, an eighth Middle flow network and an Exit flow network.
[0048] The input end of the adder is also stepwise connected with the output end of the eighth Middle flow network through a second convolutional layer.
[0049] The internal structures of the Entry flow network, the Middle flow network and the Exit flow network are shown in Figures 2(a), 2(b) and 2(c). The Xception structure has a total of 36 layers, which are divided into Entry flow; Middle flow; Exit flow; the Entry flow contains 8 conv; the Middle flow contains 3*8=24 conv; the Exit flow contains 4 conv, so the Xception has a total of 36 layers.
[0050] Further, the Entry flow network comprises:
[0051] the convolutional layer C1, the activation function layer J1, the convolutional layer C2, the activation function layer J2, the convolutional layer C3, the activation function layer J3, the convolutional layer C4, the maximum pooling layer Z1, the adder J1, the activation function layer J4, the convolutional layer C5, the activation function layer J5, the convolutional layer C6, the maximum pooling layer Z2, the adder J2, the activation function layer J6, the convolutional layer C7, the activation function layer J7, the convolutional layer C8, the maximum pooling layer Z3 and the adder J3 are connected in sequence;
[0052] The output end of the activation function layer J2 is connected to the input end of the adder J1 through the convolutional layer C9.
[0053] The output end of the activation function layer J2 is connected to the input end of the adder J2 through the convolutional layer C9 and the convolutional layer C10.
[0054] The output end of the activation function layer J2 is connected to the input end of the adder J3 through the convolutional layer C9, the convolutional layer C10 and the convolutional layer C11.
[0055] Further, the first Middle flow network, the second Middle flow network, the third Middle flow network, the fourth Middle flow network, the fifth Middle flow network, the sixth Middle flow network, the seventh Middle flow network and the eighth Middle flow network have the same internal structure.
[0056] Further, the first Middle flow network comprises:
[0057] the activation function layer J8, the convolutional layer C12, the activation function layer J9, the convolutional layer C13, the activation function layer J10, the convolutional layer C14 and the adder J4 are connected in sequence.
[0058] The input end of the activation function layer J8 is connected to the input end of the adder J4.
[0059] Further, the Exit flow network comprises:
[0060] The activation function layer J11, the convolution layer C14, the activation function layer J12, the convolution layer C15, the maximum pooling layer Z4, the adder J5, the convolution layer C16, the activation function layer J13, the convolution layer C17, the activation function layer J14, the average pooling layer and the full connection layer are sequentially connected.
[0061] The input end of the activation function layer J11 is connected with the input end of the adder J5 through the convolution layer C18.
[0062] Further, the feature extraction is performed on the image to be segmented, and the first local feature, the second local feature and the global feature are extracted, respectively, wherein the first local feature is the output result of the Entry flow network, the second local feature is the output result of the eighth Middle flow network, and the global feature is the output result of the Exit flow network.
[0063] The local feature is extracted from the shallow network, and the corresponding receptive field is small, while the global feature is extracted from the deep network. With the deepening of the network, the local information will gradually disappear, which is not conducive to improving the segmentation effect. In order to solve the contradiction between semantic information and representation information, the application introduces a jump architecture to combine semantic information and representation information to produce accurate and fine segmentation effect.
[0064] Further, the first convolution layer and the second convolution layer are both 1*1 convolution layers.
[0065] Further, as shown in FIGS. 3(a), 3(b) and 3(c), the double-channel attention mechanism module (CBAM, Convolutional Block Attention Module) comprises an input end, a channel attention unit, a first multiplier, a spatial attention unit, a second multiplier and an output end, wherein the input end is further connected with the input end of the first multiplier, and the output end of the first multiplier is further connected with the input end of the second multiplier.
[0066] It should be understood that in order to obtain rich context dependency, the application adds two types of attention mechanism modules to adaptively integrate local features and their global dependencies, as shown in FIGS. 3(a), 3(b) and 3(c). The attention mechanism can make large-scale target segmentation more perfect. By using the mutual enhancement of feature information between channels and spatial pixels, the edge target can be more accurately segmented.
[0067] Further, as shown in FIGS. 3(a), 3(b) and 3(c), the double-channel attention mechanism module (CBAM, Convolutional Block Attention Module) comprises an input end, a channel attention unit, a first multiplier, a spatial attention unit, a second multiplier and an output end, wherein the input end is further connected with the input end of the first multiplier, and the output end of the first multiplier is further connected with the input end of the second multiplier. Figure 4As shown, the spatial pyramid pooling module with an atrous convolution (ASSP, Atrous Spatial Pyramid Pooling) includes a 1x1 convolution layer, three 3x3 atrous convolutions, and a global average pooling layer, and outputs of five parallel branches are spliced and merged together by a serial splicer.
[0068] Further, the step feature fusion of the enhanced global feature and the second local feature refers to sum processing of the enhanced global feature and the second local feature.
[0069] Further, the decoder includes a first bilinear interpolation up-sampling module and a first deconvolution layer, an input end of the first bilinear interpolation up-sampling module is configured to input an output result of the first convolution layer;
[0070] An input end of the first deconvolution layer is configured to input an output result of the Entry flow network;
[0071] An output end of the first bilinear interpolation up-sampling module and an output end of the first deconvolution layer are both connected to an input end of the serial splicer, and the serial splicer is configured to serially splice output feature maps of the first bilinear interpolation up-sampling module and the first deconvolution layer;
[0072] An output end of the serial splicer is connected to an input end of a second deconvolution layer, an output end of the second deconvolution layer is connected to an input end of a second bilinear interpolation up-sampling module, and an output end of the second bilinear interpolation up-sampling module outputs an image segmented image.
[0073] Further, in the decoding process, the fused feature is up-sampled by bilinear up-sampling, the up-sampled result is serially spliced with the first local feature, the spliced result is deconvoluted, the deconvolution is used to capture details of different shapes of objects, the deconvoluted result is finally up-sampled to obtain an image segmentation result, and the specific operations include:
[0074] The fused feature is up-sampled by the first bilinear interpolation up-sampling module, the up-sampled result is serially spliced with a deconvoluted result of the first local feature, the spliced result is deconvoluted by the second deconvolution layer, the deconvolution is used to capture details of different shapes of objects, and the deconvoluted result is finally up-sampled by the second bilinear interpolation up-sampling module to obtain an image segmentation result.
[0075] Further, the first deconvolution layer and the second deconvolution layer have the same working principle.
[0076] Further, the details of different shaped objects are captured by deconvolution in the process of decoding processing, and the specific expression of deconvolution is:
[0077] o = s(i - 1) + 2p - k + 2 (1)
[0078] Wherein, o represents the size of the output size, s represents the step length, i represents the size of the input feature map; p represents the boundary expansion size; k represents the size of the convolution kernel.
[0079] Further, the working principle of the first bilinear interpolation up-sampling module and the second bilinear interpolation up-sampling module is the same.
[0080] Further, the working principle of the first bilinear interpolation up-sampling module includes:
[0081] First, linear interpolation is performed in the x direction:
[0082]
[0083]
[0084] Wherein, f(x,y1) represents the value taken at (x,y1), f(x,y2) represents the value taken at (x,y2), x and y represent the coordinates of the pixel points to be interpolated, Q 11 ,Q 12 ,Q 21 ,Q 22 represent four different positions of pixel points, f(Q 11 ) represents the pixel value of the coordinate (x1,y1) on the original image, f(Q 12 ) represents the pixel value of the coordinate (x1,y2) on the original image, f(Q 21 ) represents the pixel value of the coordinate (x2,y1) on the original image, and f(Q 22 ) represents the pixel value of the coordinate (x2,y2) on the original image.
[0085] Then, linear interpolation is performed in the y direction:
[0086]
[0087] Wherein, f(x,y) represents the value of the final interpolation at coordinate (x,y).
[0088] It should be understood that in the decoder, deconvolution is performed, and in addition to considering the balance between speed and accuracy, bilinear up-sampling is selected to recover the size. The structure diagram of the rich function is deconvolved at different layers to capture details of different shapes. Shallow deconvolution is used to capture the shape and position of the object. High-level deconvolution is used to capture complex background information. Deconvolution can amplify the activation related to the object, thereby suppressing irrelevant regions. Bilinear up-sampling is simple and fast, and can capture the specific structure of the object. Therefore, finer segmentation can be generated by deconvolution and bilinear up-sampling.
[0089] The structure diagram of the rich function is deconvolved at different layers to capture details of different shapes. Shallow deconvolution is used to capture the shape and position of the object. High-level deconvolution is used to capture complex background information. Deconvolution can amplify the activation related to the object, thereby suppressing irrelevant regions. Bilinear up-sampling is simple and fast, and can capture the specific structure of the object. Therefore, finer segmentation can be generated by deconvolution and bilinear up-sampling.
[0090] Further, as shown in Figure 1 The training process of the trained image segmentation network includes:
[0091] The data set is constructed, and the data set is divided into a training set and a validation set;
[0092] The training set is input into the image segmentation network, and the image segmentation network is trained, and when the loss function value of the network no longer decreases or the iteration number exceeds the set number of times, the training is stopped, and an initial image segmentation network is obtained;
[0093] The validation set is input into the initial image segmentation network, and the network is verified, and when the segmentation accuracy index value exceeds the set threshold, the verification is stopped, and the current initial image segmentation network is the trained image segmentation network.
[0094] The data set of the application is PASCALVOC2012, wherein the training set has 1464 pictures, the validation set has 1449 pictures and 21 categories. The size of each picture is cut to 352*480. Adam is used in the optimizer, the momentum is 0.9, the learning rate is 10 -4 , and the learning rate is multiplied by 0.5 every 50 epochs. 2 pictures are input at a time, and 300 epochs are trained. Figures 5(a)-5(i) The image segmentation result of the embodiment one is shown in the schematic diagram.
[0095] The model of the application is trained and evaluated on the PASCALVOC2012 data set, and compared with other methods to prove the superiority of the model of the application, and MIOU is used as the evaluation index of segmentation accuracy. The test results are shown in the following table, and the method of the application achieves good results.
[0096] Table 1. Comparison with other advanced methods on PASCAL VOC2012 dataset.
[0097]
[0098]
[0099] Embodiment Two
[0100] The embodiment provides an image segmentation system based on step feature fusion and attention mechanism.
[0101] The image segmentation system based on step feature fusion and attention mechanism comprises:
[0102] An acquisition module configured to acquire an image to be segmented.
[0103] A segmentation module configured to input the image to be segmented into a trained image segmentation network and output an image segmentation result; wherein the trained image segmentation network is used for feature extraction on the image to be segmented, and a first local feature, a second local feature and a global feature are extracted respectively, the global feature is subjected to feature enhancement by a double-channel attention mechanism, the enhanced global feature and the second local feature are subjected to step feature fusion, and the fused feature is subjected to decoding processing to obtain the image segmentation result, the fused feature is subjected to upsampling processing by bilinear upsampling in the decoding processing, the upsampling processing result is concatenated with the first local feature, the concatenated result is subjected to deconvolution processing, the deconvolution is used to capture details of objects of different shapes, and finally the deconvolution processing result is subjected to upsampling processing to obtain the image segmentation result.
[0104] It should be noted that the acquisition module and the segmentation module correspond to steps S101 to S102 in Embodiment One, and the above modules have the same examples and application scenarios as the corresponding steps, but are not limited to the content disclosed in Embodiment One. It should be noted that the above modules as part of the system can be executed in a computer system such as a set of computer executable instructions.
[0105] Embodiment Three
[0106] The embodiment also provides an electronic device comprising one or more processors, one or more memories, and one or more computer programs; wherein the processor is connected with the memory, the one or more computer programs are stored in the memory, and when the electronic device is running, the processor executes the one or more computer programs stored in the memory, so that the electronic device executes the method in Embodiment One.
[0107] Example Four
[0108] The embodiment also provides a computer readable storage medium for storing computer instructions, which, when executed by a processor, complete the method in the embodiment one.
[0109] The above merely provides the preferred embodiment of the present application and not for limiting the present application. For the person skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. An image segmentation method based on step feature fusion and attention mechanism, characterized in that, The method comprises the following steps: acquiring an image to be segmented; inputting the image to be segmented into a trained image segmentation network to output an image segmentation result; wherein the trained image segmentation network is used to extract features of the image to be segmented, and first local features, second local features and global features are extracted respectively, the global features are enhanced by a double-channel attention mechanism, the enhanced global features and the second local features are stepwise fused, the fused features are decoded to obtain the image segmentation result, in the decoding process, the fused features are up-sampled by bilinear up-sampling, and the up-sampled result is concatenated with the first local features, the concatenated result is deconvoluted to capture details of objects of different shapes, and finally the deconvoluted result is up-sampled to obtain the image segmentation result; the trained image segmentation network comprises: an encoder and a decoder connected in sequence; the encoder comprises an Xception model, a double-channel attention mechanism module, a spatial pyramid pooling module with a hole convolution, an adder and a first convolution layer connected in sequence; wherein the Xception model comprises an Entry flow network, eight Middle flow networks and an Exit flow network connected in sequence; wherein the input end of the adder is stepwise connected with the output end of the eighth Middle flow network through a second convolution layer; the decoder comprises a first bilinear interpolation up-sampling module and a first deconvolution layer; the input end of the first bilinear interpolation up-sampling module is used to input the output result of the first convolution layer; the input end of the first deconvolution layer is used to input the output result of the Entry flow network; the output end of the first bilinear interpolation up-sampling module and the output end of the first deconvolution layer are connected with the input end of a concatenator, and the concatenator is used to concatenate the output feature map of the first bilinear interpolation up-sampling module and the output feature map of the first deconvolution layer; the output end of the concatenator is connected with the input end of a second deconvolution layer; the output end of the second deconvolution layer is connected with the input end of a second bilinear interpolation up-sampling module; and the output end of the second bilinear interpolation up-sampling module outputs an image after image segmentation; the features of the image to be segmented are extracted, and local features and global features are extracted respectively, wherein the local features refer to the output result of the Middle flow network, and the global features refer to the output result of the Exit flow network; the stepwise feature fusion of the enhanced global features and the second local features refers to summing the enhanced global features and the second local features.
2. The image segmentation method based on step feature fusion and attention mechanism according to claim 1, characterized in that, the specific expression of the deconvolution for capturing details of objects of different shapes is: ,(1) wherein, denotes the size of the output dimension, denotes the step size, denotes the size of the input feature map; denotes the boundary expansion size; k denotes the size of the convolution kernel. 3.The image segmentation method based on step feature fusion and attention mechanism according to claim 1, characterized in that, the working principle of the first bilinear interpolation up-sampling module comprises: First, in Linearly interpolate in the direction: wherein denotes the value taken at , denotes the value taken at , and denotes the coordinates of the pixel to be interpolated, , , Q 22 represents the pixel at four different positions, denotes the pixel value at coordinate of the original image, denotes the pixel value at coordinate of the original image, denotes the pixel value at coordinate of the original image, denotes the pixel value at coordinate of the original image; Then, in Linearly interpolate in the direction: wherein, represents the value of the final interpolation at the coordinate . 4.The image segmentation method based on step feature fusion and attention mechanism according to claim 1, characterized in that, the training process of the trained image segmentation network comprises: constructing a data set, and dividing the data set into a training set and a validation set; The training set is input into the image segmentation network, the image segmentation network is trained, and when the loss function value of the network no longer decreases or the iteration number exceeds a set number of times, the training is stopped, and an initial image segmentation network is obtained; The verification set is input into the initial image segmentation network, the network is verified, and when the segmentation accuracy index value exceeds a set threshold, the verification is stopped, and the current initial image segmentation network is a trained image segmentation network.
5. The image segmentation system based on step feature fusion and attention mechanism, characterized in that, Comprise: An acquisition module configured to acquire an image to be segmented; A segmentation module configured to input the image to be segmented into the trained image segmentation network and output an image segmentation result; wherein the trained image segmentation network is used to extract features from the image to be segmented, extract first local features, second local features and global features respectively, enhance the global features by using a double-channel attention mechanism, perform stepwise feature fusion on the enhanced global features and the second local features, perform decoding processing on the features after the stepwise feature fusion to obtain the image segmentation result, perform upsampling processing on the fused features by bilinear upsampling during the decoding processing, concatenate and splice the upsampling processing result and the first local features, perform deconvolution processing on the spliced result, capture details of objects of different shapes by deconvolution, and finally perform upsampling processing on the deconvolution processing result to obtain the image segmentation result; the trained image segmentation network comprises: An encoder and a decoder connected in sequence; The encoder comprises an Xception model, a double-channel attention mechanism module, a spatial pyramid pooling module with a hollow convolution, an adder and a first convolutional layer connected in sequence; The Xception model comprises an Entry flow network, eight Middle flow networks and an Exit flow network connected in sequence; The input end of the adder is further connected in steps with the output end of the eighth Middle flow network through a second convolutional layer; The decoder comprises a first bilinear interpolation upsampling module and a first deconvolutional layer; The input end of the first bilinear interpolation upsampling module is used to input the output result of the first convolutional layer; The input end of the first deconvolutional layer is used to input the output result of the Entry flow network; The output end of the first bilinear interpolation upsampling module and the output end of the first deconvolutional layer are connected with the input end of a concatenation splicer, and the concatenation splicer is used to concatenate and splice the output feature maps of the first bilinear interpolation upsampling module and the first deconvolutional layer; The output end of the concatenation splicer is connected with the input end of a second deconvolutional layer; the output end of the second deconvolutional layer is connected with the input end of a second bilinear interpolation upsampling module; and the output end of the second bilinear interpolation upsampling module outputs an image after image segmentation. The features are extracted from the image to be segmented, and local features and global features are extracted respectively, wherein the local features refer to the output result of the Middle flow network, and the global features refer to the output result of the Exit flow network. The step feature fusion of the enhanced global feature and the second local feature is a sum operation of the enhanced global feature and the second local feature. 6.An electronic device, comprising: a memory configured to store non-transitory computer-readable instructions; and a processor configured to execute the computer-readable instructions, wherein the computer-readable instructions, when executed by the processor, perform the method of any one of claims 1-4.
7. A storage medium characterized by, non-transitory computer-readable instructions, wherein the non-transitory computer-readable instructions, when executed by a computer, perform the method of any one of claims 1-4.
Citation Information
Patent Citations
Semantic segmentation method based on double-flow feature fusion
CN110782462A
Semantic segmentation method based on channel attention and pyramid convolution fusion
CN114155371A