Waterlogging image day-night bidirectional conversion model construction method based on reflection map consistency and application

By constructing a day-night bidirectional conversion model for water accumulation images with consistent reflectance, reversible conversion between day and night images was achieved, solving the problems of scarce nighttime data and cross-domain adaptation, and improving the segmentation accuracy and semantic reliability of road water accumulation identification across all time periods.

CN121961833BActive Publication Date: 2026-06-23HANGZHOU SOUNDBEI SOFTWARE TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU SOUNDBEI SOFTWARE TECH CO LTD
Filing Date
2026-03-31
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing road water accumulation recognition technologies suffer from data scarcity and insufficient cross-domain model performance in nighttime scenarios. Traditional algorithms struggle to effectively distinguish water accumulation areas from interference factors such as shadows and road surface reflections, leading to decreased segmentation accuracy and failing to meet the needs of all-day applications.

Method used

A bidirectional day-night transformation model for water accumulation images based on reflectance consistency is constructed. The model achieves bidirectional reversible transformation of day and night images through brightening and darkening transformation units. A pre-trained CLIP text encoder is used to generate scene prompts, and the reflectance consistency loss is calculated in combination with the reflectance consistency decoder. The transformation process is constrained to preserve the essential attributes of the water accumulation area and prevent semantic distortion.

Benefits of technology

It effectively solves the problem of scarce nighttime labeled data, improves the semantic reliability and segmentation accuracy of nighttime water accumulation segmentation tasks, expands the nighttime training set, and ensures the semantic consistency and visual realism of images under different lighting conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121961833B_ABST
    Figure CN121961833B_ABST
Patent Text Reader

Abstract

The application provides a pond image day-night bidirectional conversion model construction method based on reflection map consistency and application, including the following steps: acquiring a plurality of real day-night pond image pairs including real daytime pond images and real nighttime pond images, generating a daytime scene prompt word for each real daytime pond image, and generating a nighttime scene prompt word for each real nighttime pond image; constructing a pond image day-night bidirectional conversion architecture including a lightening conversion unit and a darkening conversion unit, the pond image day-night bidirectional conversion architecture generating a simulated nighttime pond image and a simulated daytime pond image; and using the plurality of real day-night pond image pairs to iteratively train the pond image day-night bidirectional conversion architecture to obtain a pond image day-night bidirectional conversion model. The scheme constructs a reflection consistency decoder to extract reflection maps of various pond images and calculate reflection consistency loss, so that the conversion process does not change the essential properties of the pond area, and effectively prevents semantic distortion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of big data mining, and in particular to a reflection-based... Figure 1 A method for constructing and applying a bidirectional day-night conversion model for consistent water accumulation images. Background Technology

[0002] Road flooding recognition, a key task in computer vision, plays an irreplaceable role in improving the safety of autonomous driving systems, optimizing urban traffic management, and accurately assessing flood disasters. Its technological reliability directly impacts travel safety and urban governance efficiency. However, current road flooding recognition technology faces significant bottlenecks in scene adaptation, with the core pain points concentrated in the scarcity of data for nighttime scenes and insufficient cross-domain model performance. Large-scale collection of labeled data for nighttime road flooding images is difficult, limited by complex nighttime lighting conditions and the difficulty of manual annotation, as well as the lack of standardized collection and annotation processes. This results in a "data shortage" for training nighttime flooding segmentation models, severely limiting performance improvements.

[0003] Meanwhile, most existing mainstream water accumulation segmentation algorithms are trained on daytime scene data. While they can accurately identify water accumulation areas under sufficient lighting, the difficulty of image feature extraction increases dramatically in low-light, high-reflectivity, and low-visibility environments at night. Traditional algorithms struggle to effectively distinguish water accumulation areas from interfering factors such as shadows and road surface reflections, leading to a significant decrease in segmentation accuracy and failing to meet practical application requirements. Furthermore, the difference in lighting between day and night scenes can cause explicit changes in image semantic features, making it difficult for algorithms designed for a single scene to adapt across different scenarios, further exacerbating the technical difficulty of all-day road water accumulation identification.

