Semantic segmentation method, device, equipment and storage medium

Through the integration of feature recognition and model parameters, the problem of low accuracy of traditional semantic segmentation methods is solved, and a higher accuracy semantic segmentation effect is achieved.

CN118334327BActive Publication Date: 2025-08-12深圳兴科华创信息技术有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410197412.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-22
Publication Date
2025-08-12
Estimated Expiration
2044-02-22

AI Technical Summary

Technical Problem

The traditional semantic segmentation method is based on pre-trained deep learning models with low accuracy.

Method used

By obtaining feature recognition of the target image, matching the semantic segmentation information set, fusing parameters of multiple initial semantic segmentation models, and training the fused semantic segmentation model to improve accuracy.

Benefits of technology

The accuracy and robustness of the semantic segmentation method are improved, and the adaptability and flexibility of the semantic segmentation model are enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118334327B_ABST
    Figure CN118334327B_ABST
Patent Text Reader

Abstract

The present application relates to the field of image processing technology and provides a semantic segmentation method, apparatus, device, and storage medium. The method includes obtaining a semantic segmentation model set and a training data set matching a target image in a database based on an image identifier of the target image; inputting the target image into each initial semantic segmentation model to obtain multiple initial semantic segmentation results, and determining a target initial semantic segmentation model from multiple initial semantic segmentation models based on the multiple initial semantic segmentation results; fusing the model parameters of each target initial semantic segmentation model to obtain fused model parameters, and updating the model parameters of any target initial semantic segmentation model based on the fused model parameters to obtain a fused semantic segmentation model; training the fused semantic segmentation model based on the training data set to obtain a target semantic segmentation model, and inputting the target image into the target semantic segmentation model to obtain a semantic segmentation result of the target image. This method improves the accuracy of semantic 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 a semantic segmentation method, apparatus, device and storage medium. Background Art

[0002] With the development of computer vision and image processing technologies, semantic segmentation, a key computer vision task, aims to assign semantic categories to each pixel in an image. This technology has been gradually applied to fields such as autonomous driving, medical image analysis, and image retrieval. Traditional semantic segmentation methods typically perform semantic segmentation on images based on pre-trained deep learning models, but this approach suffers from low accuracy. Summary of the Invention

[0003] The present application provides a semantic segmentation method, apparatus, device and storage medium to solve the problems raised by the above background technology.

[0004] In a first aspect, the present application provides a semantic segmentation method, comprising:

[0005] Acquire a target image, and perform feature recognition on the target image to obtain an image identifier of the target image;

[0006] Based on the image identifier, a semantic segmentation information set matching the target image is obtained from a preset database; wherein the semantic segmentation information set includes a semantic segmentation model set and a training data set, the semantic segmentation model set includes multiple initial semantic segmentation models, the training data set includes multiple training images, and each pixel of the training image is provided with a standard classification label;

[0007] Inputting the target image into each of the initial semantic segmentation models respectively to obtain multiple initial semantic segmentation results, and determining a target initial semantic segmentation model from the multiple initial semantic segmentation models based on the multiple initial semantic segmentation results; wherein the target initial semantic segmentation model includes multiple;

[0008] Fusing the model parameters of the target initial semantic segmentation models to obtain fused model parameters, and updating the model parameters of any target initial semantic segmentation model based on the fused model parameters to obtain a fused semantic segmentation model;

[0009] The fusion semantic segmentation model is trained based on the training data set to obtain a target semantic segmentation model, and the target image is input into the target semantic segmentation model to obtain a semantic segmentation result of the target image.

[0010] In a second aspect, the present application provides a semantic segmentation device, comprising:

[0011] A first acquisition module is used to acquire a target image and perform feature recognition on the target image to obtain an image identifier of the target image;

[0012] A second acquisition module is configured to acquire a semantic segmentation information set matching the target image from a preset database based on the image identifier; wherein the semantic segmentation information set includes a semantic segmentation model set and a training data set, the semantic segmentation model set includes a plurality of initial semantic segmentation models, the training data set includes a plurality of training images, and each pixel of the training image is provided with a standard classification label;

