Semantic segmentation method and device, equipment, medium and product

Through a multi-scale attention platform, the intermediate features are pooled and convolutional operations are generated to generate the final feature vector for semantic segmentation, which solves the problem of difficulty in distinguishing target objects at different scales in the existing technology and improves the accuracy of semantic segmentation.

CN119251496APending Publication Date: 2025-01-03GUANGDONG YISHENG INNOVATION INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411285821.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The prior art is difficult to accurately distinguish target objects of different scale sizes during semantic segmentation, resulting in low accuracy of semantic segmentation.

Method used

A multi-scale attention platform is used to pool and convolution the intermediate features to generate the final feature vector, and semantic segmentation is performed based on the feature vector to improve the accuracy of the segmentation result.

Benefits of technology

Semantic segmentation of intermediate features through a multi-scale attention platform solves the problem of difficulty in distinguishing target objects at different scales, and significantly improves the accuracy of semantic segmentation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251496A_ABST
    Figure CN119251496A_ABST
Patent Text Reader

Abstract

The invention discloses a semantic segmentation method and device, equipment, a medium and a product, and relates to the field of computer vision, and the method comprises the steps: carrying out the preprocessing of preset image data, inputting the data into a backbone network ResNet50, carrying out the feature extraction through the ResNet50, and obtaining an intermediate feature; and performing semantic segmentation on the intermediate feature through a multi-scale attention platform to obtain a segmentation result. Therefore, image data obtained in advance is preprocessed and then output to the backbone network ResNet50 for feature extraction, intermediate features are obtained, semantic segmentation is performed on the intermediate features through a multi-scale attention platform, and a segmentation result is obtained. The problem that in the prior art, target objects of different sizes are difficult to accurately distinguish during semantic segmentation is solved, and the accuracy of semantic segmentation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of semantic segmentation technology, and in particular to a semantic segmentation method, apparatus, device, medium and product. Background Art

[0002] The semantic segmentation task is a pixel-level image recognition, target positioning and detection task. It is one of the core technologies in the field of autonomous driving. The attention mechanism is a data processing method in machine learning. In the deep learning model, the attention mechanism uses masks to form new weights to act on the image feature domain, which enables the model to selectively focus on effective information and improve the efficiency and accuracy of the model's information processing.

[0003] At present, the common attention mechanisms in the field of semantic segmentation are: Convolutional Attention Mechanism Module (CBAM). The convolutional attention mechanism module integrates channel attention and spatial attention mechanisms, makes full use of the convolutional calculation characteristics of convolutional neural networks, and integrates cross-channel and spatial information to enhance feature extraction. However, this method only focuses on channel features and spatial information and cannot solve the problem of multi-scale target segmentation.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a semantic segmentation method, device, equipment, medium and product, aiming to solve the technical problem that the prior art is difficult to accurately identify target objects of different sizes when performing semantic segmentation.

[0006] To achieve the above objectives, the present application proposes a semantic segmentation method, which includes:

[0007] The preset image data is preprocessed and then input into the backbone network ResNet50, and feature extraction is performed through the ResNet50 to obtain intermediate features;

[0008] The intermediate features are semantically segmented through a multi-scale attention platform to obtain a segmentation result.

[0009] In one embodiment, the step of performing semantic segmentation on the intermediate features through a multi-scale attention platform to obtain a segmentation result includes:

[0010] Pooling the intermediate features through the multi-scale attention platform to obtain a third feature vector;

[0011] Convolving the third eigenvector with a plurality of convolution kernels in the multi-scale attention platform to obtain a fourth eigenvector;

[0012] Convolution is performed according to the fourth feature vector to obtain a final feature vector, and semantic segmentation is performed based on the final feature vector to obtain a segmentation result.

[0013] In one embodiment, the step of pooling the intermediate features through the multi-scale attention platform to obtain a third feature vector includes:

[0014] Average pooling is performed on the intermediate features through the multi-scale attention platform to obtain a first feature vector;

[0015] Performing maximum pooling on the intermediate features through the multi-scale attention platform to obtain a second feature vector;

[0016] The first eigenvector and the second eigenvector are concatenated to obtain a third eigenvector.

[0017] In one embodiment, the plurality of convolution kernels include a first convolution kernel, a second convolution kernel, and a third convolution kernel, and the step of convolving the third feature vector with the plurality of convolution kernels in the multi-scale attention platform to obtain a fourth feature vector includes:

[0018] Convolving the third eigenvector with the first convolution kernel to obtain a first intermediate vector;

[0019] Convolving the third eigenvector with the second convolution kernel to obtain a second intermediate vector;

[0020] Convolving the third eigenvector with the third convolution kernel to obtain a third intermediate vector;

[0021] Performing a global average pooling operation on the third eigenvector to obtain a fourth intermediate vector;

[0022] The first intermediate vector, the second intermediate vector, the third intermediate vector and the fourth intermediate vector are cascaded to obtain a fourth eigenvector.

[0023] In one embodiment, the step of performing convolution according to the fourth feature vector to obtain a final feature vector, and performing semantic segmentation based on the final feature vector to obtain a segmentation result includes:

[0024] After inputting the fourth eigenvector into the first convolution kernel for convolution, the fourth eigenvector is processed by a normalized exponential function softmax to obtain a weight vector;

[0025] Multiplying the weight vector and the intermediate feature to obtain a final feature vector;

[0026] Perform semantic segmentation on the final feature vector to obtain a segmentation result.

[0027] In one embodiment, after the step of performing semantic segmentation on the final feature vector to obtain a segmentation result, the method includes:

[0028] Receive user operation instructions;

[0029] Analyze the operation instruction to obtain an operation task, wherein the operation task includes one or more of image recognition, target positioning, and planning control;

[0030] The operation task is executed based on the segmentation result to obtain an execution result.

[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes a semantic segmentation device, which includes:

[0032] An extraction module is used to pre-process the preset image data and input it into the backbone network ResNet50, perform feature extraction through the ResNet50, and obtain intermediate features;

[0033] The segmentation module is used to perform semantic segmentation on the intermediate features through a multi-scale attention platform to obtain a segmentation result.

[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes a semantic segmentation device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the semantic segmentation method described above.

[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the semantic segmentation method described above are implemented.

[0036] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the semantic segmentation method described above are implemented.

[0037] One or more technical solutions proposed in this application have at least the following technical effects:

[0038] The embodiments of the present application propose a semantic segmentation method, device, equipment, storage medium and computer program product, which pre-processes the preset image data and inputs it into the backbone network ResNet50, extracts features through the ResNet50 to obtain intermediate features, and performs semantic segmentation on the intermediate features through a multi-scale attention platform to obtain a segmentation result. Thus, the pre-obtained image data is pre-processed and then output to the backbone network ResNet50 for feature extraction to obtain intermediate features, and then semantic segmentation is performed on the intermediate features through a multi-scale attention platform to obtain a segmentation result, which solves the problem that the prior art is difficult to accurately distinguish target objects of different scales when performing semantic segmentation, and improves the accuracy of semantic segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0041] Figure 1 A flowchart of the first embodiment of the semantic segmentation method of the present application is provided;

[0042] Figure 2 A schematic diagram of the process of segmenting an image in the semantic segmentation method of this application;

[0043] Figure 3 A flowchart of the second embodiment of the semantic segmentation method of the present application is provided;

[0044] Figure 4 A schematic diagram of the principle of segmenting feature vectors involved in the semantic segmentation method of this application;

[0045] Figure 5 A brief flowchart of the semantic segmentation method provided in Example 2 of the present application;

[0046] Figure 6 This is a schematic diagram of the module structure of the semantic segmentation device according to an embodiment of the present application;

[0047] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the semantic segmentation method in the embodiment of the present application.

[0048] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0049] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0050] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0051] The main solution of the embodiment of the present application is: pooling the intermediate features through the multi-scale attention platform to obtain a third feature vector; convolving the third feature vector through several convolution kernels in the multi-scale attention platform to obtain a fourth feature vector; convolving the fourth feature vector to obtain a final feature vector, and performing semantic segmentation based on the final feature vector to obtain a segmentation result. Average pooling is performed on the intermediate features through the multi-scale attention platform to obtain a first feature vector; maximum pooling is performed on the intermediate features through the multi-scale attention platform to obtain a second feature vector; the first feature vector and the second feature vector are cascaded to obtain a third feature vector. Convolve the third feature vector through the first convolution kernel to obtain a first intermediate vector; convolve the third feature vector through the second convolution kernel to obtain a second intermediate vector; convolve the third feature vector through the third convolution kernel to obtain a third intermediate vector; perform a global average pooling operation on the third feature vector to obtain a fourth intermediate vector; cascade the first intermediate vector, the second intermediate vector, the third intermediate vector and the fourth intermediate vector to obtain a fourth feature vector. After the fourth feature vector is input into the first convolution kernel for convolution, it is processed by the normalized exponential function softmax to obtain a weight vector; the weight vector and the intermediate feature are multiplied to obtain a final feature vector; the final feature vector is semantically segmented to obtain a segmentation result. Receive the user's operation instruction; analyze the operation instruction to obtain an operation task, and the operation task includes one or more of image recognition, target positioning, and planning control; execute the operation task based on the segmentation result to obtain an execution result. Thus, the problem that the prior art is difficult to accurately distinguish target objects of different sizes when performing semantic segmentation is solved, the segmentation of the vector is achieved, and the accuracy of the semantic segmentation is improved. Based on the scheme of the present invention, a semantic segmentation method is designed based on the problem that the commonly used backbone network for semantic segmentation is difficult to accurately distinguish target objects of different sizes, and the accuracy of the semantic segmentation cannot be guaranteed, thereby the accuracy is low. The effectiveness of the semantic segmentation method of the present invention is verified when the vector is segmented. Finally, the accuracy of the semantic segmentation performed by the method of the present invention is significantly improved.