[0004] This dual dilemma of "poor adaptability of daytime models and lack of data for nighttime models" makes it difficult for road water accumulation recognition technology to operate stably under all-day and complex lighting conditions. Existing scene transfer algorithms are mostly one-way transformations and suffer from issues such as detail distortion and insufficient semantic consistency, failing to simultaneously address the core needs of supplementing nighttime data and adapting cross-domain algorithms. Therefore, there is an urgent need for a two-way image transformation technology that can break down the data barriers between day and night scenes, while maintaining semantic consistency and visual realism. This technology would supplement nighttime models with high-quality training data and simultaneously allow nighttime images to be adapted to existing daytime segmentation algorithms, thereby overcoming current technological limitations. Summary of the Invention

[0005] This application provides a reflection-based embodiment. Figure 1A method and apparatus for constructing a day-night bidirectional conversion model for consistent water accumulation images are proposed. Based on DecomNet, a reflection consistency decoder is constructed to extract the reflection maps of various water accumulation images and calculate the reflection consistency loss. The conversion process is constrained to not change the essential attributes of the water accumulation area, effectively preventing semantic distortion, ensuring the semantic reliability of the converted image, and improving the performance of downstream water accumulation segmentation tasks.

[0006] Firstly, embodiments of this application provide a reflection-based... Figure 1 A method for constructing a day-night bidirectional conversion model for consistent water accumulation images, the method comprising:

[0007] Multiple pairs of real day and night water accumulation images are obtained, including real daytime water accumulation images and real nighttime water accumulation images taken from the same location. Daytime scene prompts are generated for each real daytime water accumulation image, and nighttime scene prompts are generated for each real nighttime water accumulation image.

[0008] A two-way day-night conversion architecture for water accumulation images is constructed, including a brightening conversion unit and a darkening conversion unit. The brightening conversion unit receives a real nighttime water accumulation image and a corresponding daytime scene prompt, and generates a simulated daytime water accumulation image. The darkening conversion unit receives a real daytime water accumulation image and a corresponding nighttime scene prompt, and generates a simulated nighttime water accumulation image.

[0009] Reflectance maps of real daytime water accumulation images, real nighttime water accumulation images, simulated daytime water accumulation images, and simulated nighttime water accumulation images are obtained respectively. The semantic consistency between the reflection maps of simulated daytime water accumulation images and real nighttime water accumulation images is used as the first consistency loss, and the semantic consistency between the reflection maps of simulated nighttime water accumulation images and real daytime water accumulation images is used as the second consistency loss. The sum of the first consistency loss and the second consistency loss is used as the reflection consistency loss. Daytime adversarial loss is generated based on the simulated daytime water accumulation images and their corresponding real daytime water accumulation images. Nighttime adversarial loss is generated based on the simulated nighttime water accumulation images and their corresponding real nighttime water accumulation images.

[0010] The day-night bidirectional transformation model for water accumulation images was obtained by iteratively training the water accumulation image day-night bidirectional transformation architecture using multiple sets of real day and night water accumulation images. The total generation loss of the water accumulation image day-night bidirectional transformation architecture training process was the weighted sum of reflection consistency loss, daytime adversarial loss, nighttime adversarial loss and identity regularization loss.

[0011] Secondly, embodiments of this application provide a reflection-based... Figure 1 A consistent method for bidirectional day-night conversion of water accumulation images, including:

[0012] The process involves acquiring the water accumulation image to be converted and its corresponding scene prompts, and then inputting these images into a day-night bidirectional conversion model for water accumulation images. When the water accumulation image to be converted is a daytime water accumulation image and the scene prompt is a nighttime scene prompt, the image and the prompt are input into a darkening conversion unit to obtain a simulated nighttime water accumulation image. Conversely, when the water accumulation image to be converted is a nighttime water accumulation image and the prompt is a daytime scene prompt, the image and the prompt are input into a brightening conversion unit to obtain a simulated daytime water accumulation image.

[0013] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform a reflection-based... Figure 1 A method for bidirectional day-night conversion of consistent water accumulation images.

[0014] Fourthly, embodiments of this application provide a readable storage medium storing a computer program, which, when executed by a processor, implements a reflection-based... Figure 1 A method for bidirectional day-night conversion of consistent water accumulation images.

[0015] The main contributions and innovations of this invention are as follows:

