Image segmentation method, image segmentation device, electronic device and storage medium

Through the image segmentation method of multi-resolution scaling and feature fusion of the original image, the problem of discontinuous and inaccurate image segmentation is solved, and higher segmentation accuracy and efficiency are achieved.

CN116310346BActive Publication Date: 2025-09-02PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310412761.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-07
Publication Date
2025-09-02
Estimated Expiration
2043-04-07

AI Technical Summary

Technical Problem

The existing image segmentation method cannot effectively retain image feature information, resulting in discontinuous or inaccurate segmentation, affecting the accuracy of image segmentation.

Method used

By acquiring the original image features and performing multi-resolution scaling processing, image embedding features with increasing resolution are obtained, label prediction and shape prediction are performed after feature fusion, and the target object is finally segmented in the original image.

Benefits of technology

Semantic segmentation of images is realized, the accuracy and efficiency of image segmentation are improved, and the image category and the shape of target objects can be better determined.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116310346B_ABST
    Figure CN116310346B_ABST
Patent Text Reader

Abstract

The present application provides an image segmentation method, an image segmentation device, an electronic device, and a storage medium, belonging to the field of image processing technology. The method includes: obtaining an original image; obtaining target image features based on the original image; performing multi-resolution scaling processing on the target image features to obtain a first image embedding feature, a second image embedding feature, a third image embedding feature, and a fourth image embedding feature; performing feature fusion on the first image embedding feature, the second image embedding feature, and the third image embedding feature to obtain a fused image embedding feature; performing label prediction based on the fused image embedding feature to obtain an image category label; performing shape prediction based on the fused image embedding feature and the fourth image embedding feature to obtain an object shape label; and segmenting the target object in the original image according to the image category label and the object shape label. The present application can improve the accuracy of image segmentation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image segmentation method, an image segmentation device, an electronic device, and a storage medium. Background Art

[0002] At present, common image segmentation methods often cannot retain the characteristic information of the image well when performing image segmentation, which will lead to problems such as discontinuous or inaccurate segmentation of some areas of the image, affecting the accuracy of image segmentation. Therefore, how to improve the accuracy of image segmentation has become a technical problem that needs to be solved urgently. Summary of the Invention

[0003] The main purpose of the embodiments of the present application is to propose an image segmentation method, an image segmentation device, an electronic device and a storage medium, aiming to improve the accuracy of image segmentation.

[0004] To achieve the above objectives, a first aspect of an embodiment of the present application provides an image segmentation method, the method comprising:

[0005] Get the original image;

[0006] Based on the original image, obtaining target image features;

[0007] Performing multi-resolution scaling on the target image feature to obtain a first image embedding feature, a second image embedding feature, a third image embedding feature, and a fourth image embedding feature; wherein the resolutions of the first image embedding feature, the second image embedding feature, the third image embedding feature, and the fourth image embedding feature are increased in sequence;

[0008] performing feature fusion on the first image embedding feature, the second image embedding feature, and the third image embedding feature to obtain a fused image embedding feature;

[0009] Performing label prediction based on the fused image embedding features to obtain an image category label of the original image;

[0010] Performing shape prediction based on the fused image embedding feature and the fourth image embedding feature to obtain an object shape label of the original image;

[0011] A target object is segmented from the original image according to the image category label and the object shape label.

[0012] In some embodiments, the performing feature fusion on the first image embedding feature, the second image embedding feature, and the third image embedding feature to obtain a fused image embedding feature includes:

[0013] Based on a preset first size parameter, performing a first attention calculation on the first image embedding feature, the second image embedding feature, and the third image embedding feature to obtain a first attention matrix;

[0014] performing a second attention calculation on the first image embedding feature, the second image embedding feature, and the third image embedding feature based on a preset second size parameter and the first attention matrix to obtain a second attention matrix;

[0015] Based on a preset third size parameter and the second attention matrix, a third attention calculation is performed on the first image embedding feature, the second image embedding feature, and the third image embedding feature to obtain the fused image embedding feature.

[0016] In some embodiments, performing label prediction based on the fused image embedding feature to obtain the image category label of the original image includes:

[0017] Based on the fused image embedding feature, a probability calculation is performed on each candidate category label in the plurality of candidate category labels using a preset first function to obtain a first probability value corresponding to each candidate category label;

[0018] The candidate category labels are filtered according to the first probability value to obtain the image category label.

[0019] In some embodiments, performing shape prediction based on the fused image embedding feature and the fourth image embedding feature to obtain the object shape label of the original image includes:

[0020] Performing a dot product process on the fused image embedding feature and the fourth image embedding feature to obtain an image dot product feature;

[0021] Based on the image dot product feature, a probability calculation is performed on each candidate shape label in the plurality of candidate shape labels using a preset second function to obtain a second probability value corresponding to each candidate shape label;

[0022] The plurality of candidate shape labels are filtered according to the second probability value to obtain the object shape label.

[0023] In some embodiments, performing multi-resolution scaling on the target image feature to obtain the first image embedding feature, the second image embedding feature, the third image embedding feature, and the fourth image embedding feature includes:

[0024] performing a first scaling process on the target image feature to obtain a first image embedding feature, wherein a resolution of the first image embedding feature is higher than a resolution of the target image feature;

[0025] performing a second scaling process on the first image embedding feature to obtain a second image embedding feature, wherein a resolution of the second image embedding feature is higher than a resolution of the first image embedding feature;