[0052] In this embodiment, for ease of description, the semantic segmentation device is used as the execution subject for explanation below.

[0053] Since the existing attention mechanisms in the prior art mainly include channel attention and spatial attention, method 1 adopts channel attention, performs average pooling and maximum pooling on the input feature map respectively, and then passes the obtained intermediate vector through the perceptron, and finally adds the output feature vector pixel by pixel, and then generates the consideration weight on the channel through the sigmoid activation operation, while method 2 adopts spatial attention, first performs maximum pooling and average pooling operations on the input feature vector based on the channel, and then concatenates the two vectors and obtains a feature vector with a channel number of 1 through convolution, and finally obtains the spatial attention feature weight through the activation function. The calculation processes of the two methods are almost the same, but the dimensions of attention are different. The average pooling and maximum pooling operations of the two methods are simple and crude, which limits the expression ability of the model. In the face of multi-scale targets, especially small-scale targets, both methods cannot achieve good model effects.

[0054] This application provides a solution. In the intelligent customer service system, the backbone network ResNet50 is used to extract features from image data to improve the accuracy of feature extraction. At the same time, a multi-scale attention platform is used to perform semantic segmentation on intermediate features to obtain more accurate segmentation results and provide users with better services.

[0055] From the above embodiments, it can be seen that the present application pre-processes the preset image data and inputs it into the backbone network ResNet50, extracts features through the ResNet50, and obtains intermediate features; the intermediate features are semantically segmented through the multi-scale attention platform to obtain segmentation results. Thus, the pre-obtained image data is pre-processed and then output to the backbone network ResNet50 for feature extraction to obtain intermediate features, and then the intermediate features are semantically segmented through the multi-scale attention platform to obtain segmentation results, which solves the problem that the prior art is difficult to accurately distinguish target objects of different scales when performing semantic segmentation, and improves the accuracy of semantic segmentation.

[0056] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, an intention device device, etc. that can realize the above functions. The following takes the semantic segmentation device as an example to illustrate this embodiment and the following embodiments.

[0057] Based on this, the present application embodiment provides a semantic segmentation method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the semantic segmentation method of the present application.

[0058] In this embodiment, the semantic segmentation method includes steps S01 to S02:

[0059] Step S01, pre-processing the preset image data and inputting it into the backbone network ResNet50, performing feature extraction through the ResNet50 to obtain intermediate features;

[0060] It should be clear that the semantic segmentation task is a pixel-level image recognition, target positioning and detection task, and is one of the core technologies in the field of autonomous driving. The attention mechanism is a data processing method in machine learning. In the deep learning model, the attention mechanism uses masks to form new weights to act on the image feature domain, which enables the model to selectively focus on effective information and improve the efficiency and accuracy of model information processing. At present, the common attention mechanisms in the field of semantic segmentation are: Convolutional Attention Mechanism Module (CBAM). The convolutional attention mechanism module integrates channel attention and spatial attention mechanisms, fully utilizes the convolutional calculation characteristics of convolutional neural networks, and integrates cross-channel and spatial information to enhance feature extraction. However, this method only focuses on channel features and spatial information and cannot solve the problem of multi-scale target segmentation.