[0016] This application constructs a bidirectional conversion architecture containing a brightening conversion unit and a darkening conversion unit to achieve bidirectional reversible conversion of day and night water accumulation images. During conversion, only the lighting style is changed, while the original image spatial semantics and water accumulation semantic structure are preserved, thus solving the problem of scarce nighttime labeled data. This application uses a pre-trained CLIP text encoder to convert scene cues into fixed-dimensional text embedding vectors, and freezes its parameters during training to ensure that the conversion unit accurately understands the text semantics, providing a stable style control signal and avoiding the impact of text encoding fluctuations on conversion consistency during training, thereby reducing model training complexity. This application constructs a reflection consistency decoder based on DecomNet, extracts reflection maps of various water accumulation images and calculates reflection consistency loss, constraining the conversion process not to change the essential attributes of the water accumulation area, effectively preventing semantic distortion, ensuring the semantic reliability of the converted image, and improving the performance of downstream water accumulation segmentation tasks.

[0017] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0018] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0019] Figure 1 This is a reflection-based embodiment according to an embodiment of this application. Figure 1 Overall structure diagram of the day-night bidirectional conversion model for consistent water accumulation images;

[0020] Figure 2 This is a schematic diagram of the structure of a text encoder according to an embodiment of this application;

[0021] Figure 3 This is a structural diagram of a brightening conversion unit and a darkening conversion unit according to an embodiment of this application;

[0022] Figure 4 This is a structural diagram of a reflection consistency decoder according to an embodiment of this application;

[0023] Figure 5 This is a structural diagram of a daytime scene discriminator and a nighttime scene discriminator according to embodiments of this application;

[0024] Figure 6 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0025] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0026] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.

[0027] Example 1

[0028] This application provides a reflection-based embodiment. Figure 1A method for constructing a day-night bidirectional conversion model for water accumulation images is proposed. Based on DecomNet, a reflection consistency decoder is built to extract reflection maps from various types of water accumulation images and calculate the reflection consistency loss. The conversion process is constrained to not change the essential attributes of the water accumulation region, effectively preventing semantic distortion, ensuring the semantic reliability of the converted image, and improving the performance of downstream water accumulation segmentation tasks. Specifically, refer to... Figure 1 The method includes:

[0029] Multiple pairs of real day and night water accumulation images are obtained, including real daytime water accumulation images and real nighttime water accumulation images taken from the same location. Daytime scene prompts are generated for each real daytime water accumulation image, and nighttime scene prompts are generated for each real nighttime water accumulation image.

[0030] A two-way day-night conversion architecture for water accumulation images is constructed, including a brightening conversion unit and a darkening conversion unit. The brightening conversion unit receives a real nighttime water accumulation image and a corresponding daytime scene prompt, and generates a simulated daytime water accumulation image. The darkening conversion unit receives a real daytime water accumulation image and a corresponding nighttime scene prompt, and generates a simulated nighttime water accumulation image.

[0031] Reflectance maps of real daytime water accumulation images, real nighttime water accumulation images, simulated daytime water accumulation images, and simulated nighttime water accumulation images are obtained respectively. The semantic consistency between the reflection maps of simulated daytime water accumulation images and real nighttime water accumulation images is used as the first consistency loss, and the semantic consistency between the reflection maps of simulated nighttime water accumulation images and real daytime water accumulation images is used as the second consistency loss. The sum of the first consistency loss and the second consistency loss is used as the reflection consistency loss. Daytime adversarial loss is generated based on the simulated daytime water accumulation images and their corresponding real daytime water accumulation images. Nighttime adversarial loss is generated based on the simulated nighttime water accumulation images and their corresponding real nighttime water accumulation images.

[0032] The day-night bidirectional transformation model for water accumulation images was obtained by iteratively training the water accumulation image day-night bidirectional transformation architecture using multiple sets of real day and night water accumulation images. The total generation loss of the water accumulation image day-night bidirectional transformation architecture training process was the weighted sum of reflection consistency loss, daytime adversarial loss, nighttime adversarial loss and identity regularization loss.

[0033] In the current embodiment, a pre-trained BLIP model is used to generate daytime scene prompts for each real daytime water accumulation image and nighttime scene prompts for each real nighttime water accumulation image.