[0026] performing a third scaling process on the second image embedding feature to obtain a third image embedding feature, wherein a resolution of the third image embedding feature is higher than a resolution of the second image embedding feature;

[0027] A fourth scaling process is performed on the third image embedding feature to obtain a fourth image embedding feature, where the resolution of the fourth image embedding feature is higher than the resolution of the third image embedding feature.

[0028] In some embodiments, obtaining target image features based on the original image includes:

[0029] Performing feature extraction on the original image to obtain candidate image features;

[0030] Calculating the pixel mean of the candidate image features to obtain the image pixel mean;

[0031] The candidate image features are screened based on the image pixel mean to obtain the target image features.

[0032] In some embodiments, screening the candidate image features based on the image pixel mean to obtain the target image feature includes:

[0033] Performing deviation calculation on the candidate image feature based on the image pixel mean to obtain a pixel deviation value;

[0034] comparing the pixel deviation value with a preset deviation threshold;

[0035] The candidate image feature whose pixel deviation value is less than the deviation threshold is used as the target image feature.

[0036] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides an image segmentation device, comprising:

[0037] An image data acquisition module, used for acquiring original images;

[0038] An image feature acquisition module, configured to obtain target image features based on the original image;

[0039] a feature scaling module, configured to perform multi-resolution scaling processing on the target image feature to obtain a first image embedding feature, a second image embedding feature, a third image embedding feature, and a fourth image embedding feature; wherein the resolutions of the first image embedding feature, the second image embedding feature, the third image embedding feature, and the fourth image embedding feature are increased in sequence;

[0040] a feature fusion module, configured to fuse the first image embedding feature, the second image embedding feature, and the third image embedding feature to obtain a fused image embedding feature;

[0041] A label prediction module, configured to perform label prediction based on the fused image embedding features to obtain an image category label for the original image;

[0042] a shape prediction module, configured to perform shape prediction based on the fused image embedding feature and the fourth image embedding feature to obtain an object shape label of the original image;

[0043] The image segmentation module is used to segment the target object in the original image according to the image category label and the object shape label.

[0044] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0045] To achieve the above-mentioned purpose, the fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method described in the first aspect.

[0046] The image segmentation method, image segmentation device, electronic device, and storage medium proposed in this application obtain target image features based on an original image, and perform multi-resolution scaling on the target image features to obtain first, second, third, and fourth image embedding features. The resolutions of the first, second, third, and fourth image embedding features increase in sequence. This approach enables multi-scale segmentation of target image features, resulting in image embedding features of different scales. Since the image embedding features have different scales, the image semantic information they contain also differs. Image embedding features of different scales can thus capture richer image semantic information. Furthermore, the first, second, and third image embedding features are fused to obtain fused image embedding features, effectively fusing feature information at different scales and extracting useful semantic features. Furthermore, label prediction is performed based on the fused image embedding features to obtain an image category label for the original image, and shape prediction is performed based on the fused image embedding features and the fourth image embedding features to obtain an object shape label for the original image. This facilitates determining the image category of the original image and the shape category of the target object contained in the original image. Finally, according to the image category label and object shape label, the target object is segmented in the original image, which can realize the semantic segmentation of the original image and obtain better segmentation results, thereby improving the accuracy of image segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 is a flowchart of the image segmentation method provided in an embodiment of the present application;

[0048] Figure 2 yes Figure 1 Flowchart of step S102 in FIG.

[0049] Figure 3 yes Figure 2 Flowchart of step S203 in FIG.

[0050] Figure 4 yes Figure 1 Flowchart of step S103 in FIG.

[0051] Figure 5 yes Figure 1 Flowchart of step S104 in FIG.

[0052] Figure 6 yes Figure 1 Flowchart of step S105 in FIG.

[0053] Figure 7 yes Figure 1 Flowchart of step S106 in FIG.

[0054] Figure 8 Schematic diagram of the structure of the image segmentation device provided in an embodiment of the present application;

[0055] Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0057] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.

[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0059] First, let’s analyze some of the terms used in this application:

[0060] Artificial intelligence (AI) is a new technical discipline that studies and develops theories, methods, technologies, and application systems for simulating, extending, and expanding human intelligence. A branch of computer science, AI seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thinking. It also encompasses the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.

[0061] Natural language processing (NLP): NLP uses computers to process, understand, and apply human languages ​​(such as Chinese and English). A branch of artificial intelligence, NLP is an interdisciplinary field between computer science and linguistics, often referred to as computational linguistics. Natural language processing encompasses grammatical analysis, semantic analysis, and discourse comprehension. Natural language processing is commonly used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis, and opinion mining. It encompasses data mining, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research related to language processing, and linguistics research related to language computing.

[0062] Information Extraction (NER): A text processing technology that extracts specified types of entity, relationship, event, and other factual information from natural language text and forms structured data output. Information extraction is a technology that extracts specific information from text data. Text data is composed of some specific units, such as sentences, paragraphs, and chapters. Text information is composed of some small specific units, such as characters, words, phrases, sentences, paragraphs, or a combination of these specific units. Extracting noun phrases, names, place names, etc. from text data is all text information extraction. Of course, the information extracted by text information extraction technology can be of various types.

[0063] Image segmentation is the technique and process of dividing an image into several specific regions with unique properties and identifying objects of interest. It is a key step in the transition from image processing to image analysis. Existing image segmentation methods are mainly categorized into the following categories: threshold-based, region-based, edge-based, and those based on specific theories. From a mathematical perspective, image segmentation is the process of dividing a digital image into non-overlapping regions. The image segmentation process is also a labeling process, where pixels belonging to the same region are assigned the same number.