[0061] Therefore, in this embodiment, the pre-obtained image data is pre-processed and then input into the backbone network ResNet50, and ResNet50 extracts features from the data to obtain intermediate features. The pre-obtained image data here includes but is not limited to the image data obtained in real time. For example, in the field of autonomous driving, due to the recognition requirements of vehicles, the real-time image is obtained by using the vehicle's camera. ResNet50 is a classic deep learning model, which belongs to a type of residual network. Its structure is relatively complex and includes multiple residual modules, each of which is composed of multiple residual blocks. The module composition of ResNet50 can be:

[0062] (1) Input layer: The input layer of ResNet50 receives input image data, which is generally a 224x224 pixel color image;

[0063] (2) Convolutional layer and pooling layer: The initial convolutional layer and pooling layer are used to process the input image and extract basic features;

[0064] (3) Residual module: ResNet50 contains 4 main residual modules, each of which contains multiple residual blocks. The specific structure is as follows: residual module 1: contains 3 residual blocks, residual module 2: contains 4 residual blocks, residual module 3: contains 6 residual blocks and residual module 4: contains 3 residual blocks;

[0065] (4) Global average pooling layer: At the top of the model, the last residual module is usually followed by a global average pooling layer, which averages all the values ​​of each feature map to generate a vector of fixed size.

[0066] (5) Fully connected layer: The fully connected layer (or densely connected layer) maps the output of the global average pooling layer to a predefined number of categories (for example, 1000 categories, corresponding to the number of categories in the ImageNet dataset);

[0067] (6) Softmax layer: The last layer is the Softmax layer, which is used to output the probability distribution of the classification.

[0068] ResNet50 is used in this embodiment because it contains 50 convolutional layers, excluding pooling layers and ReLU activation layers. This structural design allows the network to be deeper. At the same time, the residual connection solves the gradient vanishing and gradient exploding problems in deep networks, making training more stable and efficient.

[0069] Step S02, performing semantic segmentation on the intermediate features through a multi-scale attention platform to obtain a segmentation result.

[0070] The multi-scale attention platform includes multiple multi-scale attention modules. The multi-scale attention module is a mechanism used in deep learning models to process information of different scales, thereby enhancing the model's expressiveness and performance. It helps the model capture richer features by introducing multi-level or multi-scale information. This mechanism is particularly important in fields such as computer vision and natural language processing. Its working principles include:

[0071] (1) Multi-scale feature extraction: The module first extracts features of multiple scales from the input data. These features may come from different layers, resolutions, or levels of detail. For example, in image processing, features can be extracted through convolutional layers of different resolutions.

[0072] (2) Attention mechanism: After extracting features of different scales, the module will apply the attention mechanism to weight these features. The attention mechanism can dynamically adjust the weights of features of different scales according to the needs of the current task, thereby improving the contribution of key features;

[0073] (3) Feature fusion: The weighted multi-scale features are fused together to form the final feature representation. This step can be completed by addition, concatenation or other fusion methods.

[0074] (4) Output: The fused features are passed to subsequent network layers for further processing and prediction.

[0075] In this embodiment, the multi-scale attention module is used because it has rich feature representation, that is, the multi-scale attention module can capture both low-level and high-level features at the same time, thereby providing a richer input representation. In addition, it has enhanced performance capabilities, that is, by focusing on information at different scales, the model can better handle complex tasks such as object detection, image segmentation, and text understanding. At the same time, it also has a certain degree of flexibility, that is, the scale setting and the application of the attention mechanism can be adjusted according to the different requirements of the task.

[0076] Specifically, in the above step S02, the step of performing semantic segmentation on the intermediate features through the multi-scale attention platform to obtain the segmentation result includes:

[0077] Step S021, pooling the intermediate features through the multi-scale attention platform to obtain a third feature vector;

[0078] Step S022, convolving the third eigenvector with a plurality of convolution kernels in the multi-scale attention platform to obtain a fourth eigenvector;

[0079] Step S023, performing convolution according to the fourth feature vector to obtain a final feature vector, and performing semantic segmentation based on the final feature vector to obtain a segmentation result.