[0013] a determination module, configured to input the target image into each of the initial semantic segmentation models respectively to obtain a plurality of initial semantic segmentation results, and determine a target initial semantic segmentation model from the plurality of initial semantic segmentation models based on the plurality of initial semantic segmentation results; wherein the target initial semantic segmentation model includes a plurality of;

[0014] A fusion module, configured to fuse the model parameters of each of the target initial semantic segmentation models to obtain fused model parameters, and update the model parameters of any of the target initial semantic segmentation models based on the fused model parameters to obtain a fused semantic segmentation model;

[0015] A training module is used to train the fusion semantic segmentation model based on the training data set to obtain a target semantic segmentation model, and input the target image into the target semantic segmentation model to obtain a semantic segmentation result of the target image.

[0016] In a third aspect, the present application provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the semantic segmentation method as described above is implemented.

[0017] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the semantic segmentation method as described above is implemented.

[0018] The present application provides a semantic segmentation method, apparatus, device and storage medium, wherein the method includes: acquiring a target image, and performing feature recognition on the target image to obtain an image identifier of the target image; acquiring a semantic segmentation information set matching the target image in a preset database based on the image identifier; wherein the semantic segmentation information set includes a semantic segmentation model set and a training data set, the semantic segmentation model set includes multiple initial semantic segmentation models, the training data set includes multiple training images, and each pixel of the training image is provided with a standard classification label; the target image is input into each of the initial semantic segmentation models respectively to obtain multiple initial semantic segmentation results, and a target initial semantic segmentation model is determined from the multiple initial semantic segmentation models based on the multiple initial semantic segmentation results; wherein the target initial semantic segmentation model includes multiple; the model parameters of each of the target initial semantic segmentation models are fused to obtain fused model parameters, and the model parameters of any target initial semantic segmentation model are updated based on the fused model parameters to obtain a fused semantic segmentation model; the fused semantic segmentation model is trained based on the training data set to obtain a target semantic segmentation model, and the target image is input into the target semantic segmentation model to obtain a semantic segmentation result of the target image. On the one hand, by acquiring a target image and performing feature recognition on the target image, an image identifier of the target image is obtained, and based on the image identifier, a semantic segmentation information set matching the target image is obtained in a preset database, thereby achieving matching of the semantic segmentation information set for the target image according to the features of the target image, which helps to improve the accuracy and flexibility of the semantic segmentation method. On the other hand, by fusing the model parameters of each of the target initial semantic segmentation models to obtain fused model parameters, and updating the model parameters of any of the target initial semantic segmentation models based on the fused model parameters to obtain a fused semantic segmentation model, and training the fused semantic segmentation model based on the training data set to obtain a target semantic segmentation model, the robustness of the target semantic segmentation model is improved, and the accuracy of the semantic segmentation method is further improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 A flowchart of the semantic segmentation method provided in an embodiment of the present application;

[0021] Figure 2A schematic block diagram of the structure of the semantic segmentation device provided in an embodiment of the present application;

[0022] Figure 3 A schematic block diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0024] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.

[0025] It should also be understood that the terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0026] It should be further understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0027] With the development of computer vision and image processing technologies, semantic segmentation, as an important computer vision processing task, aims to assign a semantic category to each pixel in an image. This technology has gradually been applied to fields such as unmanned driving, medical image analysis, and image retrieval. Traditional semantic segmentation methods usually perform semantic segmentation on images based on pre-trained deep learning models, but this method has low accuracy. To this end, the embodiments of the present application provide a semantic segmentation method, apparatus, device, and storage medium to solve the above problems.

[0028] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments may be combined with each other.

[0029] See also Figure 1 , Figure 1 A flowchart of the semantic segmentation method provided in the embodiment of the present application is shown in FIG. Figure 1As shown, the semantic segmentation method provided in the embodiment of the present application includes steps S100 to S500.

[0030] Step S100: Acquire a target image, and perform feature recognition on the target image to obtain an image identifier of the target image.

