Sample image generation, image processing, intelligent driving control method and device

By using the spatial prior matrix representing object distribution and semantic segmentation information for image fusion in the unsupervised domain adaptation method, the problem of unreasonable object distribution is solved and the training accuracy of the neural network is improved.

CN112200889BActive Publication Date: 2024-10-29SHANGHAI SENSETIME INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011197925.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-30
Publication Date
2024-10-29
Estimated Expiration
2040-10-30

AI Technical Summary

Technical Problem

In unsupervised domain adaptation methods, when labeled sample images are fused with unlabeled sample images, it can easily lead to unreasonable object distribution and affect the training accuracy of the neural network.

Method used

By obtaining the annotation information of the source domain image and the target domain image, and using the spatial prior distribution matrix representing the object in the source domain image to perform semantic fusion with the semantic segmentation image of the target domain image, a more reasonable fusion image is generated, thereby generating a more accurate fusion image. Reasonable sample data.

Benefits of technology

It improves the training accuracy of the neural network, reduces interference caused by unreasonable object distribution, and improves the overall performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112200889B_ABST
    Figure CN112200889B_ABST
Patent Text Reader

Abstract

The present disclosure provides a sample image generation, image processing, and intelligent driving control method and device, including: obtaining a source domain image, first annotation information of the source domain image, and a target domain image; semantically fusing the source domain image and the target domain image to obtain a fused image based on a spatial prior distribution matrix that characterizes distribution features of multiple objects in each image of the source domain and a first semantic segmentation image of the target domain image; and semantically fusing the first semantic segmentation image and the first annotation information of the source domain image to obtain second annotation information corresponding to the fused image; and generating a sample image based on the fused image and the second annotation information corresponding to the fused image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a sample image generation, image processing, and intelligent driving control method and device. Background Art

[0002] Generally, in supervised training of neural networks, it is necessary to obtain sample data with labeled information in advance, and then use the sample data to train the neural network. However, since the neural network requires a lot of sample data during training, the labeling of sample data is time-consuming. Based on this, people have proposed unsupervised domain adaptation methods to train neural networks.

[0003] When using unsupervised domain adaptation methods to train a neural network, it is usually necessary to fuse labeled sample images and unlabeled sample images, and generate new sample images based on the fused images and the labels of the corresponding sample images to train the neural network so that the neural network can learn the features of both labeled sample images and unlabeled sample images.

[0004] Currently, in the process of fusing labeled sample images with unlabeled sample images, the labeled sample images and the unlabeled sample images are generally fused in a positional manner. This positional fusion method may cause unreasonable distribution of objects in the fused image; for example, if the sample images in the source domain include telephone poles, cars, etc., after the labeled sample images are fused with the unlabeled sample images, the telephone poles may appear in the middle of the road and the cars may appear in the sky, which will lead to unreasonable labeling of the sample data, thereby affecting the training accuracy of the neural network. Summary of the invention

[0005] The embodiments of the present disclosure at least provide a method and device for sample image generation, image processing, and intelligent driving control.

[0006] In a first aspect, an embodiment of the present disclosure provides a sample image generation method, comprising:

[0007] Acquire a source domain image, first annotation information of the source domain image, and a target domain image;

[0008] Based on a spatial prior distribution matrix representing distribution features of multiple objects in each image of the source domain and a first semantic segmentation image of the target domain image, semantically fusing the source domain image and the target domain image to obtain a fused image;

[0009] and semantically fusing the first semantically segmented image and the first annotation information of the source domain image to obtain second annotation information corresponding to the fused image;

[0010] A sample image is generated according to the fused image and the second annotation information corresponding to the fused image.

[0011] In the above method, based on the first semantic segmentation image, various objects in the target domain image can be obtained, and then the various objects in the target domain image are fused into the source domain image using a predefined spatial prior distribution matrix that characterizes the distribution of objects in the image to obtain a fused image. Under the guidance of the spatial prior distribution matrix, various objects can have a more reasonable distribution in the position of the obtained fused image, thereby making the generated sample data more reasonable. Furthermore, when the fused image is used to train the neural network, the interference caused by the unreasonable distribution of objects in the fused image to the accuracy of the neural network is reduced, thereby improving the accuracy of the neural network.

[0012] In a possible implementation, the semantically fusing the source domain image and the target domain image based on the spatial prior distribution matrix characterizing the distribution features of the multiple objects in each image of the source domain and the first semantic segmentation image of the target domain image to obtain the fused image includes:

[0013] Based on the spatial prior distribution matrix and the first semantic segmentation image of the target domain image, determining a target mask image corresponding to the first semantic segmentation image;

[0014] The source domain image and the target domain image are semantically fused based on the target mask image to obtain the fused image.

[0015] In this way, when the source domain image and the target domain image are fused, since the target mask image determined based on the spatial prior distribution matrix has combined the distribution law of each object in the image, the fused image obtained based on the target mask image can be more consistent with the actual distribution of each object.

[0016] In a possible implementation manner, determining a target mask image corresponding to the first semantic segmentation image based on the spatial prior distribution matrix and the first semantic segmentation image of the target domain image includes:

[0017] Multiplying the spatial prior distribution matrix by the first semantic segmentation image to obtain a semantic distribution map corresponding to the first semantic segmentation image; wherein the value of each pixel point in the semantic distribution map represents the probability that the pixel point belongs to the different types of objects;

[0018] For any pixel, based on the probability that the pixel belongs to the multiple objects, determine the semantic information corresponding to the pixel;

[0019] The target mask image is obtained by setting the value of the pixel whose corresponding semantic information is the target semantic information to a first preset value and setting the value of the pixel whose corresponding semantic information is not the target semantic information to a second preset value.

[0020] Based on the above implementation, the value of each pixel in the first semantic segmentation image represents the probability that the pixel belongs to multiple objects. The first semantic segmentation image is multiplied by the spatial prior distribution matrix. When determining the semantic information corresponding to each pixel, the distribution law of each object is combined. Therefore, it is more accurate to determine the semantic information corresponding to the pixel.

[0021] In a possible implementation manner, determining a target mask image corresponding to the first semantic segmentation image based on the spatial prior distribution matrix and the first semantic segmentation image of the target domain image includes:

[0022] Multiplying the spatial prior distribution matrix by the first semantic segmentation image to obtain a semantic distribution map corresponding to the first semantic segmentation image; wherein the value of each pixel point in the semantic distribution map represents the probability that the pixel point belongs to a different type of object;

[0023] For any pixel, based on the probability that the pixel belongs to the multiple objects, determine the semantic information corresponding to the pixel;

[0024] The value of the pixel point whose corresponding semantic information is the target semantic information is set to a first preset value, the value of the pixel point whose corresponding semantic information is not the target semantic information is set to a second preset value, and the value of the pixel point whose corresponding semantic information is the associated semantic information of the target semantic information is set to the first preset value to obtain the target mask image.

[0025] In a possible implementation manner, semantically fusing the source domain image and the target domain image based on the target mask image to obtain the fused image includes:

[0026] An image composed of corresponding pixel points in the source domain image and pixel points whose values ​​in the target mask image are the second preset value is used as a first image to be fused corresponding to the source domain image; and an image composed of corresponding pixel points in the target domain image and pixel points whose values ​​in the target mask image are the first preset value is used as a second image to be fused corresponding to the target domain image;

[0027] The first image to be fused and the second image to be fused are fused to obtain the fused image.

[0028] In a possible implementation manner, after generating the sample image, the method further includes:

[0029] A semantic segmentation network is trained using the source domain image, the first annotation information, and a plurality of sample images.

[0030] In a possible implementation, the semantic segmentation network includes a student network and a teacher network; when generating a sample image, the first semantic segmentation image of the target domain image is obtained by the teacher network performing semantic segmentation processing on the target domain image.

[0031] In a possible implementation, the step of training a semantic segmentation network using the source domain image, the first annotation information, and a plurality of sample images includes:

[0032] Updating parameter values ​​of the student network using the source domain image, the first annotation information, the fused image, and the second annotation information;

[0033] Based on the updated parameter values ​​of the student network, the parameter values ​​of the teacher network are updated.