[0064] Resolution, also known as resolution, can be further categorized as display resolution, image resolution, print resolution, and scanning resolution. Resolution determines the fineness of detail in a bitmap image. Generally speaking, the higher the image resolution, the more pixels it contains, the clearer the image, and the better the print quality.

[0065] Softmax function: The Softmax function is a normalized exponential function that can "compress" a K-dimensional vector z containing any real number into another K-dimensional real vector σ(z) so that the range of each element is between (0,1) and the sum of all elements is 1. This function is often used in multi-classification problems.

[0066] At present, common image segmentation methods often cannot retain the characteristic information of the image well when performing image segmentation, which will lead to problems such as discontinuous or inaccurate segmentation of some areas of the image, affecting the accuracy of image segmentation. Therefore, how to improve the accuracy of image segmentation has become a technical problem that needs to be solved urgently.

[0067] Based on this, the embodiments of the present application provide an image segmentation method, an image segmentation device, an electronic device and a storage medium, aiming to improve the accuracy of image segmentation.

[0068] The image segmentation method, image segmentation device, electronic device and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the image segmentation method in the embodiments of the present application is described.

[0069] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results.

[0070] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0071] The image segmentation method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The image segmentation method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the image segmentation method, etc., but is not limited to the above forms.

[0072] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0073] Figure 1 This is an optional flowchart of the image segmentation method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S107.

[0074] Step S101, obtaining an original image;

[0075] Step S102, obtaining target image features based on the original image;

[0076] Step S103: performing multi-resolution scaling processing on the target image feature to obtain a first image embedding feature, a second image embedding feature, a third image embedding feature, and a fourth image embedding feature; wherein the resolutions of the first image embedding feature, the second image embedding feature, the third image embedding feature, and the fourth image embedding feature are increased in sequence;

[0077] Step S104, performing feature fusion on the first image embedding feature, the second image embedding feature, and the third image embedding feature to obtain a fused image embedding feature;

[0078] Step S105, performing label prediction based on the fused image embedding features to obtain the image category label of the original image;

[0079] Step S106, performing shape prediction based on the fused image embedding feature and the fourth image embedding feature to obtain an object shape label of the original image;

[0080] Step S107 : Segment the target object in the original image according to the image category label and the object shape label.

[0081] In steps S101 to S107 of the embodiment of the present application, an original image is obtained, and based on the original image, target image features are obtained. The target image features are then subjected to multi-resolution scaling processing to obtain first, second, third, and fourth image embedding features. The resolutions of the first, second, third, and fourth image embedding features are sequentially increased. This approach enables multi-scale segmentation of the target image features, resulting in image embedding features of different scales. Due to the different scales of the image embedding features, the image semantic information they contain also differs. Image embedding features of different scales can be used to obtain richer image semantic information. Furthermore, the first, second, and third image embedding features are subjected to feature fusion to obtain fused image embedding features, which effectively fuses feature information at different scales and extracts useful semantic features. Furthermore, label prediction is performed based on the fused image embedding features to obtain an image category label for the original image, and shape prediction is performed based on the fused image embedding features and the fourth image embedding features to obtain an object shape label for the original image. This allows for more convenient determination of the image category of the original image and the shape category of the target object contained in the original image. Finally, according to the image category label and object shape label, the target object is segmented in the original image, which can realize the semantic segmentation of the original image and obtain better segmentation results, thereby improving the accuracy of image segmentation.

[0082] In step S101 of some embodiments, a candidate image may be extracted from a known image database as the original image, or an image may be downloaded from a network platform as the original image, or the original image may be obtained by photographing with a video camera or a still camera, without limitation. The original image may contain at least one target object, which may be a person, an animal, a plant, a car, or other object, without limitation.

[0083] It should be noted that there may be certain differences in the size, category, color, shape, etc. of the target objects in the original image. The image segmentation method of the embodiment of the present application can identify the feature information of the target objects in the original image and perform image segmentation according to the feature information of different target objects, thereby realizing semantic segmentation of the original image.

[0084] Prior to step S102 in some embodiments, the image segmentation method of embodiments of the present application further includes constructing an image segmentation model, comprising a backbone network, a pixel decoder, a transformer decoder, a prediction network, and a segmentation network. The backbone network is primarily used to obtain target image features based on the original image. The pixel decoder is primarily used to perform multi-resolution scaling on the target image features to obtain first, second, third, and fourth image embedding features with increasing resolutions. The transformer decoder is primarily used to perform feature fusion on the first, second, and third image embedding features to obtain fused image embedding features. The prediction network is primarily used to perform label prediction based on the fused image embedding features to obtain the image category label of the original image, and to perform shape prediction based on the fused image embedding features and the fourth image embedding features to obtain the object shape label of the original image. The segmentation network is primarily used to segment the target object from the original image based on the image category label and the object shape label. This image segmentation model can significantly simplify the computational process and improve the efficiency and accuracy of image segmentation.

[0085] See also Figure 2 In some embodiments, the original image can be input into the backbone network of the image segmentation model, and the target image features can be obtained based on the backbone network and the original image. Step S102 may include but is not limited to steps S201 to S203:

[0086] Step S201, extracting features from the original image to obtain candidate image features;

[0087] Step S202, performing pixel mean calculation on the candidate image features to obtain the image pixel mean;

