Model training method, semantic segmentation method, and model training method
The method uses pseudo-semantic labels and synthesized nighttime images to train a segmentation model, addressing the challenge of labeling nighttime images and enhancing model performance for nighttime semantic segmentation.
Patent Information
- Application Number
- JP2024019458
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-15
- Filing Date
- 2024-02-13
- Publication Date
- 2024-08-27
AI Technical Summary
Training semantic segmentation models for nighttime images is challenging due to the difficulty in labeling large numbers of nighttime images, which is time-consuming and requires significant effort, especially since content recognition at night is difficult.
A method involving a source daytime domain dataset with labeled images and a target daytime domain dataset without labels, using a trained daytime segmentation model to generate pseudo-semantic labels, and a latent diffusion model to synthesize nighttime images, followed by training a segmentation model with these generated images to improve performance on nighttime images.
Reduces training costs and enhances model performance by leveraging pseudo-semantic labels and synthesized nighttime images, increasing the number of training samples and improving segmentation accuracy.
Smart Images

Figure 2024116098000001_ABST
Abstract
Description
[Technical field]
[0001] The present disclosure relates generally to neural network based image processing, and in particular to a method for training a segmentation model for performing semantic segmentation on target domain nighttime images, a semantic segmentation method, and a method for training the segmentation model. [Background technology]
[0002] With the development of computer science and artificial intelligence, it is becoming more and more common and effective to use a computer to execute an artificial intelligence model to realize information processing. For example, a semantic segmentation model based on a neural network can be used to perform semantic segmentation on an input image. Specifically, the semantic segmentation model can predict the classification of each pixel of the input image.
[0003] Before performing semantic segmentation on the images in the test set, we need to iteratively train the initial model using images in the training dataset to tune the parameters of the model so that the model can output sufficiently good segmentation results.
[0004] Semantic segmentation of nighttime images can be used in autonomous driving, urban public space monitoring, river channel monitoring, etc. It is desirable to perform accurate semantic segmentation on nighttime images.
[0005] However, training a semantic segmentation model usually requires a large number of labeled samples. Labeling a large number of images is time-consuming and labor-intensive, and labeling training images is difficult, especially when the images are nighttime, because the image content is hard to recognize. Therefore, training a model suitable for semantic segmentation of nighttime images is a difficult task. Summary of the Invention [Problem to be solved by the invention]
[0006] The following presents a simplified summary of the disclosure in order to provide a basic understanding of aspects of the disclosure. It is not intended to be an exhaustive overview of the disclosure, nor is it intended to intentionally identify key or critical portions of the disclosure or to intentionally limit the scope of the disclosure. However, it is merely intended to introduce concepts in a simplified form as a prelude to the more detailed description that is presented later.
[0007] Considering the demand for segmentation models suitable for semantic segmentation of nighttime images in various fields and the difficulty of training such segmentation models, the inventors have devised the technical solution of the present disclosure. The technical problems that the embodiments of the present disclosure aim to solve include, but are not limited to, at least one of the following problems: Reduce the training cost and improve the performance of the model. [Means for solving the problem]
[0008] In one aspect of the disclosure, a method for training a segmentation model for performing semantic segmentation on target domain night images includes the steps of: training a day segmentation model using a source day domain dataset including source day images with semantic labels and a target day domain dataset including target day images without semantic labels; determining semantic segmentation results of target day images in the target day domain dataset using the trained day segmentation model as pseudo semantic labels for the target day images; and determining a pseudo semantic label for the target day images based on the source day domain dataset including the source day images with semantic labels and the target day domain dataset including the target day images with the pseudo semantic labels. training a latent diffusion model using a target night domain dataset including target night images with the same pseudo semantic labels as corresponding target day images; generating source night images corresponding to the source day images using the trained latent diffusion model; training the segmentation model using the source day domain dataset including the source day images with semantic labels, a source night domain dataset including source night images with the same semantic labels as corresponding source day images, the target day domain dataset including the target day images with the pseudo semantic labels, and the target night domain dataset including the target night images with the same pseudo semantic labels as corresponding target day images.
[0009] Another aspect of the present disclosure provides a semantic segmentation method, comprising: performing semantic segmentation on target domain night-time images in a test set using a segmentation model trained using the above-mentioned method for training a segmentation model.
[0010] In another aspect of the disclosure, an apparatus for training a segmentation model for performing semantic segmentation on target domain night images includes a memory having instructions stored therein and at least one processor coupled to the memory, the at least one processor performing the steps of: training a day segmentation model using a source day domain dataset including source day images with semantic labels and a target day domain dataset including target day images without semantic labels; determining semantic segmentation results of target day images in the target day domain dataset as pseudo semantic labels for the target day images using the trained day segmentation model; and determining a pseudo semantic label for the target day images using the source day domain dataset including the source day images with semantic labels and the target day images with the pseudo semantic labels. training a latent diffusion model using the target daytime domain dataset including the source daytime images with semantic labels, and a target night domain dataset including target night images with the same semantic labels as the corresponding target daytime images; generating source night images corresponding to the source daytime images using the trained latent diffusion model; training the segmentation model using the source daytime domain dataset including the source daytime images with semantic labels, a source night domain dataset including source night images with the same semantic labels as the corresponding source daytime images, the target daytime domain dataset including the target daytime images with the pseudo semantic labels, and the target night domain dataset including the target night images with the same pseudo semantic labels as the corresponding target daytime images.
[0011] Another aspect of the present disclosure is a computer-readable non-transitory storage medium having a program stored thereon, the program, when executed by a computer, comprising the steps of: training a day segmentation model using a source day domain dataset including source day images with semantic labels and a target day domain dataset including target day images without semantic labels; determining semantic segmentation results of target day images in the target day domain dataset using the trained day segmentation model as pseudo semantic labels of the target day images; and determining a pseudo semantic label for the target day images using the source day domain dataset including the source day images with semantic labels and the target day domain dataset including the target day images with the pseudo semantic labels. training a latent diffusion model using a latent diffusion model generated from the source night domain dataset including the source day images with semantic labels, a source night domain dataset including source night images with the same semantic labels as the corresponding source day images, the target day domain dataset including the target day images with the pseudo semantic labels, and the target night domain dataset including the target night images with the same pseudo semantic labels as the corresponding target day images.
[0012] Another aspect of the present disclosure provides a computer-readable non-transitory storage medium having a program stored thereon, the program, when executed by a computer, causing the computer to perform a step of performing semantic segmentation on target domain night-time images in a test set using a segmentation model trained using the above-mentioned method for training a segmentation model.
[0013] Advantageous effects of the disclosed method, apparatus, and storage medium include at least one of the following advantageous effects: Reduce training costs and improve model performance. [Brief description of the drawings]
[0014] In order to make the above and other objects, features and advantages of the present disclosure more easily understandable, the following describes the embodiments of the present disclosure with reference to the drawings. It should be noted that the drawings are merely for illustrating the principles of the present disclosure. The drawings do not necessarily depict the size and relative positions of each part according to scale. The same reference numerals may denote the same features. [Figure 1] 1 is a flowchart illustrating an example of a method for training a segmentation model according to one embodiment of the present disclosure. [Diagram 2] FIG. 2 is a schematic diagram illustrating a method for training a segmentation model according to one embodiment of the present disclosure. [Diagram 3] FIG. 2 is a schematic diagram illustrating an example of a first domain hostile network according to one embodiment of the present disclosure. [Figure 4] FIG. 2 is a block diagram illustrating an example of a latent diffusion model according to one embodiment of the present disclosure. [Diagram 5] FIG. 2 illustrates an example of a method for generating a source nighttime image according to one embodiment of the present disclosure. [Figure 6] 1A-1C are schematic diagrams illustrating composite images of various image synthesis models. [Figure 7] FIG. 2 is a schematic diagram illustrating an example of a second domain hostile network in accordance with one embodiment of the present invention; [Figure 8] FIG. 2 is a block diagram illustrating an example of an apparatus for training a segmentation model suitable for semantic segmentation of target domain night-time images in accordance with one embodiment of the present disclosure. [Figure 9] 1 is a block diagram showing an example of an information processing device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0015] The following describes exemplary embodiments of the present disclosure with reference to the drawings. For convenience of description, the specification does not show all the features of the actual embodiment. However, when a person skilled in the art realizes the embodiment, he or she may make certain decisions to realize the embodiment, and these decisions may be changed according to the embodiment.
[0016] It should be noted that, for clarity of the present disclosure, the drawings show only the device components and / or process steps closely related to the present disclosure, and omit details unrelated to the present disclosure.
[0017] It should be noted that the present disclosure is not limited to the described embodiments, which will be described below with reference to the accompanying drawings. In this specification, where feasible, the embodiments may be combined with each other, features of different embodiments may be substituted or utilized, and one or more features may be omitted in one embodiment.
[0018] Computer program code for carrying out operations of each aspect of the exemplary embodiments disclosed herein may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages, such as the "C" programming language or similar programming languages.
[0019] The methods of the present disclosure may be implemented by circuitry having corresponding functional configurations, including circuitry for a processor.
[0020] One aspect of the present disclosure relates to a method for training a segmentation model sM suitable for semantic segmentation of target domain nighttime images, the method may be computer-implemented.
[0021] The following exemplarily describes a method 100 for training a segmentation model sM according to one embodiment of the present invention with reference to FIG.
[0022] FIG. 1 is a flow chart illustrating an example of a method 100 for training a segmentation model sM according to one embodiment of the present disclosure. The model sM is suitable for semantic segmentation of target domain night images. The trained model sM is capable of predicting the semantic classification of each pixel in a test image, e.g., “road”, “pedestrian”, “sky”, “bus”, “train”, “rider”, “car”, etc. The method 100 trains a source daytime image I S_d , Target daytime image I T_d ,Target night image I S_n and source night image I S_n Here, the source daytime images are represented by a source daytime domain dataset S_dD corresponding to the source daytime domain S_dD. S_d A target daytime domain dataset S corresponding to the target daytime domain T_dD is constructed as a plurality of target daytime images. T_d A target night domain dataset S corresponding to the target night domain T_nD is constructed as a set of target night images. T_n Source daytime image I S_d are training sample images with semantic labels, and the semantic labels are GT S_d The semantic labels may be manually labeled labels. T_d The target night image I has no semantic labels. T_nIn one example, the source daytime domain dataset S S_d are 2975 labeled images in the common dataset Cityscapes, and the target daytime domain dataset S T_d are 2416 unlabeled daytime images in the common dataset "Dark Zurich". The target nighttime domain dataset S T_n are 2416 unlabeled nighttime images in the common dataset "Dark Zurich". Here, we consider one target daytime image I T_d and one corresponding target nighttime image corresponding to the same scene I T_dand constitute an image pair, in which two images in the image pair correspond to the same scene, but one is taken during the day and the other is taken at night (e.g., two images taken at the same location from the same viewpoint during the day and at night). The input target domain (including the target day domain and the target night domain) samples in the method 100 are not labeled with semantic labels (e.g., the semantic labels are not manually labeled), which can reduce the training cost and reduce the difficulty of obtaining a large number of target domain samples. A large number of samples of the target domain improves the performance of the trained segmentation model sM. For example, the more training samples of the target domain, the more accurate the segmentation result by the segmentation model sM is, and the higher the mean intersection over union (mIoU) is. Aspects of the present disclosure relate to semantic segmentation of images, which essentially belongs to pixel-level classification problems of images, and when referring to the semantic labels of an image, unless otherwise stated, it means a label array (semantic map) of semantic classification labels of all pixels in the image, which label array corresponds to the pixel array of the image. Before performing the model training method 100, the input in the method 100 includes target domain images (including target daytime images and target nighttime images) and daytime images labeled with source domain semantic labels, where the input target domain images (including target daytime images and target nighttime images) do not have semantic labels. The trained segmentation model obtained by performing the method 100 is suitable for performing semantic segmentation on images from the target domain.
[0023] As shown in FIG. 1, in step Op101, a semantic label GT S_d Source daytime image with I S_d Source daytime domain dataset S including S_dand the target daytime image I without semantic labels. T_d A target daytime domain dataset S containing T_d The daytime segmentation model dM is trained using the source daytime domain dataset S. This training process is an iterative training. Each iterative training round includes calculating a loss function and adjusting the network parameters of the daytime segmentation model dM based on the loss. For example, gradient descent is used to adjust the network parameters and incrementally improve the model's performance. In one example, in this step, the source daytime domain dataset S S_d and the target daytime domain dataset S T_d Scan all images in .
[0024] In step Op103, the trained daytime segmentation model dM is used to generate a target daytime domain dataset S T_d Target daytime image I T_d Semantic segmentation results for target daytime image I T_d Pseudo-semantic label PL T_d This determines the pseudo-semantic label PL T_d For each target daytime image I T_d The target daytime image I can be constructed as a label. T_d After the pseudo-semantic labels are constructed for the target daytime images I based on the labels, as in normal sample training. T_d We can train a segmentation model using the target daytime image I T_d This overcomes the problem that the labels of the target daytime region dataset S are insufficient and supervised learning cannot be performed. T_d For each target daytime image in, we generate pseudo-semantic labels.
[0025] In step Op_105, a source daytime domain dataset S containing source daytime images with semantic labels is S_dand a target daytime domain dataset S, which contains target daytime images annotated with pseudo-semantic labels. T_d and a target nighttime image I with the same pseudo-semantic labels as the corresponding target daytime image. T_n A target night domain dataset S containing S_n In other words, in this step, we train a latent diffusion model using three data sets S S_d , S T_d , S S_n Here, two images in a “day-night” image pair, which correspond to the same scene in the target domain (i.e., the union of the target day domain T_dD and the target night domain T_nD), have the same semantic label, which is determined for the corresponding target day image in the corresponding step Op103 using the pseudo-label PL T_d In one example, in this step, the source daytime domain data set S S_d , the target daytime domain dataset S T_d and the target night domain dataset S T_n Scan all images in . The latent diffusion model (LDM) is a model based on neural networks.
[0026] In step Op_107, the trained latent diffusion model LDM is used to extract the source daytime image I S_d Source nighttime image I corresponding to S_n We generate a pair of “day-night” images (I S_d , I S_n ) have the same semantic label, which is the labelled label GT of the corresponding source daytime image. In one example, in this step, the source night domain dataset S S_dFor each source daytime image in, generate a corresponding source nighttime image. S_d is a real photo taken during the day at the source domain location, and the source daytime image I S_d Source nighttime image I corresponding to S_n I S_d , the composite image having characteristics representative of a nighttime scene.
[0027] In step Op_109, a source daytime domain dataset S containing source daytime images with semantic labels is S_d and a source night domain dataset S that contains source night images with the same semantic labels as the corresponding source day images. S_n and a target daytime domain dataset S, which contains target daytime images annotated with pseudo-semantic labels. T_d and a target night domain dataset S that contains target night images with the same pseudo semantic labels as the corresponding target day images. S_n The segmentation model sM is trained using the source daytime domain dataset S. This training process is an iterative training. Each iterative training round includes calculating a loss function and adjusting the network parameters of the daytime segmentation model dM based on the loss. For example, gradient descent is used to adjust the network parameters to incrementally improve the model's performance. In one example, in this step, the source daytime domain dataset S S_d ,Source night domain dataset S S_n , the target daytime domain dataset S T_d and the target night domain dataset S S_n Scan all images in . The trained segmentation model sM is suitable for semantic segmentation of target domain images (including target domain daytime images and target domain nighttime images).
[0028] As can be seen from the above training process, the training method for the segmentation model sM according to the present disclosure is a multi-layer unsupervised domain adaptation (UDA) method.
[0029] The following exemplarily describes a training method 200 for training a segmentation model sM according to one embodiment of the present disclosure with reference to Fig. 2. The model sM is suitable for semantic segmentation for target domain nighttime images.
[0030] FIG. 2 is a schematic diagram illustrating a method 200 for training a segmentation model sM according to one embodiment of the present disclosure.
[0031] As shown in FIG. 2, the method 200 is divided into three stages. In the first stage, Stage_1, a target daytime image I T_d Pseudo-label PL T_d In the second stage, Stage_2, the source night image I S_n In the third stage, Stage_3, a model sM is trained.
[0032] The first stage, Stage_1, includes two steps, namely, step Op_1.1 and step Op_1.2. In step Op_1.1, the semantic label GT S_d Source daytime image with I S_d Source daytime domain dataset S including S_d and the target daytime image I without semantic labels. T_d A target daytime domain dataset S containing T_d We train a daytime segmentation model,dM,using,and,.
[0033] In step Op1.2, the trained daytime segmentation model dM is used to generate a target daytime domain dataset S T_d Target daytime image S T_d We compare the semantic segmentation results of the target daytime image IT_d Pseudo-semantic label PL T_d It is determined as follows.
[0034] The second stage, Stage_2, includes two steps, namely, step Op_2.1 and step Op_2.2. In step Op_2.1, a source day domain dataset S 1 containing source day images with semantic labels is S_d and the target daytime domain dataset S, which contains target daytime images annotated with pseudo semantic labels. T_d and a target nighttime image I with the same pseudo-semantic labels as the corresponding target daytime image. T_n A target night domain dataset S containing S_n and train a latent diffusion model (LDM) using the above. In one example, when training the LDM, the input data is images in three domains, namely, I T_n , I T_d , I S_d , corresponding domain labels, i.e., T_n, T_d, S_d, and corresponding semantic labels, i.e., PL T_n , P.L. T_d , G.L. S_d One-hot embedding may be used to represent the three domain labels (T_d, T_n, S_d) 001, 010, and 100.
[0035] In step Op_2.2, the trained latent diffusion model LDM is used to extract the source daytime image I S_d Source nighttime image I corresponding to S_n In one example, we generate the semantic label GT S_d and based on the domain label equal to “T_n” (indicating the target night domain), S_d Source nighttime image I corresponding to S_n In addition, when synthesizing a source daytime image, semantic conditions and domain conditions are necessary. Here, the semantic conditions are GT S_dand the domain condition (corresponding to the domain label) is "T_n". The semantic condition is used to control the semantic label. The domain condition is used to control the style of the synthetic image, and in this step, the domain condition "T_n" is used to control the style of the synthetic image to a night style.
[0036] The third stage, Stage_3, comprises a step Op_3, which comprises training a segmentation model sM using the four domain datasets, where: For images in the source domain, the labeled true values GT are used as their labels, and for images in the target domain, the pseudo-labels PL determined in step Op_1.2 are used as their labels. In one example, the initial segmentation pattern sM before training in step Op_3 may be dM after training in step Op_1.1. Note that the initial segmentation model sM may be a randomly initialized neural network of semantic segmentation.
[0037] The following further describes the training of the daytime segmentation model dM in the methods 100, 200.
[0038] 3 is a schematic diagram illustrating an example of a first domain adversarial network AdvNet1 according to one embodiment of the present disclosure. In this embodiment, a daytime segmentation model dM is trained based on the first domain adversarial network AdvNet1. As shown in FIG. 3, the first domain adversarial network AdvNet1 includes a first image semantic segmentation network S1 and a first classifier network D dThe first image semantic segmentation network S1 is for predicting the semantic segmentation result of the input image and corresponds to the daytime segmentation model dM. The trained first image semantic segmentation network S1 may be used as the daytime segmentation model dM for generating the subsequent pseudo tag. The first image semantic segmentation network S1 includes a backbone network for extracting classification features and a classification header for classification. As shown in FIG. 3, a source daytime image I S_d After being processed by network S1, the output predicted semantic segmentation result is "P S_d " Target daytime image I T_d After being processed by network S1, the output predicted semantic segmentation result is "P T_d The first classifier network Dd classifies which domain the input image is from based on the semantic segmentation result P, i.e., whether the input image is from the source day domain S_dD or the target day domain T_dD. As shown in equation (1), the step of training the day segmentation model is a total loss L total The method includes optimizing a first image semantic segmentation network S1 based on
[0039]
number
[0040]
number
[0041] Target daytime image classification result D d (P T_d ) and the domain labels of the source daytime images. adv may be calculated based on equation (3).
[0042]
number
[0043] As shown in Equation (4), the step of training the daytime segmentation model is to obtain the classification result D of the target daytime image. d (P T_d ) and the classification result of the source daytime image D d (P S_d ) based on the first classifier network D d The method includes optimizing the above-mentioned.
[0044]
number
[0045] The training of the latent diffusion model LDM in methods 100 and 200 is further described below.
[0046] 4 is a block diagram illustrating an example of a latent diffusion model LDM according to one embodiment of the present disclosure. The latent diffusion model LDM includes an encoding module ε, a diffusion module d_M, a conditional module c_M, a denoising module dn_M, and a decoding module D.
[0047] The encoding module ε encodes a mixed image x obtained by mixing a first image x1 and a second image x2 in an input image pair (x1, x2) and determines an encoding feature z that maps the mixed image x from a pixel space Sp to a latent space Sl. Each of x1 and x2 may be from any one of a source day domain, a target day domain, and a target night domain.
[0048] The diffusion module d_M performs a diffusion process on the encoded feature z to obtain a Gaussian feature z with a preset Gaussian noise. T Generate.
[0049] The multi-layer denoising module (denoising module is denoted as “dn_M”) decomposes Gaussian features z T , condition feature cF and link feature z t’ Based on the Gaussian feature z T Generate Gaussian noise-free latent features z' corresponding to the Gaussian features z T By concatenating ("Concat") the condition feature cF with the concatenated feature z t’ The input of the first layer denoising module in the multi-layer denoising module is the connected feature z t’The input of the cross attention module QKV in each layer of the denoising module includes the condition feature cF. In one example, the denoising module dn_M is a U-Net network (outside 2) TIFF2024116098000007.tif14170. The input of the cross attention module includes two parts, namely, a first input and a second input. For the first hierarchical cross attention module, the first input is the connected feature, and the second input is the condition feature cF related to the connected feature of the semantic map feature and the domain label feature. The cross attention module is obtained by calculating the relationship (e.g., similarity) between each two elements in the union.
[0050] The condition module c_M generates condition features cF based on the semantic labels x1.L, x2.L and the domain labels x1.domain_label, x2.domain_label of the two images in an image pair (x1, x2).
[0051] The decoding module D decodes the latent features z' and maps the latent features from the latent space Sl to the pixel space Sp. (Outside 3) Determine TIFF2024116098000008.tif17170.
[0052] The condition module c_M evaluates the semantic map features Cond s1 and domain label feature Cond d1 and the semantic map feature Cond of the second image x2 in the image pair are concatenated as the first condition concatenation feature Cond1. s2 and domain label feature Cond d2 The first conditional concatenation feature Cond1 and the second conditional concatenation feature Cond2 are combined as a mixed conditional feature Cond, and dimension reduction (network τ θ(This is realized by the following) to obtain the condition feature cF. That is, when synthesizing the condition feature, two conditions, namely, the semantic map condition and the domain label condition, are considered. The semantic map feature Cond s1 The shape of Cond may be represented as [b,c,h,w], where b is the number of image pairs in the current training batch, c is the number of channels, h is the image height, and w is the image width. d1 The shape of the network τ may be represented as [b,d,h,w], where d is the number of types of domain labels and its value is "3", which may be generated by one-hot coding of the domain labels of image x1. The shape of the first conditional concatenation feature Cond1 is [b,c+d,h,w]. θ The mixed condition feature Cond is used as the Gaussian feature z T For example, the Gaussian feature z T has shape [b,3,64,64], then the conditional feature cF also has shape [b,3,64,64], and the Gaussian feature z T The concatenated feature z obtained by concatenating the condition feature cF and t’ The shape of b is [b,6,64,64], where the semantic map of an image corresponds to the semantic labels of the image.
[0053] The mixture x1, x2 may be expressed by formula (5).
[0054]
number
[0055]
number
[0056]
number
[0057] 5 illustrates an example of a method 500 for generating a source nighttime image according to one embodiment of the present disclosure. The method 500 uses a trained latent diffusion model LDM to generate a source daytime image I S_d Source nighttime image I corresponding to S_n Specifically, we use a trained latent diffusion model to generate a source daytime image I S_d Semantic label of G S_d Based on the domain label “T_n” indicating the target night domain, a source night image corresponding to the source day image is generated. S_d Semantic map feature Cond s and domain label feature Cond d The condition feature Cond is concatenated with the network τ θ The multi-layer denoising module uses the Gaussian features z T, based on the conditional features and the connected features, generate Gaussian noise-free latent features z′ corresponding to the Gaussian features. Finally, the decoding module D decodes the latent features z′ and generates a decoded image, which maps the latent features z′ from the latent space S l to the pixel space S p . (outside 5) TIFF2024116098000013.tif15170 is the composite source daytime image I S_n Here, the Gaussian feature z used in synthesizing the source night image is T is randomly sampled from a single Gaussian distribution.
[0058] The inventor of the present invention has conducted a test on the latent diffusion model for the synthetic image according to the present disclosure. FIG. 6 is a schematic diagram showing synthetic images of various image synthesis models. The test results show that the latent diffusion model according to the present disclosure has a positive effect. Since multiple conditions (including semantic conditions for the semantic map of the first image and the second image, and domain label conditions for the domain labels of the first image and the second image) are used, it is possible to learn from multiple domains and generate synthetic images including dynamic objects, overexposed features, underexposed features, diverse objects, and high-quality image quality (close to photorealistic). The technology according to the present disclosure is advantageous in increasing the number of training samples and improving the quality of the training samples for the synthesis of images using a multi-condition multi-domain latent diffusion model (Multi-domain multi-condition LDM: MDMC-LDM). The multi-condition LDM model is advantageous in synthesizing higher quality night images. In contrast, a single-condition (i.e., only using the semantic condition of a single image of the domain during training) latent diffusion model cannot control the style (e.g., night style) of the generated synthetic image well enough; for example, the synthesized night image only has reduced brightness and lacks the features of overexposure (e.g., overexposure due to street lights at night) and underexposure (see the schematic diagram in row (a) of Figure 6. Note that the original image is a color image (similar below)). When synthesizing images using a mixed-mode LDM including concatenation mode and cross-attention mode, it is advantageous to obtain high-quality images, while when only concatenation mode is used (i.e., concatenating Gaussian features and condition features, obtaining the concatenated features as the input of the denoising module, and not using the cross-attention mechanism during denoising), the semantic requirements can be met, but the quality of the synthetic image is low.If only the cross-attention mode is used (not concatenating the Gaussian feature with the conditional feature, and only the Gaussian feature is used as the input of the denoising module, and the cross-attention mechanism is used to obtain the attention value for each conditional feature of each pixel in the Gaussian noise, and the attention value and the Gaussian feature are multiplied to obtain the output of the denoising module), the model is not stable, and the quality of the synthetic image may be high but not satisfy the semantic condition or the domain condition, and the quality of the synthetic image may be low (see the schematic diagram in row (b) of FIG. 6). When training the LDM, the mixup operation is favorable to improving the performance of the model and improving the quality of the synthetic image. Without the mixup operation, the quality of the synthetic image will be poor, and dynamic objects (e.g., people, cars, etc., which are common objects during the day but rare objects at night. See the schematic diagram in row (c) of FIG. 6) cannot be synthesized. When considering three domains (source daytime domain, target daytime domain, and target nighttime domain) when training the LDM, the quality of the synthesized images is improved (e.g., object diversity is improved, see the schematic diagram in row (d) of Figure 6) due to the increased number of samples compared to when considering only one domain (target nighttime domain) or two domains (target daytime domain and target nighttime domain). Also, one GT. S_d When generating (i.e., synthesizing) source night images using MDMC-LDM in, we also use a random seed. By changing the random seed used for each image generation, we may generate different source night images with the same meaning. Using high-quality synthetic images as training images is advantageous for improving the performance of the trained segmentation model.
[0059] The training of the segmentation model sM in the methods 100 and 200 is further described below.
[0060] FIG. 7 is a schematic diagram illustrating an example of a second domain adversarial network AdvNet2 according to one embodiment of the present invention.
[0061] In this embodiment, a segmentation model sM is trained based on a second domain adversarial network AdvNet2. As shown in FIG. 7, the second domain adversarial network AdvNet2 includes a light enhancement network E, a second semantic segmentation network S2, and a multiple classifier network D d , D n , D n2 The light gain network E generates a light gain image of the input image. Based on the generated light gain image, the light gain loss L light The second semantic segmentation network S2 predicts the semantic segmentation result P of the light-increased image. Based on the semantic segmentation result P, the source nighttime segmentation loss L seg_sn , the source daytime segmentation loss L seg_sd , static loss L static The classifier network D d Based on the semantic segmentation result P, classifies whether the input image is from the source day domain or the target day domain. The classifier network D n Based on the semantic segmentation result P, classifies whether the input image is from the source daytime domain or the target nighttime domain. The classifier network D n2 Based on the semantic segmentation result P, we identify whether the input image is from the source night domain or the target night domain. As shown in (8), training a segmentation model sM reduces the total loss L total The method includes optimizing a light increase network E and a second semantic segmentation network S2 based on the light increase network E and the second semantic segmentation network S2 (the segmentation model sM includes the light increase network E and the second semantic segmentation network S2).
[0062]
number
[0063]
number
[0064]
number
[0065]
number
[0066]
number
[0067] Reference 2: Wu, Xinyi, et al. “Dannet: A one-stage domain adaptation network for unsupervised nighttime semantic segmentation.” Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition.2021.
[0068] As shown in equation (13), training the segmentation model sM involves training the daytime classifier network D based on the daytime loss Ld. d This includes optimizing the
[0069]
number
[0070]
number
[0071]
number
[0072] Tests using the common dataset Cityscapes (serving as the source daytime domain dataset) and the common dataset “Dark Zurich” (serving as the target daytime domain dataset and the target nighttime domain dataset) show that the segmentation model sM according to the present disclosure is able to achieve an average union intersection of 46.92% compared to the average union intersection of 44.13% of the DANNet model in Reference 2, thereby improving performance.
[0073] In one embodiment of the present disclosure, a computer-readable non-transitory storage medium having a program stored thereon is provided, which, when executed by a computer, causes the computer to: train a day segmentation model using a source day domain dataset including source day images with semantic labels and a target day domain dataset including target day images without semantic labels; determine semantic segmentation results of target day images in the target day domain dataset using the trained day segmentation model as pseudo semantic labels of the target day images; and determine the pseudo semantic labels of the target day images identical to the source day domain dataset including the source day images with semantic labels and the target day domain dataset including the target day images with the pseudo semantic labels, corresponding to the target day images. and a target night domain dataset including target night images with pseudo semantic labels, training a latent diffusion model using the trained latent diffusion model to generate source night images corresponding to the source day images, and training the segmentation model using the source day domain dataset including the source day images with semantic labels, the source night domain dataset including source night images with the same semantic labels as the corresponding source day images, the target day domain dataset including the target day images with the pseudo semantic labels, and the target night domain dataset including the target night images with the pseudo semantic labels. For further details of the above operations, reference may be made to the descriptions of methods 100 and 200.
[0074] An example application of the methods 100 and 200 may be to process a test set using the trained segmentation model sM to obtain semantic segmentation results for the test images.
[0075] In one embodiment of the present disclosure, there is provided a method for semantic segmentation, the method including performing semantic segmentation on target domain nighttime images in a test set using a segmentation model trained using the method for training a segmentation model described above.
[0076] In one embodiment of the present disclosure, a storage medium for image classification is provided. In one embodiment of the present disclosure, the storage medium is a computer-readable non-transitory storage medium having a program stored therein. When the program is executed by a computer, the computer is caused to perform a step of performing semantic segmentation on target domain nighttime images in a test set using a segmentation model sM trained using the method 100 or 200.
[0077] In one embodiment of the present disclosure, an apparatus for training a segmentation model suitable for semantic segmentation of a target domain night image is provided. The following is illustratively described with reference to Fig. 8. Fig. 8 is a block diagram illustrating an example of an apparatus 800 for training a segmentation model suitable for semantic segmentation of a target domain night image according to one embodiment of the present disclosure. The apparatus 800 includes a memory 801 having instructions stored therein, and at least one processor 803 coupled to the memory 801 and configured to execute the instructions. At least one processor 803 includes steps of: training a day segmentation model using a source day domain dataset including source day images with semantic labels and a target day domain dataset including target day images without semantic labels; determining, using the trained day segmentation model, semantic segmentation results of target day images in the target day domain dataset as pseudo semantic labels of the target day images; and determining, using the source day domain dataset including the source day images with semantic labels, the target day domain dataset including the target day images with the pseudo semantic labels, and the pseudo semantic labels identical to the corresponding target day images. training a latent diffusion model using a target night domain dataset including target night images having the same semantic labels as the corresponding source day images; generating source night images corresponding to the source day images using the trained latent diffusion model; training the segmentation model using the source day domain dataset including the source day images with semantic labels, a source night domain dataset including source night images having the same semantic labels as the corresponding source day images, the target day domain dataset including the target day images with the pseudo semantic labels, and the target night domain dataset including the target night images with the pseudo semantic labels and the target night images having the same pseudo semantic labels as the corresponding target day images.For further details of the above operations, reference may be made to the descriptions of methods 100 and 200.
[0078] The present disclosure further provides an information processing device. Fig. 9 is a block diagram showing an example of an information processing device 900 according to an embodiment of the present invention. In Fig. 9, a central processing unit (CPU) 901 executes various processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage unit 908 to a random access memory (RAM) 903. The RAM 903 stores data necessary for the CPU 901 to execute various processes as necessary.
[0079] The CPU 901, the ROM 902, and the RAM 903 are connected to one another via a bus 904. An input / output interface 905 is also connected to the bus 904.
[0080] An input unit 906 (including a keyboard, a mouse, etc.), an output unit 907 (including a display, such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.), a storage unit 908 (including, for example, a hard disk, etc.), and a communication unit 909 (including a network interface card, such as a LAN card, a modem, etc.) are connected to the input / output interface 905. The communication unit 909 executes communication processing via a network, such as the Internet, a local area network, a mobile network, or a combination thereof.
[0081] If necessary, the driver 910 may be connected to the input / output interface 905. The removable medium 911 is, for example, a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, and is set up in the driver 910 as necessary, and a computer program read from the removable medium 911 is installed in the storage unit 908 as necessary.
[0082] The CPU 901 may execute a program corresponding to a method for training a segmentation model and a method for semantic segmentation.
[0083] The advantageous effects of the method, apparatus, and storage medium according to the present disclosure include at least one of the following advantageous effects: It is possible to synthesize high-quality training images, realize unsupervised main adaptive training, reduce training costs, and improve model performance.
[0084] As described above, the present disclosure has described the principles of generating a classification model. Note that the effects of the present disclosure are not necessarily limited to the effects described above, and any of the effects shown herein may be obtained or other effects may be understood from the present disclosure in addition to or in place of the effects described in the above paragraphs.
[0085] Although the above describes the specific embodiments of the present disclosure, those skilled in the art may make various modifications (combining or replacing the features of each embodiment in the case of lines), improvements or equivalents to the present disclosure within the spirit and scope of the appended claims. These modifications, improvements or equivalents belong to the scope of protection of the present disclosure. For example, the shelf in the space may be replaced with other obstacles that block the passage of the target.
[0086] It should be noted that the terms "including" and "having" refer to the presence of features, elements, steps or components described in this specification, but do not exclude the presence or addition of one or more other features, elements, steps or components.
[0087] Furthermore, the methods of the embodiments of the present invention are not limited to being performed in the order of time described in the specification or shown in the drawings, and may be performed in other orders of time, or may be performed in parallel or independently. Therefore, the order of performing the methods described herein does not limit the technical scope of the present invention.
[0088] Furthermore, the following supplementary notes are disclosed regarding the embodiments including the above-mentioned examples, but the present invention is not limited to these supplementary notes. (Appendix 1) 1. A method for training a segmentation model for performing semantic segmentation on target domain nighttime images, comprising: training a day segmentation model using a source day domain dataset including source day images with semantic labels and a target day domain dataset including target day images without semantic labels; determining a semantic segmentation result of a target daytime image in the target daytime domain dataset as a pseudo semantic label of the target daytime image using the trained daytime segmentation model; training a latent diffusion model using the source daytime domain dataset including the source daytime images with semantic labels, the target daytime domain dataset including the target daytime images with the pseudo semantic labels, and a target nighttime domain dataset including target nighttime images with the same pseudo semantic labels as the corresponding target daytime images; generating a source nighttime image corresponding to the source daytime image using the trained latent diffusion model; training the segmentation model using the source day domain dataset including the source day images with semantic labels, a source night domain dataset including source night images with identical semantic labels as the corresponding source day images, the target day domain dataset including the target day images with the pseudo semantic labels, and the target night domain dataset including the target night images with the same pseudo semantic labels as the corresponding target day images. (Appendix 2) 2. The method of claim 1, further comprising training the daytime segmentation model based on a first domain adversarial network. (Appendix 3) The first domain adversarial network comprises: A first image semantic segmentation network that predicts a semantic segmentation result of an input image; and a first classifier network that identifies which domain the input image is from based on the semantic segmentation result. (Appendix 4) Training a daytime segmentation model includes optimizing the first image semantic segmentation network based on a total loss; The total loss includes the segmentation loss and the adversarial loss, determining the segmentation loss based on the semantic segmentation result of the source daytime image and the semantic labels of the source daytime image; determining the adversarial loss based on the identification result of the target daytime image and the domain label of the source daytime image; 4. The method of claim 3, wherein the first image semantic segmentation network corresponds to the daytime segmentation model. (Appendix 5) The step of training the daytime segmentation model includes: 4. The method of claim 3, further comprising optimizing the first classifier network based on the classification results of the target daytime image and the classification results of the source daytime image. (Appendix 6) The latent diffusion model is an encoding module for encoding a blended image obtained by blending a first image and a second image of an input image pair and determining encoding features that map the blended image from a pixel space to a latent space; a diffusion module for performing a diffusion process on the encoded features to generate Gaussian features having a predetermined Gaussian noise; a multi-layer denoising module that generates Gaussian noise-free latent features corresponding to the Gaussian features based on the Gaussian features, conditional features and concatenated features; a conditional module that generates the conditional features based on semantic labels and domain labels of two images in the input image pair; a decoding module for decoding the latent features and determining a decoded image that maps the latent features from the latent space to the pixel space; Concatenating the Gaussian features and the conditional features to determine the concatenated features; an input of a first layer de-noising module in the multi-layer de-noising module includes the connected features; The method described in Appendix 1, wherein the input of the cross attention module in each layer of the denoising module includes the conditional features. (Appendix 7) The condition module includes: Concatenating the semantic map feature and the domain label feature of the first image as a first conditional concatenation feature; Concatenating the semantic map feature and the domain label feature of the second image in the input image pair as a second conditional concatenation feature; mixing the first condition linking feature and the second condition linking feature as a mixed condition feature; The method of claim 6, further comprising performing dimensionality reduction on the mixed conditional features to obtain the conditional features. (Appendix 8) generating a source nighttime image corresponding to the source daytime image using the trained latent diffusion model, 2. The method of claim 1, further comprising: using a trained latent diffusion model to generate a source night image corresponding to the source day image based on semantic labels of the source day image and domain labels indicating a target night domain. (Appendix 9) 2. The method of claim 1, further comprising training the segmentation model based on a second domain adversarial network. (Appendix 10) The second domain adversarial network comprises: A light augmentation network that generates a light augmented image of an input image; a second semantic segmentation network for predicting a semantic segmentation result of the increased light image; and and a plurality of classifier networks that identify which domain the input image is from based on the semantic segmentation result. (Appendix 11) The method of claim 9, wherein the total loss of the second domain adversarial network includes a source daytime segmentation loss, a source nighttime segmentation loss, a light increase loss, an adversarial loss, and a static loss. (Appendix 12) A semantic segmentation method comprising: performing semantic segmentation on target domain night-time images in a test set using a segmentation model trained using the method described in Appendix 1. (Appendix 13) 1. An apparatus for training a segmentation model for performing semantic segmentation on a target domain nighttime image, comprising: A memory having instructions stored therein; at least one processor coupled to the memory; The at least one processor: training a day segmentation model using a source day domain dataset including source day images with semantic labels and a target day domain dataset including target day images without semantic labels; determining a semantic segmentation result of a target daytime image in the target daytime domain dataset as a pseudo semantic label of the target daytime image using the trained daytime segmentation model; training a latent diffusion model using the source daytime domain dataset including the source daytime images with semantic labels, the target daytime domain dataset including the target daytime images with the pseudo semantic labels, and a target nighttime domain dataset including target nighttime images with the same pseudo semantic labels as the corresponding target daytime images; generating a source nighttime image corresponding to the source daytime image using the trained latent diffusion model; training the segmentation model using the source day domain dataset including the source day images with semantic labels, a source night domain dataset including source night images with identical semantic labels as corresponding source day images, the target day domain dataset including the target day images with the pseudo semantic labels, and the target night domain dataset including the target night images with the same pseudo semantic labels as corresponding target day images. (Appendix 14) 14. The apparatus of claim 13, further comprising: training the daytime segmentation model based on a first domain adversarial network. (Appendix 15) The first domain adversarial network comprises: A first image semantic segmentation network that predicts a semantic segmentation result of an input image; and a first classifier network that identifies which domain the input image is from based on the semantic segmentation result. (Appendix 16) Training a daytime segmentation model includes optimizing the first image semantic segmentation network based on a total loss; The total loss includes the segmentation loss and the adversarial loss, determining the segmentation loss based on the semantic segmentation result of the source daytime image and the semantic labels of the source daytime image; determining the adversarial loss based on the identification result of the target daytime image and the domain label of the source daytime image; 16. The apparatus of claim 15, wherein the first image semantic segmentation network corresponds to the daytime segmentation model. (Appendix 17) The step of training the daytime segmentation model includes: 16. The apparatus of claim 15, further comprising optimizing the first classifier network based on the classification results of the target daytime image and the classification results of the source daytime image. (Appendix 18) The latent diffusion model is an encoding module for encoding a blended image obtained by blending a first image and a second image of an input image pair and determining encoding features that map the blended image from a pixel space to a latent space; a diffusion module for performing a diffusion process on the encoded features to generate Gaussian features having a predetermined Gaussian noise; a multi-layer denoising module that generates Gaussian noise-free latent features corresponding to the Gaussian features based on the Gaussian features, conditional features and concatenated features; a conditional module that generates the conditional features based on semantic labels and domain labels of two images in the input image pair; a decoding module for decoding the latent features and determining a decoded image that maps the latent features from the latent space to the pixel space; Concatenating the Gaussian features and the conditional features to determine the concatenated features; an input of a first layer de-noising module in the multi-layer de-noising module includes the connected features; The apparatus of claim 13, wherein the input of the cross attention module in each hierarchical denoising module includes the conditional features. (Appendix 19) The condition module includes: Concatenating the semantic map feature and the domain label feature of the first image as a first conditional concatenation feature; Concatenating the semantic map feature and the domain label feature of the second image in the input image pair as a second conditional concatenation feature; mixing the first condition linking feature and the second condition linking feature as a mixed condition feature; 19. The apparatus of claim 18, further comprising: (Appendix 20) 14. The apparatus of claim 13, further comprising: training the segmentation model based on a second domain adversarial network.
Claims
1. 1. A method for training a segmentation model for performing semantic segmentation on target domain nighttime images, comprising: training a day segmentation model using a source day domain dataset including source day images with semantic labels and a target day domain dataset including target day images without semantic labels; determining a semantic segmentation result of a target daytime image in the target daytime domain dataset as a pseudo semantic label of the target daytime image using the trained daytime segmentation model; training a latent diffusion model using the source daytime domain dataset including the source daytime images with semantic labels, the target daytime domain dataset including the target daytime images with the pseudo semantic labels, and a target nighttime domain dataset including target nighttime images with the same pseudo semantic labels as the corresponding target daytime images; generating a source nighttime image corresponding to the source daytime image using the trained latent diffusion model; training the segmentation model using the source day domain dataset including the source day images with semantic labels, a source night domain dataset including source night images with identical semantic labels as the corresponding source day images, the target day domain dataset including the target day images with the pseudo semantic labels, and the target night domain dataset including the target night images with the same pseudo semantic labels as the corresponding target day images.
2. The method of claim 1 , further comprising training the daytime segmentation model based on a first domain adversarial network.
3. The first domain adversarial network comprises: a first image semantic segmentation network for predicting a semantic segmentation result of an input image; a first classifier network that identifies from which domain the input image is from based on the semantic segmentation result.
4. Training a daytime segmentation model includes optimizing the first image semantic segmentation network based on a total loss; The total loss includes the segmentation loss and the adversarial loss, determining the segmentation loss based on the semantic segmentation result of the source daytime image and the semantic labels of the source daytime image; determining the adversarial loss based on the identification result of the target daytime image and the domain label of the source daytime image; The method of claim 3 , wherein the first image semantic segmentation network corresponds to the daytime segmentation model.
5. The latent diffusion model is an encoding module for encoding a blended image obtained by blending a first image and a second image of an input image pair and determining encoding features that map the blended image from a pixel space to a latent space; a diffusion module for performing a diffusion process on the encoded features to generate Gaussian features having a predetermined Gaussian noise; a multi-layer denoising module that generates Gaussian noise-free latent features corresponding to the Gaussian features based on the Gaussian features, conditional features and concatenated features; a conditional module that generates the conditional features based on semantic labels and domain labels of two images in the input image pair; a decoding module for decoding the latent features and determining a decoded image that maps the latent features from the latent space to the pixel space; Concatenating the Gaussian features and the conditional features to determine the concatenated features; an input of a first layer de-noising module in the multi-layer de-noising module includes the connected features; The method of claim 1 , wherein an input of a cross-attention module in each layer of a denoising module includes the conditional features.
6. The condition module includes: Concatenating the semantic map feature and the domain label feature of the first image as a first conditional concatenation feature; Concatenating the semantic map feature and the domain label feature of the second image in the input image pair as a second conditional concatenation feature; mixing the first condition linking feature and the second condition linking feature as a mixed condition feature; The method of claim 5 , further comprising performing dimensionality reduction on the mixed conditional features into the conditional features.
7. generating a source nighttime image corresponding to the source daytime image using the trained latent diffusion model, 2. The method of claim 1, comprising: using a trained latent diffusion model to generate the source night image corresponding to the source day image based on semantic labels of the source day image and domain labels indicating a target night domain.
8. The method of claim 1 , further comprising training the segmentation model based on a second domain adversarial network.
9. A method for semantic segmentation comprising: performing semantic segmentation on target domain nighttime images in a test set using a segmentation model trained using the method of claim 1.
10. 1. An apparatus for training a segmentation model for performing semantic segmentation on a target domain nighttime image, comprising: A memory having instructions stored therein; at least one processor coupled to the memory; The at least one processor training a day segmentation model using a source day domain dataset including source day images with semantic labels and a target day domain dataset including target day images without semantic labels; determining a semantic segmentation result of a target daytime image in the target daytime domain dataset as a pseudo semantic label of the target daytime image using the trained daytime segmentation model; training a latent diffusion model using the source daytime domain dataset including the source daytime images with semantic labels, the target daytime domain dataset including the target daytime images with the pseudo semantic labels, and a target nighttime domain dataset including target nighttime images with the same pseudo semantic labels as the corresponding target daytime images; generating a source nighttime image corresponding to the source daytime image using the trained latent diffusion model; training the segmentation model using the source day domain dataset including the source day images with semantic labels, a source night domain dataset including source night images with identical semantic labels as corresponding source day images, the target day domain dataset including the target day images with the pseudo semantic labels, and the target night domain dataset including the target night images with the same pseudo semantic labels as corresponding target day images.
Citation Information
Cited By
Unsupervised pavement crack detection method and system based on de-noising diffusion model
CN119784764A
Method and device for training all atom structure prediction model, and electronic device
JP2025106517A
Methods for Visualizing and Analyzing the Image Generation Process of a Latent Diffusion Model, Computing Device, and Computer-Readable Medium thereof
KR103047145B1
Electronic device comprising image processing unit for removing noise from nighttime image and method for operating same
WO2026116541A1