[0034] In a possible implementation manner, the method further includes:

[0035] Based on the teacher network, semantic segmentation processing is performed on the noise image of the target domain image to obtain a second semantic segmentation image; wherein the noise image of the target domain image is an image after noise is added to the target domain image;

[0036] Based on the second semantic segmentation image, determining credibility information of each pixel in the second semantic segmentation image;

[0037] The updating of the parameter value of the student network by using the source domain image, the first annotation information, the fused image, and the second annotation information includes:

[0038] The parameter values ​​of the student network are updated by using the source domain image, the first annotation information, the fused image, the second annotation information, and the credibility information of each pixel in the second semantic segmentation image.

[0039] In a possible implementation, updating the parameter value of the student network by using the source domain image, the first annotation information, the fused image, the second annotation information, and the credibility information of each pixel in the second semantic segmentation image includes:

[0040] semantically fusing the credibility information of each pixel in the second semantic segmentation image with the credibility information of each pixel in the source domain image to obtain fused credibility information; and

[0041] Using the student network to perform semantic segmentation processing on the fused image to obtain a third semantic segmentation image;

[0042] Determine a consistency loss based on the third semantic segmentation image, the second annotation information, and the fusion credibility information; and determine a weight of the consistency loss based on a current number of iterations;

[0043] Using the student network to perform semantic segmentation processing on the source domain image to obtain a fourth semantic segmentation image; and determining the semantic segmentation loss based on the fourth semantic segmentation image and the first annotation information;

[0044] Based on the consistency loss, the weight, and the semantic segmentation loss, a parameter value of the student network is updated.

[0045] In the above implementation, the weight of the consistency loss is determined by the current number of iterations, and the adjustment process of the parameter value of the student network is supervised based on the consistency loss, the determined weight of the consistency loss, and the semantic segmentation loss. As the number of iterations of the student network and the teacher network increases, the influence of the consistency loss and the semantic segmentation loss on the parameter values ​​of the student network and the teacher network is dynamically adjusted, so as to learn specific features in the target domain image while ensuring the semantic segmentation accuracy of the student network and the teacher network.

[0046] In a possible implementation, based on the teacher network, semantic segmentation processing is performed on the noise image of the target domain image to obtain a second semantic segmentation image, including:

[0047] Based on the teacher network, semantically segmenting the multiple noise images of the target domain image to obtain multiple intermediate semantic segmentation images;

[0048] Based on the multiple intermediate semantic segmentation images, the second semantic segmentation image is generated.

[0049] In this way, by using the teacher network to perform semantic segmentation processing on multiple noisy images respectively, multiple intermediate semantic segmentation images are obtained, and a second semantic segmentation image is generated based on the multiple intermediate semantic segmentation images, so that more uncertainty information in the noise image can be extracted, and the credibility information of each pixel point in the second semantic segmentation image obtained based on the noise image has better prominence, thereby improving the optimization efficiency of the student network parameter values.

[0050] In a possible implementation, the generating the second semantic segmentation image based on the multiple intermediate semantic segmentation images includes:

[0051] Sequentially calculating the average pixel values ​​of the pixel points at corresponding positions in the plurality of intermediate semantic segmentation images;

[0052] The mean value of the pixels at any corresponding position is determined as the pixel value of the pixel at the corresponding position in the second semantic segmentation image.

[0053] In a possible implementation, determining the credibility information of each pixel in the second semantic segmentation image based on the second semantic segmentation image includes:

[0054] Determining the information entropy of each pixel in the second semantic segmentation image based on the pixel value of each pixel in the second semantic segmentation image;

[0055] Comparing the information entropy of each pixel in the second semantic segmentation image with the information entropy threshold;

[0056] Based on the comparison result, determining the credibility information of each pixel in the second semantic segmentation image;

[0057] Among them, if the absolute value of the information entropy of any pixel point in the second semantic segmentation image is greater than the information entropy threshold, the credibility information corresponding to the any pixel point is set to a preset value representing the credibility of the pixel value of the any pixel point, wherein the preset value is greater than 0.

[0058] In a possible implementation manner, the information entropy threshold is generated in the following manner:

[0059] The information entropy threshold is determined based on the semantic segmentation type of the teacher network.

[0060] In a possible implementation manner, updating the parameter value of the teacher network based on the updated parameter value of the student network includes:

[0061] Performing exponential moving average processing on the parameter values ​​of the parameters in the student network to obtain target parameter values;

[0062] The target parameter value is used to replace the parameter value of the corresponding parameter in the teacher network.

[0063] In a second aspect, the present disclosure provides an image processing method, including:

[0064] Get the image to be processed;

[0065] Using a semantic segmentation network trained with a sample image obtained based on the first aspect or any possible implementation of the first aspect, semantic segmentation processing is performed on the image to be processed to obtain a semantic segmentation result of the image to be processed.

[0066] In a third aspect, an embodiment of the present disclosure provides an intelligent driving control method, including:

[0067] Acquire images collected by the driving device during driving;

[0068] Detecting a target object in the image using a semantic segmentation network trained with a sample image obtained based on the first aspect or any possible implementation manner of the first aspect;

[0069] Based on the detected target object, the travel device is controlled.

[0070] In a fourth aspect, an embodiment of the present disclosure provides a sample image generating device, including:

[0071] A first acquisition module, used to acquire a source domain image, first annotation information of the source domain image, and a target domain image;

[0072] A fusion module, configured to semantically fuse the source domain image and the target domain image based on a spatial prior distribution matrix representing distribution features of multiple objects in each image of the source domain and a first semantic segmentation image of the target domain image to obtain a fused image;

[0073] The fusion module is further used to perform semantic fusion on the first semantic segmentation image and the first annotation information of the source domain image to obtain second annotation information corresponding to the fused image;

[0074] The generating module is used to generate a sample image according to the fused image and the second annotation information corresponding to the fused image.

[0075] In a fifth aspect, an embodiment of the present disclosure provides an image processing device, including:

[0076] A second acquisition module is used to acquire the image to be processed;

[0077] The segmentation module is used to perform semantic segmentation processing on the image to be processed using a semantic segmentation network trained with a sample image obtained based on the first aspect or any possible implementation method of the first aspect, so as to obtain a semantic segmentation result of the image to be processed.

[0078] In a sixth aspect, an embodiment of the present disclosure provides an intelligent driving control device, including:

[0079] A third acquisition module is used to acquire images collected by the driving device during driving;

[0080] A detection module, configured to detect a target object in the image using a semantic segmentation network trained with a sample image obtained based on the first aspect or any possible implementation manner of the first aspect;

[0081] The control module is used to control the travel device based on the detected target object.

[0082] In the seventh aspect, an embodiment of the present disclosure further provides a computer device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the first aspect or any possible implementation of the first aspect are executed, or the steps of the second aspect are executed, or the steps of the third aspect are executed.

[0083] In an eighth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the computer program executes the steps of the above-mentioned first aspect, or any possible implementation of the first aspect, or executes the steps described in the above-mentioned second aspect, or executes the steps described in the above-mentioned third aspect.

[0084] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0085] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.

[0086] Figure 1 A schematic diagram of a fused image provided by an embodiment of the present disclosure is shown;

[0087] Figure 2 A flow chart of a sample image generation method provided by an embodiment of the present disclosure is shown;

[0088] Figure 3 A flow chart of a method for semantically fusing a source domain image and a target domain image to obtain a fused image provided by an embodiment of the present disclosure is shown;

[0089] Figure 4 A flowchart of a semantic segmentation network training method provided by an embodiment of the present disclosure is shown;

[0090] Figure 5 A schematic diagram showing the overall architecture of the sample image generation method provided by an embodiment of the present disclosure;

[0091] Figure 6 A flowchart of an image processing method provided by an embodiment of the present disclosure is shown;

[0092] Figure 7 A flow chart of an intelligent driving control method provided by an embodiment of the present disclosure is shown;

[0093] Figure 8 A schematic diagram of the architecture of a sample image generating device provided by an embodiment of the present disclosure is shown;