[0031] It should be noted that the method for performing feature recognition on the target image is to input the target image into a preset feature recognition model to obtain the image identification of the target image. The feature recognition model includes an input layer, a feature recognition layer, an image identification generation layer and an output layer, wherein the input layer is used to accept the target image, the feature recognition layer is used to perform feature recognition on the target image to obtain the image features of the target image, the image identification generation layer is used to generate the image identification of the target image based on the image features, and the output layer is used to output the image identification.

[0032] Step S200: obtaining a semantic segmentation information set matching the target image in a preset database based on the image identification; wherein the semantic segmentation information set includes a semantic segmentation model set and a training data set, the semantic segmentation model set includes multiple initial semantic segmentation models, the training data set includes multiple training images, and each pixel of the training image is provided with a standard classification label.

[0033] It should be noted that the semantic segmentation information sets in the database are each provided with a digital matrix, the digital matrix being a 3×3 matrix, the image identifier including 9 letters, and obtaining a semantic segmentation information set matching the target image in a preset database based on the image identifier, including the following steps:

[0034] Obtain a preset coding table; wherein the coding table includes a number column and a letter column;

[0035] Extract all prime numbers from the number column, and arrange all the extracted prime numbers in order from small to large to obtain a prime number sequence;

[0036] Extract all composite numbers from the number sequence, and arrange all the extracted composite numbers in descending order to obtain a composite number sequence;

[0037] Comparing a first quantity and a second quantity; wherein the first quantity is the number of prime numbers in the prime number sequence, and the second quantity is the number of composite numbers in the composite number sequence;

[0038] If the first number is greater than the second number, inserting each composite number in the composite number sequence into the digit gaps of the prime number sequence in sequence to obtain a target digit sequence;

[0039] If the first number is smaller than the second number, each of the prime numbers in the prime number sequence is sequentially inserted into the digit gaps of the composite number sequence to obtain a target digit sequence.

[0040] Deleting all numbers in the number column to obtain a plurality of number spaces, and inserting each number in the target number sequence into the plurality of number spaces in sequence to obtain a target coding table;

[0041] Encoding the image identifier based on the target encoding table to obtain an initial decrypted digital sequence;

[0042] For each decoded number in the initial decrypted number sequence, determining a third number; wherein the third number is the number of times the decoded number appears in all the number matrices;

[0043] Arranging the decoded digits in sequence based on the third numbers to obtain a target decoded digit sequence; wherein the third numbers corresponding to the decoded digits in the target decoded digit sequence decrease in sequence;

[0044] Constructing a 3×3 blank matrix, and inserting each number in the target decoding number sequence into the blank matrix in sequence to obtain a decoding matrix;

[0045] The decoding matrix is compared with each of the digital matrices respectively, and a semantic segmentation information set corresponding to the digital matrix that is completely consistent with the decoding matrix is determined as a semantic segmentation information set that matches the target image.

[0046] It can be understood that the above method obtains the decoding matrix, compares the decoding matrix with each of the digital matrices respectively, and determines the semantic segmentation information set corresponding to the digital matrix that is completely consistent with the decoding matrix as the semantic segmentation information set that matches the target image, thereby achieving accurate matching of the semantic segmentation information set for the target image, which helps to improve the accuracy of the semantic segmentation method.

[0047] Step S300: input the target image into each of the initial semantic segmentation models respectively to obtain multiple initial semantic segmentation results, and determine the target initial semantic segmentation model among the multiple initial semantic segmentation models based on the multiple initial semantic segmentation results; wherein, the target initial semantic segmentation model includes multiple.

[0048] It should be noted that each of the initial semantic segmentation results includes a first predicted classification label for each pixel of the target image, and determining a target initial semantic segmentation model from the multiple initial semantic segmentation models based on the multiple initial semantic segmentation results includes:

[0049] For each pixel of the target image, determine the first predicted classification label corresponding to the pixel based on all the initial semantic segmentation results; wherein the first predicted classification label corresponding to the pixel includes at least one;

[0050] For each pixel of the target image, determine the classification probability of each first predicted classification label corresponding to the pixel based on all the initial semantic segmentation results, determine the first predicted classification label corresponding to the maximum classification probability as the target first predicted classification label, and combine all the initial semantic segmentation models corresponding to the target first predicted classification label into a target initial semantic segmentation model to be selected set;