[0080] like Figure 2 As shown in the figure, after the feature extraction of the original image is completed and the intermediate features are obtained, they are input into the multi-scale attention module in the multi-scale attention platform to pool the intermediate features to obtain the third feature vector, where pooling is an operation widely used in deep learning, mainly used to reduce the spatial size of the feature map, thereby reducing the computational complexity, reducing overfitting, and extracting important features;

[0081] Subsequently, the third eigenvector is convolved by several convolution kernels in the multi-scale attention platform to obtain the fourth eigenvector;

[0082] Finally, the fourth eigenvector is convolved again to obtain the final eigenvector, and semantic segmentation is performed based on the final eigenvector to obtain the segmentation result. Upsampling is a commonly used technique in image processing and signal processing, which is used to expand low-resolution images or signals to high resolution. It is also often used in deep learning, especially in tasks such as semantic segmentation, image generation, and super-resolution. In deep learning, upsampling is mainly used to expand feature maps from low-resolution space to high-resolution space. This usually involves expanding the size of the feature map from a smaller value (such as 8x8 or 16x16) to the size of the original input image (such as 256x256). The goal of upsampling is to retain and enhance the details and semantic information in the image, so that the model can output higher quality results when predicting and generating.

[0083] More specifically, after the step S02 of performing semantic segmentation on the final feature vector to obtain a segmentation result, the method includes:

[0084] Step S03, receiving an operation instruction from a user;

[0085] Step S04, analyzing the operation instruction to obtain an operation task, wherein the operation task includes one or more of image recognition, target positioning, and planning control;

[0086] Step S05: executing the operation task based on the segmentation result to obtain an execution result.

[0087] After completing the segmentation of the vector, the user's operation instructions can be accepted synchronously. In this embodiment, autonomous driving is used as an example. After the user boards the running vehicle, he can enter the destination (i.e., the operation instruction), and then the operation task "transport passengers to the designated location" is obtained based on the analysis of the operation instruction. On the road, the segmentation results, i.e., road signs and path information on the road surface, are needed to assist the vehicle to reach the destination, thereby obtaining the corresponding execution result.

[0088] This embodiment adopts the above scheme, specifically, by pre-processing the preset image data and inputting it into the backbone network ResNet50, extracting features through the ResNet50 to obtain intermediate features; and performing semantic segmentation on the intermediate features through the multi-scale attention platform to obtain segmentation results. Thus, the pre-obtained image data is pre-processed and then output to the backbone network ResNet50 for feature extraction to obtain intermediate features, and then semantic segmentation is performed on the intermediate features through the multi-scale attention platform to obtain segmentation results, which solves the problem that the prior art is difficult to accurately distinguish target objects of different scales when performing semantic segmentation, and improves the accuracy of semantic segmentation.

[0089] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 In step S021, in which the intermediate features are pooled by the multi-scale attention platform to obtain a third feature vector, the semantic segmentation method further includes steps S0211 to S0213:

[0090] Step S0211, performing average pooling on the intermediate features through the multi-scale attention platform to obtain a first feature vector;

[0091] Step S0212, performing maximum pooling on the intermediate features through the multi-scale attention platform to obtain a second feature vector;

[0092] Step S0213: cascade the first eigenvector and the second eigenvector to obtain a third eigenvector.

[0093] It should be clear that after obtaining the intermediate features, the multi-scale attention platform performs average pooling on the intermediate features, that is, dimensionality reduction operation, which is used in convolutional neural networks (CNNs) to reduce the size of feature maps. It achieves dimensionality reduction by calculating the average value in a specific area. The specific steps are as follows:

[0094] (1) Define the pooling window: select a fixed-size window (e.g. 2x2 or 3x3) that slides over the feature map;

[0095] (2) Calculate the average value: For the area covered by each window, calculate the average value of all values ​​in the window;

[0096] (3) Generate pooling results: The calculated average value is used as a pixel value in the new feature map to generate a feature map after dimensionality reduction.

[0097] After the above steps, the average pooling can be completed. However, in order to obtain a more accurate vector, this embodiment also performs maximum pooling on the intermediate features through a multi-scale attention platform, wherein the maximum pooling can retain the most significant features in the local area.