[0094] Fig. 9 A schematic diagram of the architecture of an image processing device provided by an embodiment of the present disclosure is shown;

[0095] Fig.10 A schematic diagram of the architecture of an intelligent driving control device provided by an embodiment of the present disclosure is shown;

[0096] Fig.11 A schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure is shown;

[0097] Fig.12 A schematic diagram showing the structure of another computer device provided by an embodiment of the present disclosure is shown;

[0098] Fig.13 A schematic diagram of the structure of another computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0099] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.

[0100] Exemplarily, in the related art, when a labeled sample image A and an unlabeled sample image B are fused, a positional fusion is generally performed. Specifically, the segmentation map corresponding to the sample image B can be predicted first to determine the number of types of objects contained in the sample image B, and then any several categories of objects can be selected therefrom. Based on the regional image corresponding to the arbitrarily selected object in the sample image B, a mask image is generated, in which the pixel values ​​of the objects belonging to the selected category in the mask image are taken as 1, and the values ​​of the remaining pixels are taken as 0. The mask image is then multiplied by the sample image B to obtain a fused image corresponding to the sample image B, and the mask image is inverted, that is, the pixel values ​​of the pixels with a pixel value of 0 are adjusted to 1, and the pixel values ​​of the pixels with a pixel value of 1 are adjusted to 0. The inverted mask image is multiplied by the sample image A to obtain a fused image corresponding to the sample image A, and then the fused image corresponding to the sample image A is fused with the fused image corresponding to the sample image B to obtain a fused image corresponding to the sample image A and the sample image B.

[0101] For example, please refer to Figure 1 As shown, however, this fusion method does not take into account the semantic relevance between objects. For example, cars and roads are semantically related. After fusion through this method, the car may float in the air. Therefore, the fused image finally obtained by this fusion method may be unreasonable. If the neural network is trained based on unreasonable fused images, the accuracy of the neural network will be affected.

[0102] Based on the above research, the present disclosure provides a sample image generation method, which can obtain various objects in the target domain image based on the first semantic segmentation image, and then use a predefined spatial prior distribution matrix that characterizes the distribution of objects in the image to fuse the various objects in the target domain image into the source domain image, thereby obtaining a fused image. Under the guidance of the spatial prior distribution matrix, the various objects can have a more reasonable distribution in the position of the obtained fused image, thereby obtaining more reasonable sample data; and then when using the fused image to train the neural network, the interference caused by the unreasonable distribution of objects in the fused image to the accuracy of the neural network is reduced, thereby improving the accuracy of the neural network.

[0103] The defects existing in the above solutions are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure for the above problems below should be the contributions made by the inventor to the present disclosure during the disclosure process.

[0104] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0105] To facilitate understanding of the present embodiment, a sample image generation method disclosed in the present embodiment is first introduced in detail. The execution subject of the sample image generation method provided in the present embodiment is generally a computer device with certain computing capabilities, and the computer device includes, for example: a terminal device or a server or other processing device. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the sample image generation method can be implemented by a processor calling a computer-readable instruction stored in a memory.

[0106] See also Figure 2 FIG. 2 is a flow chart of a sample image generation method provided by an embodiment of the present disclosure, wherein the method comprises steps 201 to 204, wherein:

[0107] Step 201: Acquire a source domain image, first annotation information of the source domain image, and a target domain image.

[0108] Step 202: Based on the spatial prior distribution matrix characterizing the distribution features of multiple objects in each image of the source domain and the first semantic segmentation image of the target domain image, the source domain image and the target domain image are semantically fused to obtain a fused image.

[0109] Step 203: semantically fuse the first semantically segmented image and the first annotation information of the source domain image to obtain second annotation information corresponding to the fused image.

[0110] Step 204: Generate a sample image according to the fused image and the second annotation information corresponding to the fused image.

[0111] The following is a detailed description of the above steps.

[0112] For step 201,

[0113] The source domain image may be any image in the source domain, and each pixel in the source domain image has corresponding first annotation information, and the first annotation information is used to indicate the object corresponding to the pixel. The target domain image may be any image in the target domain, and the pixels in the target domain image do not have corresponding annotation information, and the source domain and the target domain belong to different fields.

[0114] For step 202,

[0115] In a possible implementation, the first semantic segmentation image of the target domain image can be obtained by semantically segmenting the target domain image based on a neural network. The value of each pixel in the first semantic segmentation image represents the probability that the pixel belongs to a predefined object, and the predefined object is the type of semantic segmentation in the method provided by the present disclosure. For example, if 20 types of objects are predefined, the number of channels of the first semantic segmentation image is 20, and different channels correspond to different objects. The value of each pixel is a 20-dimensional vector, and each eigenvalue in the vector represents the probability that the pixel belongs to each category of objects.

[0116] The dimension of the spatial prior distribution matrix is ​​the same as the number of the predefined objects. Each dimension of the spatial prior distribution matrix corresponds to a different object. The value at each position on each dimension represents the probability of the object corresponding to the dimension appearing at that position. For example, if the spatial prior matrix is ​​a 10-dimensional matrix, each dimension corresponds to a different object. If the object corresponding to the Nth dimension is a car, the value at each position on the dimension represents the probability of the car appearing at that position.

[0117] The method provided in the present disclosure is mainly used in autonomous driving vehicles, so the source domain images are also images collected by autonomous driving vehicles. In the images collected by autonomous driving vehicles, each object should have a corresponding appearance position, for example, the road generally appears in the center of the image, and the sky generally appears in the upper part of the image, etc.

[0118] When determining the spatial prior distribution matrix, the spatial prior distribution vectors of the spatial prior distribution matrix can be determined first. The size of the vector should be consistent with the size of the source domain image. For example, if the source domain image is an image of size M*N, the spatial prior distribution vector should also be M*N dimensional.

[0119] Specifically, different spatial prior distribution vectors are used to describe the distribution of different problems in the image, and each position of the spatial prior distribution vector is mapped one-to-one to each position of the source domain image. When determining the spatial prior distribution vector, illustratively, if the spatial prior distribution vector is used to describe the distribution of object A in the image, and there are S images in the source domain image, for each position of the spatial prior distribution vector, the number of times object A appears at this position in different source domain images is determined. If there are K images with object A at this position, the value of the spatial prior distribution vector at this position is K / S.

[0120] In a possible implementation, when the source domain image and the target domain image are semantically fused based on the spatial prior distribution matrix and the first semantic segmentation image to obtain a fused image, the following method can be referred to: Figure 3 The method shown includes the following steps:

[0121] Step 301: Based on the spatial prior distribution matrix and a first semantic segmentation image of the target domain image, determine a target mask image corresponding to the first semantic segmentation image.

[0122] Step 302: semantically fuse the source domain image and the target domain image based on the target mask image to obtain the fused image.

[0123] In step 301, specifically, when determining the target mask image corresponding to the first semantic segmentation image, the spatial prior distribution matrix can be multiplied by the first semantic segmentation image to obtain a semantic distribution map corresponding to the first semantic segmentation image; wherein the value of each pixel in the semantic distribution map represents the probability that the pixel belongs to multiple objects; for any pixel, the semantic information corresponding to the pixel can be determined based on the probability that the pixel belongs to multiple objects, and then the target mask image can be determined based on the semantic information of each pixel.

[0124] Specifically, the dimension of the spatial prior distribution matrix is ​​the same as the number of channels of the first semantic segmentation image. When the spatial prior distribution matrix is ​​multiplied by the first semantic segmentation image, the corresponding values ​​at each corresponding position may be point-multiplied.

[0125] Exemplarily, if the dimension of the spatial prior distribution matrix is ​​3, the number of channels of the first semantic segmentation image is also 3, and the size of the spatial prior distribution matrix is ​​M*N*3, then for the pixel point in the ath row and bth column of the first semantic segmentation image, the value of the pixel point is [n1, n2, n3], respectively indicating that the probability that the pixel point belongs to object 1 is n1, the probability that it belongs to object 2 is n2, and the probability that it belongs to object 3 is n3; the value of the ath row and bth column position in the spatial prior distribution matrix at different spatial prior distribution vectors is [m1, m2, m3], respectively indicating that the frequency of object 1 appearing at this position is m1, the probability of object 2 appearing at this position is m2, and the probability of object 3 appearing at this position is m3, then in the semantic distribution map corresponding to the spatial prior distribution matrix, the value at this position is [m1×n1, m2×n2, m3×n3].