[0051] For each of the initial semantic segmentation models, a fourth number is determined based on all the target initial semantic segmentation models to be selected, and the fourth number is compared with a preset number, and when the fourth number is greater than the preset number, the initial semantic segmentation model is determined as the target initial semantic segmentation model; wherein the fourth number is the number of times the initial semantic segmentation model appears in all the target initial semantic segmentation models to be selected.

[0052] It can be understood that, for each pixel of the target image, after the target image is input into different initial semantic segmentation models, the first predicted classification labels of the pixels may be the same or different.

[0053] It can be understood that the classification probability of each first predicted classification label corresponding to the pixel refers to the ratio of the number of the initial semantic segmentation results corresponding to the first predicted classification label to the total number of the initial semantic segmentation results for each of the first predicted classification labels of the pixel.

[0054] It can be understood that for each of the initial semantic segmentation models, when the fourth number corresponding to the initial semantic segmentation model is greater than the preset number, it means that the initial semantic segmentation model has a high degree of fit with the target image. When the fourth number corresponding to the initial semantic segmentation model is greater than the preset number, the initial semantic segmentation model is determined as the target initial semantic segmentation model, which helps to improve the accuracy of the semantic segmentation method.

[0055] Step S400: Fusing the model parameters of each of the target initial semantic segmentation models to obtain fused model parameters, and updating the model parameters of any of the target initial semantic segmentation models based on the fused model parameters to obtain a fused semantic segmentation model.

[0056] Among them, the method of fusing the model parameters of each of the target initial semantic segmentation models includes but is not limited to a weighted average method, a Bayesian model mixing method, and a stacking method.

[0057] Step S500: training the fused semantic segmentation model based on the training data set to obtain a target semantic segmentation model, and inputting the target image into the target semantic segmentation model to obtain a semantic segmentation result of the target image.

[0058] It should be noted that the method for training the fusion semantic segmentation model based on the training data set is described in detail below and will not be repeated here.

[0059] The method provided in this embodiment, on the one hand, obtains the image identification of the target image by acquiring the target image and performing feature recognition on the target image, and obtains the semantic segmentation information set matching the target image in a preset database based on the image identification, thereby achieving matching of the semantic segmentation information set for the target image according to the features of the target image, which helps to improve the accuracy and flexibility of the semantic segmentation method; on the other hand, obtains fused model parameters by fusing the model parameters of each of the target initial semantic segmentation models, and updates the model parameters of any of the target initial semantic segmentation models based on the fused model parameters to obtain a fused semantic segmentation model, and trains the fused semantic segmentation model based on the training data set to obtain a target semantic segmentation model, thereby improving the robustness of the target semantic segmentation model and further improving the accuracy of the semantic segmentation method.

[0060] In some embodiments, before performing feature recognition on the target image, the method further includes performing enhancement processing on the target image.

[0061] It should be noted that the methods for performing enhancement processing on the target image include but are not limited to contrast enhancement, color adjustment, geometric transformation and brightness adjustment.

[0062] The method provided in this embodiment helps to further improve the accuracy of the semantic segmentation method.

[0063] In some embodiments, training the fused semantic segmentation model based on the training dataset to obtain a target semantic segmentation model includes the following steps:

[0064] Inputting each of the training images into the fused semantic segmentation model respectively to obtain a second predicted classification label corresponding to each pixel of each of the training images;

[0065] Constructing a standard classification label-second predicted classification label mapping relationship table based on the standard classification label and the second predicted classification label corresponding to each pixel of each of the training images, and generating a classification loss function of the fusion semantic segmentation model based on the standard classification label-second predicted classification label mapping relationship table;

[0066] Adjusting model parameters of the fused semantic segmentation model based on the classification loss function to obtain initial adjusted model parameters of the fused semantic segmentation model;

[0067] Calculating a first fitness of the initial adjustment model parameters, and comparing the first fitness with a preset fitness;