[0034] Specifically, daytime scene cues are textual descriptions of real daytime flooded images, such as "sunny streets with flooding, vehicles driving, and clearly visible flooded areas." Nighttime scene cues are textual descriptions of real nighttime flooded images, such as "streets illuminated by streetlights with flooding, vehicles driving, and significant reflections in the flooded areas, resulting in low visibility." Both daytime and nighttime scene cues are automatically generated using a pre-trained BLIP model, ensuring consistency between the textual descriptions and the image content, and providing accurate semantic guidance for conditional diffusion.

[0035] In the current embodiment, a pre-trained text encoder is used to convert daytime scene cue words and nighttime scene cue words into daytime text embedding vectors and nighttime text embedding vectors, respectively. The brightening conversion unit takes the daytime text embedding vector and a real nighttime water accumulation image as input, and the darkening conversion unit takes the nighttime text embedding vector and a real daytime water accumulation image as input.

[0036] Specifically, the structure of a text encoder is as follows: Figure 2 As shown, in order to ensure that the brightening and darkening conversion units can correctly understand the text content, the forward inference of the text encoder is used to convert the daytime scene cue words and nighttime scene cue words into a fixed-dimensional text embedding vector of scene features rich in semantic information, thus serving as a dense representation of daytime / nighttime scenes.

[0037] In addition, in this scheme, the text encoder is pre-trained based on the CLIP text encoder. During the parameter tuning process of the brightening and darkening conversion units in this scheme, the parameters of the text encoder are not changed.

[0038] In the current embodiment, to meet the input requirements of the model, the water accumulation images in the real day and night water accumulation image pairs are scaled to a size of 448×448, and the real day and night water accumulation image pairs are randomly flipped and cropped.

[0039] In the current embodiment, the structures of the brightening conversion unit and the darkening conversion unit are as follows: Figure 3 As shown, the brightening conversion unit consists of a CLIP image encoder, a conditional U-Net, and a Transformer decoder. The CLIP image encoder encodes the real nighttime water accumulation image into a first nighttime conditional image noise with nighttime scene semantic features. The conditional U-Net fuses the first nighttime conditional image noise with daytime text embedding vectors to obtain a first daytime conditional image noise with daytime lighting conditions. The Transformer decoder generates a corresponding simulated daytime water accumulation image based on the first daytime conditional image noise. The darkening conversion unit has the same structure as the brightening conversion unit.

[0040] In other words, in the darkening transformation unit, the CLIP image encoder encodes the real daytime water accumulation image into a second daytime conditional image noise with daytime scene semantic features. The conditional U-Net fuses the second daytime conditional image noise with the nighttime text embedding vector to obtain a second nighttime conditional image noise with nighttime lighting conditions. The Transformer decoder generates the corresponding simulated nighttime water accumulation image based on the second nighttime conditional image noise.

[0041] Specifically, the CLIP image encoder, Conditional U-Net, and Transformer decoder are all existing model structures. Taking the darkening transformation unit as an example, the function of this structure will be explained:

[0042] In this scheme, the CLIP image encoder encodes a real daytime water accumulation image into a second daytime conditional image noise containing daytime scene semantics through multi-layer downsampling encoding. Then, the cross-attention module in the conditional U-Net uses the nighttime text embedding vector as a style control signal to guide the diffusion process of the second daytime conditional image noise to deepen into nighttime visual features such as low illumination, high reflectivity, and weak details, thereby outputting a second nighttime conditional image noise with nighttime lighting conditions. In the Transformer decoder, the second nighttime conditional image noise is decoded into a simulated nighttime water accumulation image through multi-layer upsampling. The resulting simulated nighttime water accumulation image maintains the consistency of spatial semantics and original water accumulation area semantics while presenting lighting and reflection characteristics consistent with real nighttime scenes.

[0043] Similarly, the brightening conversion unit functions in the opposite way to the darkening conversion unit. By fusing the semantic content of nighttime images with daytime text cues, the brightening conversion unit guides the generation of high-brightness, low-reflectivity, and detail-rich daytime-style images, enabling images acquired at night to be effectively processed by existing daytime segmentation models.

[0044] Specifically, this scheme, through brightening and darkening conversion units, can generate images that conform to the visual characteristics of nighttime scenes by only changing the lighting style while preserving the original image spatial semantics (scene layout of vehicles, roads, etc.) and the semantic structure of water accumulation (such as the shape, location, and boundaries of water accumulation areas). This capability is crucial for solving the problem of scarce nighttime labeled data—by converting a large number of easily accessible daytime water accumulation images into realistic nighttime images, the nighttime training set can be effectively expanded.