[0126] For any pixel, when determining the semantic information corresponding to the pixel based on the probabilities that the pixel belongs to multiple objects, the object with the highest corresponding probability can be used as the semantic information corresponding to the pixel.

[0127] Here, it should be noted that the number of predefined objects may be T, and the types of semantic information finally determined for each pixel in the final semantic distribution map may be only D, where D is less than or equal to T, and both D and T are positive integers.

[0128] When determining the target mask image based on the semantic information of each pixel point, the value of the pixel point whose corresponding semantic information is the target semantic information can be set to a first preset value, and the value of the pixel point whose corresponding semantic information is not the target semantic information can be set to a second preset value to obtain the target mask image. In practical applications, the first preset value can be 1, and the second preset value can be 0.

[0129] The target semantic information may be at least one piece of semantic information randomly selected from the semantic information of each pixel point, or may be semantic information determined based on a selection instruction of the user after receiving the selection instruction of the user.

[0130] In another possible implementation, when the target semantic information has corresponding associated semantic information, when determining the target mask image, in addition to setting the value of the pixel point whose corresponding semantic information is the target semantic information to the first preset value and setting the value of the pixel point whose corresponding semantic information is not the target semantic information to the second preset value, it is also necessary to set the value of the pixel point whose corresponding semantic information is the associated semantic information to the first preset value.

[0131] Here, the associated semantic information corresponding to the target semantic information is the semantic information that needs to appear at the same time. For example, if the target semantic information is a signboard, the associated semantic information corresponding to the target semantic information is the signpost. If the target semantic information is a cyclist, the associated semantic information corresponding to the target semantic information is a bicycle.

[0132] The regional image of the object corresponding to the target semantic information is the image that needs to be fused. If the target semantic information with the corresponding associated semantic information is fused separately, semantic irrationality may occur, such as a signboard hanging in the air. Therefore, when generating a fused image, the semantic correlation between the objects can be combined with the associated semantic information corresponding to the target semantic information, and the generated fused image is more in line with the laws of reality.

[0133] In step 302, when semantically fusing the source domain image and the target domain image based on the target mask image, an image composed of corresponding pixel points in the source domain image and pixel points in the target mask image whose values ​​are the second preset values ​​can be first used as a first image to be fused corresponding to the source domain image; and an image composed of corresponding pixel points in the target domain image and pixel points in the target mask image whose values ​​are the first preset values ​​can be used as a second image to be fused corresponding to the target domain image; the first image to be fused and the second image to be fused are fused to obtain the fused image.

[0134] In practical applications, the first preset value can be 1, and the second preset value can be 0. The target mask image, the source domain image, and the target domain image have the same size. The target mask image can be multiplied by corresponding pixels of the target domain image. The corresponding pixel of the first pixel whose value is 1 in the target mask image in the target domain image can be retained, and the corresponding pixel of the second pixel whose value is 0 in the target mask image in the target domain image is covered, that is, the value is 0 after multiplication. Similarly, in the source domain image, the target mask image can be inverted, and then the inverted target mask image can be multiplied by the source domain image. The corresponding pixel of the first pixel whose value is 1 in the target mask image in the source domain image can be retained, and the corresponding pixel of the second pixel whose value is 0 in the target mask image in the source domain image is covered, that is, the value is 0 after multiplication.

[0135] Specifically, it can be calculated by the following formula:

[0136] X M =M⊙X T +(1-M)⊙X S (1)

[0137] Among them, X M represents the fused image, M represents the mask matrix, X S represents the source domain image, X T represents the target domain image, and ⊙ represents the multiplication of corresponding pixels.

[0138] For step 203,

[0139] In a possible implementation, when semantically fusing the first semantic segmentation image and the first annotation information of the source domain image, the first semantic segmentation image and the first annotation information of the source domain image can be semantically fused based on the target mask image obtained in step 202 to obtain second annotation information corresponding to the fused image.

[0140] Specifically, it can be calculated by the following formula:

[0141] Y M =M⊙Y T +(1-M)⊙Y S (2)

[0142] Among them, Y M represents the second annotation information corresponding to the fused image, M represents the mask matrix, and Y S represents the first semantic segmentation image, Y T represents the first annotation information of the source domain image, and ⊙ represents the multiplication of corresponding pixels.

[0143] For step 204,

[0144] Here, a plurality of fused images and the second annotation information corresponding to the fused images constitute the sample image.

[0145] In a possible implementation, after generating the sample image, the source domain image, the first annotation information and the plurality of sample images may be used to train a semantic segmentation network. Here, the first semantic segmentation image of the target domain image may be obtained by performing semantic segmentation processing on the target domain image by the teacher network.

[0146] In one implementation, the semantic segmentation network may include neural networks of a student network and a teacher network. Before updating the parameter values ​​of the student network (Student Network) and the teacher network (Teacher Network), the parameter values ​​of the student network and the teacher network may be initialized first.

[0147] Exemplarily, the student network can be first trained based on multiple source domain images in the source domain to obtain a preliminarily trained student network, and then the network parameters of the teacher network can be determined based on the network parameters of the preliminarily trained student network to obtain a preliminarily trained teacher network. The preliminarily training process is the process of initializing the parameter values ​​of the student network and the teacher network.

[0148] Specifically, when the source domain image, the first annotation information, and a plurality of sample images are used to train the semantic segmentation network, reference may be made to Figure 4 The method shown includes the following steps:

[0149] Step 401: Update the parameter values ​​of the student network using the source domain image, the first annotation information, the fused image, and the second annotation information.

[0150] Step 402: Update the parameter values ​​of the teacher network based on the updated parameter values ​​of the student network.

[0151] In a possible implementation, semantic segmentation processing can also be performed on the noise image of the target domain image based on the teacher network to obtain a second semantic segmentation image, and then the credibility information of each pixel in the second semantic image can be determined based on the second semantic segmentation image. When the source domain image, the first annotation information, the fused image, and the second annotation information are used to update the parameter value of the student network, the source domain image, the first annotation information, the fused image, the second annotation information, and the credibility information of each pixel in the second semantic segmentation image can be used to update the parameter value of the student network.

[0152] Specifically, the noise image of the target domain image may be an image after random noise is added to the target domain image. Exemplarily, the random noise includes any one of Gaussian noise and white noise, which may be determined according to actual needs. The size of the noise image of the target domain image is the same as the size of the target domain image.

[0153] In one possible implementation, there may be multiple noisy images of the target domain image; in this case, when semantic segmentation processing is performed on the noisy image of the target domain image to obtain a second semantic segmentation image, semantic segmentation processing can be performed on the multiple noisy images of the target and the image based on the teacher network to obtain multiple intermediate semantic segmentation images, and then the second semantic segmentation image is generated based on the multiple intermediate semantic segmentation images.

[0154] Specifically, when generating a second semantic segmentation image based on multiple intermediate semantic segmentation images, the average pixel values ​​of the pixel points at corresponding positions in the multiple intermediate semantic segmentation images can be calculated in turn, and then the average pixel value of any corresponding position can be determined as the pixel value of the pixel point at the corresponding position in the second semantic segmentation image.

[0155] For example, the size of the target domain image is h×w, and there are N noise images of the target domain image, namely A1, A2, …, AN; after semantic segmentation of multiple noise images using the teacher network, the intermediate semantic segmentation image of the i-th noise image is obtained It is expressed as: Among them, x t represents the target domain image; h represents the height of the target domain image, w represents the width of the target domain image; C represents the semantic segmentation type of the teacher network.

[0156] Second semantic segmentation image For example, the following formula (3) is satisfied:

[0157]

[0158] In this way, by injecting random noise into the target domain image multiple times to generate multiple noise images, and obtaining a second semantic segmentation image based on the intermediate semantic segmentation images corresponding to the multiple noise images, more uncertainty information in the noise image can be extracted, so that the credibility information of each pixel point in the second semantic segmentation image obtained based on the noise image has better prominence, thereby improving the optimization efficiency of the student network parameter values.

