Image instance segmentation method and device based on edge information enhancement
The edge features of instances are enhanced through deep convolutional neural networks and edge information fusion modules, which solves the problem of insufficient accuracy in edge information processing of image segmentation methods in the existing technology, achieves more accurate instance and boundary segmentation, and improves segmentation performance.
Patent Information
- Application Number
- CN202410421905.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-09
- Publication Date
- 2024-08-23
AI Technical Summary
Existing image segmentation methods have low accuracy when processing instance edge information, are difficult to distinguish, and have significant differences in instance shapes, resulting in reduced model segmentation performance.
An image instance segmentation method based on edge information enhancement is adopted, and a deep convolutional neural network combined with an edge information fusion module is used to extract and enhance instance edge features. The self-attention mechanism and edge supplementary fusion feature map are used for feature alignment to achieve accurate instance and Boundary segmentation.
It improves the model's accurate segmentation performance of object boundaries and enhances the visual effects and overall performance of image instance segmentation.
Smart Images

Figure CN118537546A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to an image instance segmentation method and device based on edge information enhancement. Background Art
[0002] Accurately segmenting instances from images is of great significance for medical image analysis, autonomous driving, industrial automation, and the economic development of human society. Traditional image segmentation methods generally use manual or object features to segment objects from images. Some major image segmentation methods include threshold methods, pixel-based clustering methods, and region growing methods. However, these methods are usually only applicable to specific types of images or specific tasks. In real scenarios, the extraction accuracy is not high and they are easily affected by factors such as expert knowledge, which limits their application scenarios.
[0003] At present, the more mainstream method is based on deep learning. The main idea is to fit and estimate the input image through a convolutional neural network, and to achieve dense prediction of each pixel of the input image through downsampling abstraction and upsampling restoration, so as to achieve the purpose of automatically distinguishing the instance target features in the image. However, since the instance edge information in the image accounts for a small proportion and is difficult to distinguish, and the instances themselves have significant shape differences and overlap and occlude each other, the model cannot effectively extract and utilize edge information, which reduces the segmentation performance of the model. Summary of the invention
[0004] The purpose of the present invention is to provide an image instance segmentation method and device based on edge information enhancement, which realizes edge information enhancement in the image and enhances the distinguishability of instance edges by adopting edge information enhancement mechanism and mask representation reconstruction, so as to achieve the purpose of accurate instance and boundary segmentation.
[0005] To achieve the above object, the technical solution adopted by the present invention is as follows:
[0006] A first aspect of the present invention provides an image instance segmentation method based on edge information enhancement, comprising:
[0007] Obtain an image dataset containing image instances of different types;
[0008] Constructing a deep convolutional neural network, taking the image data set as input and the extracted instance target features as output, training the deep convolutional neural network, continuously iteratively updating network parameters, and saving the optimal network parameters;
[0009] Importing the optimal network parameters into the constructed deep convolutional neural network to obtain an image instance segmentation model;
[0010] Using the image instance segmentation model to perform instance segmentation on the image and output instance targets;
[0011] The deep convolutional neural network includes:
[0012] The feature extraction module is used to extract features from the input image and obtain instance target feature maps of different scales;
[0013] A feature pyramid module is used to perform dimensionality reduction processing on the instance target feature maps of different scales to obtain multi-layer low-dimensional feature maps;
[0014] A region candidate module, used for generating a region of interest based on the multi-layer low-dimensional feature map;
[0015] A semantic enhancement module, used for extracting semantic features from the multi-layer low-dimensional feature map, and performing semantic enhancement based on a self-attention mechanism to obtain a semantically enhanced feature map;
[0016] An edge information fusion module is used to extract edge features from an input image and fuse them with the semantic enhancement feature map to obtain an edge supplement fusion feature map;
[0017] and,
[0018] The prediction module is used to take the feature map after feature alignment of the region of interest and the edge supplementary fusion feature map as input, perform classification score prediction, bounding box position prediction and mask prediction on each region of interest feature map, and perform optimization processing to obtain the final image instance segmentation result; the image instance segmentation result includes a category label, a bounding box and a corresponding mask.
[0019] Furthermore, the method further comprises:
[0020] Before each iteration, all images in the image dataset are randomly cropped, randomly horizontally slid, randomly flipped and rotated, and color enhanced.
[0021] Furthermore, during the training process, network parameters are updated by back propagation.
[0022] Furthermore, the feature extraction module uses ResNet-101 to obtain instance target feature maps of 4 scales, expressed as: F i , F i ∈H i ×W i ×C i , where F i represents the feature map output by the i-th feature extraction layer, H i ,W i ,C i Represents the height, width, and number of channels of the feature map output by the i-th feature extraction layer.
[0023] Furthermore, the feature pyramid module obtains a multi-layer low-dimensional feature map, including:
[0024] The instance target feature map F i Each layer of feature map performs a 1x1 convolution to integrate information and reduce the dimension of the feature map to obtain the feature map F i ';
[0025] The feature map F'4 of the fourth layer is taken as P4;
[0026] The feature map F'4 of the fourth layer is downsampled twice to obtain the feature map P5;
[0027] The feature maps F'3 and F'4 of the third layer are upsampled twice and added together, and then input into a 3x3 convolution to obtain P3;
[0028] The feature maps F'2 and F'3 of the second layer are upsampled twice and then input into a 3x3 convolution to obtain P2;
[0029] The feature maps F1' and F'2 of the first layer are upsampled twice and then input into a 3x3 convolution to obtain P1;
[0030] Finally, we get a multi-layer low-dimensional feature map P j , P j ∈H j ×W j ×256, j=1,2,3,4,5.
[0031] Furthermore, the semantic enhancement module obtains a semantic enhancement feature map, including:
[0032] For the multi-layer low-dimensional feature map P j The feature map is convolutionally reduced and sampled so that each layer of feature map is sampled to size P2. After sampling, fusion is performed to obtain the fused feature P fusion ;
[0033] For the fusion feature P fusion Perform self-attention calculation to obtain the self-attention map P self ;
[0034] The fusion feature P fusion It is sent to the full convolutional network, and through four 3x3 convolutions and one 1x1 convolution operation, the semantic feature map P is obtained. FCN ;
[0035] The self-attention map P self and semantic feature map P FCN Perform pixel-by-pixel addition and fusion to obtain the semantic enhancement feature map P semantic .
[0036] Furthermore, the edge information fusion module obtains an edge supplementary fusion feature map, including:
[0037] The original input image is extracted using the Canny algorithm to obtain the edge feature map P boundary ;
[0038] The edge feature map P boundary With the semantic enhancement feature map P semantic The fusion operation is performed, and then the semantic enhancement feature map and the fused feature map are added pixel by pixel through the residual connection, and then the edge supplement fusion feature map P is obtained after convolution. boundary-fusion , expressed as:
[0039]
[0040] in, and They represent pixel-by-pixel multiplication and pixel-by-pixel addition respectively.
[0041] Furthermore, the prediction module includes a classification branch, a detection branch and a mask representation reconstruction module.
[0042] The classification branch is used to predict the probability that the region of interest belongs to each image instance category based on the aligned region of interest feature map;
[0043] The detection branch is used to predict the position and size of the bounding box of the region of interest based on the aligned feature map of the region of interest;
[0044] The mask representation reconstruction module is used to perform mask prediction based on the aligned feature map of the region of interest to obtain a pixel-level instance target in the region of interest;
[0045] The prediction module is also used to delete duplicate detection results using a non-maximum suppression processing operation.
[0046] Furthermore, the data processing process of the mask representation reconstruction module is as follows:
[0047] Assume that the region of interest feature output by the region candidate module is: i RoI ∈14×14×256,
[0048] P i RoI The edge supplementary fusion feature map P boundary-fusion Perform fusion and feature alignment operations to obtain the aligned feature map P of the region of interest i out ,
[0049] The aligned region of interest feature map P i out Four layers of convolution are used to extract the rich features of the mask, and then three fully connected layers are used to regress the discrete cosine transform mask vector to obtain the predicted output P i result , expressed as:
[0050]
[0051] Among them, f 3×3 and f c Represent 3×3 convolution and fully connected layers respectively, and Represents discrete cosine transform and inverse discrete cosine transform, respectively, x channl (·) represents the channel attention operation.
[0052] In a second aspect of the present invention, a device for image instance segmentation based on edge information enhancement is provided, which is used to implement the above-mentioned method for image instance segmentation based on edge information enhancement, and the device comprises:
[0053] A preprocessing module, used for acquiring an image data set containing image instances of different types, and preprocessing all images in the image data set before each iteration;
[0054] A model building module is used to build a deep convolutional neural network, which includes: a feature extraction module, which is used to extract features from an input image to obtain instance target feature maps of different scales; a feature pyramid module, which is used to perform dimensionality reduction processing on the instance target feature maps of different scales to obtain multi-layer low-dimensional feature maps; a region candidate module, which is used to generate a region of interest based on the multi-layer low-dimensional feature map; a semantic enhancement module, which is used to extract semantic features from the multi-layer low-dimensional feature map, and perform semantic enhancement based on a self-attention mechanism to obtain a semantic enhanced feature map; an edge information fusion module, which is used to extract edge features from an input image, and fuse them with the semantic enhanced feature map to obtain an edge supplementary fusion feature map; and a prediction module, which is used to use the feature map after feature alignment between the region of interest and the edge supplementary fusion feature map as input, perform classification score prediction, bounding box position prediction and mask prediction on each region of interest feature map, and perform optimization processing to obtain a final image instance segmentation result; the image instance segmentation results all include a category label, a bounding box and a corresponding mask;
[0055] A parameter updating module, used to take the image data set as input and the extracted instance target features as output, train the deep convolutional neural network, continuously iterate and update the network parameters, and save the optimal network parameters;
[0056] The result output module is used to import the optimal network parameters into the constructed deep convolutional neural network to obtain an image instance segmentation model, use the image instance segmentation model to perform instance segmentation on the image, and output instance targets.
[0057] The beneficial effects achieved by the present invention are:
[0058] The present invention provides an image instance segmentation method, an instance segmentation method and a device for enhancing instance edge information features based on an edge information enhancement mechanism, which can overcome the difficulties caused by the small amount of object edge information and the difficulty in distinguishing the edge information, realize the accurate segmentation of the object boundary by the model, and improve the performance of the model and the visual effect of the segmentation. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 It is an image instance segmentation method based on edge information enhancement and a principle diagram provided by an embodiment of the present invention;
[0060] Figure 2 It is a structure and principle diagram of a semantic enhancement module provided by an embodiment of the present invention;
[0061] Figure 3 It is the structure and principle diagram of the edge information fusion module provided by the embodiment of the present invention;
[0062] Figure 4 It is a structure and principle diagram of a mask characterization reconstruction module provided by an embodiment of the present invention;
[0063] Figure 5 It is a schematic diagram of an image instance segmentation device based on edge information enhancement provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0064] The specific implementation of the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. The embodiments described below with reference to the accompanying drawings are illustrative and intended to be used to explain the present invention, but should not be construed as limiting the present invention.
[0065] It should be noted that the term "one embodiment" or "embodiment" of the present invention refers to a specific feature, structure or characteristic that can be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not refer to the same embodiment, nor is it a separate or selective embodiment that is mutually exclusive with other embodiments.
[0066] The specific embodiments of the present invention are described in further detail below in conjunction with the accompanying drawings. The following examples are used to illustrate the present invention but are not intended to limit the scope of the present invention.
[0067] Multi-object images in natural scenes usually contain multiple objects of different types, such as people, animals, vehicles, etc. Each individual object in the image is called an image instance. The purpose of the present invention is to segment and identify image instances in the image. Based on this, an embodiment of the present invention provides an image instance segmentation method based on edge information enhancement, including:
[0068] Get image dataset;
[0069] Constructing a deep convolutional neural network, taking the image data set as input and the extracted instance target features as output, training the constructed deep convolutional neural network, continuously iteratively updating network parameters, and saving the optimal network parameters;
[0070] Import the optimal network parameters into the constructed deep convolutional neural network to obtain the image instance segmentation model;
[0071] The image instance segmentation model is used to perform instance segmentation on the image and output instance targets.
[0072] It should be noted that the image datasets are obtained from COCO, Pascal VOC and other datasets, which can be obtained on the corresponding public platforms.
[0073] See also Figure 1 , the structure and principle of deep convolutional neural network include:
[0074] The feature extraction module is used to extract features from the input image and obtain instance target feature maps of different scales;
[0075] Feature pyramid module, used to reduce the dimensionality of instance target feature maps of different scales to obtain multi-layer low-dimensional feature maps;
[0076] Region candidate module, used to generate regions of interest based on multi-layer low-dimensional feature maps;
[0077] The semantic enhancement module is used to extract semantic features from multi-layer low-dimensional feature maps and perform semantic enhancement based on the self-attention mechanism to obtain a semantically enhanced feature map;
[0078] The edge information fusion module is used to extract edge features from the input image and fuse them with the semantic enhancement feature map to obtain an edge supplementary fusion feature map;
[0079] and,
[0080] The prediction module is used to take the feature map after feature alignment of the region of interest and the edge supplementary fusion feature map as input, and perform classification score prediction, bounding box position prediction and mask prediction for each region of interest feature map, and optimize it through non-maximum suppression processing operations to obtain the final image instance segmentation result. Each detected instance target must have a category label, an accurate bounding box and a corresponding mask.
[0081] It should be noted that the prediction module includes a classification branch, a detection branch, and a mask representation reconstruction module.
[0082] The classification branch is used to predict the probability that the region of interest belongs to each image instance category based on the aligned region of interest feature map;
[0083] The detection branch is used to predict the position and size of the bounding box of the region of interest based on the aligned feature map of the region of interest;
[0084] The mask representation reconstruction module is used to perform mask prediction based on the aligned feature map of the region of interest to obtain the pixel-level instance target in the region of interest.
[0085] In one embodiment, the COCO dataset is used as a benchmark image dataset.
[0086] In one embodiment, before each iteration, all images in the dataset are randomly cropped, randomly horizontally slid, randomly flipped and rotated, and color enhanced to enhance the generalization ability of the model.
[0087] In one embodiment, a loss function is constructed to calculate the loss between the true label and the predicted result, and the network parameters are continuously updated iteratively through the optimizer. After reaching the set maximum number of iterations, the training is stopped and the network parameters of the optimal result are saved.
[0088] In one embodiment, the network parameters are updated by back propagation to make the loss value as small as possible.
[0089] In one embodiment, the maximum number of iterations is set to 12 times.
[0090] In one embodiment, the feature extraction module uses ResNet-101, which contains 101 layers of convolution, but is divided into 5 stages, wherein the first stage is a convolution with a kernel size of 7x7 and a stride of 2; the second stage is a 3x3 maximum pooling with a stride of 2, and 3 blocks (1x1 convolution, 3x3 convolution, 1x1 convolution as one block); the third stage is composed of 4 blocks; the fourth stage is composed of 23 blocks; the fifth stage is composed of 3 blocks. Each block has a residual connection, and each of the last four stages outputs a layer of feature maps. The feature extraction module is based on a residual structure, and the residual connection enables the shallow features in the convolutional neural network model to be transferred to the deeper network layer, so as to fully extract the multi-scale instance target features and retain richer detail information, which can effectively avoid gradient explosion or gradient disappearance.
[0091] Finally, the feature extraction module obtains instance target feature maps of 4 scales, expressed as: F i , F i ∈H i ×W i ×C i Among them, H i ,W i ,C i Represents the height, width, and number of channels of the feature map output by the i-th feature extraction layer.
[0092] In one embodiment, the feature pyramid module is used to fuse the extracted multi-scale instance target feature maps to enhance the expressiveness and robustness of the model, reduce the semantic gap between features at different layers, and obtain multi-layer low-dimensional feature maps.
[0093] Specifically, the feature map F i Each layer of feature map is sent to the feature pyramid module, and a 1x1 convolution is performed on each layer of feature map to integrate information and reduce the dimension of the feature map (256 channels) to obtain the feature map F i ';
[0094] The feature map F'4 of the fourth layer is taken as P4;
[0095] The feature map F'4 of the fourth layer is downsampled twice to obtain the feature map P5;
[0096] The feature maps F'3 and F'4 of the third layer are upsampled twice and added together, and then input into a 3x3 convolution to obtain P3;
[0097] The feature maps F'2 and F'3 of the second layer are upsampled twice and then input into a 3x3 convolution to obtain P2;
[0098] The feature maps F1' and F'2 of the first layer are upsampled twice and then input into a 3x3 convolution to obtain P1;
[0099] Finally, we get a multi-layer low-dimensional feature map P j , P j ∈H j ×W j ×256, where j=1,2,3,4,5.
[0100] In one embodiment, the region candidate module uses the RPN network (Region Proposal Network), which is a relatively mature network structure in the technical field for generating high-quality candidate regions.
[0101] In this embodiment, the semantic enhancement module enhances the high-level semantic features of instances by fusing multi-scale features and using a self-attention mechanism and a fully convolutional network.
[0102] See also Figure 2 In one embodiment, the semantic enhancement module data processing process is as follows:
[0103] 31) For the multi-layer low-dimensional feature map P j The feature map is convolutionally reduced and sampled so that each layer of feature map is sampled to size P2. After sampling, fusion is performed to obtain the fused feature:
[0104] P fusion =∑f sample(j) (f 1×1 (P j )),
[0105] Among them, f 1×1 (P j ) and f sample(j) Respectively represent the feature map P j Perform 1x1 convolution dimensionality reduction and sampling operations, P fusion The shape is H3×W3×256.
[0106] 32) P fusion Perform self-attention calculation to obtain the self-attention map. The specific operations are as follows:
[0107] Input feature map reshaping: X = reshape(P fusion )=[x1,x2,...,x N ], where N = H × W;
[0108] Preset three matrices Then generate the query matrix Q, key matrix K and value matrix V:
[0109] Calculate the similarity between all query matrix and key matrix position pairs, and use the similarity as the weight to give the value to obtain the weighted self-attention map: Pself =ρ(QK T )V,
[0110] Among them, ρ(·) is a normalization function used to represent the i-th query feature and the jth key feature The similarities between.
[0111] 33) P fusion It is sent to the full convolutional network, and through four 3x3 convolutions and one 1x1 convolution operation, the semantic feature map P is obtained. FCN ;
[0112] 34) The self-attention map P self and semantic feature map P FCN Perform pixel-by-pixel addition and fusion to obtain a semantically enhanced feature map: P semantic ∈H3×W3×256,
[0113] Among them, P semantic and P fusion The shape and size are consistent, Indicates pixel-by-pixel addition.
[0114] In this embodiment, the edge information fusion module realizes instance edge information feature enhancement through an edge information fusion mechanism.
[0115] See also Figure 3 In one embodiment, the edge information fusion module data processing process is as follows:
[0116] 41) Input the original input image into the Canny algorithm to extract edge features and obtain the edge feature map P boundary ;
[0117] 42) The edge feature map P boundary and semantically enhanced feature map P semantic After the fusion operation is performed, the semantic enhancement feature map and the fused feature map are then fused pixel by pixel through the residual connection, and then the edge supplement fusion feature map is obtained after convolution:
[0118] P boundary-fusion ∈H3×W3×C3,
[0119] in, and They represent pixel-by-pixel multiplication and pixel-by-pixel addition respectively.
[0120] See also Figure 4 In one embodiment, the mask characterization reconstruction module data processing process is as follows:
[0121] (51) Assume that the region feature output by the region candidate module is: i RoI ∈14×14×256,
[0122] P i RoI Supplement and fuse feature map P with edge boundary-fusion Perform fusion and feature alignment operations to obtain the aligned feature map P of the region of interest i out ,
[0123] (52) The features of the region of interest are passed through four layers of convolution to extract the rich features of the mask, and then three fully connected layers are used to regress the discrete cosine transform mask vector to obtain the predicted output:
[0124]
[0125] Among them, f 3×3 and f c Represent 3×3 convolution and fully connected layers respectively, and Represents discrete cosine transform and inverse discrete cosine transform, respectively, x channl (·) represents the channel attention operation.
[0126] In this embodiment, the prediction module compresses the channel through convolution, and performs classification, bounding box regression and mask representation reconstruction prediction, and realizes dense prediction of the input image according to the classification score, bounding box position and mask prediction results.
[0127] Based on the above inventive concept, the present invention also provides an image instance segmentation device, such as Figure 5 As shown, the device comprises:
[0128] A preprocessing module, used for acquiring an image data set containing image instances of different types, and preprocessing all images in the image data set before each iteration;
[0129] A model building module is used to build a deep convolutional neural network, which includes: a feature extraction module, which is used to extract features from an input image to obtain instance target feature maps of different scales; a feature pyramid module, which is used to perform dimensionality reduction processing on the instance target feature maps of different scales to obtain multi-layer low-dimensional feature maps; a region candidate module, which is used to generate a region of interest based on the multi-layer low-dimensional feature map; a semantic enhancement module, which is used to extract semantic features from the multi-layer low-dimensional feature map, and perform semantic enhancement based on a self-attention mechanism to obtain a semantic enhanced feature map; an edge information fusion module, which is used to extract edge features from an input image, and fuse them with the semantic enhanced feature map to obtain an edge supplementary fusion feature map; and a prediction module, which is used to use the feature map after feature alignment between the region of interest and the edge supplementary fusion feature map as input, perform classification score prediction, bounding box position prediction and mask prediction on each region of interest feature map, and perform optimization processing to obtain a final image instance segmentation result; the image instance segmentation results all include a category label, a bounding box and a corresponding mask;
[0130] A parameter updating module, used to take the image data set as input and the extracted instance target features as output, train the deep convolutional neural network, continuously iterate and update the network parameters, and save the optimal network parameters;
[0131] The result output module is used to import the optimal network parameters into the constructed deep convolutional neural network to obtain an image instance segmentation model, use the image instance segmentation model to perform instance segmentation on the image, and output instance targets.
[0132] It is worth pointing out that the device embodiment corresponds to the above-mentioned method embodiment, and the implementation methods of the above-mentioned method embodiments are all applicable to the device embodiment and can achieve the same or similar technical effects, so they will not be repeated here.
[0133] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0134] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0135] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0136] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. An image instance segmentation method based on edge information enhancement, characterized in that: include: Obtain an image dataset containing image instances of different types; Constructing a deep convolutional neural network, taking the image data set as input and the extracted instance target features as output, training the deep convolutional neural network, continuously iteratively updating network parameters, and saving the optimal network parameters; Importing the optimal network parameters into the constructed deep convolutional neural network to obtain an image instance segmentation model; Using the image instance segmentation model to perform instance segmentation on the image and output instance targets; The deep convolutional neural network includes: The feature extraction module is used to extract features from the input image and obtain instance target feature maps of different scales; A feature pyramid module is used to perform dimensionality reduction processing on the instance target feature maps of different scales to obtain multi-layer low-dimensional feature maps; A region candidate module, used for generating a region of interest based on the multi-layer low-dimensional feature map; A semantic enhancement module, used for extracting semantic features from the multi-layer low-dimensional feature map, and performing semantic enhancement based on a self-attention mechanism to obtain a semantically enhanced feature map; An edge information fusion module is used to extract edge features from an input image and fuse them with the semantic enhancement feature map to obtain an edge supplement fusion feature map; and, The prediction module is used to take the feature map after feature alignment of the region of interest and the edge supplementary fusion feature map as input, perform classification score prediction, bounding box position prediction and mask prediction on each region of interest feature map, and perform optimization processing to obtain the final image instance segmentation result; the image instance segmentation result includes a category label, a bounding box and a corresponding mask.
2. The image instance segmentation method based on edge information enhancement according to claim 1, characterized in that: The method further comprises: Before each iteration, all images in the image dataset are randomly cropped, randomly horizontally slid, randomly flipped and rotated, and color enhanced.
3. The image instance segmentation method based on edge information enhancement according to claim 1, characterized in that: During the training process, the network parameters are updated by back propagation.
4. The image instance segmentation method based on edge information enhancement according to claim 1, characterized in that: The feature extraction module uses ResNet-101 to obtain instance target feature maps of 4 scales, expressed as: F i , F i ∈H i ×W i ×C i , where F i represents the feature map output by the i-th feature extraction layer, H i ,W i ,C i Represents the height, width, and number of channels of the feature map output by the i-th feature extraction layer.
5. The image instance segmentation method based on edge information enhancement according to claim 4, characterized in that: The feature pyramid module obtains a multi-layer low-dimensional feature map, including: The instance target feature map F i Each layer of feature map performs a 1x1 convolution to integrate information and reduce the dimension of the feature map to obtain the feature map F i '; The feature map F′4 of the fourth layer is taken as P4; The feature map F′4 of the fourth layer is downsampled twice to obtain the feature map P5; The feature maps F3' and F'4 of the third layer are upsampled twice and added together, and then input into the 3x3 convolution to obtain P3; The feature maps F2' and F'3 of the second layer are upsampled twice and then input into a 3x3 convolution to obtain P2; The feature maps F1' and F2' of the first layer are upsampled twice and then input into a 3x3 convolution to obtain P1; Finally, we get a multi-layer low-dimensional feature map P j , P j ∈H j ×W j ×256, j=1,2,3,4,5.
6. The image instance segmentation method based on edge information enhancement according to claim 5, characterized in that: The semantic enhancement module obtains a semantic enhancement feature map, including: For the multi-layer low-dimensional feature map P j The feature map is convolutionally reduced and sampled so that each layer of feature map is sampled to size P2. After sampling, fusion is performed to obtain the fused feature P fusion ; For the fusion feature P fusion Perform self-attention calculation to obtain the self-attention map P self ; The fusion feature P fusion It is sent to the full convolutional network, and through four 3x3 convolutions and one 1x1 convolution operation, the semantic feature map P is obtained. FCN ; The self-attention map P self and semantic feature map P FCN Perform pixel-by-pixel addition and fusion to obtain the semantic enhancement feature map P semantic .
7. The image instance segmentation method based on edge information enhancement according to claim 6, characterized in that: The edge information fusion module obtains an edge supplementary fusion feature map, including: The original input image is extracted using the Canny algorithm to obtain the edge feature map P boundary ; The edge feature map P boundary With the semantic enhancement feature map P semantic The fusion operation is performed, and then the semantic enhancement feature map and the fused feature map are added pixel by pixel through the residual connection, and then the edge supplement fusion feature map P is obtained after convolution. boundary-fusion , expressed as: in, and They represent pixel-by-pixel multiplication and pixel-by-pixel addition respectively.
8. The image instance segmentation method based on edge information enhancement according to claim 7, characterized in that: The prediction module includes a classification branch, a detection branch and a mask representation reconstruction module. The classification branch is used to predict the probability that the region of interest belongs to each image instance category based on the aligned region of interest feature map; The detection branch is used to predict the position and size of the bounding box of the region of interest based on the aligned feature map of the region of interest; The mask representation reconstruction module is used to perform mask prediction based on the aligned feature map of the region of interest to obtain a pixel-level instance target in the region of interest; The prediction module is also used to delete duplicate detection results using a non-maximum suppression processing operation.
9. The image instance segmentation method based on edge information enhancement according to claim 8, characterized in that: The data processing process of the mask characterization reconstruction module is as follows: Assume that the region of interest feature output by the region candidate module is: i RoI ∈14×14×256, P i RoI The edge supplementary fusion feature map P boundary-fusion Perform fusion and feature alignment operations to obtain the aligned feature map P of the region of interest i out , The aligned region of interest feature map P i out Four layers of convolution are used to extract the rich features of the mask, and then three fully connected layers are used to regress the discrete cosine transform mask vector to obtain the predicted output P i result , expressed as: Among them, f 3×3 and f c Represent 3×3 convolution and fully connected layers respectively, and Represents discrete cosine transform and inverse discrete cosine transform, respectively, x channl (·) represents the channel attention operation.
10. An image instance segmentation device based on edge information enhancement, characterized in that: The device is used to implement the image instance segmentation method based on edge information enhancement according to any one of claims 1 to 9, comprising: A preprocessing module, used for acquiring an image data set containing image instances of different types, and preprocessing all images in the image data set before each iteration; A model building module is used to build a deep convolutional neural network, which includes: a feature extraction module, which is used to extract features from an input image to obtain instance target feature maps of different scales; a feature pyramid module, which is used to perform dimensionality reduction processing on the instance target feature maps of different scales to obtain multi-layer low-dimensional feature maps; a region candidate module, which is used to generate a region of interest based on the multi-layer low-dimensional feature map; a semantic enhancement module, which is used to extract semantic features from the multi-layer low-dimensional feature map, and perform semantic enhancement based on a self-attention mechanism to obtain a semantic enhanced feature map; an edge information fusion module, which is used to extract edge features from an input image, and fuse them with the semantic enhanced feature map to obtain an edge supplementary fusion feature map; and a prediction module, which is used to use the feature map after feature alignment between the region of interest and the edge supplementary fusion feature map as input, perform classification score prediction, bounding box position prediction and mask prediction on each region of interest feature map, and perform optimization processing to obtain a final image instance segmentation result; the image instance segmentation results all include a category label, a bounding box and a corresponding mask; A parameter updating module, used to take the image data set as input and the extracted instance target features as output, train the deep convolutional neural network, continuously iterate and update the network parameters, and save the optimal network parameters; The result output module is used to import the optimal network parameters into the constructed deep convolutional neural network to obtain an image instance segmentation model, use the image instance segmentation model to perform instance segmentation on the image, and output instance targets.
Citation Information
Cited By
Blastocyst image instance segmentation method and device, computer equipment and storage medium
CN119339371A
Image processing method and device, electronic equipment, storage medium and program product
CN119810472A