[0068] If the fitness is less than the preset fitness, performing population processing on the initial adjustment model parameters based on a preset genetic algorithm to obtain a plurality of first intermediate target adjustment model parameters;

[0069] respectively calculating a second fitness of each of the first intermediate objective adjustment model parameters, and comparing each of the second fitnesses with the preset fitness;

[0070] If all second fitness values are less than the preset fitness value, performing population processing on the first intermediate objective adjustment model parameters corresponding to the largest second fitness value based on the genetic algorithm to obtain a plurality of second intermediate objective adjustment model parameters;

[0071] respectively calculating a third fitness of each of the second intermediate objective adjustment model parameters, and comparing each of the third fitnesses with the preset fitness;

[0072] If there are multiple third fitness values greater than the preset fitness value, the second intermediate target adjustment model parameters corresponding to the third fitness values greater than the preset fitness value are merged to obtain the target adjustment model parameters;

[0073] The model parameters of the fusion semantic segmentation model are adjusted based on the target adjustment model parameters to obtain a target semantic segmentation model.

[0074] The genetic algorithm is an optimization algorithm obtained by simulating the evolution process of nature based on the theory of natural selection.

[0075] The method of this embodiment can improve the training effect of the target semantic segmentation model, thereby improving the fit between the target semantic segmentation model and the target image, and further improving the accuracy of the semantic segmentation method.

[0076] See also Figure 2 , Figure 2A schematic block diagram of the structure of the semantic segmentation device 100 provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the semantic segmentation device 100 includes:

[0077] The first acquisition module 110 is configured to acquire a target image and perform feature recognition on the target image to obtain an image identifier of the target image.

[0078] The second acquisition module 120 is used to obtain a semantic segmentation information set matching the target image in a preset database based on the image identification; wherein the semantic segmentation information set includes a semantic segmentation model set and a training data set, the semantic segmentation model set includes multiple initial semantic segmentation models, the training data set includes multiple training images, and each pixel of the training image is provided with a standard classification label.

[0079] The determination module 130 is used to input the target image into each of the initial semantic segmentation models respectively to obtain multiple initial semantic segmentation results, and determine the target initial semantic segmentation model among the multiple initial semantic segmentation models based on the multiple initial semantic segmentation results; wherein the target initial semantic segmentation model includes multiple.

[0080] The fusion module 140 is used to fuse the model parameters of each of the target initial semantic segmentation models to obtain fused model parameters, and update the model parameters of any of the target initial semantic segmentation models based on the fused model parameters to obtain a fused semantic segmentation model.

[0081] The training module 150 is used to train the fusion semantic segmentation model based on the training data set to obtain a target semantic segmentation model, and input the target image into the target semantic segmentation model to obtain a semantic segmentation result of the target image.

[0082] It should be noted that, those skilled in the art will clearly understand that, for the sake of convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned semantic segmentation method embodiment and will not be repeated here.

[0083] The semantic segmentation device 100 provided in the above embodiment can be implemented in the form of a computer program. The computer program can be used in Figure 3 The system runs on the terminal device 200 shown.

[0084] See also Figure 3 , Figure 3This is a schematic block diagram of the structure of a terminal device 200 provided in an embodiment of the present application. The terminal device 200 includes a processor 201 and a memory 202. The processor 201 and the memory 202 are connected via a system bus 203, wherein the memory 202 may include a non-volatile storage medium and an internal memory.

[0085] The non-volatile storage medium may store a computer program. The computer program includes program instructions, and when the program instructions are executed by the processor 201, the processor 201 may perform any of the above-mentioned semantic segmentation methods.

[0086] The processor 201 is used to provide computing and control capabilities to support the operation of the entire terminal device 200.

[0087] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor 201, the processor 201 can execute any of the above-mentioned semantic segmentation methods.

[0088] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the terminal device 200 involved in the solution of the present application. The specific terminal device 200 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0089] It should be understood that the processor 201 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0090] In some embodiments, the processor 201 is configured to execute a computer program stored in the memory to implement the following steps:

[0091] Acquire a target image, and perform feature recognition on the target image to obtain an image identifier of the target image;