[0088] Step S203: Screen candidate image features based on the image pixel mean to obtain target image features.

[0089] In step S201 of some embodiments, convolution processing is performed on the original image through the backbone network to extract image feature information in the original image to obtain candidate image features, wherein the candidate image features include feature information of the target object.

[0090] In step S202 of some embodiments, the pixel values ​​of all candidate image features may be summed to obtain a total pixel value, and then the total pixel value may be divided by the number of candidate image features to obtain an image pixel mean.

[0091] In step S203 of some embodiments, a pixel deviation value for each candidate image feature may be obtained by calculating the difference between the pixel value of each candidate image feature and the image pixel mean. A determination is made as to whether the candidate image feature should be considered as a target image feature based on the relative magnitude of the pixel deviation value and a preset deviation threshold.

[0092] Through the above steps S201 to S203, candidate image features containing characteristic information of the target object can be extracted from the original image more conveniently, and other redundant information irrelevant to image segmentation can be eliminated, which can effectively reduce the amount of data; the candidate image features can also be screened to obtain target image features with better quality, which is conducive to improving the accuracy of image segmentation.

[0093] See also Figure 3 In some embodiments, step S203 may include but is not limited to steps S301 to S303:

[0094] Step S301, performing deviation calculation on the candidate image features based on the image pixel mean to obtain a pixel deviation value;

[0095] Step S302, comparing the pixel deviation value with a preset deviation threshold;

[0096] Step S303: taking the candidate image features whose pixel deviation values ​​are smaller than the deviation threshold as target image features.

[0097] In step S301 of some embodiments, when calculating the deviation of the candidate image feature based on the image pixel mean, the image pixel mean and the pixel value of each subsequent image feature can be subtracted, and the difference result can be used as the pixel deviation value, which can represent the degree of difference between the candidate image feature and the basic image feature of the original image.

[0098] In step S302 of some embodiments, a determination is made as to whether to use the candidate image feature as a target image feature based on a relationship between the pixel deviation value and a preset deviation threshold. If the pixel deviation value is less than the deviation threshold, this indicates that the deviation of the candidate image feature has little impact on the subsequent image segmentation process. If the pixel deviation value is greater than or equal to the preset deviation threshold, this indicates that the deviation of the subsequent image feature is significant and will affect the subsequent image segmentation process.

[0099] In step S303 of some embodiments, in order to improve the quality of image features and the accuracy of image segmentation, candidate image features with pixel deviation values ​​greater than or equal to the deviation threshold are filtered, and candidate image features with pixel deviation values ​​less than the deviation threshold are retained as target image features.

[0100] By calculating the pixel deviation between the pixel values ​​of the candidate image features and the image pixel mean, steps S301 to S303 can clearly identify candidate image features with significant differences. Based on the relationship between the pixel deviation value and the deviation threshold, unqualified candidate image features are filtered out. Unqualified candidate image features may be garbled or defective. Finally, the retained candidate image features are used as target image features, which can significantly improve the quality of the image features and facilitate the accuracy of image segmentation.

[0101] In other embodiments, step S102 may include, but is not limited to, steps S204 to S205:

[0102] Step S204, performing contour recognition on the original image, and identifying candidate image features based on the continuity of the recognized contours;

[0103] Step S205: Input the candidate image features into the feature screening model to obtain the target image features.

[0104] In step S204 of some embodiments, contour recognition can be performed on the original image based on image processing tools such as OpenCV. The pixels of the original image are binarized, and then morphological operations are performed on the binarized original image to identify contour features present in the original image. The contour features are composed of multiple point vectors, and contour drawing is performed based on these point vectors. If these point vectors cannot form a continuous contour feature, that is, the contour feature has breakpoints, etc., these discontinuous contour features are filtered out. If these point vectors can form a continuous contour feature, this continuous contour feature is used as a candidate image feature.

[0105] In step S205 of some embodiments, the candidate image features may be input into a feature screening model, and the model parameters of the feature screening model may be used to calculate the importance of the candidate image features, and candidate image features with lower importance may be filtered out; and candidate image features with higher importance may be used as target image features.

[0106] It should be noted that the importance of the candidate image feature can be determined based on the relationship between the calculated importance value and the preset threshold, that is, if the importance value is greater than the preset threshold, it indicates that the candidate image feature is more important; conversely, if the importance value is less than or equal to the preset threshold, it indicates that the candidate image feature is less important.

[0107] It should be noted that, according to actual business needs, the preset feature selection method can be embedded in the training process of the feature screening model, so that the model learns the feature selection information during the training process and calculates the importance of the candidate image features in the model application. Among them, the feature selection method includes the numerical range in which the pixel mean of the feature should be; or the numerical range in which the number of pixels in the feature should be, etc., without restriction.

[0108] Through the above steps S204 to S205, the contour features in the original image can be identified and screened more conveniently, and the image features with higher importance can be retained, which can better improve the quality of the image features and help improve the accuracy of image segmentation.

[0109] See also Figure 4 In some embodiments, the target image features may be input into the feature decoder of the above-mentioned image segmentation model, and multi-scale scaling of the target image features may be performed based on the feature decoder. Step S103 may include but is not limited to steps S401 to S404:

[0110] Step S401: performing a first scaling process on the target image feature to obtain a first image embedding feature, wherein the resolution of the first image embedding feature is higher than the resolution of the target image feature;