[0159] After obtaining the second semantic segmentation image, determining the credibility information of each pixel in the second semantic segmentation image may include the following steps:

[0160] Step 1: Determine the information entropy of each pixel in the second semantic segmentation image based on the pixel value of each pixel in the second semantic segmentation image.

[0161] Here, the information entropy of any pixel is For example, the following formula (4) is satisfied:

[0162]

[0163] Step 2: Determine the credibility information of each pixel in the second semantic segmentation image based on the information entropy of each pixel in the second semantic segmentation image and a predetermined information entropy threshold.

[0164] Here, the information entropy threshold may be determined, for example, based on the semantic segmentation type of the teacher network.

[0165] The information entropy threshold H satisfies the following formula (5), for example:

[0166]

[0167] Among them, a, b, and c are all hyperparameters; K max =logC; C represents the semantic segmentation type of the teacher network. t represents the current iteration number; t max Indicates the maximum number of iterations.

[0168] Exemplarily, the information entropy threshold satisfies, for example:

[0169] After determining the information entropy threshold of each pixel, for example, the information entropy of each pixel in the second semantic segmentation image can be compared with a predetermined information entropy threshold; then based on the comparison result, the credibility information of each pixel in the second semantic segmentation image is determined.

[0170] Among them, if the absolute value of the information entropy of any pixel point in the second semantic segmentation image is greater than the information entropy threshold, the credibility information corresponding to the any pixel point is set to a preset value representing the credibility of the pixel value of the any pixel point, wherein the preset value is greater than 0.

[0171] In a specific implementation, it can be seen from the above formula (4) that the value of information entropy is a negative number; for a certain pixel point in the second semantic segmentation image, the smaller the value of the information entropy of the pixel point, the higher the credibility of the pixel point, that is, the higher the credibility of the classification of the pixel point in the corresponding target domain image represented by the pixel value of the pixel point in the second semantic segmentation image. When calculating the consistency loss, the pixels with higher credibility in the second semantic segmentation image should be taken into account to increase the influence of the pixels with higher credibility on the loss; and for the pixels with lower credibility in the second semantic segmentation image, their influence on the consistency loss can be reduced or even eliminated.

[0172] Furthermore, for example, the preset value of a reliable pixel value can be set to 1, and the preset value of an unreliable pixel value can be set to 0; for another example, the preset value of a reliable pixel value can be set to 1, and the preset value of an unreliable pixel value can be set to 0.5, etc. The specific settings can be made according to actual needs.

[0173] Furthermore, illustratively, the credibility information of each pixel in the second semantic segmentation image satisfies the following formula (6):

[0174]

[0175] Where H represents the information entropy threshold; I(·) represents the 0-1 function; and When , I(·) takes 1; When , I(·) takes 0.

[0176] In step 401, specifically, when the parameter value of the student network is updated by using the source domain image, the first annotation information, the fused image, the second annotation information, and the credibility information of each pixel in the second semantic segmentation image, the following steps may be included:

[0177] Step 1: semantically fuse the credibility information of each pixel in the second semantic segmentation image with the credibility information of each pixel in the source domain image to obtain fused credibility information; and use the student network to perform semantic segmentation processing on the fused image to obtain a third semantic segmentation image.

[0178] Step 2: determining a consistency loss based on the third semantic segmentation image, the second annotation information, and the fusion credibility information; and determining a weight of the consistency loss based on a current number of iterations.

[0179] Step 3: Perform semantic segmentation processing on the source domain image using the student network to obtain a fourth semantic segmentation image; and determine the semantic segmentation loss based on the fourth semantic segmentation image and the first annotation information.

[0180] Step 4: Update the parameter value of the student network based on the consistency loss, the weight, and the semantic segmentation loss.

[0181] With respect to the above step 1, when the credibility information of each pixel in the second semantic segmentation image is semantically fused with the credibility information of each pixel in the source domain image, the fusion can be performed based on the target mask image calculated in step 202. In practical applications, since the credibility information of each pixel in the source domain image is obtained from the first annotation information of the source domain image, it can be assumed that each pixel in the source domain image is credible.

[0182] Specifically, the method for semantically fusing the credibility information of each pixel in the second semantic segmentation image with the credibility information of each pixel in the source domain image is the same as the semantic fusion method of the source domain image and the target domain image mentioned above, and will not be repeated here.

[0183] For the above step 2, for example, when determining the consistency loss based on the third semantic segmentation image, the second annotation information, and the fusion credibility information, the following formula (7) may be referred to:

[0184]

[0185] Among them, f θ' represents the teacher network, f θ represents the student network, L con (f θ' ,f θ ) represents the consistency loss between the teacher network and the student network, U M represents the fusion credibility information, f θ (X M ) represents the third semantic segmentation image, Y M Indicates the second annotation information, CE(f θ (X M ),Y M ) represents the segmentation loss between the third fused segmented image and the second annotation information, ∑ j Represents pixel-by-pixel summation.

[0186] In the specific implementation, since each pixel in the source domain image is credible when the credibility information of each pixel in the second semantic segmentation image is semantically fused with the credibility information of each pixel in the source domain image, when calculating the consistency loss based on the fused credibility information, only the loss value corresponding to the credible pixel in the third semantic segmentation image is considered (the fused credibility information corresponding to the uncredible pixel is 0). Therefore, the influence of pixels with low prediction accuracy of the teacher network on adjusting the parameters of the student network can be avoided, thereby avoiding the problem of error accumulation.

[0187] For step 3 above, for example, the semantic segmentation loss L seg For example, the cross entropy loss of the source domain image satisfies the following formula (8):

[0188]

[0189] Where H represents the height of the source domain image; W represents the width of the source domain image; C represents the number of channels; Y s Represents the first annotation information of the source domain image; P s =f θ ((X S ) (h,w,c) ), represents the fourth semantic segmentation image; X S represents the source domain image; f θ (·) indicates student network.

[0190] For the above step 4, when updating the parameter value of the student network based on the consistency loss, the weight, and the semantic segmentation loss, the total loss value in this training process can be calculated based on the consistency loss, the weight, and the semantic segmentation loss, and then the network parameter value of the student network can be updated based on the total loss value.

[0191] For example, the total loss value in this training process can be calculated according to the following formula:

[0192] L total =L seg +λ con L con (9)

[0193] Among them, L con represents the consistency loss, L seg represents the semantic segmentation loss, λ con The weight representing the consistency loss is, for example, a dynamic weight, which is set as an ascending function that increases with the number of iterations. The dynamic weight can strike a balance between the semantic segmentation loss and the consistency loss, increase the advantage of the semantic segmentation loss in the early training process of the neural network, and gradually increase the advantage of the consistency loss in the later training process, so as to stably control the convergence of the parameter values ​​of the neural network.

[0194] When updating the parameter values ​​of the teacher network based on the updated parameter values ​​of the student network, for example, exponential moving average processing can be performed on the parameter values ​​of the parameters in the student network to obtain target parameter values; and the target parameter values ​​are used to replace the parameter values ​​of the corresponding parameters in the teacher network.

[0195] The following diagram will introduce the overall architecture of the training method of the above semantic segmentation network. Figure 5 As shown, the fusion includes three aspects. The first aspect is the semantic fusion of the source domain image and the target domain image. The second aspect is the semantic fusion of the first annotation information of the source domain image and the first semantic segmentation image. The third aspect is the fusion of the credibility information of the target domain image and the credibility information of the source domain image. Specifically, the following steps can be included:

[0196] Step 1: Input the target domain image into the teacher network to obtain the first semantic segmentation image;

[0197] Step 2: semantically fuse the source domain image and the target domain image based on the first semantic segmentation image to obtain a fused image;

[0198] Step 3: You can perform the following steps simultaneously:

[0199] Step 31, adding noise to the target domain image, and inputting the noise image of the target domain image into the teacher image to obtain a second semantic segmentation image;

[0200] Step 32: input the source domain image into the student network to obtain a third semantic segmentation image;