[0098] Subsequently, the first eigenvector and the second eigenvector are cascaded to obtain the third eigenvector. In deep learning, cascade refers to cascading multiple models or layers together to build a complex network structure. The output of each model or layer becomes the input of the next model or layer. Common applications include:

[0099] (1) Cascade classifier: For example, in object detection, the cascade classifier performs feature extraction and classification layer by layer to improve detection accuracy and reduce false positive rate;

[0100] (2) Cascaded neural networks: multiple neural network layers are cascaded to gradually extract features and process them. For example, in a convolutional neural network (CNN), feature maps are processed layer by layer.

[0101] (3) Cascade training: In some methods, a base model is trained first and then its results are used as input to a new model to gradually improve performance.

[0102] Furthermore, the above Figure 1 In the illustrated embodiment, the step S022, convolving the third eigenvector with a plurality of convolution kernels in the multi-scale attention platform to obtain a fourth eigenvector, comprises:

[0103] Step S0221, convolving the third eigenvector with the first convolution kernel to obtain a first intermediate vector;

[0104] Step S0222, convolving the third eigenvector with the second convolution kernel to obtain a second intermediate vector;

[0105] Step S0223, convolving the third eigenvector with the third convolution kernel to obtain a third intermediate vector;

[0106] Step S0224, performing a global average pooling operation on the third feature vector to obtain a fourth intermediate vector;

[0107] Step S0225, cascading the first intermediate vector, the second intermediate vector, the third intermediate vector and the fourth intermediate vector to obtain a fourth eigenvector.

[0108] It should be clear that the several convolution kernels in this embodiment include a first convolution kernel, a second convolution kernel and a third convolution kernel, wherein convolution is one of the core operations of convolutional neural network (CNN) in deep learning, which is the basis of image processing and feature extraction, and is used to extract useful features from input data. The convolution operation completes the feature extraction task by applying the convolution kernel (or filter) to the input data.

[0109] The convolution kernels in this embodiment are: convolution kernel 1: 3*3 convolution kernel, convolution kernel 2, 5*5 convolution kernel, convolution kernel 3, 7*7 convolution kernel. By performing convolution on the above three convolution kernels respectively, a first intermediate vector, a second intermediate vector and a third intermediate vector are obtained, which correspond to various features of the image from large to small that need to be paid attention to.

[0110] Subsequently, there is a global average pooling operation, which averages the first intermediate vector, the second intermediate vector, and the third intermediate vector to obtain a fourth intermediate vector.

[0111] Finally, concatenation is performed in the channel dimension to obtain a feature vector (i.e., the fourth feature vector) covering multi-scale information.

[0112] Furthermore, the above Figure 1 In the illustrated embodiment, step S023, performing convolution according to the fourth feature vector to obtain a final feature vector, and performing semantic segmentation based on the final feature vector, the step of obtaining the segmentation result includes:

[0113] Step S0231, inputting the fourth eigenvector into the first convolution kernel for convolution, and then processing it through a normalized exponential function softmax to obtain a weight vector;

[0114] Step S0232, multiplying the weight vector and the intermediate feature to obtain a final feature vector;

[0115] Step S0233, performing semantic segmentation on the final feature vector to obtain a segmentation result.

[0116] In order to obtain a more accurate segmentation result, in this embodiment, the fourth feature vector is input into the first convolution kernel. Since the first convolution kernel is 3*3, it is more accurate for details. After the convolution is completed, it is processed by the normalized exponential function softmax to obtain a weight vector, where softmax is an activation function commonly used in classification problems, which converts the original score (logits) output by the network into a probability distribution. The specific steps are as follows:

[0117] (1) Exponentiation: Take the exponent of each output score to ensure that all values ​​are positive;

[0118] (2) Normalization: Divide all exponential values ​​by their sum to obtain a probability distribution;

[0119] The formula of the Softmax function in this embodiment may be: [\text{Softmax}(z_i)=\frac{e^{z_i}}{\sum_{j}e^{z_j}}], where (z_i) is the score of the (i)th class, and (\sum_{j}e^{z_j}) is the exponential sum of the scores of all classes;

[0120] After obtaining the weight vector, the weight vector and the intermediate features can be multiplied to obtain the final feature vector. Finally, the final feature vector is semantically segmented to obtain the segmentation result.