[0045] In the current embodiment, a reflection consistency decoder is constructed based on the DecomNet structure. The reflection consistency decoder takes the water accumulation image as input and outputs the corresponding reflection map. The water accumulation image includes a real daytime water accumulation image, a real nighttime water accumulation image, a simulated daytime water accumulation image, and a simulated nighttime water accumulation image.

[0046] Specifically, the reflectance consistency decoder is a pre-trained network. The output of the reflectance consistency decoder includes the reflectance map and illuminance map of the corresponding puddles image. Since the output illuminance map and reflectance map should satisfy the retinal cortex theory, the illuminance map is used to verify the accuracy of the reflectance map. Let the input puddles image be defined as I, the reflectance map as R, and the illuminance map as L. Based on the retinal cortex theory, it can be known that… , This represents element-wise product.

[0047] Specifically, the reflection map represents the material, color, and semantic structure of the object surface in the water accumulation image, while the illuminance map reflects the current lighting conditions. Therefore, the image is decomposed into an intrinsic reflection component that is independent of lighting and an illuminance component that is related to scene lighting by using a reflection consistency decoder.

[0048] In other words, theoretically, if the conversion process only changes the illumination without altering the essential properties of the water accumulation area, then the semantics of the reflection map of the simulated daytime water accumulation image and the reflection map of the real nighttime water accumulation image should be highly consistent. Similarly, the semantic consistency of the reflection map of the simulated nighttime water accumulation image and the reflection map of the real daytime water accumulation image should also be highly consistent. Therefore, this scheme constructs a reflection consistency loss to constrain the function of the brightening conversion unit and the darkening conversion unit, preventing semantic distortion (such as deformation, disappearance, or misalignment of the water accumulation area) between the simulated daytime water accumulation image and the simulated nighttime water accumulation image. This ensures that while achieving brightness style transfer, the key semantic information of road water accumulation is strictly maintained, thereby significantly improving the reliability of downstream segmentation tasks.

[0049] Reflectance maps of real daytime water accumulation images, real nighttime water accumulation images, simulated daytime water accumulation images, and simulated nighttime water accumulation images are obtained based on a reflection consistency decoder. The structure of the reflection consistency decoder is as follows: Figure 4 As shown,

[0050] Furthermore, the formula for reflection consistency loss is expressed as:

[0051]

[0052] in, For reflection consistency loss, This is a reflection image of actual daytime floodwater. To simulate the reflection pattern of water accumulation at night, This is a reflection image of real nighttime floodwater. This is a reflection image simulating daytime water accumulation.

[0053] In the current embodiment, the structures of the daytime scene discriminator and the nighttime scene discriminator are as follows: Figure 5As shown, the daytime scene discriminator uses an encoder with stacked transformer layers as its backbone to receive real daytime water accumulation images and simulated daytime water accumulation images as input. The output is a classification result indicating whether the images are real or simulated, aiming to distinguish real daytime water accumulation images from simulated daytime water accumulation images within their corresponding daytime domain. The nighttime scene discriminator receives real nighttime water accumulation images and simulated nighttime water accumulation images as input, outputting a classification result indicating whether the images are real or simulated, distinguishing real nighttime water accumulation images from simulated daytime water accumulation images within their corresponding nighttime domain. It should be noted that the specific structures and workflows of the daytime and nighttime scene discriminators are existing technologies well-known to those skilled in the art and will not be described in detail here.

[0054] In the current embodiment, the total generation loss formula for the training process of the day-night bidirectional transformation architecture for water accumulation images is expressed as:

[0055]

[0056] in, For the total generation loss, For reflection consistency loss, To mitigate losses, this includes both daytime and nighttime loss mitigation. For identity regularization loss, , , These are the weighting coefficients.

[0057] Specifically, combating losses The formula is expressed as:

[0058]

[0059] in, It is a standard loss function for a recurrent adversarial architecture. These are real daytime images of floodwater. To simulate images of flooded areas at night, Images of accumulated water at night. To simulate images of water accumulation during the day. , These are the daytime scene discriminator and the nighttime scene discriminator, respectively. , These represent the averaging operations performed on the daytime scene discriminator and the nighttime scene discriminator, respectively. , This indicates "for all real nighttime images of flooding". Images of water accumulation during the day "The average logarithm of the discriminator's prediction of its truth value". , This indicates "for all simulated nighttime water accumulation images" and simulated daytime water accumulation images "The probability that the discriminator detects it as fake is logarithmic."