[0201] Step 33, input the fused image into the student network to obtain a fourth semantic segmentation image;

[0202] Step 4: Calculate the semantic segmentation loss between the fourth semantic segmentation image and the first annotation information based on formula (8);

[0203] Step 5: semantically fuse the first annotation information and the first semantic segmentation image to obtain second annotation information;

[0204] Step 6: Based on the second semantic segmentation image, determine the information entropy corresponding to the second semantic segmentation image;

[0205] Step 7: Determine the credibility information of the second segmented image based on the information entropy and the information entropy threshold of the second semantic segmented image;

[0206] Step 8: semantically fuse the credibility information of the source domain image and the credibility information of the second segmented image to obtain fused credibility information;

[0207] Step 9: Calculate the consistency loss between the third semantic segmentation image, the second annotation information and the fusion credibility information using formula (7);

[0208] Step 10: Use formula (9) to calculate the total loss in this training process, and adjust the parameters of the student network based on the calculated total loss, and adjust the parameters of the teacher network based on the adjusted parameters of the student network.

[0209] See also Figure 6 As shown, the embodiment of the present disclosure also provides an image processing method, including:

[0210] Step 601: Obtain an image to be processed;

[0211] Step 602: Using a semantic segmentation network trained with a sample image obtained by the sample image generation method described in any embodiment of the present disclosure, perform semantic segmentation processing on the image to be processed to obtain a semantic segmentation result of the image to be processed.

[0212] When the present disclosure implements semantic segmentation processing on the image to be processed, it utilizes the neural network trained with the sample image obtained by the sample image generation method provided by the embodiment of the present disclosure. The neural network trained with the sample image can obtain a more accurate semantic segmentation result of the image to be processed.

[0213] See also Figure 7 As shown, the embodiment of the present disclosure also provides an intelligent driving control method, including:

[0214] Step 701: Acquire images collected by the driving device during driving;

[0215] Step 702: Detect a target object in the image using a semantic segmentation network trained on the sample image obtained by the sample image generation method described in any embodiment of the present disclosure;

[0216] Step 703: Control the travel device based on the detected target object.

[0217] In a specific implementation, the driving device is, for example but not limited to, any of the following: an autonomous driving vehicle, a vehicle equipped with an Advanced Driving Assistance System (ADAS), or a robot, etc.

[0218] Controlling the traveling device, for example, includes controlling the acceleration, deceleration, steering, braking, etc. of the traveling device, or playing voice prompt information to prompt the driver to control the acceleration, deceleration, steering, braking, etc. of the traveling device.

[0219] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0220] Based on the same inventive concept, a sample image generating device corresponding to the sample image generating method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned sample image generating method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0221] Reference Figure 8 FIG. 8 is a schematic diagram of the architecture of a sample image generating device provided by an embodiment of the present disclosure, wherein the device comprises: a first acquisition module 801, a fusion module 802, and a generating module 803; wherein:

[0222] A first acquisition module 801 is used to acquire a source domain image, first annotation information of the source domain image, and a target domain image;

[0223] A fusion module 802 is used to semantically fuse the source domain image and the target domain image based on a spatial prior distribution matrix representing distribution features of multiple objects in each image of the source domain and the first semantic segmentation image of the target domain image to obtain a fused image;

[0224] The fusion module 802 is further configured to perform semantic fusion on the first semantic segmentation image and the first annotation information of the source domain image to obtain second annotation information corresponding to the fused image;

[0225] The generating module 803 is used to generate a sample image according to the fused image and the second annotation information corresponding to the fused image.

[0226] The fusion module 802, when semantically fusing the source domain image and the target domain image to obtain a fused image based on a spatial prior distribution matrix representing distribution features of multiple objects in each image of the source domain and the first semantic segmentation image of the target domain image, is used to:

[0227] Based on the spatial prior distribution matrix and the first semantic segmentation image of the target domain image, determining a target mask image corresponding to the first semantic segmentation image;

[0228] The source domain image and the target domain image are semantically fused based on the target mask image to obtain the fused image.

[0229] In a possible implementation, the fusion module 802, when determining the target mask image corresponding to the first semantic segmentation image based on the spatial prior distribution matrix and the first semantic segmentation image of the target domain image, is configured to:

[0230] Multiplying the spatial prior distribution matrix by the first semantic segmentation image to obtain a semantic distribution map corresponding to the first semantic segmentation image; wherein the value of each pixel point in the semantic distribution map represents the probability that the pixel point belongs to the different types of objects;

[0231] For any pixel, based on the probability that the pixel belongs to the multiple objects, determine the semantic information corresponding to the pixel;

[0232] The target mask image is obtained by setting the value of the pixel whose corresponding semantic information is the target semantic information to a first preset value and setting the value of the pixel whose corresponding semantic information is not the target semantic information to a second preset value.

[0233] In a possible implementation, the fusion module 802, when determining the target mask image corresponding to the first semantic segmentation image based on the spatial prior distribution matrix and the first semantic segmentation image of the target domain image, is configured to:

[0234] Multiplying the spatial prior distribution matrix by the first semantic segmentation image to obtain a semantic distribution map corresponding to the first semantic segmentation image; wherein the value of each pixel point in the semantic distribution map represents the probability that the pixel point belongs to a different type of object;

[0235] For any pixel, based on the probability that the pixel belongs to the multiple objects, determine the semantic information corresponding to the pixel;

[0236] The value of the pixel point whose corresponding semantic information is the target semantic information is set to a first preset value, the value of the pixel point whose corresponding semantic information is not the target semantic information is set to a second preset value, and the value of the pixel point whose corresponding semantic information is the associated semantic information of the target semantic information is set to the first preset value to obtain the target mask image.

[0237] In a possible implementation manner, the fusion module 802, when semantically fusing the source domain image and the target domain image based on the target mask image to obtain the fused image, is configured to:

[0238] An image composed of corresponding pixel points in the source domain image and pixel points whose values ​​in the target mask image are the second preset value is used as a first image to be fused corresponding to the source domain image; and an image composed of corresponding pixel points in the target domain image and pixel points whose values ​​in the target mask image are the first preset value is used as a second image to be fused corresponding to the target domain image;

[0239] The first image to be fused and the second image to be fused are fused to obtain the fused image.

[0240] In a possible implementation, the apparatus further includes a training module 804, which is used to: after generating the sample image, train a semantic segmentation network using the source domain image, the first annotation information, and the plurality of sample images.

[0241] In a possible implementation, the semantic segmentation network includes a student network and a teacher network; when generating a sample image, the first semantic segmentation image of the target domain image is obtained by the teacher network performing semantic segmentation processing on the target domain image.

[0242] In a possible implementation manner, the training module 804, when training the semantic segmentation network using the source domain image, the first annotation information, and the plurality of sample images, is configured to:

[0243] Updating parameter values ​​of the student network using the source domain image, the first annotation information, the fused image, and the second annotation information;

[0244] Based on the updated parameter values ​​of the student network, the parameter values ​​of the teacher network are updated.

[0245] In a possible implementation manner, the training module 804 is further configured to:

[0246] Based on the teacher network, semantic segmentation processing is performed on the noise image of the target domain image to obtain a second semantic segmentation image;

[0247] Based on the second semantic segmentation image, determining credibility information of each pixel in the second semantic segmentation image;

[0248] The training module 804, when updating the parameter value of the student network using the source domain image, the first annotation information, the fused image, and the second annotation information, is used to:

[0249] The parameter values ​​of the student network are updated by using the source domain image, the first annotation information, the fused image, the second annotation information, and the credibility information of each pixel in the second semantic segmentation image.

[0250] In a possible implementation, the training module 804, when updating the parameter value of the student network using the source domain image, the first annotation information, the fused image, the second annotation information, and the credibility information of each pixel in the second semantic segmentation image, is used to:

[0251] semantically fusing the credibility information of each pixel in the second semantic segmentation image with the credibility information of each pixel in the source domain image to obtain fused credibility information; and

[0252] Using the student network to perform semantic segmentation processing on the fused image to obtain a third semantic segmentation image;