[0111] Step S402: performing a second scaling process on the first image embedding feature to obtain a second image embedding feature, wherein the resolution of the second image embedding feature is higher than the resolution of the first image embedding feature;

[0112] Step S403: performing a third scaling process on the second image embedding feature to obtain a third image embedding feature, where the resolution of the third image embedding feature is higher than the resolution of the second image embedding feature;

[0113] Step S404: Perform a fourth scaling process on the third image embedding feature to obtain a fourth image embedding feature. The resolution of the fourth image embedding feature is higher than the resolution of the third image embedding feature.

[0114] In step S401 of some embodiments, a first decoding layer of a feature decoder performs a first scaling process on the target image feature. During the scaling process, the first decoding layer performs an upsampling process on the target image feature to obtain a first image embedding feature. The resolution of the first image embedding feature is higher than the resolution of the target image feature. For example, the first decoding layer performs a two-fold upsampling process on the target image feature to obtain the first image embedding feature, and the scale of the first image embedding feature is 1 / 32 of the scale of the target image feature.

[0115] In step S402 of some embodiments, a second scaling process is performed on the first image embedded feature by a second decoding layer of a feature decoder. During the scaling process, the first image embedded feature is upsampled by the second decoding layer to obtain a second image embedded feature. The resolution of the second image embedded feature is higher than the resolution of the first image feature. For example, the first image embedded feature is upsampled by a factor of two by the second decoding layer to obtain the second image embedded feature, and the scale of the second image embedded feature is 1 / 16 of the scale of the target image feature.

[0116] In step S403 of some embodiments, a third scaling process is performed on the second image embedded feature by a third decoding layer of the feature decoder. During the scaling process, the second image embedded feature is upsampled by the third decoding layer to obtain a third image embedded feature. The resolution of the third image embedded feature is higher than the resolution of the second image embedded feature. For example, the second image embedded feature is upsampled by a factor of two by the third decoding layer to obtain the third image embedded feature. The scale of the third image embedded feature is 1 / 8 of the scale of the target image feature.

[0117] In step S404 of some embodiments, a fourth scaling process is performed on the third image embedding feature by a fourth decoding layer of the feature decoder. During this scaling process, the third image embedding feature is upsampled by the fourth decoding layer to obtain a fourth image embedding feature. The resolution of the fourth image embedding feature is higher than the resolution of the third image embedding feature. For example, the third image embedding feature is upsampled by a factor of two by the fourth decoding layer to obtain the third image embedding feature. The scale of the fourth image embedding feature is 1 / 4 of the scale of the target image feature.

[0118] Through the above steps S401 to S404, pixel-by-pixel feature extraction of target image features can be achieved, and low-resolution target image features can be converted into higher-resolution image features to obtain image embedding features of different scales. Different image embedding features contain different amounts of image semantic information. This method can obtain richer image semantic information and help improve the accuracy of image segmentation.

[0119] In other embodiments, in contrast to the aforementioned sequentially connected multiple decoding layers, the feature decoder of the image processing model can also be configured as a parallel arrangement of multiple decoding layers. Taking the example of a feature decoder comprising four parallel decoding layers, four different scaling scales are defined in the four decoding layers. These four decoding layers are used to scale the target image features, thereby obtaining first, second, third, and fourth image embedding features of varying resolutions. This achieves multi-scale scaling of the target image features and enhances the richness of the image's semantic information.

[0120] See also Figure 5 In some embodiments, the first image embedding feature, the second image embedding feature, and the third image embedding feature may be input into the transformer decoder of the above-mentioned image processing model, and feature fusion may be performed based on the transformer decoder. Step S104 may include but is not limited to steps S501 to S503:

[0121] Step S501: performing a first attention calculation on the first image embedding feature, the second image embedding feature, and the third image embedding feature based on a preset first size parameter to obtain a first attention matrix;

[0122] Step S502: performing a second attention calculation on the first image embedding feature, the second image embedding feature, and the third image embedding feature based on a preset second size parameter and the first attention matrix to obtain a second attention matrix;

[0123] Step S503: Based on the preset third size parameter and the second attention matrix, a third attention calculation is performed on the first image embedding feature, the second image embedding feature, and the third image embedding feature to obtain a fused image embedding feature.

[0124] In step S501 of some embodiments, the preset first size parameter may include the scale parameter and the number of channels of the first image embedding feature. That is, in the first decoding module of the transformer decoder, the scale and number of channels of the second image embedding feature and the third image embedding feature are adjusted to be consistent with the first image embedding feature based on the scale and number of channels of the first image embedding feature. The first image embedding feature, the adjusted second image embedding feature, and the third image embedding feature are vector-spliced ​​to obtain a first splicing vector. Furthermore, an attention calculation is performed on the first splicing vector X1 to obtain a first attention matrix Z1. The process of performing attention calculation on the first splicing vector X1 can be expressed as shown in formula (1):

[0125]

[0126] Where Q1 is the query matrix of the first concatenated vector X1, Q1 = X1 * W1; V1 is the value matrix of the first concatenated vector X1, V1 = X1 * W2; K1 is the key matrix of the first concatenated vector X1, K1 = X1 * W3; W1, W2, and W3 are trainable parameters. T represents the transpose operation on the key matrix K1.

