Method for training domain-adapted neural network, and associated device
The method trains a domain-adaptive neural network using stylized images to align feature representations across domains, addressing domain shift issues and improving semantic segmentation accuracy in varying conditions.
Patent Information
- Application Number
- JP2024021893
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-16
- Filing Date
- 2024-02-16
- Publication Date
- 2024-08-28
- Estimated Expiration
- 2044-02-16
AI Technical Summary
Existing semantic segmentation models struggle with domain shift issues when adapting from one domain to another, particularly when transitioning from normal to ill-conditioned conditions, due to the lack of labeled data and the high cost of manual labeling, leading to poor performance.
A method for training a domain-adaptive neural network using labeled source images and unlabeled target images, along with stylized versions of both, through a loss function that penalizes differences in features generated from these images, ensuring invariance to lighting and weather conditions, thereby improving semantic segmentation accuracy across domains.
The method enhances the accuracy of semantic segmentation by aligning feature representations across different domains, achieving better performance even in adverse conditions without the need for extensive manual labeling.
Smart Images

Figure 2024117086000001_ABST
Abstract
Description
[Background technology]
[0001] 1. Field of the Invention The present disclosure relates to the field of computer vision. More precisely, the present disclosure relates to neural networks that may be capable of generating semantic segmentations of images belonging to different domains.
[0002] 2. Description of Related Technology Machine learning techniques typically require huge amounts of labeled data associated with a given domain to obtain reliable performance. However, collecting and annotating large datasets corresponding to new domains is very costly, time-consuming, and error-prone. Furthermore, in some domains, sufficient training data is not available. And models trained on a dataset from one domain provide poor results when tested on data from another domain due to "domain shift."
[0003] However, it often happens that a large amount of data is available for another domain that happens to be related to the one under consideration, and it is therefore advantageous to adapt a learning model that is trained on examples from one domain to apply the task to examples from another domain.
[0004] Domain adaptation (DA) is a learning task that addresses this problem by considering the case of a model that is trained with samples from one or more domains (termed "source domains") and then configured to apply the task to samples from a different but related domain (termed "target domain"). The goal of domain adaptation is to address shifts between source and target domains that typically degrade the performance of a learning model by providing a model that is first trained on samples from a given domain, but then adapted to process samples from another domain related to the given domain. Domain adaptation is typically considered as a specific type of transfer learning, where the data distributions of the source and target domains are different, but the label spaces of the source and target domains are the same.
[0005] Adapting a model to process samples of a target domain by considering only samples from the source domain leads to poor performance, even when the domain shift present is small. To address this, unsupervised domain adaptation (UDA) techniques process labeled samples from the source domain and unlabeled samples from the target domain. UDA techniques are particularly useful for semantic segmentation, where learning models require a huge amount of manually labeled data, which is expensive to obtain because pixel-by-pixel labeling is required. Semantic segmentation is defined as the task of assigning to each pixel of an input image a label that represents its semantic content. Typically, an initial supervised training on the source domain is adapted to the target domain by an unsupervised learning method that aims to achieve reliable performance even on the target domain where no labels are available.
[0006] The technique is particularly adapted to bridge the gap between these synthetic data and real-world data. In fact, the computer graphics field generates a large amount of annotated synthetic data that can ultimately be used to train models dedicated to processing real-world data. The UDA technique then makes it possible to avoid the time-consuming and very expensive manual labeling required for real-world training data.
[0007] However, most feature-level adaptation methods validated in synthetic vs. real adaptation provide small gains in normal vs. adverse condition level adaptation.
[0008] Thus, there is room for improvement in the field of semantic segmentation models that are trained with data representing normal conditions, but are intended to process data representing adverse conditions. Summary of the Invention
[0009] To this end, the present invention first provides a computer-implemented method for training a domain-adaptive neural network to generate a semantic segmentation of an image, the method comprising: inputting at least one labeled source image belonging to a source domain, at least one unlabeled target image belonging to a target domain different from the source domain, at least one stylized source image, and at least one stylized target image into a neural network (F); training the neural network by minimizing a loss function that penalizes differences between features generated from at least one labeled source image and features generated from at least one stylized source image, and / or a loss function that penalizes differences between features generated from at least one target image and features generated from at least one stylized target image.
[0010] Thus, the above method proposes to train a neural network with labeled images belonging to a given domain (termed the "source domain") and unlabeled images belonging to another domain (termed the "target domain"), where the source images and at least one stylized source image are labeled, whereas the target image and at least one stylized target image are unlabeled.
[0011] However, the neural network is trained under the condition that the source image and at least one stylized source image input to the neural network show the same scene from the same viewpoint, and the at least one target image and at least one stylized target image show a different single scene from the same viewpoint.
[0012] As used herein, a "viewpoint" corresponds to a viewpoint relative to a camera used to capture an image of a scene.
[0013] The source and target images differ in their content and style, i.e., they represent scenes captured under different lighting and / or weather conditions. In an example, the source images belong to a source domain composed of scene images captured under normal conditions (e.g., daytime, about 20000 lux when the sky is bright blue), and at least one target image belongs to a target domain composed of a batch of scene images captured under adverse conditions (e.g., at night when the illuminance is below 1 lux or in foggy weather).
[0014] "Normal conditions" are defined herein as a combination of daylight and bright weather with no precipitation or snow on the ground, i.e., good visibility, whereas "bad conditions" includes "bad weather", possibly with precipitation and / or snow on the ground, and / or unfavorable light levels, i.e., poor visibility.
[0015] As described in further detail below, the at least one stylized source image is generated by mapping the style of the target image to the source image. In this way, the source image and the at least one stylized source image have similar structural content, and the at least one stylized source image has the style of the image belonging to the target domain. In other words, in the above method, only style information is exploited from the target image to generate the at least one stylized source image. Then, training attempts to reduce the distance between the features extracted from the source image and the at least one stylized source image, and since both images have similar structural content, the neural network is prompted to generate feature representations that are invariant to the styles of these input images.
[0016] Similarly, at least one stylized target image is generated by mapping the style of the source image to the target image. In this way, the target image and the at least one stylized target image have similar structural content, and the at least one stylized target image has the style of the image belonging to the source domain. In other words, in the above method, only style information is exploited from the source image to generate at least one stylized target image. The training also tries to reduce the distance between the features extracted from the target image and the features related to the at least one stylized target image, and since both images have similar structural content, the neural network is encouraged to generate feature representations that are invariant to the styles of these input images.
[0017] A neural network is trained to generate a semantic segmentation of an input image. The goal of semantic segmentation is to assign to each pixel of the input image a label that represents its semantic content. Semantic segmentation differs from image classification in that in image classification, a single label is assigned to the entire scene, which label indicates the dominant object in the scene. Semantic segmentation also differs from object detection in that in object detection, objects are identified by bounding boxes and a label is assigned to each box.
[0018] Semantic segmentation of an input image results in the image being clustered into regions corresponding to different objects and structures labeled with categories that represent its semantic content.
[0019] A "category" of an object may be referred to as a type or class of object, as is commonly done by those skilled in the art of object detection or semantic segmentation. As an example, a category may be selected from a list of object categories typically present in scenes observed on roads. For example, a category may be selected in a list comprising cars, pedestrians, cyclists, buses, trucks, etc. The categories may also be more precisely defined (e.g., for cars it is possible to consider sedans, compact cars, etc.).
[0020] Training of the neural network can be done iteratively, in which case multiple source images and multiple target images represent different scenes, each with different structural content, and multiple stylized source images and stylized target images are then generated and the training step is applied iteratively.
[0021] The neural network is trained by minimizing a loss function that penalizes differences between features extracted from the images. The differences may be expressed as distances, and after multiple distances are calculated (in the case of batch training), stochastic gradient descent or any other suitable training algorithm or variant of stochastic gradient descent may be used. Stochastic gradient descent may be used to adapt the weights of the neural network. The training method according to the invention includes minimizing the loss function, for example backpropagating this loss.
[0022] In certain implementations, the labeled source image and at least one unlabeled target image are captured under different lighting and / or weather conditions.
[0023] In a particular implementation, at least one stylized source image is generated by applying a stylization method to a source image, the stylization method maintaining the structural content of the source image, and the at least one stylized source image having a style of an image belonging to a target domain.
[0024] In a particular implementation, at least one stylized target image is generated by applying a stylization method to a target image, the stylization method maintaining the structural content of the target image, and the at least one stylized target image having a style of an image belonging to a source domain.
[0025] In a particular implementation, the neural network includes an encoder configured to generate intermediate features, and minimizing the loss function prompts the encoder to generate intermediate features that are invariant to lighting and / or weather conditions.
[0026] In certain implementations, the labels of the source images are used as ground truth for supervising the semantic segmentation prediction of the source images.
[0027] In certain implementations, the neural network further comprises a decoder configured to parse the generated features into "semantic classes" or "categories."
[0028] As mentioned above, the concept of "category" may be referred to as a type or class of object, as is commonly done by those skilled in the art of object detection or semantic segmentation.
[0029] In a particular implementation, the loss function is: a first feature invariant loss that penalizes differences between features generated from at least one labeled source image and features generated from at least one stylized source image, the at least one stylized source image having the same structural content as the labeled source image; a second feature invariant loss that penalizes differences between features generated from at least one target image and at least one stylized target image, the at least one stylized target image having the same structural content as the target image; Source Image I S Set of labels Y S The cross-entropy error L at the output of the trained neural network for the labeled source images, CE (F,I S , Y S ), and -Target Image I T A set of pseudo labels
number
number
[0030] In a particular implementation, the first and second feature invariant losses are represented as follows: I is an image in the source image and the target image, I' is a stylized version of I, and φ(I), φ(I')∈R D×M×N The features generated by the bottleneck layer are φ(I) and φ(I') using the Frobenius norm ||| F and D is the number of channels, and M and N are the spatial dimensions of the feature maps.
number
[0031] In certain implementations, the method further includes generating at least one stylized source image by applying the stylization method to the source image, and generating at least one stylized target image by applying the stylization method to the target image.
[0032] In certain implementations, applying the stylized method to the source image includes: Applying the Fourier transform to the source image gives the source image phase F P (I S ) and the source image amplitude F A (I S ) and A Fourier transform is applied to at least one target image to obtain a target image amplitude F A (I T ) and Source image amplitude F A (I S ) the low frequency part of the target image amplitude F A (I T ) and replacing it with the low frequency part of M is a mask β have
number
[0033] The invention also relates to a neural network trained by the method according to the invention.
[0034] According to a third aspect, the invention relates to an electronic device comprising at least one processor and a memory having stored thereon a program implementing the method described above.
[0035] According to a fourth aspect, the present invention relates to a computer implemented method for generating a semantic segmentation of an input image, the method comprising: obtaining a trained neural network by carrying out the method for training a neural network described above; and generating a semantic segmentation of the input image using the obtained neural network.
[0036] As mentioned above, generating a semantic segmentation of an input image aims to assign to each pixel of the input image a label that represents its semantic content.
[0037] According to a fifth aspect, the invention relates to an electronic device comprising at least one processor and a memory having stored thereon a program implementing the method for generating a semantic segmentation as described above.
[0038] According to a sixth aspect, the invention relates to a system comprising an electronic device configured to implement a method for training a neural network and an electronic device configured to implement a method for generating a semantic segmentation of an input image.
[0039] An embodiment of the present invention also extends to a program which, when executed in a computer or processor, causes the computer or processor to perform the above-mentioned method, or when loaded into a programmable device, causes the device to become the above-mentioned device. The program may be provided by itself or may be carried on a carrier medium. The carrier medium may be a storage or recording medium, or may be a transmission medium such as a signal. A program embodying the present invention may be transitory or non-transitory. [Brief description of the drawings]
[0040] The features, advantages, and technical and industrial importance of preferred embodiments of the present invention are described below with reference to the accompanying drawings, in which like reference numerals refer to like elements, and in which:
[0041] [Figure 1] FIG. 1 illustrates a particular implementation of an electronic device (10A) configured to implement a method for training a neural network. [Diagram 2] FIG. 10B illustrates a particular implementation of an electronic device (10B) configured to generate a semantic segmentation of an input image. [Diagram 3] FIG. 2 is a diagram showing an example of the hardware architecture of the electronic device (10A) shown in FIG. 1. [Figure 4] FIG. 3 is a diagram showing an example of the hardware architecture of the electronic device (10B) shown in FIG. 2. [Diagram 5] FIG. 2 illustrates a functional representation of the electronic device (10A) illustrated in FIG. [Figure 6] 1 is a flowchart of a method for training a neural network according to a particular implementation of the present invention. [Figure 7] 1 is a flowchart of a method for generating a semantic segmentation of an input image according to a particular implementation of the present invention; [Figure 8]FIG. 10 shows qualitative results obtained with the electronic device (10A) of FIG. 1 for the “normal vs. wicked domain adaptation” scenario using the Cityscapes dataset and the Awkward Conditions with Correspondences dataset (ACDC). DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0042] For purposes of the present invention, it is to be understood that the specific devices and processes illustrated in the accompanying drawings, and described in the following specification, are merely preferred embodiments or aspects of the subject matter of the present disclosure, and thus, specific dimensions and other physical characteristics relating to the embodiments or aspects disclosed herein are not to be considered as limiting, unless specifically indicated.
[0043] As used herein, aspects, components, elements, modules, entities, steps, functions, instructions, and / or the like should not be construed as critical or essential unless expressly stated otherwise. Additionally, as used herein, the articles "a" and "an" are intended to include one or more items and may be used interchangeably with "one or more" and "at least one." When only one item is intended, the term "one" or similar terms are used. Additionally, as used herein, the terms "has," "have," "having," or the like are intended to be open-ended terms. Additionally, the phrase "based on" is intended to mean "based at least in part on," unless expressly stated otherwise.
[0044] FIG. 1 illustrates a particular implementation of an electronic device 10A configured to implement a method for training a neural network.
[0045] FIG. 2 illustrates a particular implementation of an electronic device 10B configured to generate a semantic segmentation of an input image.
[0046] The remaining description is more specifically aimed at training a neural network to provide a semantic segmentation of an input image. Whatever the nature of the neural network considered (convolutional, perceptron, autoencoder, recurrent, etc.), the invention remains applicable, in particular for any deep neural network.
[0047] Additionally, no limitations are placed on the type or content of images (also termed "input images") that may be input to a semantic segmentation model, nor on the type of semantic segmentation that may be output based on an input image (i.e., the nature of the classes or "categories" is not a limiting factor of the present invention. In particular, such images may include images of urban scenes with pixel-level semantic annotations captured, for example, by an autonomous vehicle.
[0048] Incidentally, semantic segmentation remains a difficult and complex task in automatic visual understanding when compared to simpler problems such as image classification or object detection: in image classification, a single label is assigned to the entire input image referring to the dominant object in the scene captured by the input image, and in object detection, objects are identified by 2D bounding boxes and a label is assigned to each box, whereas in semantic segmentation, each pixel of the input image is assigned a label corresponding to its semantic content.
[0049] The electronic device 10A is configured to train a neural network (F) so as to improve the accuracy of the semantic segmentation of an image. The trained neural network is then used as input for the electronic device 10B implementing a method for generating a semantic segmentation of an input image. Said method is hereinafter referred to as the "semantic segmentation method". Herein, reference is made by "improving the accuracy of the semantic segmentation" for obtaining a more accurate semantic segmentation result than would be the case if the neural network had not been improved (or "adapted") according to the invention.
[0050] FIG. 3 illustrates an example of the hardware architecture of the electronic device 10A illustrated by FIG.
[0051] The electronic device 10A has a computer hardware architecture. As shown in Figure 3, the electronic device 10A includes a processor 1. Although shown as a single processor 1, two or more processors may be used according to the particular requirements, desires, or particular implementation of the electronic device 10A. Generally, the processor 1 executes instructions and manipulates data to perform the operation of the electronic device 10A as well as any algorithms, methods, functions, processes, flows, and procedures described in this disclosure.
[0052] The electronic device 10A also comprises a communication means 5, which is used by the electronic device 10A to communicate with another electronic device communicatively connected to the electronic device 10A, for example to connect to a database storing a plurality of labeled source images and a plurality of target images, where each source image of the plurality is associated with at least one target image. In general, the communication means 5 comprises logic operable to communicate with a wireless network and encoded in software, hardware, or a combination of software and hardware. More specifically, the communication means 5 may comprise software supporting one or more communication protocols associated with the communication, such that the hardware of the wireless network or interface is operable to communicate physical signals in and out of the depicted electronic device.
[0053] Although shown in Figure 3 as a single communication means 5, two or more communication means may be used according to the particular needs, desires or particular implementation of the system. The electronic device 10A also comprises a random access memory 2, a read only memory 3 and a non-volatile memory 4.
[0054] The non-volatile memory 4 of the electronic device 10A stores a computer program PROG_IMP according to the invention, which contains instructions for executing the method for training a neural network according to the invention.
[0055] The program PROG_IMP defines functional modules of the electronic device 10A, which are based on or control the aforementioned elements 1 to 5 of the electronic device 10A, in particular: At least one labeled source image (I S ), at least one unlabeled target image (I T ), at least one stylized source image (I S→T ), and at least one stylized target image (I T→S) to a neural network (F); At least one labeled source image (I S ) generated features (φ(I S )) and at least one stylized source image (I S→T ) generated features (φ(I S→T A loss function (L CISS ), and / or at least one target image (I T ) generated features (φ(I T )) and at least one stylized target image (I T→S ) generated features (φ(I T→S A loss function (L CISS and a module MOD_IMP configured to train the neural network (F) by minimizing
[0056] The different functional modules mentioned above may be part of a single electronic device (10A) or may be distributed among several electronic devices belonging to a system.
[0057] FIG. 4 illustrates an example of the hardware architecture of the electronic device 10B illustrated by FIG.
[0058] The electronic device 10B has a computer hardware architecture. As shown in Figure 4, the electronic device 10B includes a processor 1. Although shown as a single processor 1, two or more processors may be used according to the particular requirements, desires, or particular implementation of the electronic device 10B. Generally, the processor 1 executes instructions and manipulates data to perform the operation of the electronic device 10B as well as any algorithms, methods, functions, processes, flows, and procedures described in this disclosure.
[0059] The electronic device 10B also comprises communication means 5, which are used by the electronic device 10B to communicate with another electronic device communicatively connected to said electronic device 10B, for example to connect to the electronic device 10A to receive a neural network once trained according to the method for training a neural network described above.
[0060] Generally, the communication means 5 comprises logic operable to communicate with a wireless network and encoded in software, hardware, or a combination of software and hardware. More specifically, the communication means 5 may comprise software supporting one or more communication protocols associated with the communication, such that the wireless network or interface hardware is operable to communicate physical signals in and out of the illustrated system.
[0061] 4 as a single communication means 5, two or more communication means may be used according to the particular needs, desires, or particular implementation of the electronic device 10B. The electronic device 10B also comprises a random access memory 2, a read only memory 3, and a non-volatile memory 4.
[0062] The non-volatile memory 4 of the electronic device 10B stores a computer program PROG_GEN according to the invention, comprising instructions for executing the method for generating a semantic segmentation of an input image according to the invention.
[0063] The program PROG_GEN defines functional modules of the electronic device 10B, which are based on or control the aforementioned elements 1 to 5 of the electronic device 10A, in particular: a module MOD_OB_F configured to obtain a neural network (F) generated by carrying out a method for training a neural network (F) according to the invention; and a module MOD_GEN configured to generate a semantic segmentation of the input image using the obtained neural network (F).
[0064] The different functional modules mentioned above may be part of a single electronic device (10B) or may be distributed among several electronic devices belonging to a system.
[0065] FIG. 5 shows a functional representation of the electronic device 10A shown in FIG.
[0066] As mentioned above, electronic device 10A implements a method for training a neural network to process images belonging to several related domains. Thus, electronic device 10A learns representations by penalizing differences between encoded features of pairs of images of the same scene, one of which is a "stylized version" of the other.
[0067] More precisely, the electronic device 10A is configured to align features extracted from the two images using a feature invariant loss that penalizes differences between the two feature maps. Intuitively, the encoder of a semantic segmentation network should output features that are invariant to the scene modality, so that the decoder can then generate identical outputs for different versions of the same scene, since the ground truth semantics of these versions are also identical.
[0068] To this end, as shown in Fig. 5, we first extract a labeled source image I S and an unlabeled target image I belonging to the target domain T is input to the neural network F. A labeled source image I S and target image I Trepresent different scenes, each captured under different lighting and / or weather conditions. A "labeled source image" refers to an image having pixels associated with labels that represent the semantic content of the pixels. In certain cases, a labeled source image may refer to an image in which each pixel of the image is associated with a label.
[0069] The stylization function g is the stylized source image I S→T To generate the source image I S is applied to the target image I T The stylized target image I T→S To generate the source image I S By further taking as input the target image I T Then, the stylized source image I S→T and stylized target image I T→S is also input to the neural network F.
[0070] As described further below, the source image I S The stylized function g applied to the source image I S and stylized source image I S→T have similar structural content, and at least one stylized source image has the style of an image belonging to the target domain. S→T In other words, the stylization method allows the generation of a source image I S Similarly, the target image I T The stylized function g applied to the target image I T and stylized target image I T→S have similar structural content, and the stylized target image I T→S A stylized target image I such that I has the style of an image belonging to the source domain. T→S Allows the generation of
[0071] Then, the representation backbone, also called the “encoder” φ, is the image I S , I T , I S→T , and I T→S From the "feature representation" φ(I S ), φ(I T ), φ(I S→T ), and φ(I T→S ) which produces a representation φ(.)∈R that corresponds to the output of the bottleneck layer. D*M*N where D corresponds to the channel dimension of the feature map (i.e., the number of channels), and M and N are the two spatial dimensions of the feature map (i.e., the number of rows and columns of the feature map, respectively).
[0072] The neural network is S and stylized source image I S→T It is trained to improve the accuracy of semantic segmentation of images from other domains by minimizing a feature-invariant loss that penalizes the difference between the features φ(I S ) and φ(I S→T ) is the feature invariant loss module L INV is fed to the feature invariant loss module L INV , L INV (F,I S , I S→T ) is generated by using the source image I S and stylized source image I S→T have similar structural content but differ only with respect to their style, and the functions L INV Minimizing I encourages the encoder φ to generate a feature representation that is independent of the modality of the input image. In a particular way, this is done by minimizing the feature φ(I S ) and φ(I S→T )
[0073] The neural network also computes the target image I Tand stylized target image I T→S Feature invariant loss L that penalizes the difference between INV To do this, the features φ(I T ) and φ(I T→S ) is the feature invariant loss module L INV is fed to the feature invariant loss module L INV , L INV (F,I T , I T→S ) for the target image I T and stylized target image I T→S have similar structural content but differ only with respect to their style, and the functions L INV Minimizing I encourages the encoder φ to generate a feature representation that is independent of the modality of the input image. In a particular way, this is done by minimizing the feature φ(I T ) and φ(I T→S )
[0074] Then, the source image I S The feature φ(I S ), and source image I T The feature φ(I T ) are fed to a shared decoder ω, which is configured to compute a softmax prediction and the respective cross-entropy error.
[0075] More precisely, the decoder ω is a cross-entropy error module L CE The source image I is fed to S The softmax output F(I S ) is generated. This cross-entropy error module L CE is the source image I S Set of labels Y S Cross entropy error L CE (F,I S , Y S) is generated. Similarly, the decoder ω is configured to generate a cross-entropy error module L CE The target image I is fed to T The softmax output F(I T ) is generated. This cross-entropy error module L CE is the target image I T A set of pseudo labels
number
number
[0076] Feature invariant loss L INV (.) and the cross-entropy error L CE Further details regarding (.) are provided below.
[0077] FIG. 6 is a flowchart of a method for training a neural network according to a particular implementation embodiment of the present invention.
[0078] The method for training a neural network involves providing at least one labeled source image (I S ) and at least one unlabeled target image (I T ) and obtain at least one stylized source image (I S→T ) and obtain at least one stylized target image (I T→S ) in step S100. This step may be implemented by a module MOD_OB_IMG of the electronic device 10A.
[0079] This step S100 includes the step of generating at least one source image (I S ) and at least one unlabeled target image (I T) is acquired. Typically, a plurality of source images (I S ) and the target image (I T ) is obtained, but for simplicity, we then use one source image (I S ) and one target image (I T ) is obtained.
[0080] Source image (I S ) and the target image (I T Each of the images I 1 and I 2 can be obtained by accessing a database D′ that stores a dataset comprising a plurality of sets of images, each set being based on one or several source images I S and one or several target images I T The source image (I S ) and the target image (I T ) represent different scenes captured under different lighting and / or weather conditions. The electronic device 10A and the database D' may be connected using a wired or wireless connection over a telecommunications network.
[0081] Step S100 is to extract a source image (I S ) and the target image (I T ) in a stylized version of the image.
[0082] More precisely, the purpose of this sub-step S120 is to generate a stylized version of a given image belonging to a given domain, such that the given image and the stylized image have similar structural content, and the stylized image has the style of an image belonging to a different domain from the given domain. In this way, the two domains are "aligned" at the pixel level, and the semantics of the given image are maintained when generating the stylized image. Thus, the semantic annotations of the given image can be used as ground truth for supervising the prediction of the semantic segmentation of the stylized image.
[0083] In a particular implementation, lightweight shallow mapping is applied to generate a stylized version of the image. "Lightweight shallow mapping" provides the advantage of on-the-fly stylization (e.g., at step S120) without introducing unnecessary additional complexity to the overall architecture.
[0084] More formally, stylized source image I S→T I S→T =g(I S , I T ) for each stylized target image, I T→S =g(I T , I S ) can be calculated as
[0085] I S→T and I T→S The stylized mapping function g used to generate
[0086] Although the method of the present invention is agnostic to the exact mapping g used for stylization, in a particular implementation, a Fourier Domain Adaptation (FDA) based method is applied. The FDA based method reduces the mismatch between the source and target distributions by exchanging the low frequency spectrum of one with that of the other. The FDA based method is used to stylize the source image I S→T To generate the signal, the electronic device 10A
number
[0087] More precisely, the electronic device 10A implements the following steps: Source image (I S ) to obtain the source image phase F P (I S ) and the source image amplitude F A (I S ), Target image (I T ) to obtain the target image amplitude F A (I T ), Source image amplitude F A (I S ) the low frequency part of the target image amplitude F A (I T ) by replacing the low frequency part of M β is the mask corresponding to an ideal low-pass filter.
number
[0088] Next, I S The modified spectral representation of (whose phase component is unchanged) is the image I S→T The structure content is then mapped back to I S , but in the style of an image belonging to the target domain.
[0089] For further details regarding FDA-based methods, those skilled in the art may refer to the paper “Fourier Domain Adaptation for Semantic Segmentation” by Yanchao Yang and Stefano Soatto at the IEEE / CVF Conference on Computer Vision and Pattern Recognition in June 2020.
[0090] The main difference with the FDA-based methods in the art is that in the method of training a neural network of the present invention, both images belonging to the source domain and images belonging to the target domain are processed to promote the constancy of the features generated by the neural network (F) across the two domains, thus better aligning the two domains at the feature level, thereby improving domain adaptation.
[0091] Step S100 is to extract a labeled source image (I S ), target image (I T ), stylized source image (I S→T ), and the stylized target image (I T→S ) into a trained neural network (F).
[0092] The method to train a neural network is to use labeled source images (I S ) generated features (φ(I S )) and at least one stylized source image (I S→T ) generated features (φ(I S→T A loss function (L CISS ), and / or at least one target image (I T ) generated features (φ(I T )) and at least one stylized target image (I T→S ) generated features (φ(I T→S A loss function (L CISS The method further includes a step S200 of training the neural network (F) by minimizing .times. ...
[0093] More precisely, step S200 includes sub-steps S220, S230, S240 and S250. As mentioned above, the neural network (F) is composed of an encoder and a decoder. In sub-step S220, the neural network (F) inputs an image IS , I T , I S→T , and I T→S From the "representation" φ(I S ), φ(I T ), φ(I S→T ), and φ(I T→S ), which is also called a feature map.
[0094] The encoder should be a fully convolutional encoder. In that case, the representation φ(.) ∈ R corresponds to the output of the bottleneck layer. D*M*N where D corresponds to the channel dimension of the feature map (i.e., the number of channels), and M and N are the two spatial dimensions of the feature map (i.e., the number of rows and columns of the feature map, respectively).
[0095] In substep S230, the feature invariant loss L INV (F,I S , I S→T ) and L INV (F,I T , I T→S ) is calculated.
[0096] By using a specific feature-invariant loss rather than the typical cross-entropy error, I S and I S→t Between and I t and I t→S This provides the advantage of imposing stronger constraints on the neural network (F) regarding the shared semantic content between and .
[0097] The feature representations generated in sub-step S220 should ideally be invariant to the particular modality or visual conditions of the input image, allowing the decoder to focus on parsing the features and outputting semantic classes without the need to further abstract from the particular modality of the input image.
[0098] Thus, the neural network (F) is trained using a feature-invariant loss function L that penalizes the difference between features generated from a given image and features generated from a stylized version of the given image. INV It is trained by minimizing (.).
[0099] More formally, let F be the composition of the encoder φ and the decoder ω, then
number
[0100] The feature invariant loss can be expressed as:
number
[0101] Returning to step S230, the feature invariant loss function is S , I S→T ) and (I T , I T→S ) is applied to align features from each pair, and the feature invariant loss L INV (F,I S , I S→T ) and L INV (F,I T , I T→S ) is calculated.
[0102] Then, the method for training the neural network (F) is to input a source image I S The softmax output F(I S ) and target image IT The softmax output F(I T ) at step S240.
[0103] In step S250, the softmax output F(I S ) is the cross-entropy error L CE (F,I S , Y S ) the cross-entropy error module L CE and the softmax output F(I T ) also, target image I T A set of pseudo labels
number
number
[0104] In a particular implementation, the target image I T The pseudo-labels of,are determined by applying the teacher-student self-training framework of,DAFormer
[12] with confidence-weighted pseudo-labels.
[0105] More formally, if the semantic labels Y are one-hot-encoded in a C × H × W tensor, then the cross-entropy error L associated with the softmax output F(I) of the network for image I is CE (.) is defined as follows:
number
[0106] The resulting two feature invariant losses L INV (F,I S , I S→T ) and L INV (F,IT , I T→S ) is the cross-entropy error L CE (F,I S , Y S ) and
number
number
[0107] In step S260, the neural network (F) calculates the resulting loss function L CISS The neural network is trained by minimizing the loss function L. Stochastic gradient descent or any other suitable training algorithm or variant of stochastic gradient descent may be used. Stochastic gradient descent may be used to adapt the weights of the neural network. The training method of the present invention is CISS This involves minimizing, for example, backpropagating this loss.
[0108] 7 is a flowchart of a method for generating a semantic segmentation of an input image according to a particular implementation of the present invention, the method being implemented by the electronic device 10B shown in FIG.
[0109] 7, the method for generating a semantic segmentation of an input image comprises a first step S300 of obtaining an input image, which may belong to a target domain, i.e., which may represent a scene captured under adverse conditions.
[0110] The method for generating a semantic segmentation of an input image further comprises a step S400 of obtaining a trained neural network (F), generated by performing the method for training a neural network described above. This step may be implemented by a module MOD_OB_F of the electronic device 10B.
[0111] In a particular implementation, "obtaining a trained neural network" includes applying, by this electronic device 10B, the method for training a neural network described above.
[0112] In a variant, the electronic device 10A implements a method for training a neural network to generate a domain-adaptive neural network, e.g., a neural network that achieves reliable performance even for images captured under adverse conditions. The step of "obtaining a trained neural network" then includes "receiving by the electronic device 10B the trained neural network generated by the electronic device 10A." In that case, the electronic device 10A and the electronic device 10B may be connected using a wired or wireless connection via a telecommunications network.
[0113] The method for generating a semantic segmentation of the input image further includes a step S500 of generating a semantic segmentation of the input image using the neural network (F) obtained in step S400. This step may be implemented by a module MOD_GEN of the electronic device 10B.
[0114] FIG. 8 shows qualitative results obtained with the electronic device (10A) of FIG. 1 for the “normal vs. wicked domain adaptation” scenario using the Cityscapes dataset and the Awkward Conditions with Correspondences dataset (ACDC).
[0115] Implementation details
[0116] The default implementation of the method for training the neural network is based on HRDA
[13] . The semantic segmentation network comprises a MiT-B5 encoder by SegFormer
[42] and a context-aware feature fusion decoder
[12] .
[0117] We also implemented our method using the DeepLabv2[3] architecture with the ResNet-101 backbone[9] for direct comparison with several previous UDA methods that use this architecture. For the default HRDA-based implementation, we follow the teacher-student self-training framework of DAFormer
[12] with confidence-weighted pseudo-labels, rare class sampling, and target data augmentation according to DACS
[34] , with a 6 × 10 -5 and 6×10 for the decoder. -4 We used the AdamW optimizer
[21] with a learning rate of , a linear learning rate warmup, and mini-batches of size B = 2, and trained on two Titan RTX GPUs, each processing one of the two examples in each mini-batch.
[0118] The default configuration and parameters of HRDA were applied for the multi-resolution setup. When applying the FDA-based method of stylizing the images, β = 0.01 was used as the bandwidth parameter for the low frequency band of the Fourier spectrum. The default values for the weights of the feature invariant loss were set to λ for the default HRDA-based implementation of CISS. S = 200 and λ t = 100 and for the alternative DeepLabv2-based implementation, S = λ t =10.
[0119] Dataset
[0120] Since the method for training the neural network is tuned for condition-level domain shifts that affect the style and texture of objects in the scene, rather than structural level shifts as in typical synthetic vs. real scenarios, the experiments focus on domain adaptation and generalization settings from normal vs. bad visual conditions.
[0121] We used the dataset Cityscapes [6] as the labeled source domain set in our experiments. Cityscapes is a large dataset of urban driving scenes captured in several Central European cities under normal conditions and contains high-quality pixel-level semantic annotations for a set of 19 common classes in driving scenes. The dataset consists of a training set with 2975 images, a validation set with 500 images, and a test set with 1525 images. When training our UDA method in our experiments, we sampled source images only from the Cityscapes training set. In addition, we used the dataset ACDC
[31] as an unlabeled target domain set to model the bad-condition domain for normal-versus-bad UDA. ACDC consists of 4006 images of driving scenes evenly distributed in four common bad conditions, namely night, fog, rain, and snow. The images feature high-quality semantic annotations for the same set of 19 classes as Cityscapes. The training, validation, and test sets contain 1600, 406, and 2000 images, respectively.
[0122] We then used BDD100K
[44] as the target set for domain generalization. In particular, we first performed zero-shot testing on a validation set of a 10,000-image semantic segmentation subset of BDD100K containing 1,000 images captured under varying visual conditions. We then used BDD100K-night
[30] , a partition of BDD100K with 87 nighttime images with accurate segmentation labels.
[0123] A comparison of state-of-the-art unsupervised domain adaptation and generalization methods for Cityscapes → ACDC.
[0124] The cityscape serves as the source domain, and the full ACDC including all four adverse conditions serves as the target domain.
[0125] Our method, CISS, significantly outperforms all competing methods, both domain adaptation and domain generalization, with a 4% difference in the main mIoU metric from the next best method. Furthermore, our method achieves the best IoU in 11 of 19 individual classes, and excels in classes critical to driving recognition, such as roads, sidewalks, and cars. Focusing on the methods that use the DeepLabv2 architecture, CISS-DeepLabv2 also has the best performance among them, indicating that the advantages of our method are general across different UDA architectures.
[0126] FIG. 8 shows qualitative results in Cityscapes → ACDC, e.g., qualitative results provided by a neural network trained with the method of the present invention using the Cityscapes dataset as the source domain and the ACDC dataset as the target domain, and then tested / validated on the ACDC dataset.
[0127] Column A contains four different images belonging to the ACDC dataset, column B corresponds to their ground truth annotations, column C corresponds to the semantic segmentation results when applying the HRDA method, and column D corresponds to the results when applying the method of training a neural network of the present invention.
[0128] In the top snow image, our method accurately captures the sky, road, and sidewalk, while HRDA misclassifies both the sidewalk and the sky as a road. In the nighttime images in the second row, our method successfully segments one of two very dark pedestrians on the left sidewalk and detects two motorcycles nearby, but HRDA completely mistakes the pedestrian for a plant and the motorcycle for a car. In the bottom rain image, HRDA incorrectly segments the green reflection of two traffic lights on the road as a traffic light, but our method correctly assigns the reflection to the road and segments the right sidewalk much more accurately.
[0129] reference
[0130] [3] Chen & Al. DeepLab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected CRFs. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(4):834-848, 2018.
[0131] [6] Cordts&Al. The Cityscapes dataset for semantic urban scene understanding. The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
[0132] [9] He&Al. Deep residual learning for image recognition. The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016.
[0133]
[12] Hoyer et al.'s DAFormer: Improving network architectures and training strategies for domain - adaptive semantic segmentation. Proceedings of the IEEE / CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2022.
[0134]
[13] Hoyer et al.'s HRDA: Context - aware high - resolution domain - adaptive semantic segmentation. The European Conference on Computer Vision (ECCV), 2022
[0135]
[21] Loshchilov et al.'s Decoupled weight decay regularization. ICLR, 2018.
[0136]
[30] Sakaridis et al.'s Map - guided curriculum domain adaptation and uncertainty - aware evaluation for semantic nighttime image segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020
[0137]
[34] Tranheden et al.'s DACS: Domain adaptation via cross - domain mixed sampling. Proceedings of the IEEE / CVF Winter Conference on Applications of Computer Vision (WACV), 2021.
[0138]
[42] Xie&Al.'s SegFormer: Simple and efficient design for semantic segmentation with transformers. Advances in Neural Information Processing Systems, 2021.
[0139]
[44] Yu&Al.'s BDD100K: A diverse driving dataset for heterogeneous multitask learning. IEEE / CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
Claims
1. 1. A computer-implemented method for training a neural network, the method comprising: At least one labeled source image (I S ), at least one unlabeled target image (I T ), at least one stylized source image (I S→T ), and at least one stylized target image (I T→S ) into the neural network; The labeled source image (I S ) generated from the feature (φ(I S )) and said at least one stylized source image (I S→T ) generated from the feature (φ(I S→T )) and / or by penalizing the difference between said at least one target image (I T ) generated from the feature (φ(I T )) and said at least one stylized target image (I T→S ) generated from the feature (φ(I T→S A loss function (L CISS training the neural network by minimizing 4. A computer-implemented method comprising:
2. The at least one labeled source image (I S ) and the at least one unlabeled target image (I T 2. The method of claim 1, wherein the first and second images are captured under different lighting and / or weather conditions.
3. The at least one stylized source image (I S→T ) is the source image (I S ) by applying a stylization method to the source image (I S ) and maintaining the structural content of said at least one stylized source image (I S→T3. The method according to claim 1, wherein the image includes a pattern of the image belonging to the target domain.
4. The at least one stylized target image (I T→S ) is the target image (I T ) by applying a stylization method to the target image (I T ) and maintaining the structural content of said at least one stylized target image (I T→S 3. The method according to claim 1, wherein the image has a format belonging to the source domain.
5. The neural network comprises an encoder (φ) configured to generate intermediate features, and the loss function (L CISS 3. The method of claim 1 or 2, wherein minimizing φ(I), φ(I′) encourages the encoder to generate intermediate features (φ(I), φ(I′)) that are invariant to lighting and / or weather conditions.
6. The loss function (L CISS )teeth, The at least one labeled source image (I S ) generated from the feature (φ(I S )) and said at least one stylized source image (I S→T ) generated from the feature (φ(I S→T a first feature invariant loss that penalizes the difference between The at least one target image (I T ) generated from the feature (φ(I T )) and said at least one stylized target image (I T→S ) generated from the feature (φ(I T→S a second feature-invariant loss that penalizes the difference between The source image I S Set of labels Y S The labeled source image (I S ) the cross-entropy error L at the output of the trained neural network CE(F, I S , Y S ), and The target image I T A set of pseudo labels [0010] The target image (I T ) the cross-entropy error at the output of the trained neural network for [0025] The method according to claim 1 or 2, which corresponds to the sum of
7. The first and second feature invariant losses are S ) and the target image (I T ), I is an image in R, I' is a stylized version of I, and φ(I), φ(I')∈R D×M×N The features φ(I) and φ(I′) generated by the bottleneck layer using ||·|| F and D, the number of channels, and M and N, the spatial dimensions of the feature maps. [0030] The method of claim 6, wherein:
8. The source image (I S ) by applying a stylization method to said at least one stylized source image (I S→T ), and generating the target image (I T ) by applying the stylization method to the at least one stylized target image (I T→S 3. The method of claim 1 or 2, further comprising:
9. The source image (I S ) applying the stylization method to The source image (I S ) to obtain the source image phase F P (I S) and the source image amplitude F A (I S ) and The at least one target image (I T ) to obtain the target image amplitude F A (I T ) and the source image amplitude F A (I S ) the low frequency portion of the target image amplitude F A (I T ) into the low frequency part of Mask M β have [0045] The inverse Fourier transform F -1 by applying S→T ) and The method of claim 8 , comprising:
10. A neural network trained by the method of claim 1 or 2.
11. 3. An electronic device comprising at least one processor and a memory having stored thereon a program implementing the method for training a neural network according to claim 1 or 2.
12. A computer program which, when executed by an electronic device, causes the electronic device to carry out the method for training a neural network according to claim 1 or 2.
13. A recording medium readable by a computer and having recorded thereon a computer program comprising instructions for carrying out the method for training a neural network according to claim 1 or 2.
14. 1. A computer-implemented method for generating a semantic segmentation of an input image, the method comprising: Obtaining a neural network trained by carrying out the method according to claim 1 or 2; generating a semantic segmentation of the input image using the obtained neural network; and 4. A computer-implemented method comprising:
15. An electronic device comprising at least one processor and a memory having stored thereon a program implementing the method for generating a semantic segmentation of an input image according to claim 14.
16. A computer program product which, when executed by an electronic device, causes the electronic device to perform the method for generating a semantic segmentation of an input image according to claim 14.
17. A recording medium readable by a computer and having recorded thereon a computer program comprising instructions for carrying out the method for generating a semantic segmentation of an input image according to claim 14.
Citation Information
Patent Citations
Semi-supervised domain self-adaption method, system and equipment and storage medium
CN113326848A
Semi-supervised person re-identification model, method and device
CN113657267A
Data augmentation techniques using style transformation with neural network
JP2019032821A
Method for training domain adaptive neural network
JP2022042487A
Information processor, information processing method, program and vehicle control system
JP2022091474A