[0121] This embodiment uses the above scheme, specifically, the multi-scale attention platform performs average pooling on the intermediate features to obtain a first feature vector; the multi-scale attention platform performs maximum pooling on the intermediate features to obtain a second feature vector; the first feature vector and the second feature vector are cascaded to obtain a third feature vector. Thus, the pre-obtained image data is pre-processed and output to the backbone network ResNet50 for feature extraction to obtain intermediate features, and then the multi-scale attention platform performs semantic segmentation on the intermediate features to obtain the segmentation result, which solves the problem that the prior art is difficult to accurately distinguish target objects of different scales when performing semantic segmentation, and improves the accuracy of semantic segmentation.

[0122] The block diagram of the segmentation principle of this embodiment is as follows Figure 4 As shown in the figure, the input of the multi-scale attention module is the feature vector output by the previous level. First, the mean and maximum values ​​of the input vector in the channel dimension are respectively calculated to obtain two feature vectors. Then, the two feature vectors are cascaded in the channel dimension to obtain a two-channel feature vector. Next, four different convolution operations are performed on this feature vector. Different padding and convolution kernels are set for the four convolutions. Different convolution kernels cover feature information at different angles. Finally, the feature vectors of information of different scales are cascaded, and the final multi-scale weight vector is obtained after a 3*3 convolution and softmax activation operation. This weight vector is multiplied with the input vector to obtain the feature vector that focuses on multi-scale information.

[0123] More specifically, if Figure 5 As shown, the actual flow chart operation is used to illustrate:

[0124] First, the original image I is obtained, and then the feature is extracted through the residual network ResNet50 module to obtain the intermediate feature F;

[0125] Then, the intermediate feature F is passed into the multi-scale attention module, and two feature vectors are obtained after average pooling and maximum pooling on the channel. These two feature vectors are cascaded in the channel dimension to obtain a new feature vector F';

[0126] Then, the new feature vector F' is subjected to four different convolution operations, namely: filling 1, 3*3 convolution kernel, filling 2, 5*5 convolution kernel, filling 3, 7*7 convolution kernel, and a global average pooling operation. The four different intermediate vectors are cascaded in the channel dimension to obtain the feature vector Fm covering multi-scale information;

[0127] Then, Fm is subjected to a 3*3 convolution and then a softmax operation to obtain the weight vector M;

[0128] Then, the weight vector M is multiplied by the input feature F to obtain a feature vector f with multi-scale information weights;

[0129] Finally, after segmentation, downstream tasks (such as planning, control, etc.) are perceived.

[0130] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the semantic segmentation method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0131] This application also provides a semantic segmentation device, please refer to Figure 6 , the semantic segmentation device comprises:

[0132] An extraction module 10 is used to pre-process the preset image data and input it into the backbone network ResNet50, and perform feature extraction through the ResNet50 to obtain intermediate features;

[0133] The segmentation module 20 is used to perform semantic segmentation on the intermediate features through a multi-scale attention platform to obtain a segmentation result.

[0134] The semantic segmentation device provided by the present application adopts the semantic segmentation method in the above embodiment, which can solve the technical problem that the prior art is difficult to accurately distinguish target objects of different sizes when performing semantic segmentation. Compared with the prior art, the beneficial effects of the semantic segmentation device provided by the present application are the same as the beneficial effects of the semantic segmentation method provided by the above embodiment, and the other technical features in the semantic segmentation device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0135] The present application provides a semantic segmentation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the semantic segmentation method in the above-mentioned embodiment 1.

[0136] Reference below Figure 7, which shows a schematic diagram of the structure of a semantic segmentation device suitable for implementing the embodiment of the present application. The semantic segmentation device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The semantic segmentation device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0137] like Figure 7 As shown, the semantic segmentation device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the semantic segmentation device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the semantic segmentation device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a semantic segmentation device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided alternatively.

[0138] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0139] The semantic segmentation device provided by the present application adopts the semantic segmentation method in the above embodiment, which can solve the technical problem that the prior art is difficult to accurately distinguish target objects of different sizes when performing semantic segmentation. Compared with the prior art, the beneficial effects of the semantic segmentation device provided by the present application are the same as the beneficial effects of the semantic segmentation method provided by the above embodiment, and the other technical features in the semantic segmentation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0140] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0141] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0142] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the semantic segmentation method in the above-mentioned embodiment.

[0143] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0144] The computer-readable storage medium may be included in the semantic segmentation device; or may exist independently without being assembled into the semantic segmentation device.