[0127] In step S502 of some embodiments, the preset second size parameter may include the scale parameter and the number of channels of the second image embedding feature. That is, in the second decoding module of the transformer decoder, the scale and number of channels of the first image embedding feature and the third image embedding feature are adjusted to be consistent with the second image embedding feature based on the scale and number of channels of the second image embedding feature. The second image embedding feature, the adjusted first image embedding feature, and the third image embedding feature are vector-spliced ​​to obtain a second splicing vector. Furthermore, an attention calculation is performed on the second splicing vector X2 to obtain a second attention matrix Z2. The process of performing attention calculation on the second splicing vector X2 can be expressed as shown in formula (2):

[0128]

[0129] Where Q2 is the query matrix of the second concatenated vector X2, Q2 = X2 * W4; V2 is the value matrix of the second concatenated vector X2, V2 = X2 * W5; K2 is the key matrix of the second concatenated vector X2, K2 = X2 * W6; W4, W5, and W6 are trainable parameters. T represents the transpose operation on the key matrix K2.

[0130] In step S503 of some embodiments, the preset third size parameter may include the scale parameter and the number of channels of the third image embedding feature. That is, in the third decoding module of the transformer decoder, the scale and number of channels of the second image embedding feature and the first image embedding feature are adjusted to be consistent with the third image embedding feature based on the scale and number of channels of the third image embedding feature. The third image embedding feature, the adjusted second image embedding feature, and the first image embedding feature are vector-spliced ​​to obtain a third splicing vector. Furthermore, an attention calculation is performed on the third splicing vector to obtain a fused image embedding feature, wherein the process of performing attention calculation on the third splicing vector is basically the same as the process of performing attention calculation on the second splicing vector X2 in the above-mentioned step S502, and will not be repeated here.

[0131] Through the above steps S501 to S503, feature information between different scales can be effectively fused and useful semantic features can be extracted. In the process of feature fusion, the second decoding module and the third decoding module can both apply the previous attention matrix containing the image query features to the current attention calculation process, thereby strengthening the feature connection between different levels and making the feature information of the final fused image embedded features more accurate.

[0132] See also Figure 6In some embodiments, the fused image embedding feature and the fourth image embedding feature are input into the prediction network of the above-mentioned image processing model, and label prediction is performed on the fused image embedding feature based on the prediction network. Step S105 includes but is not limited to steps S601 to S602:

[0133] Step S601: Based on the fused image embedding feature, a probability calculation is performed on each candidate category label among a plurality of candidate category labels using a preset first function to obtain a first probability value corresponding to each candidate category label;

[0134] Step S602: Filter candidate category labels according to the first probability value to obtain an image category label.

[0135] In step S601 of some embodiments, the preset first function may be a softmax function. The softmax function in the prediction network is used to calculate the probability distribution of the fused image embedding feature on multiple preset candidate category labels to obtain a first probability value corresponding to each candidate category label.

[0136] In step S602 of some embodiments, the magnitude of the first probability value can clearly reflect the degree of correlation between the fused image embedded feature and each candidate category label, that is, the larger the first probability value corresponding to the candidate category label, the higher the likelihood that the fused image embedded feature belongs to this candidate category label. Therefore, based on the magnitude of the first probability value, the candidate category label with the largest first probability value is selected as the image category label of the original image, where the candidate category labels include multi-level category labels. For example, the first-level category labels in the candidate category labels include people, animals, plants, vehicles, etc., the second-level category labels include cats, dogs, and fish in the animal category, and cars, bicycles, etc. in the vehicle category, but are not limited to these.

[0137] Through the above steps S601 to S602, the type of the target object in the original image can be identified based on the feature information contained in the fused image embedded features, thereby determining the image category of the original image, thereby improving the recognition accuracy of the image category.

[0138] See also Figure 7 In some embodiments, the fused image embedding feature and the fourth image embedding feature are input into the prediction network of the above-mentioned image processing model, and shape prediction is performed based on the prediction network. Step S106 may include but is not limited to steps S701 to S703:

[0139] Step S701, performing dot product processing on the fused image embedding feature and the fourth image embedding feature to obtain an image dot product feature;

[0140] Step S702: Based on the image dot product feature, a preset second function is used to calculate the probability of each candidate shape label in the plurality of candidate shape labels to obtain a second probability value corresponding to each candidate shape label;

[0141] Step S703: Filter multiple candidate shape labels according to the second probability value to obtain an object shape label.

[0142] In step S701 of some embodiments, vector dot product is performed on the fused image embedding feature and the fourth image embedding feature in the prediction network, and the dot product result is converted from a numerical form to a vector form to obtain an image dot product feature.

[0143] In step S702 of some embodiments, the preset second function may be a softmax function or a sigmoid function. Taking the softmax function as an example, the softmax function is used in the prediction network to calculate the probability distribution of the image dot product feature over a plurality of preset candidate shape labels, thereby obtaining a second probability value corresponding to each candidate shape label.

[0144] In step S703 of some embodiments, the magnitude of the second probability value clearly reflects the degree of correlation between the image dot product feature and each candidate shape label. That is, the larger the second probability value corresponding to a candidate shape label, the more likely the image dot product feature belongs to that candidate shape label. Therefore, based on the magnitude of the second probability value, the candidate shape label with the largest second probability value is selected as the object shape label of the original image. The candidate shape labels include circle, triangle, rhombus, trapezoid, cone, and other geometric shapes.

[0145] Through the above steps S701 to S703, the shape of the target object in the original image can be recognized based on the feature information contained in the fused image embedding feature and the fourth image embedding feature, thereby determining the object shape of the target object in the original image and improving the shape recognition accuracy.

