Image processing method and device, electronic equipment and computer readable medium
Through feature extraction and attention enhancement processing in image processing methods, the edge accuracy and naturalness of general portrait segmentation are improved, the problems of inaccurate edge segmentation and background stability in the existing technology are solved, and more efficient image segmentation is achieved. Effect.
Patent Information
- Application Number
- CN202410073060.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-17
- Publication Date
- 2024-09-17
AI Technical Summary
In human body segmentation, especially general portrait segmentation, the accuracy of edge segmentation in the existing technology is not ideal, and the stability requirements of the background image lead to inconvenience in practical applications.
Image processing methods are used to improve the accuracy of image features in the target area and enhance the high-frequency information and local receptive fields of texture features through feature extraction, down-sampling, up-sampling, attention enhancement processing and binary mask feature generation.
It improves the accuracy and naturalness of image segmentation, reduces the dependence on background stability, enhances the acquisition of image information in edge areas, and improves the segmentation effect.
Smart Images

Figure CN118657937A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of visual technology, and in particular to an image processing method and device, an electronic device, and a computer-readable medium. Background Art
[0002] Image segmentation is the process of dividing an image into several specific regions with unique properties and proposing objects of interest. Human segmentation is an application of image segmentation, which distinguishes people from backgrounds at the pixel level. Human segmentation includes portrait segmentation and general portrait segmentation. Portrait segmentation is the segmentation of half-length portraits, which is mainly suitable for video calls and conference scenarios. Since portrait segmentation is widely deployed on web pages, mobile phones, and edge devices, portrait segmentation needs to have extremely fast inference speed while taking into account segmentation accuracy. General portrait segmentation is the segmentation of full-length and half-length portraits. With the help of deep learning technology, the effect and efficiency of general portrait segmentation have made rapid breakthroughs, but the segmentation accuracy of portrait edges is still not ideal. Summary of the invention
[0003] The present disclosure provides an image processing method and device, an electronic device, and a computer-readable medium, which can improve segmentation accuracy.
[0004] In a first aspect, the present disclosure provides an image processing method, the method comprising:
[0005] Perform feature extraction on the target area of the image to be processed to obtain the features of the target area;
[0006] Downsampling the target region features to obtain semantic features of the target region;
[0007] Performing up-sampling processing on the semantic features of the target area to obtain the texture features of the target area;
[0008] Performing attention enhancement processing on the texture features of the target area to obtain a channel probability weight of a feature extraction channel;
[0009] Performing up-sampling processing on the channel probability weight and the texture feature to obtain enhanced texture features;
[0010] Obtaining a binary mask feature based on the enhanced texture feature;
[0011] Based on the binary mask features, image features of the target area are obtained.
[0012] In a second aspect, the present disclosure provides an image processing device, the device comprising:
[0013] An input module, used for acquiring an image to be processed;
[0014] A processing module, used for performing feature extraction on the target area of the image to be processed to obtain target area features; performing downsampling processing on the target area features to obtain semantic features of the target area; performing upsampling processing on the semantic features of the target area to obtain texture features of the target area; performing attention enhancement processing on the texture features of the target area to obtain channel probability weights of feature extraction channels; performing upsampling processing on the channel probability weights and the texture features to obtain enhanced texture features; obtaining binary mask features based on the enhanced texture features; and obtaining image features of the target area based on the binary mask features;
[0015] The output module is used to output the image features of the target area.
[0016] In a third aspect, the present disclosure provides an image segmentation model, comprising:
[0017] A feature extraction network is used to extract features of the target area of the image to be processed and obtain the features of the target area;
[0018] A downsampling network, used for downsampling the target region features to obtain semantic features of the target region;
[0019] An upsampling network is used to perform upsampling processing on the semantic features of the target area to obtain the texture features of the target area;
[0020] An attention network is used to perform attention enhancement processing on the texture features of the target area to obtain a channel probability weight of a feature extraction channel;
[0021] The upsampling network is further used to perform upsampling processing on the channel probability weight and the texture feature to obtain enhanced texture features;
[0022] A bottleneck layer, used for obtaining a binary mask feature based on the enhanced texture feature;
[0023] The output layer is used to obtain the image features of the target area based on the binary mask features.
[0024] In a fourth aspect, the present disclosure provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, and one or more of the computer programs are executed by the at least one processor so that the at least one processor can perform the above-mentioned image processing method.
[0025] In a fifth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above-mentioned image processing method when executed by a processor.
[0026] The image processing method provided by the embodiment of the present disclosure uses an image segmentation model to obtain semantic features and texture features of a target area, and enhances the texture features to obtain channel probability weights of feature extraction channels. Then, the texture features are enhanced using the channel probability weights, so that the enhanced texture features contain more high-frequency information and local receptive fields, and the binary mask features obtain more image information, especially in edge areas, thereby making the image features of the target area more accurate, thereby improving the accuracy of image processing.
[0027] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings, in which:
[0029] Figure 1 A flowchart of an image processing method provided by an embodiment of the present disclosure;
[0030] Figure 2 A structural diagram of an image processing device provided by an embodiment of the present disclosure;
[0031] Figure 3 A structural diagram of an image segmentation model provided in an embodiment of the present disclosure;
[0032] Figure 4 A schematic diagram of the structure of an attention network provided by an embodiment of the present disclosure;
[0033] Figure 5 A flowchart of a method for training an image segmentation model provided in an embodiment of the present disclosure;
[0034] Figure 6 A block diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0035] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0036] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.
[0037] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0038] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "including" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. "Connected" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0039] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.
[0040] The background mating algorithm is a portrait segmentation method in natural scenes. It needs to use the background image as a reference. Therefore, when shooting the image, it is necessary to keep the background image as still as possible, that is, try not to shake it, which is inconvenient for practical application. To this end, relevant technicians proposed to use the context switching (CS) module to select useful information, and then obtain the segmented image through the decoder. However, this segmentation will be mixed with the background pixel information, resulting in defects in the edge area of the image and poor segmentation accuracy.
[0041] To this end, the embodiments of the present disclosure provide an image processing method and device, an electronic device, and a computer-readable medium, which can improve the accuracy of image segmentation and make the image of the segmented target area more accurate and natural.
[0042] The image processing method according to the embodiment of the present disclosure can be executed by an electronic device such as a terminal device or a server. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The server can be an independent physical server, a server cluster composed of multiple physical servers, or a cloud server capable of cloud computing. The method can be implemented by a processor calling a computer-readable program instruction stored in a memory.
[0043] In a first aspect, an embodiment of the present disclosure provides an image processing method.
[0044] Figure 1 A flowchart of an image processing method provided by an embodiment of the present disclosure. Figure 1 , the image processing method provided by the embodiment of the present disclosure includes:
[0045] Step S101, extracting features of a target area of the image to be processed to obtain features of the target area.
[0046] The image to be processed refers to an image that needs to be segmented, and the image to be processed includes an image of a target area and a background image. The target area can be any area in the image to be processed, such as a portrait area or a specific object area in the image to be processed.
[0047] This embodiment does not limit the feature extraction method. For example, a mobilenetv3 network can be used to extract features from the image to be processed to obtain features of the target area.
[0048] Step S102: down-sample the target region features to obtain semantic features of the target region.
[0049] Downsampling is the process of extracting the features of the target area and reducing the resolution. Downsampling can make the features of the target area more consistent with the size of the target area and reduce the amount of computation in subsequent steps.
[0050] In some embodiments, the target region features may be downsampled using a downsampling network, and the downsampling network includes multiple downsampling layers. For example, the downsampling network includes four sequentially connected downsampling layers, and the first downsampling layer conv1 is used for downsampling to obtain 128-dimensional semantic features, and the second downsampling layer conv2 is used for downsampling the 128-dimensional semantic features to obtain 64-dimensional semantic features, and the third downsampling layer conv3 is used for downsampling the 64-dimensional semantic features to obtain 32-dimensional semantic features, and the fourth downsampling layer conv4 is used for downsampling the 32-dimensional semantic features to obtain 16-dimensional semantic features, and each downsampling will lose some features.
[0051] Step S103: up-sample the semantic features of the target area to obtain texture features of the target area.
[0052] Upsampling is the process of enlarging low-resolution features to the original resolution, which can improve the accuracy of image processing. In some embodiments, the upsampling network can be used to upsample the semantic features of the target area to obtain the texture features of the target area. The upsampling network includes multiple upsampling layers. For example, the upsampling network includes four upsampling layers. The first upsampling layer conv5 is used to upsample the 16-dimensional semantic features to obtain 32-dimensional texture features; the second upsampling layer conv6 is used to upsample the 32-dimensional texture features and the 32-dimensional semantic features to obtain 64-dimensional texture features; the third upsampling layer conv7 is used to upsample the 64-dimensional texture features and the 64-dimensional semantic features to obtain 128-dimensional texture features; the fourth upsampling layer conv8 is used to upsample the 128-dimensional texture features and the 128-dimensional semantic features to obtain the texture features of the target area.
[0053] Step S104, performing attention enhancement processing on the texture features of the target area to obtain the channel probability weight of the feature extraction channel.
[0054] The disclosed embodiment can process the texture features of the target area to obtain the binary features of the target area. However, because downsampling and upsampling processes easily lead to the loss of high-frequency information of areas such as hair and edges, the disclosed embodiment obtains the high-frequency information of the target area through attention enhancement processing, and then uses the high-frequency information to enhance the texture features.
[0055] In some embodiments, attention is enhanced on the texture features of the target area to obtain channel probability weights of feature extraction channels, including: performing residual subtraction processing on the first texture feature and the second texture feature to obtain a feature residual map; the first texture feature and the second texture feature are texture features of the target area, and the second texture feature is a feature after convolution processing based on the first texture feature; smoothing the feature residual map to obtain a smoothed feature map; pooling the smoothed feature map to obtain a pooled feature map; and obtaining the channel probability weight based on the pooled feature map.
[0056] In some embodiments, the second texture feature is a feature obtained after convolution processing based on the first texture feature. For example, if the upsampling network includes N upsampling layers, where N is an integer greater than 1, the first texture feature may be the texture feature output by the 1st upsampling layer, and the second texture feature may be the texture feature output by the N-1th upsampling layer. Since the first texture feature contains more high-frequency information, the first texture feature and the second texture feature are subjected to residual processing to obtain a residual map of high-frequency information, and then after smoothing, pooling and classification processing based on the residual map, the obtained channel probability weight can contain more high-frequency information.
[0057] In some embodiments, before performing residual reduction processing on the first texture feature and the second texture feature to obtain a feature residual map, it also includes: upsampling the first texture feature to obtain a first upsampled texture feature; performing residual reduction processing on the first upsampled texture feature and the second texture feature to obtain a feature residual map.
[0058] Step S105, upsampling the channel probability weights and texture features to obtain enhanced texture features.
[0059] Since the channel probability weight can contain more high-frequency information, the channel probability weight and the texture feature are convolved to obtain the enhanced texture feature, even if the texture feature contains more high-frequency information.
[0060] In some embodiments, the last upsampling layer in the upsampling network may be used to upsample the channel probability weights and texture features to obtain enhanced texture features.
[0061] Step S106, obtaining a binary mask feature based on the enhanced texture feature.
[0062] A binary mask feature (referred to as mask feature) is obtained based on the enhanced texture feature. Since the enhanced texture feature contains more high-frequency information, the binary mask feature obtained thereby contains more high-frequency information. In some embodiments, the bottleneck layer may use a 1*1*3 convolution.
[0063] Step S107, obtaining image features of the target area based on the binary mask features.
[0064] The image feature (alpha) of the target area is obtained based on the binary mask feature, and the image feature may be a feature map containing 0 and 1.
[0065] In some embodiments, the image processing method further comprises generating a target image based on the image features of the target area. For example, when the target area is a portrait area, the generated target image is a portrait image.
[0066] In some embodiments, when the network structures of the upsampling network and the downsampling network are relatively simple, the upsampling process and the downsampling process are prone to lose some detail information in the image. For this reason, the image processing method provided in this embodiment also includes a feature compensation step.
[0067] Before obtaining the image features of the target area based on the binary mask features, the method further includes: performing splicing processing on the semantic features and the texture features of the target area to obtain the semantic texture features; and performing convolution processing on the semantic texture features to obtain the first target features.
[0068] For example, the semantic features output by the downsampling layer and the texture features output by the upsampling layer are concatenated to obtain semantic texture features, which include both semantic features and texture features. Then, the semantic texture features are convolved to obtain the first target feature.
[0069] In some embodiments, when the dimension of the first target feature exceeds the processing dimension of the convolution layer, it is also necessary to perform dimensionality reduction processing on the first target feature so that the dimension of the first target feature is the same as the processing dimension of the convolution layer.
[0070] It should be noted that when the downsampling network includes multiple downsampling layers and the upsampling network includes multiple upsampling layers, the semantic features output by any downsampling layer in the downsampling network and the texture features output by any upsampling layer in the upsampling network can be spliced to obtain semantic texture features. The present disclosure does not limit the spliced downsampling layers and upsampling layers.
[0071] In some embodiments, based on the binary mask feature, the image feature of the target area is obtained, including: splicing the first target feature and the binary mask feature to obtain the target mask feature; and convolution processing the target mask feature to obtain the image feature of the target area.
[0072] In practical applications, light will affect the accuracy of image segmentation. Therefore, the image segmentation model provided in the embodiment of the present disclosure also includes a light desensitization network.
[0073] In some embodiments, before obtaining the image features of the target area based on the binary mask features, the method further includes: performing convolution processing on the enhanced texture features to obtain light weights.
[0074] Convolution processing is performed on the target mask feature to obtain the image feature of the target area, including: convolution processing is performed on the target mask feature and the light weight to obtain the image feature of the target area.
[0075] For example, the light weight is input into the convolution layer, and the convolution layer is used to convolve the target mask feature and the light weight, so that the light weight is weighted into the target mask feature. This can reduce the sensitivity of the image segmentation model to lighting, and will not affect the accuracy of the image features of the target area even in poor lighting conditions.
[0076] In some embodiments, when the convolution layer performs convolution processing, the light weight can be added to the target mask feature by (1-A), where A represents the light weight.
[0077] The image processing method provided by the embodiment of the present disclosure uses an image segmentation model to obtain semantic features and texture features of a target area, and enhances the texture features to obtain channel probability weights of feature extraction channels. Then, the texture features are enhanced using the channel probability weights, so that the enhanced texture features contain more high-frequency information and local receptive fields, and the binary mask features obtain more image information, thereby making the image features of the target area more accurate.
[0078] In a second aspect, an embodiment of the present disclosure also provides an image processing device.
[0079] Figure 2 FIG. 1 is a structural diagram of an image processing device provided by an embodiment of the present disclosure. Figure 2 As shown, the image processing device 200 provided by the embodiment of the present disclosure includes:
[0080] The acquisition module 201 is used to acquire the image to be processed.
[0081] The processing module 202 is used to extract features of the target area of the image to be processed to obtain target area features; down-sample the target area features to obtain semantic features of the target area; up-sample the semantic features of the target area to obtain texture features of the target area; perform attention enhancement processing on the texture features of the target area to obtain channel probability weights of the feature extraction channel; up-sample the channel probability weights and texture features to obtain enhanced texture features; obtain binary mask features based on the enhanced texture features; and obtain image features of the target area based on the binary mask features.
[0082] The output module 203 is used to output the image features of the target area.
[0083] In some embodiments, the processing module 202 is also used to perform residual subtraction processing on the first texture feature and the second texture feature to obtain a feature residual map; the first texture feature and the second texture feature are texture features of the target area, and the second texture feature is a feature after convolution processing based on the first texture feature; smoothing the feature residual map to obtain a smoothed feature map; pooling the smoothed feature map to obtain a pooled feature map; and obtaining channel probability weights based on the pooled feature map.
[0084] The processing module 202 is further configured to perform upsampling processing on the first texture feature to obtain a first upsampled texture feature; and perform residual subtraction processing on the first upsampled texture feature and the second texture feature to obtain a feature residual map.
[0085] In some embodiments, the first texture feature is a texture feature output by the 1st upsampling layer in the upsampling network, and the second texture feature is a texture feature output by the N-1th upsampling layer in the upsampling network; and / or,
[0086] The last upsampling layer in the upsampling network is used to upsample the channel probability weights and texture features to obtain enhanced texture features, where N is an integer greater than 2.
[0087] In some embodiments, the processing module 202 is further used to perform concatenation processing on the semantic features of the target area and the texture features of the target area to obtain semantic texture features; and perform convolution processing on the semantic texture features to obtain the first target features.
[0088] The processing module 202 is further used to perform splicing processing on the first target feature and the binary mask feature to obtain the target mask feature; and perform convolution processing on the target mask feature to obtain the image feature of the target area.
[0089] In some embodiments, the processing module 202 is further used to perform convolution processing on the enhanced texture features to obtain light weights; and perform convolution processing on the target mask features and the light weights to obtain image features of the target area.
[0090] The steps performed by the processing module in the image processing device mentioned in the embodiment of the present disclosure are the same as the image processing method provided in the first aspect, and will not be repeated here.
[0091] Each module in the above image processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0092] The image processing device provided by the embodiment of the present disclosure utilizes the semantic features and texture features of the target area, and enhances the texture features to obtain the channel probability weights of the feature extraction channels. Then, the texture features are enhanced using the channel probability weights, so that the enhanced texture features contain more high-frequency information and local receptive fields, and the binary mask features obtain more image information, thereby making the image features of the target area more accurate.
[0093] In a third aspect, the present disclosure provides an image segmentation model. Figure 3 A structural diagram of an image segmentation model provided by an embodiment of the present disclosure, such as Figure 3 As shown, the image segmentation model includes a feature extraction network 21, a downsampling network 22, an upsampling network 23, a bottleneck layer 24, an attention network 25 and an output layer 26. Among them,
[0094] The feature extraction network 21 is used to extract features of the target area of the image to be processed to obtain the features of the target area.
[0095] The embodiment of the present disclosure does not limit the feature extraction network. For example, the feature extraction network may adopt a mobilenetv3 network. The target area may be any area in the image to be processed, such as a portrait area or a specific object area in the image to be processed.
[0096] The downsampling network 22 is used to perform downsampling processing on the target area features to obtain the semantic features of the target area.
[0097] The downsampling network 22 may include M layers of downsampling layers connected in sequence, where M is an integer greater than 2. For example, it may include four layers of downsampling layers connected in sequence, such as a first downsampling layer conv1, a second downsampling layer conv2, a third downsampling layer conv3, and a fourth downsampling layer conv4. In some embodiments, the downsampling layers conv1, conv2, conv3, and conv4 use 3*3 convolutions, the step size may be 2, the size of the convolution kernel is 64, and an activation (Parametric Rectified Linear Unit, referred to as prelu) layer may be set after each downsampling layer, and the prelu layer may use a prelu activation function.
[0098] For example, the first downsampling layer conv1 is used for downsampling to obtain 128-dimensional semantic features, the second downsampling layer conv2 is used for downsampling the 128-dimensional semantic features to obtain 64-dimensional semantic features, the third downsampling layer conv3 is used for downsampling the 64-dimensional semantic features to obtain 32-dimensional semantic features, and the fourth downsampling layer conv4 is used for downsampling the 32-dimensional semantic features to obtain 16-dimensional semantic features. Each downsampling will result in the loss of some features.
[0099] The upsampling network 23 is used to perform upsampling processing on the semantic features of the target area to obtain the texture features of the target area.
[0100] The upsampling network 23 may include N upsampling layers connected in sequence, where N is an integer greater than 2. For example, four upsampling layers may be connected in sequence, such as a first upsampling layer conv5, a second upsampling layer conv6, a third upsampling layer conv7, and a fourth upsampling layer conv8. In some embodiments, the upsampling layers conv5, conv6, conv7, and conv8 use 3*3 convolutions, the step size may be 1 / 2, the size of the convolution kernel is 64, and an activation (Parametric Rectified Linear Unit, abbreviated as prelu) layer may be set after each upsampling layer, and the prelu layer may use a prelu activation function.
[0101] For example, the first upsampling layer conv5 is used to upsample the 16-dimensional semantic features to obtain 32-dimensional texture features; the second upsampling layer conv6 is used to upsample the 32-dimensional texture features and the 32-dimensional semantic features to obtain 64-dimensional texture features; the third upsampling layer conv7 is used to upsample the 64-dimensional texture features and the 64-dimensional semantic features to obtain 128-dimensional texture features; the fourth upsampling layer conv8 is used to upsample the 128-dimensional texture features and the 128-dimensional semantic features to obtain the texture features of the target area.
[0102] The attention network 25 is used to perform attention enhancement processing on the texture features of the target area to obtain the channel probability weight of the feature extraction channel.
[0103] The attention (AM) network 25 is used to enhance the attention to the texture features of the target area and obtain the channel probability weight of the feature extraction channel. The channel probability weight can make the last upsampling layer in the upsampling network focus on high-frequency information (such as hair and edge areas), making the image of the target area more accurate.
[0104] The disclosed embodiment can process the texture features of the target area to obtain the binary features of the target area. However, since the network used for the downsampling and upsampling processes is relatively small, the obtained texture features of the target area will lose the high-frequency information of areas such as hair and edges. The disclosed embodiment obtains the high-frequency information of the target area through an attention network, and then uses the high-frequency information to enhance the texture features.
[0105] Figure 4 A schematic diagram of the structure of an attention network provided by an embodiment of the present disclosure. Figure 4 As shown, the attention network includes a residual layer 31, a smoothing layer 32, a pooling layer 33 and a classification layer 34; wherein,
[0106] The residual layer 31 is used to perform residual subtraction processing on the first texture feature and the second texture feature to obtain a feature residual map; the first texture feature and the second texture feature are texture features of the target area, and the second texture feature is a feature after convolution processing based on the first texture feature.
[0107] The smoothing layer 32 is used to smooth the feature residual map to obtain a smoothed feature map.
[0108] For example, the smoothing layer 32 may adopt a 1*1*64 convolution layer, that is, a 1*1*64 convolution layer is used for smoothing.
[0109] The pooling layer 33 is used to perform pooling processing on the smoothed feature map to obtain a pooled feature map.
[0110] For example, a global spatial pooling process is performed on the smoothed feature map to obtain a pooled feature map.
[0111] The classification layer 34 is used to obtain the channel probability weights of the feature extraction channels based on the pooled feature map.
[0112] For example, the classification layer 34 may adopt a sigmoid layer to extract channel probability weights of different feature channels.
[0113] The attention network is used to perform attention enhancement processing on the texture features of the target area to obtain the channel probability weight of the feature extraction channel, including: using a residual layer to perform residual subtraction processing on the first texture feature and the second texture feature to obtain a feature residual map; the first texture feature and the second texture feature are texture features of the target area, and the second texture feature is a feature after convolution processing based on the first texture feature; using a smoothing layer to smooth the feature residual map to obtain a smoothed feature map; using a pooling layer to pool the smoothed feature map to obtain a pooled feature map; using a classification layer to obtain the channel probability weight based on the pooled feature map.
[0114] In some embodiments, the first texture feature is a texture feature output by the 1st upsampling layer, and the second texture feature is a texture feature output by the N-1th upsampling layer.
[0115] For example, see Figure 3 and Figure 4 The attention network performs residual subtraction processing on the first texture feature output by the first upsampling layer conv5 and the second texture feature output by the third upsampling layer conv7. Since the first texture feature contains more high-frequency information, the first texture feature and the second texture feature are subjected to residual processing to obtain a residual map of high-frequency information. After smoothing, pooling and classification based on the residual map, the obtained channel probability weight can contain more high-frequency information.
[0116] In some embodiments, the attention network further includes an attention upsampling layer 35 for upsampling the first texture feature to obtain a first upsampled texture feature.
[0117] The residual layer 31 is also used to perform residual subtraction processing on the first up-sampled texture feature and the second texture feature to obtain a feature residual map.
[0118] like Figure 4 As shown, the first texture feature is upsampled using the attention upsampling layer 35 to obtain the first upsampled texture feature; then, the first upsampled texture feature and the second texture feature are subjected to residual subtraction processing using the residual layer 31 to obtain a feature residual map; the smoothing layer 32 is used to perform pooling processing on the smoothed feature map to obtain a pooled feature map; finally, the classification layer classifies the pooled feature map to obtain the channel probability weight.
[0119] The upsampling network 23 is also used to perform upsampling processing on the channel probability weights and texture features to obtain enhanced texture features.
[0120] In the case where the upsampling network includes N upsampling layers, where N is an integer greater than 2, the channel probability weights and texture features are upsampled using the Nth upsampling layer (the last layer) in the upsampling network to obtain enhanced texture features.
[0121] For example, Figure 3 As shown, the channel probability weights are input into the fourth upsampling layer conv8, and attention weighting is performed by multiplication to obtain enhanced texture features, so that the enhanced texture features obtain more high-frequency information.
[0122] The bottleneck layer 24 is used to obtain a binary mask feature based on the enhanced texture feature.
[0123] For example, the bottleneck layer 24 may be a 1*1*3 convolution layer. After the bottleneck layer 24 performs convolution processing on the enhanced texture features, it outputs a binary mask feature (mask) of the target area.
[0124] The output layer 26 is used to obtain the image features of the target area based on the binary mask features.
[0125] In the embodiment of the present disclosure, the binary mask feature may be an image composed of pixel values of 0 and 255, and the image feature may be an image composed of pixel values of 0 and 1.
[0126] In the embodiment of the present disclosure, the image to be processed is input into the image segmentation model, and the image features of the target area are obtained through the feature extraction network 21, the downsampling network 22, the upsampling network 23, the bottleneck layer 24, the attention network 25 and the output layer 26, that is, the image features of the target area are segmented from the image to be processed. In some embodiments, a hidden coding layer is also provided between the downsampling network 22 and the upsampling network 23.
[0127] It should be noted that in the disclosed embodiment, the downsampling network 22, the upsampling network 23, and the bottleneck layer 24 are used as mask networks. In addition to the above mask network structure, the mask network can also use a Unet network. In the disclosed embodiment, the attention network 25 can also be used as part of the segmentation (matting) network, and the matting network is used to supplement the mask network to make the output image of the target area more accurate.
[0128] When the network structures of the upsampling network and the downsampling network are relatively simple, some detail information is easily lost. Therefore, the image segmentation model provided in this embodiment also includes a feature compensation network 27.
[0129] In some embodiments, Figure 3 As shown, the feature compensation network 27 includes a first connection layer 271, a first convolutional layer 272, a second connection layer 273 and a second convolutional layer 274.
[0130] The first connection layer 271 is used to perform splicing processing on the semantic features and the texture features of the target area to obtain semantic texture features.
[0131] For example, the first connection layer 271 concatenates the semantic features output by the third downsampling layer conv3 and the texture features output by the second upsampling layer conv6 to obtain semantic texture features, that is, the semantic texture features include both semantic features and texture features. Then, the semantic texture features are convolved using the first convolution layer 272 to obtain the first target feature. Among them, the first convolution layer 272 can use 3*3*64 convolution to extract features and obtain the first target feature.
[0132] In some embodiments, when the dimension of the first target feature exceeds the processing dimension of the first convolutional layer 272, it is also necessary to perform dimensionality reduction processing on the first target feature output by the first convolutional layer 272 so that the dimension of the first target feature is the same as the processing dimension of the first convolutional layer 272.
[0133] The first convolution layer 272 is used to perform convolution processing on the semantic texture feature to obtain the first target feature.
[0134] The second connection layer 273 is used to perform splicing processing on the first target feature and the binary mask feature to obtain the target mask feature.
[0135] The second convolution layer 274 is used to perform convolution processing on the target mask features to obtain image features of the target area.
[0136] For example, Figure 3 As shown, the second connection layer 273 is used to concatenate the first target feature and the binary mask feature to obtain the target mask feature; then, the second convolution layer 274 is used to convolve the target mask feature to obtain the image feature of the target area. The second convolution layer 274 can use a 3*3*3 convolution to extract features and obtain the image feature of the target area.
[0137] In practical applications, light will affect the accuracy of image segmentation. Therefore, the image segmentation model provided in the embodiment of the present disclosure also includes a light desensitization network.
[0138] like Figure 3 As shown, the optical desensitization network 28 includes a third convolutional layer 281, wherein the third convolutional layer 281 performs convolution processing on the enhanced texture features output by the fourth upsampling layer conv8 of the upsampling network 23 to obtain optical weights.
[0139] For example, the light weight is input into the second convolution layer 274, and the second convolution layer is used to perform convolution processing on the target mask feature and the light weight, so that the light weight is weighted into the target mask feature. This can reduce the sensitivity of the image segmentation model to lighting, and will not affect the accuracy of the image features of the target area even in a poor lighting environment.
[0140] In some embodiments, when the second convolution layer 274 performs convolution processing, the light weight can be added to the target mask feature by (1-A), where A represents the light weight.
[0141] In the image segmentation model provided by the embodiment of the present disclosure, a downsampling network obtains semantic features of the target area, an upsampling network obtains texture features of the target area, and an attention network is used to enhance the texture features to obtain channel probability weights of feature extraction channels. Then, the upsampling network uses the channel probability weights to enhance the texture features so that the enhanced texture features contain more high-frequency information and local receptive fields. The bottleneck layer can enable the binary mask features to obtain more image information, especially the edge area, so that the image features of the target area output by the output layer are more accurate, thereby improving the accuracy of image processing.
[0142] In a fourth aspect, the present disclosure also provides a model training method. Figure 5 The following is a flow chart of a method for training an image segmentation model provided by an embodiment of the present disclosure. Figure 5 As shown, the training method of the image segmentation model includes:
[0143] Step S501: input the training image samples into the image segmentation model to be trained to obtain the binary mask features, the image features of the target area and the light weight.
[0144] Among them, the structure of the image segmentation model and the working principle of each network in the image segmentation model are similar to those in the first aspect and will not be repeated here.
[0145] Step S502: Based on the binary mask features and the preset mask labels, a first loss value is determined using a first loss function.
[0146] In some embodiments, the first loss function may adopt a binary cross entropy (BCE) function. For example, the first loss value is obtained by formula (1):
[0147] Loss1 = BCE(unet(x),M) (1)
[0148] Among them, Loss1 represents the first loss value, BCE() represents the binary cross entropy function, unet represents the image segmentation model, x represents the input training image sample, and M represents the mask label.
[0149] Step S503: Determine a second loss value using a second loss function based on the image features of the target area and a preset image label.
[0150] In some embodiments, the second loss value can be obtained using formula (2):
[0151] Loss2= L1|mat (x)-alpha+a| +2ssim(mat(x)-alpha) (2)
[0152] Among them, Loss2 represents the second loss value, mat represents the matting network, alpha represents the alpha label, and a represents a constant between 0 and 1, which is mainly used to ensure that the loss can be returned. ssim represents the similarity loss weight, which can be set. For example, the similarity loss weight is set to 2, which aims to make the image features of the predicted target area more refined and have better visual effects.
[0153] Step S504: Determine a third loss value using a third loss function based on the light weight.
[0154] In some embodiments, the third loss value can be obtained using formula (3):
[0155] Loss3 = -log(1-A) (3)
[0156] Among them, Loss3 represents the third loss value, and A represents the light weight.
[0157] Step S505: determining a total loss value based on the first loss value, the second loss value and the third loss value.
[0158] In some embodiments, the total loss value is equal to the sum of the first loss value, the second loss value and the third loss value, that is, Loss=Loss1+Loss2+Loss3.
[0159] Step S506, adjusting the model parameters in the image segmentation model to be trained based on the total loss value, and continuing to train the image segmentation model until a preset cutoff condition is met, thereby obtaining a trained image segmentation model.
[0160] In some embodiments, the cutoff condition may be a total loss value and a preset loss threshold, and when the total loss value is less than or equal to the preset loss threshold, a trained image segmentation model is obtained.
[0161] In some embodiments, the cutoff condition may also be the number of iterations. When the number of training iterations reaches a preset iteration threshold, a trained image segmentation model is obtained.
[0162] It should be noted that the convolution a*b*c mentioned in the embodiments of the present disclosure, where a represents the height of the image, b represents the width of the image, and c represents the number of channels. For example, in the convolution 3*3*64, the first "3" represents the height of the image, the second "3" represents the width of the image, and "64" represents the number of channels.
[0163] The image processing method provided by the embodiment of the present disclosure uses an image segmentation model to obtain semantic features and texture features of a target area, and enhances the texture features to obtain channel probability weights of feature extraction channels. Then, the texture features are enhanced using the channel probability weights, so that the enhanced texture features contain more high-frequency information and local receptive fields, and the binary mask features obtain more image information, thereby making the image features of the target area more accurate.
[0164] Figure 6 A block diagram of an electronic device provided in an embodiment of the present disclosure.
[0165] Reference Figure 6 An embodiment of the present disclosure provides an electronic device, which includes: at least one processor 601; a memory 602 communicatively connected to the at least one processor 601, and one or more I / O interfaces 603; wherein the memory 602 stores one or more computer programs that can be executed by the at least one processor 601, and the one or more computer programs are executed by the at least one processor 601 so that the at least one processor 601 can perform the above-mentioned image processing method.
[0166] Processor 601 is used to obtain an image to be processed; perform feature extraction on a target area of the image to be processed to obtain target area features; perform down-sampling processing on the target area features to obtain semantic features of the target area; perform up-sampling processing on the semantic features of the target area to obtain texture features of the target area; perform attention enhancement processing on the texture features of the target area to obtain channel probability weights of feature extraction channels; perform up-sampling processing on the channel probability weights and texture features to obtain enhanced texture features; obtain binary mask features based on the enhanced texture features; obtain image features of the target area based on the binary mask features, and output the image features of the target area.
[0167] In some embodiments, the processor 601 is further used to perform residual subtraction processing on the first texture feature and the second texture feature to obtain a feature residual map; the first texture feature and the second texture feature are texture features of the target area, and the second texture feature is a feature after convolution processing based on the first texture feature; smoothing the feature residual map to obtain a smoothed feature map; pooling the smoothed feature map to obtain a pooled feature map; and obtaining channel probability weights based on the pooled feature map.
[0168] In some embodiments, the processor 601 is further configured to perform upsampling processing on the first texture feature to obtain a first upsampled texture feature; and perform residual subtraction processing on the first upsampled texture feature and the second texture feature to obtain a feature residual map.
[0169] In some embodiments, the first texture feature is the texture feature output by the 1st upsampling layer, and the second texture feature is the texture feature output by the N-1th upsampling layer; and / or, the channel probability weights and texture features are upsampled using the Nth upsampling layer in the upsampling network to obtain enhanced texture features, where N is an integer greater than 2.
[0170] In some embodiments, the processor 601 is further used to perform concatenation processing on the semantic features of the target area and the texture features of the target area to obtain semantic texture features; and perform convolution processing on the semantic texture features to obtain the first target features.
[0171] The processor 601 is further configured to perform a splicing process on the first target feature and the binary mask feature to obtain a target mask feature; and perform a convolution process on the target mask feature to obtain an image feature of the target area.
[0172] In some embodiments, the processor 601 is further configured to perform convolution processing on the enhanced texture features to obtain light weights; and perform convolution processing on the target mask features and the light weights to obtain image features of the target area.
[0173] Each module in the above electronic device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0174] The present disclosure also provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the above-mentioned image processing method when executed by a processor / processing core. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium.
[0175] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned image processing method.
[0176] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).
[0177] As is known to those of ordinary skill in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable program instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technology, portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, it is known to those of ordinary skill in the art that communication media typically contain computer-readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.
[0178] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0179] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0180] The computer program product described herein may be implemented in hardware, software, or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.
[0181] Various aspects of the present disclosure are described herein 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 disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0182] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0183] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0184] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0185] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.
Claims
1. An image processing method, characterized in that: include: Perform feature extraction on the target area of the image to be processed to obtain the features of the target area; Downsampling the target region features to obtain semantic features of the target region; Performing up-sampling processing on the semantic features of the target area to obtain the texture features of the target area; Performing attention enhancement processing on the texture features of the target area to obtain a channel probability weight of a feature extraction channel; Performing up-sampling processing on the channel probability weight and the texture feature to obtain enhanced texture features; Obtaining a binary mask feature based on the enhanced texture feature; Based on the binary mask features, image features of the target area are obtained.
2. The method according to claim 1, characterized in that The step of performing attention enhancement processing on the texture features of the target area to obtain a channel probability weight of a feature extraction channel includes: Performing residual subtraction processing on the first texture feature and the second texture feature to obtain a feature residual map; the first texture feature and the second texture feature are texture features of the target area, and the second texture feature is a feature obtained after performing convolution processing on the first texture feature; Smoothing the feature residual map to obtain a smoothed feature map; Performing pooling processing on the smoothed feature map to obtain a pooled feature map; A channel probability weight of the feature extraction channel is obtained based on the pooled feature map.
3. The method according to claim 2, characterized in that Before performing residual subtraction processing on the first texture feature and the second texture feature to obtain a feature residual map, the method further includes: Performing upsampling processing on the first texture feature to obtain a first upsampled texture feature; Perform residual subtraction processing on the first up-sampled texture feature and the second texture feature to obtain the feature residual map.
4. The method according to claim 1, characterized in that Before obtaining the image features of the target area based on the binary mask features, the method further includes: Performing splicing processing on the semantic features of the target area and the texture features of the target area to obtain semantic texture features; Performing convolution processing on the semantic texture feature to obtain a first target feature; The step of obtaining the image features of the target area based on the binary mask features includes: Performing splicing processing on the first target feature and the binary mask feature to obtain a target mask feature; The target mask features are subjected to convolution processing to obtain image features of the target area.
5. The method according to claim 4, characterized in that Before obtaining the image features of the target area based on the binary mask features, the method further includes: Performing convolution processing on the enhanced texture features to obtain light weights; The performing convolution processing on the target mask feature to obtain the image feature of the target area includes: The target mask feature and the light weight are convolved to obtain image features of the target area.
6. An image processing device, characterized in that: include: An input module, used for acquiring an image to be processed; A processing module, used for extracting features of a target area of the image to be processed to obtain features of the target area; Performing down-sampling processing on the target region feature to obtain the semantic feature of the target region; performing up-sampling processing on the semantic feature of the target region to obtain the texture feature of the target region; Performing attention enhancement processing on the texture features of the target area to obtain a channel probability weight of a feature extraction channel; Performing up-sampling processing on the channel probability weight and the texture feature to obtain enhanced texture features; Obtaining a binary mask feature based on the enhanced texture feature; Based on the binary mask features, obtaining image features of the target area; The output module is used to output the image features of the target area.
7. An image segmentation model, characterized in that: include: A feature extraction network is used to extract features of the target area of the image to be processed and obtain the features of the target area; A downsampling network, used for downsampling the target region features to obtain semantic features of the target region; An upsampling network is used to perform upsampling processing on the semantic features of the target area to obtain the texture features of the target area; An attention network is used to perform attention enhancement processing on the texture features of the target area to obtain a channel probability weight of a feature extraction channel; The upsampling network is further used to perform upsampling processing on the channel probability weight and the texture feature to obtain enhanced texture features; A bottleneck layer, used for obtaining a binary mask feature based on the enhanced texture feature; The output layer is used to obtain the image features of the target area based on the binary mask features.
8. The image segmentation model according to claim 7, characterized in that The attention network includes: A residual layer, used for performing residual subtraction processing on the first texture feature and the second texture feature to obtain a feature residual map; the first texture feature and the second texture feature are texture features of the target area, and the second texture feature is a feature after convolution processing is performed on the first texture feature; A smoothing layer, used for smoothing the feature residual map to obtain a smoothed feature map; A pooling layer, used for performing pooling processing on the smoothed feature map to obtain a pooled feature map; A classification layer is used to obtain a channel probability weight of the feature extraction channel based on the pooled feature map.
9. The image segmentation model according to claim 8, characterized in that: The attention network includes: an attention upsampling layer, configured to perform upsampling processing on the first texture feature to obtain a first upsampled texture feature; The residual layer is further used to perform residual subtraction processing on the first up-sampled texture feature and the second texture feature to obtain the feature residual map.
10. The image segmentation model according to claim 8, characterized in that The upsampling network includes N upsampling layers, where N is an integer greater than 2; The first texture feature is a texture feature output by the 1st upsampling layer, and the second texture feature is a texture feature output by the N-1th upsampling layer; and / or, The Nth upsampling layer in the upsampling network performs upsampling processing on the channel probability weights and the texture features to obtain enhanced texture features.
11. The image segmentation model according to claim 7, characterized in that: Also included is a characteristic compensation network, the characteristic compensation network comprising: A first connection layer is used to perform splicing processing on the semantic features of the target area and the texture features of the target area to obtain semantic texture features; A first convolution layer, used for performing convolution processing on the semantic texture feature to obtain a first target feature; A second connection layer, used for performing splicing processing on the first target feature and the binary mask feature to obtain a target mask feature; The second convolution layer is used to perform convolution processing on the target mask features to obtain image features of the target area.
12. The image segmentation model according to claim 11, characterized in that The image segmentation model also includes an optical desensitization network, which includes: A third convolutional layer is used to perform convolution processing on the enhanced texture features to obtain light weights; The second convolution layer is also used to perform convolution processing on the target mask features and the light weights to obtain image features of the target area.
13. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor so that the at least one processor can perform the image processing method according to any one of claims 1 to 5.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the image processing method according to any one of claims 1 to 5.