[0060] Specifically, identity regularization loss The formula is expressed as:

[0061]

[0062] in, This means "for a batch of real daytime water accumulation image samples, calculate their darkening transformation after passing through the darkening transformation unit." The output simulated nighttime flooded image The average value of the pixel difference between them. This means "for a batch of real nighttime water accumulation image samples, calculate their brightness transformation after passing through the brightening conversion unit." The output simulated daytime water accumulation image The average value of the pixel difference between them.

[0063] In the current embodiment, the parameters of the text encoder and the reflection-consistent decoder are kept frozen during training. The CLIP image encoder and the conditional U-Net in the darkening and brightening conversion units use lora to fine-tune and update their parameters. The total number of training iterations is 25,000. The batch size during training is 2 (i.e., each batch processes 2 images). The optimizer is AdamW, the initial learning rate is 5e-06, the momentum parameters beta1 is 0.9, beta2 is 0.999, the weight decay is 0.01, the epsilon value of the Adam optimizer is 1e-08, the maximum norm of gradient clipping is 10.0, and the learning rate adjustment strategy is a constant strategy.

[0064] Example 2

[0065] Based on the same concept, this application also proposes a reflection-based method. Figure 1 A consistent method for bidirectional day-night conversion of water accumulation images, including:

[0066] The process involves acquiring the water accumulation image to be converted and its corresponding scene prompts, and inputting these images into the day-night bidirectional conversion model for water accumulation images constructed in Example 1. When the water accumulation image to be converted is a daytime water accumulation image and the scene prompt is a nighttime scene prompt, the image and the corresponding scene prompt are input into the darkening conversion unit to obtain a simulated nighttime water accumulation image. When the water accumulation image to be converted is a nighttime water accumulation image and the scene prompt is a daytime scene prompt, the image and the corresponding scene prompt are input into the brightening conversion unit to obtain a simulated daytime water accumulation image.

[0067] Example 3

[0068] This embodiment also provides an electronic device, see reference. Figure 6 It includes a memory 404 and a processor 402, wherein the memory 404 stores a computer program and the processor 402 is configured to run the computer program to perform the steps in any of the above method embodiments.

[0069] Specifically, the processor 402 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0070] Memory 404 may include a mass storage device for data or instructions. For example, and not limitingly, memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 404 may include removable or non-removable (or fixed) media. Where appropriate, memory 404 may be internal or external to a data processing device. In a particular embodiment, memory 404 is non-volatile memory. In a particular embodiment, memory 404 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), Extended Data Out Dynamic Random-Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.

[0071] The memory 404 can be used to store or cache various data files that need to be processed and / or communicated, as well as possible computer program instructions executed by the processor 402.

[0072] Processor 402 reads and executes computer program instructions stored in memory 404 to implement any of the reflection-based methods described in the above embodiments. Figure 1 A method for constructing a day-night bidirectional conversion model for consistent water accumulation images.

[0073] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408, wherein the transmission device 406 is connected to the processor 402, and the input / output device 408 is connected to the processor 402.

[0074] The transmission device 406 can be used to receive or send data via a network. Specific examples of the network described above may include wired or wireless networks provided by the communication provider of the electronic device. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 406 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0075] The input / output device 408 is used to input or output information. In this embodiment, the input information may be a real daytime image of flooded area, a real nighttime image of flooded area, etc., and the output information may be a simulated daytime image of flooded area and a simulated nighttime image of flooded area, etc.

[0076] Optionally, in this embodiment, the processor 402 can be configured to perform the following steps via a computer program:

[0077] Multiple pairs of real day and night water accumulation images are obtained, including real daytime water accumulation images and real nighttime water accumulation images taken from the same location. Daytime scene prompts are generated for each real daytime water accumulation image, and nighttime scene prompts are generated for each real nighttime water accumulation image.

[0078] A two-way day-night conversion architecture for water accumulation images is constructed, including a brightening conversion unit and a darkening conversion unit. The brightening conversion unit receives a real nighttime water accumulation image and a corresponding daytime scene prompt, and generates a simulated daytime water accumulation image. The darkening conversion unit receives a real daytime water accumulation image and a corresponding nighttime scene prompt, and generates a simulated nighttime water accumulation image.