[0146] In step S107 of some embodiments, the image category label and the object shape label can be input into the segmentation network of the image processing model, and the pixel area information where the target image feature is located is extracted from the original image, so that the segmentation network can perform object segmentation in the pixel area where the target image feature is located according to the image category label and the object shape label, and segment the target object from the original image, thereby realizing semantic segmentation of the original image.

[0147] The image segmentation method of the embodiment of the present application obtains the original image, obtains the target image features based on the original image, and performs multi-resolution scaling processing on the target image features to obtain the first image embedding features, the second image embedding features, the third image embedding features and the fourth image embedding features; wherein the resolutions of the first image embedding features, the second image embedding features, the third image embedding features and the fourth image embedding features are increased in sequence. This method can achieve multi-scale segmentation of the target image features and obtain image embedding features of different scales. Since the scales of the image embedding features are different, the image semantic information they contain is also different. Based on the image embedding features of different scales, richer image semantic information can be obtained. Furthermore, the first image embedding features, the second image embedding features and the third image embedding features are subjected to feature fusion to obtain fused image embedding features, which can effectively fuse the feature information between different scales and extract useful semantic features. Furthermore, a softmax function is used to predict labels on the fused image embedding features to obtain the image category label of the original image. Shape prediction is also performed on the fused image embedding features and the fourth image embedding features using the softmax function to obtain the object shape label of the original image. This makes it easier to determine the image category of the original image and the shape category of the target object contained in the original image, improving the accuracy of image category prediction and shape prediction. Finally, based on the image category label and object shape label, the target object is segmented in the original image, achieving semantic segmentation of the original image and obtaining better segmentation results, thereby improving the accuracy of image segmentation.

[0148] See also Figure 8 The present application also provides an image segmentation device that can implement the above-mentioned image segmentation method. The device includes:

[0149] Image data acquisition module 801, used to acquire original images;

[0150] An image feature acquisition module 802 is used to obtain target image features based on the original image;

[0151] A feature scaling module 803 is configured to perform multi-resolution scaling on the target image feature to obtain a first image embedding feature, a second image embedding feature, a third image embedding feature, and a fourth image embedding feature; wherein the resolutions of the first image embedding feature, the second image embedding feature, the third image embedding feature, and the fourth image embedding feature are increased in sequence;

[0152] A feature fusion module 804 is configured to fuse the first image embedding feature, the second image embedding feature, and the third image embedding feature to obtain a fused image embedding feature;

[0153] The label prediction module 805 is used to perform label prediction based on the fused image embedding features to obtain the image category label of the original image;

[0154] a shape prediction module 806 for performing shape prediction based on the fused image embedding feature and the fourth image embedding feature to obtain an object shape label of the original image;

[0155] The image segmentation module 807 is used to segment the target object in the original image according to the image category label and the object shape label.

[0156] The specific implementation of the image segmentation device is basically the same as the specific embodiment of the above-mentioned image segmentation method, and will not be repeated here.

[0157] The present application also provides an electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for enabling communication between the processor and the memory. When the program is executed by the processor, the aforementioned image segmentation method is implemented. The electronic device may be any intelligent terminal, such as a tablet computer or an in-vehicle computer.

[0158] See also Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:

[0159] The processor 901 can be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0160] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program codes are stored in the memory 902 and are called by the processor 901 to execute the image segmentation method of the embodiments of this application.

[0161] Input / output interface 903, used to implement information input and output;

[0162] Communication interface 904, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);

[0163] Bus 905 , which transmits information between various components of the device (e.g., processor 901 , memory 902 , input / output interface 903 , and communication interface 904 );

[0164] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0165] An embodiment of the present application further provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the above-mentioned image segmentation method.

[0166] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0167] The image segmentation method, image segmentation device, electronic device and computer-readable storage medium provided in the embodiments of the present application obtain target image features based on the original image by acquiring an original image, and performing multi-resolution scaling processing on the target image features to obtain a first image embedding feature, a second image embedding feature, a third image embedding feature and a fourth image embedding feature; wherein the resolutions of the first image embedding feature, the second image embedding feature, the third image embedding feature and the fourth image embedding feature increase in sequence. This method can achieve multi-scale segmentation of the target image features and obtain image embedding features of different scales. Since the scales of the image embedding features are different, the image semantic information they contain is also different. Based on the image embedding features of different scales, richer image semantic information can be obtained. Furthermore, the first image embedding feature, the second image embedding feature and the third image embedding feature are subjected to feature fusion to obtain a fused image embedding feature, which can effectively fuse the feature information between different scales and extract useful semantic features. Furthermore, a softmax function is used to predict labels on the fused image embedding features to obtain the image category label of the original image. Shape prediction is also performed on the fused image embedding features and the fourth image embedding features using the softmax function to obtain the object shape label of the original image. This makes it easier to determine the image category of the original image and the shape category of the target object contained in the original image, improving the accuracy of image category prediction and shape prediction. Finally, based on the image category label and object shape label, the target object is segmented in the original image, achieving semantic segmentation of the original image and obtaining better segmentation results, thereby improving the accuracy of image segmentation.

[0168] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0169] It will be understood by those skilled in the art that Figure 1-7 The technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figures, or a combination of certain steps, or different steps.

[0170] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0171] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0172] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0173] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0174] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0175] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0176] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0177] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0178] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.

Claims