[0092] Based on the image identifier, a semantic segmentation information set matching the target image is obtained from a preset database; wherein the semantic segmentation information set includes a semantic segmentation model set and a training data set, the semantic segmentation model set includes multiple initial semantic segmentation models, the training data set includes multiple training images, and each pixel of the training image is provided with a standard classification label;

[0093] Inputting the target image into each of the initial semantic segmentation models respectively to obtain multiple initial semantic segmentation results, and determining a target initial semantic segmentation model from the multiple initial semantic segmentation models based on the multiple initial semantic segmentation results; wherein the target initial semantic segmentation model includes multiple;

[0094] Fusing the model parameters of the target initial semantic segmentation models to obtain fused model parameters, and updating the model parameters of any target initial semantic segmentation model based on the fused model parameters to obtain a fused semantic segmentation model;

[0095] The fusion semantic segmentation model is trained based on the training data set to obtain a target semantic segmentation model, and the target image is input into the target semantic segmentation model to obtain a semantic segmentation result of the target image.

[0096] It should be noted that those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the terminal device 200 described above can refer to the corresponding process of the aforementioned semantic segmentation method and will not be repeated here.

[0097] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by one or more processors, the one or more processors implement the semantic segmentation method provided in the embodiment of the present application.

[0098] The computer-readable storage medium may be an internal storage unit of the terminal device 200 in the aforementioned embodiment, such as a hard disk or memory of the terminal device 200. The computer-readable storage medium may also be an external storage device of the terminal device 200, such as a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash card, etc. equipped with the terminal device 200.

[0099] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A semantic segmentation method, characterized in that: include: Acquire a target image, and perform feature recognition on the target image to obtain an image identifier of the target image; Based on the image identifier, a semantic segmentation information set matching the target image is obtained from a preset database; wherein the semantic segmentation information set includes a semantic segmentation model set and a training data set, the semantic segmentation model set includes multiple initial semantic segmentation models, the training data set includes multiple training images, and each pixel of the training image is provided with a standard classification label; Inputting the target image into each of the initial semantic segmentation models respectively to obtain multiple initial semantic segmentation results, and determining a target initial semantic segmentation model from the multiple initial semantic segmentation models based on the multiple initial semantic segmentation results; wherein the target initial semantic segmentation model includes multiple; The model parameters of each of the target initial semantic segmentation models are fused to obtain fused model parameters, and the model parameters of any of the target initial semantic segmentation models are updated based on the fused model parameters to obtain a fused semantic segmentation model; wherein the method for fusing the model parameters of each of the target initial semantic segmentation models is a weighted average method; Training the fused semantic segmentation model based on the training data set to obtain a target semantic segmentation model, and inputting the target image into the target semantic segmentation model to obtain a semantic segmentation result of the target image; The semantic segmentation information sets in the database are each provided with a digital matrix, the digital matrix is a 3×3 matrix, the image identifier includes 9 letters, and obtaining a semantic segmentation information set matching the target image in a preset database based on the image identifier includes: Obtain a preset coding table; wherein the coding table includes a number column and a letter column; Extract all prime numbers from the number column, and arrange all the extracted prime numbers in order from small to large to obtain a prime number sequence; Extract all composite numbers from the number sequence, and arrange all the extracted composite numbers in descending order to obtain a composite number sequence; Comparing a first quantity and a second quantity; wherein the first quantity is the number of prime numbers in the prime number sequence, and the second quantity is the number of composite numbers in the composite number sequence; If the first number is greater than the second number, inserting each composite number in the composite number sequence into the digit gaps of the prime number sequence in sequence to obtain a target digit sequence; Deleting all numbers in the number column to obtain a plurality of number spaces, and inserting each number in the target number sequence into the plurality of number spaces in sequence to obtain a target coding table; Encoding the image identifier based on the target encoding table to obtain an initial decrypted digital sequence; For each decoded number in the initial decrypted number sequence, determining a third number; wherein the third number is the number of times the decoded number appears in all the number matrices; Arranging the decoded digits in sequence based on the third numbers to obtain a target decoded digit sequence; wherein the third numbers corresponding to the decoded digits in the target decoded digit sequence decrease in sequence; Constructing a 3×3 blank matrix, and inserting each number in the target decoding number sequence into the blank matrix in sequence to obtain a decoding matrix; Comparing the decoding matrix with each of the digital matrices, and determining the semantic segmentation information set corresponding to the digital matrix that is completely consistent with the decoding matrix as the semantic segmentation information set matching the target image; Each of the initial semantic segmentation results includes a first predicted classification label for each pixel of the target image, and determining a target initial semantic segmentation model from the multiple initial semantic segmentation models based on the multiple initial semantic segmentation results includes: For each pixel of the target image, determine the first predicted classification label corresponding to the pixel based on all the initial semantic segmentation results; wherein the first predicted classification label corresponding to the pixel includes at least one; For each pixel of the target image, determine the classification probability of each first predicted classification label corresponding to the pixel based on all the initial semantic segmentation results, determine the first predicted classification label corresponding to the maximum classification probability as the target first predicted classification label, and combine all the initial semantic segmentation models corresponding to the target first predicted classification label into a target initial semantic segmentation model to be selected set; For each of the initial semantic segmentation models, a fourth number is determined based on all the target initial semantic segmentation models to be selected, and the fourth number is compared with a preset number, and when the fourth number is greater than the preset number, the initial semantic segmentation model is determined as the target initial semantic segmentation model; wherein the fourth number is the number of times the initial semantic segmentation model appears in all the target initial semantic segmentation models to be selected.