[0145] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the semantic segmentation device, the semantic segmentation device: pre-processes the preset image data and inputs it into the backbone network ResNet50, performs feature extraction through the ResNet50 to obtain intermediate features; and performs semantic segmentation on the intermediate features through the multi-scale attention platform to obtain the segmentation results.

[0146] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through 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., via the Internet using an Internet service provider).

[0147] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite 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 a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0148] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0149] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned semantic segmentation method, and can solve the technical problem that the prior art is difficult to accurately distinguish target objects of different sizes when performing semantic segmentation. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the semantic segmentation method provided in the above-mentioned embodiment, and will not be repeated here.

[0150] The present application also provides a computer program product, including a computer program, which implements the steps of the semantic segmentation method as described above when executed by a processor.

[0151] The computer program product provided by the present application can solve the technical problem that the prior art is difficult to accurately distinguish target objects of different sizes when performing semantic segmentation. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the semantic segmentation method provided by the above embodiment, which will not be repeated here.

[0152] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A semantic segmentation method, characterized in that: The method comprises: The preset image data is preprocessed and then input into the backbone network ResNet50, and feature extraction is performed through the ResNet50 to obtain intermediate features; The intermediate features are semantically segmented through a multi-scale attention platform to obtain a segmentation result.

2. The method according to claim 1, characterized in that The step of performing semantic segmentation on the intermediate features through a multi-scale attention platform to obtain a segmentation result comprises: Pooling the intermediate features through the multi-scale attention platform to obtain a third feature vector; Convolving the third eigenvector with a plurality of convolution kernels in the multi-scale attention platform to obtain a fourth eigenvector; Convolution is performed according to the fourth feature vector to obtain a final feature vector, and semantic segmentation is performed based on the final feature vector to obtain a segmentation result.

3. The method according to claim 2, characterized in that The step of pooling the intermediate features through the multi-scale attention platform to obtain a third feature vector comprises: Average pooling is performed on the intermediate features through the multi-scale attention platform to obtain a first feature vector; Performing maximum pooling on the intermediate features through the multi-scale attention platform to obtain a second feature vector; The first eigenvector and the second eigenvector are concatenated to obtain a third eigenvector.

4. The method according to claim 2, characterized in that The plurality of convolution kernels include a first convolution kernel, a second convolution kernel, and a third convolution kernel, and the step of convolving the third feature vector with the plurality of convolution kernels in the multi-scale attention platform to obtain a fourth feature vector includes: Convolving the third eigenvector with the first convolution kernel to obtain a first intermediate vector; Convolving the third eigenvector with the second convolution kernel to obtain a second intermediate vector; Convolving the third eigenvector with the third convolution kernel to obtain a third intermediate vector; Performing a global average pooling operation on the third eigenvector to obtain a fourth intermediate vector; The first intermediate vector, the second intermediate vector, the third intermediate vector and the fourth intermediate vector are cascaded to obtain a fourth eigenvector.

5. The method according to claim 4, characterized in that The step of performing convolution according to the fourth feature vector to obtain a final feature vector, and performing semantic segmentation based on the final feature vector to obtain a segmentation result comprises: After inputting the fourth eigenvector into the first convolution kernel for convolution, the fourth eigenvector is processed by a normalized exponential function softmax to obtain a weight vector; Multiplying the weight vector and the intermediate feature to obtain a final feature vector; Perform semantic segmentation on the final feature vector to obtain a segmentation result.

6. The method according to claim 2, characterized in that After the step of performing semantic segmentation on the final feature vector to obtain a segmentation result, the method comprises: Receive user operation instructions; Analyze the operation instruction to obtain an operation task, wherein the operation task includes one or more of image recognition, target positioning, and planning control; The operation task is executed based on the segmentation result to obtain an execution result.

7. A semantic segmentation device, characterized in that: The device comprises: An extraction module is used to pre-process the preset image data and input it into the backbone network ResNet50, perform feature extraction through the ResNet50, and obtain intermediate features; The segmentation module is used to perform semantic segmentation on the intermediate features through a multi-scale attention platform to obtain a segmentation result.

8. A semantic segmentation device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the semantic segmentation method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the semantic segmentation method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the semantic segmentation method according to any one of claims 1 to 6 are implemented.