[0253] Determine a consistency loss based on the third semantic segmentation image, the second annotation information, and the fusion credibility information; and determine a weight of the consistency loss based on a current number of iterations;

[0254] Using the student network to perform semantic segmentation processing on the source domain image to obtain a fourth semantic segmentation image; and determining the semantic segmentation loss based on the fourth semantic segmentation image and the first annotation information;

[0255] Based on the consistency loss, the weight, and the semantic segmentation loss, a parameter value of the student network is updated.

[0256] In a possible implementation manner, the training module 804, when performing semantic segmentation processing on the noise image of the target domain image based on the teacher network to obtain the second semantic segmentation image, is used to:

[0257] Based on the teacher network, semantically segment the multiple noise images of the target domain image to obtain multiple intermediate semantic segmentation images; wherein the noise image of the target domain image is an image after adding noise to the target domain image;

[0258] Based on the multiple intermediate semantic segmentation images, the second semantic segmentation image is generated.

[0259] In a possible implementation, the training module 804, when generating the second semantic segmentation image based on the multiple intermediate semantic segmentation images, is configured to:

[0260] Sequentially calculating the average pixel values ​​of the pixel points at corresponding positions in the plurality of intermediate semantic segmentation images;

[0261] The mean value of the pixels at any corresponding position is determined as the pixel value of the pixel at the corresponding position in the second semantic segmentation image.

[0262] In a possible implementation, the training module 804, when determining the credibility information of each pixel in the second semantic segmentation image based on the second semantic segmentation image, is used to:

[0263] Determining the information entropy of each pixel in the second semantic segmentation image based on the pixel value of each pixel in the second semantic segmentation image;

[0264] Comparing the information entropy of each pixel in the second semantic segmentation image with the information entropy threshold;

[0265] Based on the comparison result, determining the credibility information of each pixel in the second semantic segmentation image;

[0266] Among them, if the absolute value of the information entropy of any pixel point in the second semantic segmentation image is greater than the information entropy threshold, the credibility information corresponding to the any pixel point is set to a preset value representing the credibility of the pixel value of the any pixel point, wherein the preset value is greater than 0.

[0267] In a possible implementation manner, the training module 804 is further configured to generate the information entropy threshold in the following manner:

[0268] The information entropy threshold is determined based on the semantic segmentation type of the teacher network.

[0269] In a possible implementation, the training module 804, when updating the parameter value of the teacher network based on the updated parameter value of the student network, is used to:

[0270] Performing exponential moving average processing on the parameter values ​​of the parameters in the student network to obtain target parameter values;

[0271] The target parameter value is used to replace the parameter value of the corresponding parameter in the teacher network.

[0272] Based on the same inventive concept, an image processing device corresponding to the image processing method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned image processing method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0273] Reference Fig. 9 , which is a schematic diagram of the architecture of an image processing device provided by an embodiment of the present disclosure, the device comprises: a second acquisition module 901, a segmentation module 902; wherein,

[0274] The second acquisition module 901 is used to acquire the image to be processed;

[0275] The segmentation module 902 is used to perform semantic segmentation processing on the image to be processed using a semantic segmentation network trained with a sample image obtained by the sample image generation method described in any embodiment of the present disclosure to obtain a semantic segmentation result of the image to be processed.

[0276] Based on the same inventive concept, an intelligent driving control device corresponding to the intelligent driving control method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned intelligent driving control method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0277] Reference Fig.10 , which is a schematic diagram of the architecture of an intelligent driving control device provided by an embodiment of the present disclosure, the device includes: a third acquisition module 1001, a detection module 1002, and a control module 1003; wherein,

[0278] The third acquisition module 1001 is used to acquire images collected by the driving device during driving;

[0279] A detection module 1002, configured to detect a target object in the image using a semantic segmentation network trained with a sample image obtained by the sample image generation method according to any one of the embodiments of the present disclosure;

[0280] The control module 1003 is used to control the travel device based on the detected target object.

[0281] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.

[0282] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device. Fig.11 As shown, it is a structural diagram of a computer device 1100 provided in an embodiment of the present disclosure, including a processor 1101, a memory 1102, and a bus 1103. Among them, the memory 1102 is used to store execution instructions, including a memory 11021 and an external memory 11022; the memory 11021 here is also called an internal memory, which is used to temporarily store the operation data in the processor 1101, and the data exchanged with the external memory 11022 such as a hard disk. The processor 1101 exchanges data with the external memory 11022 through the memory 11021. When the computer device 1100 is running, the processor 1101 communicates with the memory 1102 through the bus 1103, so that the processor 1101 executes the following instructions:

[0283] Acquire a source domain image, first annotation information of the source domain image, and a target domain image;

[0284] Based on a spatial prior distribution matrix representing distribution features of multiple objects in each image of the source domain and a first semantic segmentation image of the target domain image, semantically fusing the source domain image and the target domain image to obtain a fused image;

[0285] and semantically fusing the first semantically segmented image and the first annotation information of the source domain image to obtain second annotation information corresponding to the fused image;

[0286] A sample image is generated according to the fused image and the second annotation information corresponding to the fused image.

[0287] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device. Fig.12 As shown, it is a schematic diagram of the structure of a computer device 1200 provided in an embodiment of the present disclosure, including a processor 1201, a memory 1202, and a bus 1203. Among them, the memory 1202 is used to store execution instructions, including a memory 12021 and an external memory 12022; the memory 12021 here is also called an internal memory, which is used to temporarily store the operation data in the processor 1201, and the data exchanged with the external memory 12022 such as a hard disk. The processor 1201 exchanges data with the external memory 12022 through the memory 12021. When the computer device 1200 is running, the processor 1201 communicates with the memory 1202 through the bus 1203, so that the processor 1201 executes the following instructions:

[0288] Get the image to be processed;

[0289] Using a semantic segmentation network trained with a sample image obtained by the sample image generation method described in any embodiment of the present disclosure, semantic segmentation processing is performed on the image to be processed to obtain a semantic segmentation result of the image to be processed.

[0290] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device. Fig.13 As shown, it is a schematic diagram of the structure of a computer device 1300 provided in an embodiment of the present disclosure, including a processor 1301, a memory 1302, and a bus 1303. Among them, the memory 1302 is used to store execution instructions, including a memory 13021 and an external memory 13022; the memory 13021 here is also called an internal memory, which is used to temporarily store the operation data in the processor 1301, and the data exchanged with the external memory 13022 such as a hard disk. The processor 1301 exchanges data with the external memory 13022 through the memory 13021. When the computer device 1300 is running, the processor 1301 communicates with the memory 1302 through the bus 1303, so that the processor 1301 executes the following instructions:

[0291] Acquire images collected by the driving device during driving;

[0292] Detecting a target object in the image using a semantic segmentation network trained with a sample image obtained by the sample image generation method described in any one of the embodiments of the present disclosure;

[0293] Based on the detected target object, the travel device is controlled.

[0294] The present disclosure also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of sample image generation, image processing, and intelligent driving control method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0295] The computer program product of the sample image generation, image processing, and intelligent driving control method provided in the embodiments of the present disclosure includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the steps of the sample image generation, image processing, and intelligent driving control method described in the above method embodiments. Please refer to the above method embodiments for details, which will not be repeated here.

[0296] The present disclosure also provides a computer program, which implements any one of the methods of the aforementioned embodiments when executed by a processor. The computer program product can be implemented in hardware, software, or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.

[0297] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

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

[0299] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0300] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0301] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A sample image generation method, characterized in that: include: Acquire a source domain image, first annotation information of the source domain image, and a target domain image; Based on a spatial prior distribution matrix representing distribution features of multiple objects in each image of the source domain and a first semantic segmentation image of the target domain image, semantically fusing the source domain image and the target domain image to obtain a fused image; Performing semantic fusion on the first semantic segmentation image and the first annotation information of the source domain image to obtain second annotation information corresponding to the fused image; A sample image is generated according to the fused image and the second annotation information corresponding to the fused image.