1. An image segmentation method, characterized in that: The method comprises: Acquire an original image; and obtain target image features based on the original image; Performing multi-resolution scaling on the target image feature to obtain a first image embedding feature, a second image embedding feature, a third image embedding feature, and a fourth image embedding feature; wherein the resolutions of the first image embedding feature, the second image embedding feature, the third image embedding feature, and the fourth image embedding feature are increased in sequence; performing feature fusion on the first image embedding feature, the second image embedding feature, and the third image embedding feature to obtain a fused image embedding feature, including: performing a first attention calculation on the first image embedding feature, the second image embedding feature, and the third image embedding feature based on a preset first size parameter to obtain a first attention matrix; performing a second attention calculation on the first image embedding feature, the second image embedding feature, and the third image embedding feature based on a preset second size parameter and the first attention matrix to obtain a second attention matrix; performing a third attention calculation on the first image embedding feature, the second image embedding feature, and the third image embedding feature based on a preset third size parameter and the second attention matrix to obtain a fused image embedding feature; Performing label prediction based on the fused image embedding features to obtain an image category label of the original image; Performing shape prediction based on the fused image embedding feature and the fourth image embedding feature to obtain an object shape label for the original image, including: performing a dot product process on the fused image embedding feature and the fourth image embedding feature to obtain an image dot product feature; performing a probability calculation on each of a plurality of candidate shape labels using a preset second function based on the image dot product feature to obtain a second probability value corresponding to each candidate shape label; and filtering the plurality of candidate shape labels according to the second probability value to obtain an object shape label; A target object is segmented from the original image according to the image category label and the object shape label.

2. The image segmentation method according to claim 1, wherein: The performing label prediction based on the fused image embedding feature to obtain the image category label of the original image includes: Based on the fused image embedding feature, a probability calculation is performed on each candidate category label in the plurality of candidate category labels using a preset first function to obtain a first probability value corresponding to each candidate category label; The candidate category labels are filtered according to the first probability value to obtain the image category label.

3. The image segmentation method according to claim 1, wherein: The performing multi-resolution scaling on the target image feature to obtain a first image embedding feature, a second image embedding feature, a third image embedding feature, and a fourth image embedding feature includes: performing a first scaling process on the target image feature to obtain a first image embedding feature, wherein a resolution of the first image embedding feature is higher than a resolution of the target image feature; performing a second scaling process on the first image embedding feature to obtain a second image embedding feature, wherein a resolution of the second image embedding feature is higher than a resolution of the first image embedding feature; performing a third scaling process on the second image embedding feature to obtain a third image embedding feature, wherein a resolution of the third image embedding feature is higher than a resolution of the second image embedding feature; A fourth scaling process is performed on the third image embedding feature to obtain a fourth image embedding feature, where the resolution of the fourth image embedding feature is higher than the resolution of the third image embedding feature.

4. The image segmentation method according to any one of claims 1 to 3, characterized in that: The step of obtaining target image features based on the original image includes: Performing feature extraction on the original image to obtain candidate image features; Calculating the pixel mean of the candidate image features to obtain the image pixel mean; The candidate image features are screened based on the image pixel mean to obtain the target image features.

5. The image segmentation method according to claim 4, characterized in that: The screening of the candidate image features based on the image pixel mean to obtain the target image features includes: Performing deviation calculation on the candidate image feature based on the image pixel mean to obtain a pixel deviation value; comparing the pixel deviation value with a preset deviation threshold; The candidate image feature whose pixel deviation value is less than the deviation threshold is used as the target image feature.

6. An image segmentation device, characterized in that: The device comprises: An image data acquisition module, used for acquiring original images; An image feature acquisition module, configured to obtain target image features based on the original image; a feature scaling module, configured to perform multi-resolution scaling processing on the target image feature to obtain a first image embedding feature, a second image embedding feature, a third image embedding feature, and a fourth image embedding feature; wherein the resolutions of the first image embedding feature, the second image embedding feature, the third image embedding feature, and the fourth image embedding feature are increased in sequence; a feature fusion module, configured to perform feature fusion on the first image embedding feature, the second image embedding feature, and the third image embedding feature to obtain a fused image embedding feature, including: performing a first attention calculation on the first image embedding feature, the second image embedding feature, and the third image embedding feature based on a preset first size parameter to obtain a first attention matrix; performing a second attention calculation on the first image embedding feature, the second image embedding feature, and the third image embedding feature based on a preset second size parameter and the first attention matrix to obtain a second attention matrix; performing a third attention calculation on the first image embedding feature, the second image embedding feature, and the third image embedding feature based on a preset third size parameter and the second attention matrix to obtain a fused image embedding feature; A label prediction module, configured to perform label prediction based on the fused image embedding features to obtain an image category label for the original image; a shape prediction module, configured to perform shape prediction based on the fused image embedding feature and the fourth image embedding feature to obtain an object shape label for the original image, comprising: performing a dot product process on the fused image embedding feature and the fourth image embedding feature to obtain an image dot product feature; performing a probability calculation on each of a plurality of candidate shape labels using a preset second function based on the image dot product feature to obtain a second probability value corresponding to each candidate shape label; and filtering the plurality of candidate shape labels according to the second probability value to obtain an object shape label; The image segmentation module is used to segment the target object in the original image according to the image category label and the object shape label.

7. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the image segmentation method according to any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the image segmentation method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Data screening method, data screening device, electronic equipment and storage medium

    CN114861799A

  • Image processing method and apparatus, server, medical image processing device and storage medium

    WO2021093448A1