2. The semantic segmentation method according to claim 1, characterized in that Before performing feature recognition on the target image, the method further includes: Performing enhancement processing on the target image.

3. The semantic segmentation method according to claim 1, characterized in that After comparing the first quantity and the second quantity, the method further includes: If the first number is smaller than the second number, each of the prime numbers in the prime number sequence is sequentially inserted into the digit gaps of the composite number sequence to obtain a target digit sequence.

4. The semantic segmentation method according to claim 1, characterized in that The step of training the fused semantic segmentation model based on the training data set to obtain a target semantic segmentation model includes: Inputting each of the training images into the fused semantic segmentation model respectively to obtain a second predicted classification label corresponding to each pixel of each of the training images; Constructing a standard classification label-second predicted classification label mapping relationship table based on the standard classification label and the second predicted classification label corresponding to each pixel of each of the training images, and generating a classification loss function of the fusion semantic segmentation model based on the standard classification label-second predicted classification label mapping relationship table; Adjusting model parameters of the fused semantic segmentation model based on the classification loss function to obtain initial adjusted model parameters of the fused semantic segmentation model; Calculating a first fitness of the initial adjustment model parameters, and comparing the first fitness with a preset fitness; If the fitness is less than the preset fitness, performing population processing on the initial adjustment model parameters based on a preset genetic algorithm to obtain a plurality of first intermediate target adjustment model parameters; respectively calculating a second fitness of each of the first intermediate objective adjustment model parameters, and comparing each of the second fitnesses with the preset fitness; If all second fitness values are less than the preset fitness value, performing population processing on the first intermediate objective adjustment model parameters corresponding to the largest second fitness value based on the genetic algorithm to obtain a plurality of second intermediate objective adjustment model parameters; respectively calculating a third fitness of each of the second intermediate objective adjustment model parameters, and comparing each of the third fitnesses with the preset fitness; If there are multiple third fitness values greater than the preset fitness value, the second intermediate target adjustment model parameters corresponding to the third fitness values greater than the preset fitness value are merged to obtain the target adjustment model parameters; The model parameters of the fusion semantic segmentation model are adjusted based on the target adjustment model parameters to obtain a target semantic segmentation model.