[0079] Reflectance maps of real daytime water accumulation images, real nighttime water accumulation images, simulated daytime water accumulation images, and simulated nighttime water accumulation images are obtained respectively. The semantic consistency between the reflection maps of simulated daytime water accumulation images and real nighttime water accumulation images is used as the first consistency loss, and the semantic consistency between the reflection maps of simulated nighttime water accumulation images and real daytime water accumulation images is used as the second consistency loss. The sum of the first consistency loss and the second consistency loss is used as the reflection consistency loss. Daytime adversarial loss is generated based on the simulated daytime water accumulation images and their corresponding real daytime water accumulation images. Nighttime adversarial loss is generated based on the simulated nighttime water accumulation images and their corresponding real nighttime water accumulation images.

[0080] The day-night bidirectional transformation model for water accumulation images was obtained by iteratively training the water accumulation image day-night bidirectional transformation architecture using multiple sets of real day and night water accumulation images. The total generation loss of the water accumulation image day-night bidirectional transformation architecture training process was the weighted sum of reflection consistency loss, daytime adversarial loss, nighttime adversarial loss and identity regularization loss.

[0081] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0082] Generally, various embodiments can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention can be implemented in hardware, while others can be implemented by firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flowcharts, or using some other graphical representation, it should be understood that, by way of non-limiting example, these blocks, apparatuses, systems, techniques, or methods described herein can be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.

[0083] Embodiments of the present invention can be implemented by computer software, which may be executable by a data processor of a mobile device, such as a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets, and / or macros can be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. The computer program product may include one or more computer-executable components configured to perform the embodiments when the program is run. The one or more computer-executable components may be at least one piece of software code or a portion thereof. Additionally, it should be noted in this respect that, as Figure 6Any box in the logical flow can represent a program step, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored on physical media such as memory chips or blocks of storage implemented within a processor, magnetic media such as hard disks or floppy disks, and optical media such as DVDs and their data variants, CDs, etc. The physical medium is a non-transient medium.

[0084] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0085] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for constructing a day-night bidirectional conversion model for water accumulation images based on reflectance consistency, characterized in that, Includes the following steps: Multiple pairs of real day and night water accumulation images are obtained, including real daytime water accumulation images and real nighttime water accumulation images taken from the same location. Daytime scene prompts are generated for each real daytime water accumulation image, and nighttime scene prompts are generated for each real nighttime water accumulation image. A two-way day-night conversion architecture for water accumulation images is constructed, including a brightening conversion unit and a darkening conversion unit. The brightening conversion unit receives a real nighttime water accumulation image and a corresponding daytime scene prompt, and generates a simulated daytime water accumulation image. The darkening conversion unit receives a real daytime water accumulation image and a corresponding nighttime scene prompt, and generates a simulated nighttime water accumulation image. Reflectance maps of real daytime water accumulation images, real nighttime water accumulation images, simulated daytime water accumulation images, and simulated nighttime water accumulation images are obtained respectively. A reflection consistency decoder is constructed based on the DecomNet structure. This decoder takes the water accumulation images as input and outputs a reflection map and an illumination map conforming to retinal cortex theory. The water accumulation images include real daytime water accumulation images, real nighttime water accumulation images, simulated daytime water accumulation images, and simulated nighttime water accumulation images. The semantic consistency between the reflection map of the simulated daytime water accumulation image and the reflection map of the real nighttime water accumulation image is used as the first consistency loss. The semantic consistency between the reflection map of the simulated nighttime water accumulation image and the reflection map of the real daytime water accumulation image is used as the second consistency loss. Semantic consistency is used as the second consistency loss, and the sum of the first consistency loss and the second consistency loss is used as the reflection consistency loss. A daytime adversarial loss is generated based on simulated daytime flood images and corresponding real daytime flood images. This daytime adversarial loss is the sum of the average logarithm of the discriminator's prediction that the simulated daytime flood image is false and the average logarithm of the discriminator's prediction that the real daytime flood image is true. A nighttime adversarial loss is generated based on simulated nighttime flood images and corresponding real nighttime flood images. This nighttime adversarial loss is the sum of the average logarithm of the discriminator's prediction that the simulated nighttime flood image is false and the average logarithm of the discriminator's prediction that the real nighttime flood image is true. The day-night bidirectional transformation model for water accumulation images is obtained by iteratively training the water accumulation image day-night bidirectional transformation architecture using multiple sets of real day and night water accumulation images. The total generation loss of the water accumulation image day-night bidirectional transformation architecture training process is the weighted sum of reflection consistency loss, daytime adversarial loss, nighttime adversarial loss, and identity regularization loss. The identity regularization loss is the average pixel difference between real daytime water accumulation images and corresponding simulated nighttime water accumulation images, and the average pixel difference between real nighttime water accumulation images and corresponding simulated daytime water accumulation images.