2. The method according to claim 1, characterized in that: The method of semantically fusing the source domain image and the target domain image based on the spatial prior distribution matrix characterizing the distribution features of the multiple objects in each image of the source domain and the first semantic segmentation image of the target domain image to obtain a fused image includes: Based on the spatial prior distribution matrix and the first semantic segmentation image of the target domain image, determining a target mask image corresponding to the first semantic segmentation image; The source domain image and the target domain image are semantically fused based on the target mask image to obtain the fused image.

3. The method according to claim 2, characterized in that The determining, based on the spatial prior distribution matrix and the first semantic segmentation image of the target domain image, a target mask image corresponding to the first semantic segmentation image comprises: Multiplying the spatial prior distribution matrix by the first semantic segmentation image to obtain a semantic distribution map corresponding to the first semantic segmentation image; wherein the value of each pixel point in the semantic distribution map represents the probability that the pixel point belongs to a different type of object; For any pixel, based on the probability that the pixel belongs to the multiple objects, determine the semantic information corresponding to the pixel; The target mask image is obtained by setting the value of the pixel whose corresponding semantic information is the target semantic information to a first preset value and setting the value of the pixel whose corresponding semantic information is not the target semantic information to a second preset value.

4. The method according to claim 2, characterized in that: The determining, based on the spatial prior distribution matrix and the first semantic segmentation image of the target domain image, a target mask image corresponding to the first semantic segmentation image comprises: Multiplying the spatial prior distribution matrix by the first semantic segmentation image to obtain a semantic distribution map corresponding to the first semantic segmentation image; wherein the value of each pixel point in the semantic distribution map represents the probability that the pixel point belongs to a different type of object; For any pixel, based on the probability that the pixel belongs to the multiple objects, determine the semantic information corresponding to the pixel; The value of the pixel point whose corresponding semantic information is the target semantic information is set to a first preset value, the value of the pixel point whose corresponding semantic information is not the target semantic information is set to a second preset value, and the value of the pixel point whose corresponding semantic information is the associated semantic information of the target semantic information is set to the first preset value to obtain the target mask image.

5. The method according to claim 3 or 4, characterized in that: The semantically fusing the source domain image and the target domain image based on the target mask image to obtain the fused image includes: An image composed of corresponding pixel points in the source domain image and pixel points whose values ​​in the target mask image are the second preset value is used as a first image to be fused corresponding to the source domain image; and an image composed of corresponding pixel points in the target domain image and pixel points whose values ​​in the target mask image are the first preset value is used as a second image to be fused corresponding to the target domain image; The first image to be fused and the second image to be fused are fused to obtain the fused image.

6. The method according to any one of claims 1 to 5, characterized in that: After generating the sample image, the method further includes: A semantic segmentation network is trained using the source domain image, the first annotation information, and a plurality of sample images.

7. The method according to claim 6, characterized in that The semantic segmentation network includes a student network and a teacher network; when generating a sample image, a first semantic segmentation image of the target domain image is obtained by the teacher network performing semantic segmentation processing on the target domain image.

8. The method according to claim 7, characterized in that The step of training a semantic segmentation network by using the source domain image, the first annotation information, and a plurality of sample images includes: Updating parameter values ​​of the student network using the source domain image, the first annotation information, the fused image, and the second annotation information; Based on the updated parameter values ​​of the student network, the parameter values ​​of the teacher network are updated.

9. The method according to claim 8, characterized in that The method further comprises: Based on the teacher network, semantic segmentation processing is performed on the noise image of the target domain image to obtain a second semantic segmentation image; wherein the noise image of the target domain image is an image after noise is added to the target domain image; Based on the second semantic segmentation image, determining credibility information of each pixel in the second semantic segmentation image; The updating of the parameter value of the student network by using the source domain image, the first annotation information, the fused image, and the second annotation information includes: The parameter values ​​of the student network are updated by using the source domain image, the first annotation information, the fused image, the second annotation information, and the credibility information of each pixel in the second semantic segmentation image.

10. The method according to claim 9, characterized in that The updating of the parameter value of the student network by using the source domain image, the first annotation information, the fused image, the second annotation information and the credibility information of each pixel in the second semantic segmentation image includes: semantically fusing the credibility information of each pixel in the second semantic segmentation image with the credibility information of each pixel in the source domain image to obtain fused credibility information; and Using the student network to perform semantic segmentation processing on the fused image to obtain a third semantic segmentation image; Determine a consistency loss based on the third semantic segmentation image, the second annotation information, and the fusion credibility information; and determine a weight of the consistency loss based on a current number of iterations; Using the student network to perform semantic segmentation processing on the source domain image to obtain a fourth semantic segmentation image; and determining a semantic segmentation loss based on the fourth semantic segmentation image and the first annotation information; Based on the consistency loss, the weight, and the semantic segmentation loss, a parameter value of the student network is updated.

11. The method according to claim 9, characterized in that Based on the teacher network, semantic segmentation processing is performed on the noise image of the target domain image to obtain a second semantic segmentation image, including: Based on the teacher network, semantically segmenting the multiple noise images of the target domain image to obtain multiple intermediate semantic segmentation images; Based on the multiple intermediate semantic segmentation images, the second semantic segmentation image is generated.

12. The method according to claim 11, characterized in that The step of generating the second semantic segmentation image based on the multiple intermediate semantic segmentation images includes: Sequentially calculating the average pixel values ​​of the pixel points at corresponding positions in the plurality of intermediate semantic segmentation images; The mean value of the pixels at any corresponding position is determined as the pixel value of the pixel at the corresponding position in the second semantic segmentation image.

13. The method according to claim 9, characterized in that The determining, based on the second semantic segmentation image, the credibility information of each pixel in the second semantic segmentation image includes: Determining the information entropy of each pixel in the second semantic segmentation image based on the pixel value of each pixel in the second semantic segmentation image; Comparing the information entropy of each pixel in the second semantic segmentation image with the information entropy threshold; Based on the comparison result, determining the credibility information of each pixel in the second semantic segmentation image; Among them, if the absolute value of the information entropy of any pixel point in the second semantic segmentation image is greater than the information entropy threshold, the credibility information corresponding to the any pixel point is set to a preset value representing the credibility of the pixel value of the any pixel point, wherein the preset value is greater than 0.

14. An image processing method, characterized in that: include: Get the image to be processed; Using a semantic segmentation network obtained based on any one of the methods described in claims 6 to 13, semantic segmentation processing is performed on the image to be processed to obtain a semantic segmentation result of the image to be processed.

15. An intelligent driving control method, characterized in that: include: Acquire images collected by the driving device during driving; Detecting the target object in the image using a semantic segmentation network obtained based on the method described in any one of claims 6 to 13; Based on the detected target object, the travel device is controlled.

16. A sample image generating device, characterized in that: include: A first acquisition module, used to acquire a source domain image, first annotation information of the source domain image, and a target domain image; A fusion module, configured to semantically fuse the source domain image and the target domain image based on a spatial prior distribution matrix representing distribution features of multiple objects in each image of the source domain and a first semantic segmentation image of the target domain image to obtain a fused image; The fusion module is further used to perform semantic fusion on the first semantic segmentation image and the first annotation information of the source domain image to obtain second annotation information corresponding to the fused image; The generating module generates a sample image according to the fused image and the second annotation information corresponding to the fused image.

17. An image processing device, characterized in that: include: A second acquisition module, used for acquiring an image to be processed; The segmentation module is used to perform semantic segmentation processing on the image to be processed using a semantic segmentation network obtained based on any one of the methods described in claims 6 to 13 to obtain a semantic segmentation result of the image to be processed.

18. An intelligent driving control device, characterized in that: include: A third acquisition module is used to acquire images collected by the driving device during driving; A detection module, configured to detect a target object in the image using a semantic segmentation network obtained based on the method described in any one of claims 6 to 13; The control module is used to control the travel device based on the detected target object.

19. A computer device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the method according to any one of claims 1 to 15 are performed.

20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, performs the steps of the method according to any one of claims 1 to 15.

Citation Information

Patent Citations

  • Domain adaptation via class-balanced self-training with spatial priors

    CN109724608A

  • Domain adaptive semantic segmentation method based on similarity space alignment

    CN110322446A