5. A semantic segmentation device, characterized in that: include: A first acquisition module is used to acquire a target image and perform feature recognition on the target image to obtain an image identifier of the target image; A second acquisition module is configured to acquire a semantic segmentation information set matching the target image from a preset database based on the image identifier; wherein the semantic segmentation information set includes a semantic segmentation model set and a training data set, the semantic segmentation model set includes a plurality of initial semantic segmentation models, the training data set includes a plurality of training images, and each pixel of the training image is provided with a standard classification label; a determination module, configured to input the target image into each of the initial semantic segmentation models respectively to obtain a plurality of initial semantic segmentation results, and determine a target initial semantic segmentation model from the plurality of initial semantic segmentation models based on the plurality of initial semantic segmentation results; wherein the target initial semantic segmentation model includes a plurality of; a fusion module, configured to fuse the model parameters of each of the target initial semantic segmentation models to obtain fused model parameters, and update the model parameters of any of the target initial semantic segmentation models based on the fused model parameters to obtain a fused semantic segmentation model; wherein the method for fusing the model parameters of each of the target initial semantic segmentation models is a weighted average method; A training module, configured to train the fused semantic segmentation model based on the training data set to obtain a target semantic segmentation model, and input the target image into the target semantic segmentation model to obtain a semantic segmentation result of the target image; The semantic segmentation information sets in the database are each provided with a digital matrix, the digital matrix is a 3×3 matrix, the image identifier includes 9 letters, and obtaining a semantic segmentation information set matching the target image in a preset database based on the image identifier includes: Obtain a preset coding table; wherein the coding table includes a number column and a letter column; Extract all prime numbers from the number column, and arrange all the extracted prime numbers in order from small to large to obtain a prime number sequence; Extract all composite numbers from the number sequence, and arrange all the extracted composite numbers in descending order to obtain a composite number sequence; Comparing a first quantity and a second quantity; wherein the first quantity is the number of prime numbers in the prime number sequence, and the second quantity is the number of composite numbers in the composite number sequence; If the first number is greater than the second number, inserting each composite number in the composite number sequence into the digit gaps of the prime number sequence in sequence to obtain a target digit sequence; Deleting all numbers in the number column to obtain a plurality of number spaces, and inserting each number in the target number sequence into the plurality of number spaces in sequence to obtain a target coding table; Encoding the image identifier based on the target encoding table to obtain an initial decrypted digital sequence; For each decoded number in the initial decrypted number sequence, determining a third number; wherein the third number is the number of times the decoded number appears in all the number matrices; Arranging the decoded digits in sequence based on the third numbers to obtain a target decoded digit sequence; wherein the third numbers corresponding to the decoded digits in the target decoded digit sequence decrease in sequence; Constructing a 3×3 blank matrix, and inserting each number in the target decoding number sequence into the blank matrix in sequence to obtain a decoding matrix; Comparing the decoding matrix with each of the digital matrices, and determining the semantic segmentation information set corresponding to the digital matrix that is completely consistent with the decoding matrix as the semantic segmentation information set matching the target image; Each of the initial semantic segmentation results includes a first predicted classification label for each pixel of the target image, and determining a target initial semantic segmentation model from the multiple initial semantic segmentation models based on the multiple initial semantic segmentation results includes: For each pixel of the target image, determine the first predicted classification label corresponding to the pixel based on all the initial semantic segmentation results; wherein the first predicted classification label corresponding to the pixel includes at least one; For each pixel of the target image, determine the classification probability of each first predicted classification label corresponding to the pixel based on all the initial semantic segmentation results, determine the first predicted classification label corresponding to the maximum classification probability as the target first predicted classification label, and combine all the initial semantic segmentation models corresponding to the target first predicted classification label into a target initial semantic segmentation model to be selected set; For each of the initial semantic segmentation models, a fourth number is determined based on all the target initial semantic segmentation models to be selected, and the fourth number is compared with a preset number, and when the fourth number is greater than the preset number, the initial semantic segmentation model is determined as the target initial semantic segmentation model; wherein the fourth number is the number of times the initial semantic segmentation model appears in all the target initial semantic segmentation models to be selected.

6. A terminal device, characterized in that: The terminal device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the semantic segmentation method according to any one of claims 1 to 4 is implemented.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the semantic segmentation method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Training method of semantic segmentation model, semantic segmentation method and device

    CN110245710A

  • Network structure construction method and apparatus for use in multi-task scenario

    WO2021114625A1