2. The method for constructing a day-night bidirectional conversion model for water accumulation images based on reflectance consistency according to claim 1, characterized in that, The pre-trained BLIP model generates daytime scene prompts for each real daytime water accumulation image and nighttime scene prompts for each real nighttime water accumulation image.

3. The method for constructing a day-night bidirectional conversion model for water accumulation images based on reflectance consistency according to claim 1, characterized in that, A pre-trained text encoder is used to convert daytime scene cues and nighttime scene cues into daytime text embedding vectors and nighttime text embedding vectors, respectively. The brightening conversion unit takes the daytime text embedding vector and a real nighttime water accumulation image as input, and the darkening conversion unit takes the nighttime text embedding vector and a real daytime water accumulation image as input.

4. The method for constructing a day-night bidirectional conversion model for water accumulation images based on reflectance consistency according to claim 1, characterized in that, The brightening conversion unit consists of a CLIP image encoder, a conditional U-Net, and a Transformer decoder. The CLIP image encoder encodes a real nighttime water accumulation image into a first nighttime conditional image noise with nighttime scene semantic features. The conditional U-Net fuses the first nighttime conditional image noise with daytime text embedding vectors to obtain a first daytime conditional image noise with daytime lighting conditions. The Transformer decoder generates a corresponding simulated daytime water accumulation image based on the first daytime conditional image noise. The darkening conversion unit has the same structure as the brightening conversion unit.

5. The method for constructing a day-night bidirectional conversion model for water accumulation images based on reflectance consistency according to claim 1, characterized in that, The formula for reflection consistency loss is expressed as: in, For reflection consistency loss, This is a reflection image of actual daytime floodwater. To simulate the reflection pattern of water accumulation at night, This is a reflection image of real nighttime floodwater. This is a reflection image simulating daytime water accumulation.

6. The method for constructing a day-night bidirectional transformation model for water accumulation images based on reflectance map consistency, as described in claim 1, wherein the total generation loss formula for the training process of the water accumulation image day-night bidirectional transformation architecture is expressed as: in, For the total generation loss, For reflection consistency loss, To mitigate losses, this includes both daytime and nighttime loss mitigation. For identity regularization loss, , , These are the weighting coefficients.

7. A method for bidirectional day-night conversion of water accumulation images based on reflectance consistency, characterized in that, include: Obtain the water accumulation image to be converted and the corresponding scene prompts. Input the water accumulation image to be converted and the corresponding scene prompts into the water accumulation image day-night bidirectional conversion model constructed by any one of claims 1-6. When the water accumulation image to be converted is a daytime water accumulation image and the scene prompts are nighttime scene prompts, input the water accumulation image to be converted and the corresponding scene prompts into the darkening conversion unit to obtain a simulated nighttime water accumulation image. When the water accumulation image to be converted is a nighttime water accumulation image and the scene prompts are daytime scene prompts, input the water accumulation image to be converted and the corresponding scene prompts into the brightening conversion unit to obtain a simulated daytime water accumulation image.

8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to execute the method for constructing a day-night bidirectional conversion model of a water accumulation image based on reflectance consistency as described in any one of claims 1-6 or the method for day-night bidirectional conversion of a water accumulation image based on reflectance consistency as described in claim 7.

9. A readable storage medium, characterized in that, The readable storage medium stores a computer program, which, when executed by a processor, implements a method for constructing a day-night bidirectional conversion model for water accumulation images based on reflectance consistency as described in any one of claims 1-6, or a method for day-night bidirectional conversion of water accumulation images based on reflectance consistency as described in claim 7.