A semantic segmentation method based on hierarchical semantic prior
Through the two-way circular regularization method based on hierarchical semantic priors, human hierarchical semantic knowledge is successfully integrated, which solves the problem of difficulty in integrating human prior knowledge in existing technologies, achieves efficient semantic segmentation, and reduces labeling costs.
Patent Information
- Application Number
- CN202110629864.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-07
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-06-07
AI Technical Summary
Existing semantic segmentation methods based on deep learning are difficult to effectively incorporate human hierarchical semantic prior knowledge, and the annotation cost is high, which limits the application of human priors in deep networks.
Using a method based on hierarchical semantic priors, the hierarchical semantic priors are described mathematically, the network is trained using a two-way loop regularization method, and coarse semantic and fine semantic category features are learned, and supervised training is performed through forged semantic category features to integrate hierarchical Semantic knowledge, imitating human thinking process for semantic segmentation.
Without increasing the complexity of the model, it successfully integrates human hierarchical semantic prior knowledge, improves the performance of semantic segmentation, solves the problem of difficulty in expressing human prior knowledge, and reduces labeling costs.
Smart Images

Figure CN113554652B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of semantic segmentation, and in particular to a semantic segmentation method based on hierarchical semantic prior. Background Art
[0002] Semantic segmentation refers to understanding and predicting the semantic category of each pixel in an image. Semantic segmentation is a dense pixel prediction problem that requires both high-level semantic information and low-level detail information, which is technically very challenging.
[0003] With the rapid development of deep learning, many deep learning-based methods have been applied to semantic segmentation, and the performance of semantic segmentation methods has been continuously improved. In particular, the development of street scene semantic segmentation has promoted the further development of fields such as autonomous driving.
[0004] Existing semantic segmentation methods based on deep learning attempt to incorporate human prior knowledge to guide the segmentation process. However, most human prior knowledge is difficult to express in deep networks and has high annotation costs, which limits the application of human prior knowledge. Summary of the invention
[0005] In order to solve the above technical problems existing in the prior art, the present invention proposes a semantic segmentation method based on hierarchical semantic prior, which uses hierarchical semantic prior knowledge to understand and segment images from coarse to fine, and uses a bidirectional cyclic regularization method to train the network, so that the hierarchical semantic knowledge can be learned without increasing the complexity of the model, so that the system can imitate the human thinking process for semantic segmentation. The specific technical solution is as follows:
[0006] A semantic segmentation method based on hierarchical semantic priors comprises the following steps:
[0007] Step 1: Use mathematical description to describe hierarchical semantic priors;
[0008] Step 2, using any known network to learn coarse semantic category features and fine semantic category features respectively;
[0009] Step 3: Use the learned coarse semantic category features and hierarchical semantic priors to construct a forged fine semantic category feature;
[0010] Step 4: Use the learned fine semantic category features and hierarchical semantic priors to construct a forged coarse semantic category feature;
[0011] Step 5: Use the bidirectional cyclic regularization method to train the network, supervise the learned coarse semantic category features and fine semantic category features with artificial labels, and compare the forged semantic category features with the learned semantic category features, so that the constructed semantic category features are close to the correct results.
[0012] Furthermore, the step 1 specifically includes the following steps:
[0013] S101) artificially classify semantic categories, dividing refined categories into several groups of coarse categories based on human experience;
[0014] S102) The hierarchical semantic prior knowledge is defined as a vector v, v={N1, N2, ..., NM}, indicating that there are M coarse category semantics, the value of N1 is equal to the number of fine categories under the first coarse category, and so on.
[0015] Furthermore, the step 2 specifically includes the following steps:
[0016] S201) Input the original image into any known network, output a feature map with M channels, and supervise it with the corresponding coarse semantic labels. The feature map is defined as the coarse semantic category feature Fc;
[0017] S202) The coarse semantic category features are further input into an arbitrary known network, and a feature map with F channels is output, which is supervised by corresponding fine semantic labels. F is the sum of all values of N1, N2...NM, indicating the number of fine semantic categories. The feature map is defined as the fine semantic category feature Ff.
[0018] Furthermore, the step 3 specifically includes the following steps:
[0019] S301) taking the learned coarse semantic category feature Fc as input and the coarse semantic category label as a mask;
[0020] S302) inputting the coarse semantic category features into M convolutional layers, wherein the convolution kernel size of each convolutional layer is K, and the number of channels is N1, N2, ...NM respectively, to obtain M feature maps, wherein the feature maps all inherit the information in the coarse semantic category class, but the number of channels is inconsistent;
[0021] S303) Processing the coarse semantic category label mask and converting it into M different sub-masks, each sub-mask is set to 1 for only one coarse semantic category and the rest of the categories are set to 0;
[0022] S304) The obtained M feature maps are respectively passed through the Softmax function, so that each feature map represents the probability of different categories, and the probability map is multiplied by the corresponding mask, so that each obtained probability map only expresses the probability of one category, and the probabilities of other categories are all 0;
[0023] S305) The M latest probability maps are concatenated in sequence. The size of the concatenated feature map is consistent with the coarse semantic category feature Fc of the original input, and the number of channels is the number of fine labels F. The feature map expresses the probability that each pixel belongs to a different category. The concatenated feature map is defined as the forged fine semantic category feature Ff0.
[0024] Furthermore, the mask is a binary map generated by labels, which guides the fusion and segmentation of feature maps during training to integrate hierarchical semantic priors into the network, but is not required during testing.
[0025] Furthermore, the step 4 specifically includes the following steps:
[0026] S401) Taking the learned fine semantic category feature Ff as input, passing it through the Softmax function, the probability of each pixel belonging to a different category is obtained;
[0027] S402) Slice Ff into M feature maps of different channels, where the number of channels is N1, N2, ...NM.
[0028] S403) Each feature map is passed through a pooling layer, and the number of channels becomes 1, so as to extract features of different categories, and now M feature maps with the number of channels of 1 are obtained;
[0029] S404) Concatenate M feature maps with a channel number of 1 in sequence to obtain a feature map with M channels, and define this feature map as a forged coarse semantic category feature Fc0.
[0030] Furthermore, the step 5 specifically includes the following steps:
[0031] S501) comparing the forged fine semantic category feature Ff0 with the learned fine semantic category feature Ff, calculating with L1 loss, and participating in back propagation to update network parameters;
[0032] S502) comparing the forged coarse semantic category feature Fc0 with the learned coarse semantic category feature Fc, calculating with L1 loss, and participating in back propagation to update network parameters;
[0033] S503) The learned coarse semantic category feature Fc is passed through the Softmax function to obtain the probability of each point being in a different coarse category, and then compared with the coarse semantic label through the cosine cross entropy loss function, and participates in back propagation to update parameters;
[0034] S504) The learned fine semantic category feature Ff is passed through the Softmax function to obtain the probability of each point being in a different fine category, and then compared with the fine semantic label through the cosine cross entropy loss function, and participates in back propagation to update the parameters.
[0035] Furthermore, during the training process, the network forms two propagation paths, Fc-Ff0-Ff and Ff-Fc0-Fc, and integrates hierarchical semantic prior knowledge to update network parameters. During the testing process, the cyclic path does not participate in the calculation, and the path of the input image is "input-Fc-Ff-output", without adding additional network complexity.
[0036] Advantages of the present invention:
[0037] The present invention solves the problem that human's hierarchical semantic prior cannot be integrated into the deep network, and utilizes human's hierarchical semantic prior to guide semantic segmentation. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 Flowchart for constructing forged fine semantic category features;
[0039] Figure 2 Flowchart for constructing forged coarse semantic category features;
[0040] Figure 3 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical scheme and technical effect of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings.
[0042] like Figure 3 As shown, a semantic segmentation method based on hierarchical semantic prior includes the following steps:
[0043] Step 1: Use mathematical description to describe hierarchical semantic priors, which specifically includes the following steps:
[0044] S101) artificially classifies semantic categories, and divides refined categories into several groups of coarse categories based on human experience. For example, cars, motorcycles, and bicycles are all classified as vehicles.
[0045] S102) The hierarchical semantic prior knowledge is defined as a vector v, v={N1, N2, ..., NM}, indicating that there are M coarse category semantics, the value of N1 is equal to the number of fine categories under the first coarse category, and so on.
[0046] In summary, the hierarchical semantic classification is to classify fine semantic categories into coarse semantic categories according to human experience, and this classification method is not fixed and unique. The method of the present invention supports the fine semantic categories to be divided into different groups of coarse semantic categories according to different logics, including random.
[0047] Step 2: Use any known network to learn coarse semantic category features and fine semantic category features respectively, which specifically includes the following steps:
[0048] S201) Input the original image into any known network, output a feature map with M channels, and supervise it with the corresponding coarse semantic labels. The feature map is defined as the coarse semantic category feature Fc.
[0049] S202) The coarse semantic category features are further input into an arbitrary known network, and a feature map with F channels is output, which is supervised by corresponding fine semantic labels. F is the sum of all values of N1, N2...NM, indicating the number of fine semantic categories. The feature map is defined as the fine semantic category feature Ff.
[0050] Step 3, construct the forged fine semantic category features, such as Figure 1 As shown, the specific steps include:
[0051] S301) takes the learned coarse semantic category feature Fc as input and the coarse semantic category label as a mask.
[0052] S302) Inputting the coarse semantic category features into M convolutional layers, the convolution kernel size of each convolutional layer is K, and the number of channels is N1, N2, ... NM respectively, to obtain M feature maps, which all inherit the information in the coarse semantic category class, but the number of channels is inconsistent.
[0053] S303) Process the coarse semantic category label mask and convert it into M different sub-masks, each sub-mask is set to 1 only for one coarse semantic category, and the rest of the categories are set to 0.
[0054] S304) The obtained M feature maps are respectively passed through the Softmax function, so that each feature map represents the probability of different categories. The probability map is multiplied by the corresponding mask, and each probability map obtained only expresses the probability of one category, while the probabilities of other categories are all 0.
[0055] S305) The M latest probability maps are concatenated in sequence. The size of the concatenated feature map is consistent with the coarse semantic category feature Fc of the original input, and the number of channels is the number of fine labels F. The feature map expresses the probability that each pixel belongs to a different category. The concatenated feature map is defined as the forged fine semantic category feature Ff0.
[0056] In summary, the mask is a binary map, which is generated by the label. During the training process, the fusion and segmentation of feature maps can be guided to integrate hierarchical semantic priors into the network, but this is not required during the test process.
[0057] Step 4, construct the forged coarse semantic category features, such as Figure 2 As shown, the specific steps include:
[0058] S401) Taking the learned fine semantic category feature Ff as input, passing it through the Softmax function, the probability of each pixel belonging to a different category is obtained.
[0059] S402) Using a slice operation, Ff is divided into feature maps of M different channels, where the number of channels is N1, N2, ...NM.
[0060] S403) Each feature map is passed through a pooling layer, and the number of channels becomes 1 to extract features of different categories. Now M feature maps with a channel number of 1 are obtained.
[0061] S404) Concatenate M feature maps with a channel number of 1 in sequence to obtain a feature map with M channels, and define this feature map as a forged coarse semantic category feature Fc0.
[0062] Step 5, bidirectional recurrent regularization, supervises the two learned coarse and fine semantic category features with artificial labels, compares the forged semantic category features with the learned semantic category features, and makes the constructed semantic category features close to the correct results. The specific steps include the following:
[0063] S501) compares the forged fine semantic category feature Ff0 with the learned fine semantic category feature Ff, calculates it with L1 loss, and participates in back-propagation to update network parameters.
[0064] S502) Compare the forged coarse semantic category feature Fc0 with the learned coarse semantic category feature Fc, calculate with L1 loss, and participate in back propagation to update network parameters.
[0065] S503) The learned coarse semantic category feature Fc is passed through the Softmax function to obtain the probability of each point being in a different coarse category, and then compared with the coarse semantic label through the cosine cross entropy loss function, and participates in back propagation to update the parameters.
[0066] S504) The learned fine semantic category feature Ff is passed through the Softmax function to obtain the probability of each point being in a different fine category, and then compared with the fine semantic label through the cosine cross entropy loss function, and participates in back propagation to update the parameters.
[0067] In summary, during the training process, the network formed two propagation paths, Fc-Ff0-Ff and Ff-Fc0-Fc, and integrated hierarchical semantic prior knowledge to update network parameters. During the test process, the loop path does not participate in the calculation, and the path of the input image is "input-Fc-Ff-output", without adding additional network complexity.
[0068] The above is only a preferred implementation case of the present invention and does not limit the present invention in any form. Although the implementation process of the present invention is described in detail above, for those familiar with the art, they can still modify the technical solutions recorded in the above examples, or replace some of the technical features therein with equivalents. All modifications, equivalent replacements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A semantic segmentation method based on hierarchical semantic priors, characterized in that: The steps include: Step 1: Use mathematical description to describe hierarchical semantic priors; Step 2, using any known network to learn coarse semantic category features and fine semantic category features respectively; Step 3: Use the learned coarse semantic category features and hierarchical semantic priors to construct a forged fine semantic category feature; Step 4: Use the learned fine semantic category features and hierarchical semantic priors to construct a forged coarse semantic category feature; Step 5: Use a bidirectional cyclic regularization method to train the network, supervise the learned coarse semantic category features and fine semantic category features with artificial labels, and compare the forged semantic category features with the learned semantic category features, so that the constructed semantic category features are close to the correct results; The step 1 specifically includes the following steps: S101) artificially classify semantic categories, dividing refined categories into several groups of coarse categories based on human experience; S102) hierarchical semantic prior knowledge is defined as a vector v, v = {N1, N2, ..., NM}, indicating that there are M coarse category semantics, the value of N1 is equal to the number of fine categories under the first coarse category, and so on; The step 2 specifically includes the following steps: S201) Input the original image into any known network, output a feature map with M channels, and supervise it with the corresponding coarse semantic labels. The feature map is defined as the coarse semantic category feature Fc; S202) The coarse semantic category features are further input into an arbitrary known network, and a feature map with F channels is output, and supervised by corresponding fine semantic labels, where F is the sum of all values of N1, N2…NM, indicating the number of fine semantic categories. The feature map is defined as the fine semantic category feature Ff; The step 3 specifically includes the following steps: S301) taking the learned coarse semantic category feature Fc as input and the coarse semantic category label as a mask; S302) inputting the coarse semantic category features into M convolutional layers, the convolution kernel size of each convolutional layer is K, and the number of channels is N1, N2, ... NM respectively, to obtain M feature maps, the feature maps all inherit the information in the coarse semantic category class, but the number of channels is inconsistent; S303) Processing the coarse semantic category label mask and converting it into M different sub-masks, each sub-mask is set to 1 for only one coarse semantic category and the rest of the categories are set to 0; S304) The obtained M feature maps are respectively passed through the Softmax function, so that each feature map represents the probability of different categories, and the probability map is multiplied by the corresponding mask, so that each obtained probability map only expresses the probability of one category, and the probabilities of other categories are all 0; S305) The M latest probability maps are sequentially spliced together. The size of the spliced feature map is consistent with the coarse semantic category feature Fc of the original input. The number of channels is the number of fine labels F. The feature map expresses the probability that each pixel belongs to a different category. The spliced feature map is defined as the forged fine semantic category feature Ff0. The step 4 specifically includes the following steps: S401) Taking the learned fine semantic category feature Ff as input, passing it through the Softmax function, the probability of each pixel belonging to a different category is obtained; S402) Slice Ff into M feature maps of different channels, where the number of channels is N1, N2, ... NM. S403) Each feature map is passed through a pooling layer, and the number of channels becomes 1, so as to extract features of different categories, and now M feature maps with the number of channels of 1 are obtained; S404) sequentially concatenate the M feature maps with a channel number of 1 to obtain a feature map with M channels, and define this feature map as a forged coarse semantic category feature Fc0; The step 5 specifically includes the following steps: S501) comparing the forged fine semantic category feature Ff0 with the learned fine semantic category feature Ff, calculating with L1 loss, and participating in back propagation to update network parameters; S502) comparing the forged coarse semantic category feature Fc0 with the learned coarse semantic category feature Fc, calculating with L1 loss, and participating in back propagation to update network parameters; S503) The learned coarse semantic category feature Fc is passed through the Softmax function to obtain the probability of each point being in a different coarse category, and then compared with the coarse semantic label through the cosine cross entropy loss function, and participates in back propagation to update parameters; S504) The learned fine semantic category feature Ff is passed through the Softmax function to obtain the probability of each point being in a different fine category, and then compared with the fine semantic label through the cosine cross entropy loss function, and participates in back propagation to update the parameters.
2. A semantic segmentation method based on hierarchical semantic priors as claimed in claim 1, characterized in that: The mask is a binary map generated by labels, which guides the fusion and segmentation of feature maps during training to integrate hierarchical semantic priors into the network, but is not required during testing.
3. The semantic segmentation method based on hierarchical semantic prior according to claim 1, characterized in that: During the training process, the network forms two propagation paths, Fc-Ff0-Ff and Ff-Fc0-Fc, and integrates hierarchical semantic prior knowledge to update network parameters. During the testing process, the cyclic path does not participate in the calculation, and the path of the input image is "input-Fc-Ff-output", without adding additional network complexity.
Citation Information
Patent Citations
Unsupervised cross-domain self-adaptive medical image segmentation method based on deep adversarial learning
AU2020103905A4
A CT image pulmonary parenchyma three-dimensional semantic segmentation method based on a deep neural network
CN109598727A
