A data processing method and apparatus

CN116665219BActive Publication Date: 2026-09-22HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310612909.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-26
Publication Date
2026-09-22
Estimated Expiration
2043-05-26

AI Technical Summary

Technical Problem

然而,现有的扩散模型在这方面的表现尚不理想,难以精确地控制生成图像中物体的几何约束关系

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116665219B_ABST
    Figure CN116665219B_ABST
Patent Text Reader

Abstract

A data processing method applied to the field of artificial intelligence, comprising: acquiring a first image and text information, the text information indicating a position constraint of at least one object in the image; the first image being an image obtained by noise adding processing through a noise adding module in a diffusion model; processing the text information according to a text encoder to obtain a first feature representation; obtaining a second image through a de-noising model in the diffusion model according to a fusion result of the first image and the first feature representation; and the object included in the second image satisfying the position constraint indicated by the text information. The application inputs the feature representation of the text information representing the position constraint of the object in the generated image and the image into the image generator together, and the image generator can more accurately obtain the image satisfying the geometric constraint specified in the text information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and more particularly to a data processing method and apparatus thereof. Background Technology

[0002] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0003] In recent years, diffusion models have made significant progress and attracted considerable attention in the generative field. Although probabilistic diffusion models perform exceptionally well in content creation, becoming one of the most popular generative models, they still have certain limitations when applied to data generation for perceptual tasks such as object detection. Specifically, data generation for complex perceptual tasks, such as object detection and pose estimation, requires fine-grained geometric control, such as bounding box positions. However, existing diffusion models do not perform ideally in this regard, struggling to precisely control the geometric constraints of objects in the generated images. Summary of the Invention

[0004] This application provides a data processing method that can obtain more accurate images that satisfy geometric constraints.

[0005] In a first aspect, this application provides a data processing method, the method comprising: acquiring a first image and text information, the text information indicating positional constraints of at least one object in the image; the first image being an image obtained by adding noise through a noise-adding module in a diffusion model; processing the text information according to a text encoder to obtain a first feature representation; and obtaining a second image by using a denoising model in the diffusion model based on a fusion result of the first image and the first feature representation; wherein the objects included in the second image satisfy the positional constraints indicated by the text information.

[0006] In this embodiment, the feature representation of the text information representing the positional constraints of objects in the generated image and the image are jointly input into the image generator. Compared with the prior art, which only uses the first image as the input of the image generator, the image generator in this application can more accurately obtain an image that satisfies the geometric constraints specified in the text information.

[0007] Furthermore, by leveraging the portability of text encoders, it is possible to avoid designing specific conditional coding network modules for a particular geometric condition, thereby making the entire framework highly flexible and scalable.

[0008] In one possible implementation, the first image is an image obtained by adding noise to the original image through a noise-adding module in a diffusion model. The original image includes the at least one object, and the text information specifically includes the size of the detection box corresponding to each object in the original image and the position of the detection box in the original image.

[0009] In one possible implementation, the text information may further include: the category of the image content in the detection frame, or the camera's perspective information when the first image was captured.

[0010] In one possible implementation, the object is a key point on a person used to indicate posture.

[0011] In one possible implementation, the fusion result is obtained by interacting with the first image and the first feature representation based on an attention mechanism.

[0012] Secondly, this application provides a data processing method, the method comprising: acquiring a first image and text information, the text information indicating the positional constraints of at least one object in the image; the first image being an image obtained by adding noise to an original image through a noise-adding module in a diffusion model; processing the text information according to a text encoder to obtain a first feature representation; obtaining a second image through an image generator in the diffusion model based on the fusion result of the first image and the first feature representation; determining a loss based on the second image and the original image, and updating the text encoder and the noise-reduction model according to the loss.

[0013] In one possible implementation, the at least one object is located in the foreground region of the second image; determining the loss based on the second image and the original image includes: determining a first loss based on the foreground region of the second image and the foreground region of the original image; determining a second loss based on the background region of the second image and the background region of the original image; and fusing the first loss and the second loss by weighting to obtain the loss; wherein the weight corresponding to the first loss is greater than the weight corresponding to the second loss.

[0014] In one possible implementation, to alleviate the imbalance problem in the foreground region of the generated image, the magnitude of the loss corresponding to the foreground region and the loss corresponding to the background region can be controlled during the training process. This helps the model focus more on the generation of foreground objects, thereby improving the generation effect of the foreground region.

[0015] In one possible implementation, the at least one object includes a first object and a second object; the first object is located in a first foreground region in the second image, and the second object is located in a second foreground region in the second image; determining the loss based on the second image and the original image includes: determining a first sub-loss based on the first foreground region and a foreground region in the original image corresponding to the first foreground region; determining a second sub-loss based on the second foreground region and a foreground region in the original image corresponding to the second foreground region; fusing the first sub-loss and the second sub-loss by weighting to obtain a first loss; wherein the first loss is a portion of the loss, the area of ​​the first foreground region is larger than that of the second foreground region, and the weight corresponding to the first sub-loss is smaller than the weight corresponding to the second foreground region.

[0016] In one possible implementation, to alleviate the imbalance problem in the foreground region of the generated image, the magnitude of the loss corresponding to small objects (or small objects) and the loss corresponding to large objects in the foreground region can be controlled during the training process to improve the generation effect of small objects.

[0017] In one possible implementation, the first image is an image obtained by adding noise to the original image through a noise-adding module in a diffusion model. The original image includes the at least one object, and the text information specifically includes the size of the detection box corresponding to each object in the original image and the position of the detection box in the original image.

[0018] In one possible implementation, the text information may further include: the category of the image content in the detection frame, or the camera's perspective information when the first image was captured.

[0019] In one possible implementation, the object is a key point on a person used to indicate posture.

[0020] In one possible implementation, the fusion result is obtained by interacting with the first image and the first feature representation based on an attention mechanism.

[0021] Thirdly, this application provides a data processing apparatus, the apparatus comprising:

[0022] An acquisition module is used to acquire a first image and text information, wherein the text information indicates the positional constraints of at least one object in the image; the first image is an image obtained by adding noise through a noise-adding module in a diffusion model.

[0023] The processing module is used to process the text information according to the text encoder to obtain a first feature representation;

[0024] Based on the fusion result of the first image and the first feature representation, a second image is obtained through the denoising model in the diffusion model; the objects included in the second image satisfy the positional constraints indicated by the text information.

[0025] In one possible implementation, the first image is an image obtained by adding noise to the original image through a noise-adding module in a diffusion model. The original image includes the at least one object, and the text information specifically includes the size of the detection box corresponding to each object in the original image and the position of the detection box in the original image.

[0026] In one possible implementation, the text information may further include: the category of the image content in the detection frame, or the camera's perspective information when the first image was captured.

[0027] In one possible implementation, the object is a key point on a person used to indicate posture.

[0028] In one possible implementation, the fusion result is obtained by interacting with the first image and the first feature representation based on an attention mechanism.

[0029] Fourthly, this application provides a data processing apparatus, the apparatus comprising:

[0030] An acquisition module is used to acquire a first image and text information, wherein the text information indicates the positional constraints of at least one object in the image; the first image is an image obtained by adding noise to the original image through a noise-adding module in a diffusion model.

[0031] The processing module is used to process the text information according to the text encoder to obtain a first feature representation;

[0032] Based on the fusion result of the first image and the first feature representation, a second image is obtained through the image generator in the diffusion model;

[0033] Based on the second image and the original image, a loss is determined, and the text encoder and the denoising model are updated according to the loss.

[0034] In one possible implementation, the processing module is specifically used for:

[0035] A first loss is determined based on the foreground region of the second image and the foreground region of the original image;

[0036] The second loss is determined based on the background region of the second image and the background region of the original image;

[0037] The first loss and the second loss are combined by weighting to obtain the loss; wherein the weight corresponding to the first loss is greater than the weight corresponding to the second loss.

[0038] In one possible implementation, the at least one object includes a first object and a second object; the first object is located in a first foreground region of the second image, and the second object is located in a second foreground region of the second image; the processing module is specifically used for:

[0039] A first sub-loss is determined based on the first foreground region and the foreground region in the original image corresponding to the first foreground region;

[0040] The second sub-loss is determined based on the second foreground region and the foreground region in the original image corresponding to the second foreground region;

[0041] The first sub-loss and the second sub-loss are fused by weighting to obtain the first loss; wherein the first loss is a part of the loss, the area of ​​the first foreground region is larger than that of the second foreground region, and the weight corresponding to the first sub-loss is smaller than the weight corresponding to the second foreground region.

[0042] In one possible implementation, the first image is an image obtained by adding noise to the original image through a noise-adding module in a diffusion model. The original image includes the at least one object, and the text information specifically includes the size of the detection box corresponding to each object in the original image and the position of the detection box in the original image.

[0043] In one possible implementation, the text information may further include: the category of the image content in the detection frame, or the camera's perspective information when the first image was captured.

[0044] In one possible implementation, the object is a key point on a person used to indicate posture.

[0045] In one possible implementation, the fusion result is obtained by interacting with the first image and the first feature representation based on an attention mechanism.

[0046] Fifthly, embodiments of this application provide a training apparatus, which may include a memory, a processor, and a bus system, wherein the memory is used to store a program, and the processor is used to execute the program in the memory to perform the methods described in the first aspect above and any of its optional methods.

[0047] In a sixth aspect, embodiments of this application provide an execution apparatus, which may include a memory, a processor, and a bus system, wherein the memory is used to store a program, and the processor is used to execute the program in the memory to perform the methods described in the second aspect above and any of its optional methods.

[0048] In a seventh aspect, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the methods described in the first aspect and any optional methods thereof, as well as the methods described in the second aspect and any optional methods thereof.

[0049] Eighthly, embodiments of this application provide a computer program that, when run on a computer, causes the computer to perform the methods described in the first aspect and any optional methods thereof, as well as the methods described in the second aspect and any optional methods thereof.

[0050] Ninthly, this application provides a chip system including a processor for supporting an execution data processing device in performing the functions involved in the foregoing aspects, such as transmitting or processing data involved in the foregoing methods; or, information. In one possible design, the chip system further includes a memory for storing program instructions and data necessary for the execution device or training device. The chip system may be composed of chips or may include chips and other discrete devices. Attached Figure Description

[0051] Figure 1A A structural diagram illustrating the main framework of artificial intelligence;

[0052] Figure 1B Hezhi Figure 1C This is a schematic diagram of the application system framework of the present invention;

[0053] Figure 1D This is a schematic diagram of an optional hardware structure for a terminal.

[0054] Figure 2 This is a schematic diagram of the structure of a server;

[0055] Figure 3 This is a schematic diagram of a system architecture according to this application;

[0056] Figure 4A A process for providing a cloud service;

[0057] Figure 4B This is an illustration of one application scenario;

[0058] Figure 5 A flowchart illustrating a data processing method provided in an embodiment of this application;

[0059] Figures 6 to 8A schematic diagram of a data processing method provided in an embodiment of this application;

[0060] Figure 9A A schematic diagram of a data processing method provided in an embodiment of this application;

[0061] Figure 9B This is a schematic diagram illustrating the beneficial effects of the embodiments of this application;

[0062] Figure 10 A schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application;

[0063] Figure 11 A schematic diagram of the structure of the execution device provided in the embodiments of this application;

[0064] Figure 12 A schematic diagram of the structure of the training device provided in the embodiments of this application;

[0065] Figure 13 This is a schematic diagram of a chip structure provided in an embodiment of this application. Detailed Implementation

[0066] The embodiments of the present invention will now be described with reference to the accompanying drawings. The terminology used in the embodiments section is for illustrative purposes only and is not intended to limit the scope of the invention.

[0067] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0068] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0069] The terms “substantially,” “about,” and similar terms used herein are used as approximations rather than as terms of degree, and are intended to take into account the inherent biases of measurements or calculations known to those skilled in the art. Furthermore, the use of “may” in describing embodiments of the invention refers to “one or more possible embodiments.” The terms “use,” “using,” and “used” used herein are to be considered synonymous with the terms “utilize,” “utilizing,” and “utilized,” respectively. Additionally, the term “exemplary” is intended to refer to an instance or illustration.

[0070] First, the overall workflow of the artificial intelligence system is described; please refer to [link / reference]. Figure 1A , Figure 1A The diagram illustrates a structural framework for artificial intelligence (AI). The framework is further elaborated below along two dimensions: the "Intelligent Information Chain" (horizontal axis) and the "IT Value Chain" (vertical axis). The "Intelligent Information Chain" reflects a series of processes from data acquisition to processing. For example, it could be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, and intelligent execution and output. In this process, data undergoes a condensation process of "data—information—knowledge—wisdom." The "IT Value Chain" reflects the value that AI brings to the information technology industry, from the underlying infrastructure of human intelligence and information (provided and processed through technological means) to the industrial ecosystem of the system.

[0071] (1) Infrastructure

[0072] Infrastructure provides computing power to support artificial intelligence systems, enabling communication with the external world and providing support through a basic platform. This communication occurs through sensors; computing power is provided by intelligent chips (hardware acceleration chips such as CPUs, NPUs, GPUs, ASICs, and FPGAs); and the basic platform includes distributed computing frameworks and related platform guarantees and support, which may include cloud storage and computing, interconnected networks, etc. For example, sensors communicate with the outside world to acquire data, and this data is provided to intelligent chips in the distributed computing system provided by the basic platform for computation.

[0073] (2) Data

[0074] The data at the next layer of infrastructure is used to represent the data sources in the field of artificial intelligence. The data involves graphics, images, voice, text, and IoT data from traditional devices, including business data from existing systems and sensor data such as force, displacement, liquid level, temperature, and humidity.

[0075] (3) Data processing

[0076] Data processing typically includes methods such as data training, machine learning, deep learning, search, reasoning, and decision-making.

[0077] Among them, machine learning and deep learning can perform intelligent information modeling, extraction, preprocessing, and training on data, including symbolization and formalization.

[0078] Reasoning refers to the process in which, in a computer or intelligent system, the machine thinks and solves problems by simulating human intelligent reasoning, based on reasoning control strategies and using formalized information. Typical functions include search and matching.

[0079] Decision-making refers to the process of making decisions based on intelligent information after reasoning, and it typically provides functions such as classification, sorting, and prediction.

[0080] (4) General ability

[0081] After the data processing mentioned above, the results of the data processing can be used to form some general capabilities, such as algorithms or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.

[0082] (5) Smart Products and Industry Applications

[0083] Intelligent products and industry applications refer to products and applications of artificial intelligence systems in various fields. They are the encapsulation of overall artificial intelligence solutions, productizing intelligent information decision-making and realizing practical applications. Their application areas mainly include: intelligent terminals, intelligent transportation, intelligent healthcare, autonomous driving, smart cities, etc.

[0084] This application can be applied to the field of natural language processing in the field of artificial intelligence. The following will introduce several application scenarios that have been implemented in products, taking natural language processing as an example.

[0085] First, we will introduce the application scenarios of this application. This application can be applied, but is not limited to, to applications with image generation or natural language synthesis functions (hereinafter referred to as generation applications) or cloud services provided by cloud-side servers, etc., which will be introduced separately below:

[0086] I. Generating class applications

[0087] The product form of this application embodiment can be a generative application. Generative applications can run on terminal devices or cloud servers.

[0088] In one possible implementation, a generative application can perform an image generation task and obtain the processing result.

[0089] For example, generative applications can implement image generation tasks that include at least diffusion-based methods, but are not limited to this.

[0090] In one possible implementation, a user can open a generative application installed on a terminal device and input image data and text data (the text may be triggered by an instruction, not necessarily actively input by the user). The generative application can process the image and text using a model trained by the method provided in the embodiments of this application, or by the method provided in the embodiments of this application, and present the processing result to the user (the presentation method may include, but is not limited to, displaying, playing, saving, uploading to the cloud, etc.).

[0091] In one possible implementation, a user can open a generative application installed on a terminal device and input image and text data. The generative application can then send the image and text data to a cloud-based server. The cloud-based server processes the image or text using a model trained by the method provided in this application embodiment and sends the processing result back to the terminal device. The terminal device can then present the processing result to the user (the presentation method may include, but is not limited to, displaying, playing, saving, or uploading to the cloud).

[0092] For example, image generation tasks can be specifically applied to, but are not limited to, the following scenarios:

[0093] Scenario 1: Generation of detection data for autonomous driving scenarios.

[0094] In the scenario of generating autonomous driving detection data, it is necessary to generate images with rich, realistic, and diverse traffic environments. These images should include various road types (such as city streets, highways, etc.), different weather conditions (sunny, rainy, snowy, etc.), multiple traffic participants (pedestrians, cyclists, cars, trucks, etc.), and various traffic rules and signals (traffic lights, stop signs, pedestrian crossings, etc.). Furthermore, the generated images also need to take into account various camera perspectives and positions to simulate the visual perception capabilities of autonomous driving systems in real-world road conditions. Figure 8 As shown, given the layout of the autonomous driving scene in the lower left corner, multiple autonomous driving data with the same layout can be generated. Figure 8 (As shown in the upper right corner).

[0095] Scenario 2: Smartwatch face data generation.

[0096] In the scenario of generating smartphone watch faces, it is necessary to generate diverse, personalized, and highly realistic watch face elements based on specific watch face layouts. These watch face elements include hands (hour, minute, and second hands), day of the week display, date display, step count, heart rate monitoring, battery level, and other information. Furthermore, the generated watch faces must consider various design styles, color schemes, and fonts to meet users' personalized needs and aesthetic preferences.

[0097] Scenario 3: AI model generation in e-commerce scenarios.

[0098] Reference Figure 4B In AI-powered model generation for e-commerce scenarios, diverse clothing combinations need to be generated based on a specified model's styling to showcase to potential consumers. First, the model needs to receive the user-input model's styling, including features such as body shape and posture. Then, based on these features, the generation algorithm will generate a series of clothing combinations matching the model's styling. These combinations may include different types of tops, pants, skirts, coats, shoes, etc. During the generation process, the algorithm needs to consider details such as the style, color, and pattern of the clothing, ensuring that the generated combinations are visually appealing and realistic. Furthermore, to meet the needs of different consumers, the generated clothing combinations should be diverse, covering different styles, occasions, and seasons.

[0099] The following sections will introduce the generated application class in this application embodiment from the perspectives of functional architecture and product architecture that implements the functions.

[0100] Reference Figure 1B , Figure 1B This is a schematic diagram of the functional architecture of the generated application class in the embodiments of this application:

[0101] In one possible implementation, such as Figure 1B As shown, the generative application 102 can receive input parameters 101 (e.g., including images or text) and generate processing results 103. The generative application 102 can be executed on at least one computer system (for example) and includes computer code that, when executed by one or more computers, causes the computers to execute a model trained by the methods provided in the embodiments of this application.

[0102] Reference Figure 1C , Figure 1C This is a schematic diagram of the entity architecture for running the generated application in this embodiment of the application:

[0103] See Figure 1C , Figure 1C A schematic diagram of a system architecture is shown. The system may include a terminal 100 and a server 200. The server 200 may include one or more servers (…). Figure 1C (The example includes a server), where server 200 can provide image synthesis or natural language generation functions for one or more terminals.

[0104] The terminal 100 may have a generation application installed, or a webpage related to image synthesis or natural language generation functions opened. The application and webpage can provide an interface. The terminal 100 can receive relevant parameters input by the user on the image synthesis or natural language generation function interface and send the parameters to the server 200. The server 200 can obtain the processing result based on the received parameters and return the processing result to the terminal 100.

[0105] It should be understood that in some optional implementations, the terminal 100 can also complete the action of obtaining the processing result based on the received parameters on its own, without the need for the server to cooperate. This application embodiment is not limited to this.

[0106] The following description Figure 1C The product form of the mid-terminal 100;

[0107] The terminal 100 in this application embodiment can be a mobile phone, tablet computer, wearable device, vehicle device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc., and this application embodiment does not impose any restrictions on it.

[0108] Figure 1D A schematic diagram of an optional hardware structure for terminal 100 is shown.

[0109] refer to Figure 1D As shown, the terminal 100 may include a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160 (optional), a speaker 161 (optional), a microphone 162 (optional), a processor 170, an external interface 180, a power supply 190, and other components. Those skilled in the art will understand that... Figure 1D These are merely examples of terminals or multi-functional devices and do not constitute a limitation on terminals or multi-functional devices. They may include more or fewer components than shown in the illustration, or combine certain components, or use different components.

[0110] The input unit 130 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the portable multi-functional device. Specifically, the input unit 130 may include a touchscreen 131 (optional) and / or other input devices 132. The touchscreen 131 can collect touch operations performed by the user on or near it (such as operations performed by the user using fingers, knuckles, styluses, or any suitable object on or near the touchscreen), and drive the corresponding connection devices according to a pre-set program. The touchscreen can detect the user's touch actions, convert the touch actions into touch signals and send them to the processor 170, and can receive and execute commands sent by the processor 170; the touch signal includes at least touch point coordinate information. The touchscreen 131 can provide an input interface and an output interface between the terminal 100 and the user. In addition, various types of touchscreens, such as resistive, capacitive, infrared, and surface acoustic wave, can be used to implement the touchscreen. Besides the touchscreen 131, the input unit 130 may also include other input devices. Specifically, other input devices 132 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.

[0111] Other input devices 132 can receive input image data or text data.

[0112] The display unit 140 can be used to display information input by the user or information provided to the user, various menus of the terminal 100, interactive interfaces, file display, and / or playback of any multimedia file. In this embodiment, the display unit 140 can be used to display the interface of a generation-type application, processing results, etc.

[0113] The memory 120 can be used to store instructions and data. The memory 120 may primarily include an instruction storage area and a data storage area. The data storage area can store various types of data, such as multimedia files and text. The instruction storage area can store software units such as operating systems, applications, and instructions required for at least one function, or subsets or extended sets thereof. It may also include non-volatile random access memory. It provides the processor 170 with hardware, software, and data resources for managing the computing device, supporting control software and applications. It is also used for storing multimedia files, as well as storing running programs and applications.

[0114] The processor 170 is the control center of the terminal 100. It connects various parts of the terminal 100 via various interfaces and lines. By running or executing instructions stored in the memory 120 and calling data stored in the memory 120, it performs various functions of the terminal 100 and processes data, thereby controlling the terminal device as a whole. Optionally, the processor 170 may include one or more processing units; preferably, the processor 170 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 170. In some embodiments, the processor and memory can be implemented on a single chip; in some embodiments, they can also be implemented separately on independent chips. The processor 170 can also be used to generate corresponding operation control signals, send them to the corresponding components of the computing processing device, read and process data in the software, especially read and process data and programs in the memory 120, so that the various functional modules therein perform corresponding functions, thereby controlling the corresponding components to act according to the instructions.

[0115] The memory 120 can be used to store software code related to the data processing method, and the processor 170 can execute the steps of the chip's data processing method, and can also schedule other units (such as the above-mentioned input unit 130 and display unit 140) to achieve the corresponding functions.

[0116] The radio frequency unit 110 (optional) can be used for receiving and transmitting signals during information transmission or calls. For example, it can receive downlink information from the base station and process it for the processor 170; additionally, it can transmit uplink data to the base station. Typically, the RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, the radio frequency unit 110 can also communicate wirelessly with network devices and other devices. This wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0117] In this embodiment of the application, the radio frequency unit 110 can send image data or text data to the server 200 and receive the processing results sent by the server 200.

[0118] It should be understood that the radio frequency unit 110 is optional and can be replaced with other communication interfaces, such as a network port.

[0119] The terminal 100 also includes a power supply 190 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.

[0120] Terminal 100 also includes an external interface 180, which can be a standard Micro USB interface or a multi-pin connector, which can be used to connect terminal 100 to other devices for communication or to connect a charger to charge terminal 100.

[0121] Although not shown, terminal 100 may also include a flash, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with various functions, etc., which will not be described in detail here. Some or all of the methods described below can be applied to, for example... Figure 1D In the terminal 100 shown.

[0122] The following description Figure 1C The product form of the mid-range server 200;

[0123] Figure 2 A structural diagram of a server 200 is provided, as follows: Figure 2 As shown, server 200 includes bus 201, processor 202, communication interface 203, and memory 204. Processor 202, memory 204, and communication interface 203 communicate with each other via bus 201.

[0124] Bus 201 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 2 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0125] The processor 202 can be any one or more of the following processors: central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP), or digital signal processor (DSP).

[0126] Memory 204 may include volatile memory, such as random access memory (RAM). Memory 204 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0127] The memory 204 can be used to store software code related to the data processing method, and the processor 202 can execute the steps of the chip's data processing method, and can also schedule other units to achieve corresponding functions.

[0128] It should be understood that the aforementioned terminal 100 and server 200 can be centralized or distributed devices. The processors (e.g., processor 170 and processor 202) in the aforementioned terminal 100 and server 200 can be hardware circuits (such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), general-purpose processors, digital signal processors (DSPs), microprocessors or microcontrollers, etc.) or combinations of these hardware circuits. For example, the processor can be a hardware system with instruction execution capabilities, such as a CPU or DSP, or a hardware system without instruction execution capabilities, such as an ASIC or FPGA, or a combination of the aforementioned hardware systems without instruction execution capabilities and hardware systems with instruction execution capabilities.

[0129] It should be understood that the steps related to the model inference process in the embodiments of this application involve AI-related operations. When performing AI operations, the instruction execution architecture of the terminal device and server is not limited to the processor-memory architecture described above. The following section will further explain... Figure 3 The system architecture provided in the embodiments of this application will be described in detail.

[0130] Figure 3 This is a schematic diagram of the system architecture provided for an embodiment of this application. Figure 3 As shown, the system architecture 500 includes an execution device 510, a training device 520, a database 530, a client device 540, a data storage system 550, and a data acquisition system 560.

[0131] The execution device 510 includes a calculation module 511, an I / O interface 512, a preprocessing module 513, and a preprocessing module 514. The calculation module 511 may include a target model / rule 501, while the preprocessing modules 513 and 514 are optional.

[0132] The execution device 510 can be a terminal device or a server that runs the aforementioned generation-type application.

[0133] The data acquisition device 560 is used to collect training samples. Training samples can be image data or text data, etc. After collecting the training samples, the data acquisition device 560 stores these training samples in the database 530.

[0134] The training device 520 can maintain training samples in the database 530 and obtain the target model / rule 501 from the neural network to be trained (e.g., the neural network model in the embodiments of this application (e.g., including text encoder, diffusion model, etc.)).

[0135] It should be understood that the training device 520 can perform a pre-training process on the neural network to be trained based on the training samples maintained in the database 530, or fine-tune the model based on the pre-training.

[0136] It should be noted that in practical applications, the training samples maintained in database 530 may not all come from the data acquisition device 560; they may also be received from other devices. Furthermore, it should be noted that training device 520 may not necessarily train the target model / rule 501 entirely based on the training samples maintained in database 530; it may also obtain training samples from the cloud or other sources for model training. The above description should not be construed as limiting the embodiments of this application.

[0137] The target model / rule 501 trained using training device 520 can be applied to different systems or devices, such as... Figure 3 The execution device 510 shown can be a terminal, such as a mobile phone terminal, tablet computer, laptop computer, augmented reality (AR) / virtual reality (VR) device, vehicle terminal, etc., or it can be a server, etc.

[0138] Specifically, the training device 520 can transfer the trained model to the execution device 510.

[0139] exist Figure 3 In the execution device 510, an input / output (I / O) interface 512 is configured for data interaction with external devices. Users can input data (such as image data or text data in this embodiment) into the I / O interface 512 through the client device 540.

[0140] Preprocessing modules 513 and 514 are used to preprocess the input data received from the I / O interface 512. It should be understood that preprocessing modules 513 and 514 may be absent, or only one preprocessing module may be used. When preprocessing modules 513 and 514 are absent, the calculation module 511 can be used directly to process the input data.

[0141] During the preprocessing of input data by the execution device 510, or during the calculation module 511 of the execution device 510 performing calculations and other related processes, the execution device 510 can call data, code, etc. in the data storage system 550 for corresponding processing, or store the data, instructions, etc. obtained from the corresponding processing into the data storage system 550.

[0142] Finally, the I / O interface 512 provides the processing result to the client device 540, thereby providing it to the user.

[0143] exist Figure 3 In the illustrated scenario, the user can manually provide input data, which can be done through the interface provided by I / O interface 512. Alternatively, the client device 540 can automatically send input data to I / O interface 512. If user authorization is required for the client device 540 to automatically send input data, the user can set the corresponding permissions in the client device 540. The user can view the output results of the execution device 510 on the client device 540, which can be presented in various forms such as display, sound, or animation. The client device 540 can also act as a data acquisition terminal, collecting the input data and output results of the input I / O interface 512 as shown in the figure, and storing them as new sample data in database 530. Alternatively, data can be collected directly from the I / O interface 512 without going through the client device 540, using the input data and output results of the input I / O interface 512 as shown in the figure, and storing them as new sample data in database 530.

[0144] It is worth noting that, Figure 3 This is merely a schematic diagram of a system architecture provided in an embodiment of this application. The positional relationships between the devices, components, modules, etc., shown in the diagram do not constitute any limitation. For example, in Figure 3 In this context, the data storage system 550 is an external storage device relative to the execution device 510. However, in other cases, the data storage system 550 may also be placed within the execution device 510. It should be understood that the aforementioned execution device 510 may be deployed within the client device 540.

[0145] From the inference side of the model:

[0146] In this embodiment, the computing module 511 of the execution device 520 can obtain the code stored in the data storage system 550 to implement the steps related to the model reasoning process in this embodiment.

[0147] In this embodiment of the application, the computing module 511 of the execution device 520 may include hardware circuits (such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), general-purpose processors, digital signal processors (DSPs), microprocessors or microcontrollers, etc.) or combinations of these hardware circuits. For example, the training device 520 may be a hardware system with instruction execution capabilities, such as a CPU or DSP, or a hardware system without instruction execution capabilities, such as an ASIC or FPGA, or a combination of the aforementioned hardware systems without instruction execution capabilities and hardware systems with instruction execution capabilities.

[0148] Specifically, the computing module 511 of the execution device 520 can be a hardware system with the function of executing instructions. The steps related to the model inference process provided in this application embodiment can be software code stored in the memory. The computing module 511 of the execution device 520 can obtain the software code from the memory and execute the obtained software code to implement the steps related to the model inference process provided in this application embodiment.

[0149] It should be understood that the computing module 511 of the execution device 520 can be a combination of a hardware system without the function of executing instructions and a hardware system with the function of executing instructions. Some steps related to the model reasoning process provided in the embodiments of this application can also be implemented by the hardware system in the computing module 511 of the execution device 520 without the function of executing instructions, which is not limited here.

[0150] From the training side of the model:

[0151] In this embodiment of the application, the training device 520 can access the memory ( Figure 3 (Not shown in the diagram, but can be integrated into the training device 520 or deployed separately from the training device 520) The code stored in the diagram can be used to implement the steps related to model training in the embodiments of this application.

[0152] In this embodiment of the application, the training device 520 may include hardware circuits (such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), general-purpose processors, digital signal processors (DSPs), microprocessors or microcontrollers, etc.) or combinations of these hardware circuits. For example, the training device 520 may be a hardware system with instruction execution capabilities, such as a CPU or DSP, or a hardware system without instruction execution capabilities, such as an ASIC or FPGA, or a combination of the aforementioned hardware systems without instruction execution capabilities and hardware systems with instruction execution capabilities.

[0153] It should be understood that the training device 520 can be a combination of a hardware system without the function of executing instructions and a hardware system with the function of executing instructions. Some steps related to the training of the neutralization model provided in the embodiments of this application can also be implemented by the hardware system in the training device 520 without the function of executing instructions, which is not limited here.

[0154] II. Cloud services provided by the server, such as image synthesis or natural language generation functions:

[0155] In one possible implementation, the server can provide image compositing services to the client side via an application programming interface (API).

[0156] In this process, the terminal device can send relevant parameters (such as images, text, and other data) to the server through the API provided by the cloud. The server can then obtain the processing results based on the received parameters and return the processing results to the terminal.

[0157] The description of the terminal and server can be found in the above embodiments, and will not be repeated here.

[0158] like Figure 4A The process of using an image compositing function cloud service provided by a cloud platform is illustrated.

[0159] 1. Activate and purchase content moderation services.

[0160] 2. Users can download the software development kit (SDK) corresponding to the content moderation service. Cloud platforms usually provide multiple development versions of the SDK for users to choose from according to their development environment needs, such as JAVA version SDK, Python version SDK, PHP version SDK, Android version SDK, etc.

[0161] 3. After downloading the corresponding version of the SDK to their local machine according to their needs, users can import the SDK project into their local development environment, configure and debug it in the local development environment, and develop other functions in the local development environment to form an application that integrates image synthesis capabilities.

[0162] 4. When an application needs to perform image compositing, it can trigger an API call for the image compositing function. When the application triggers the image compositing function, it sends an API request to the running instance of the image compositing service in the cloud environment. The API request carries an image or text, which is then processed by the running instance in the cloud environment to obtain the result.

[0163] 5. The cloud environment returns the processing results to the application, thus completing one image compositing function call.

[0164] Since the embodiments of this application involve a large number of neural network applications, for ease of understanding, the relevant terms and concepts such as neural networks involved in the embodiments of this application will be introduced below.

[0165] (1) Neural Network

[0166] A neural network can be composed of neural units, which can be defined as a computational unit that takes xs (i.e., input data) and an intercept of 1 as input. The output of this computational unit can be:

[0167]

[0168] Where s = 1, 2, ..., n, where n is a natural number greater than 1, Ws is the weight of xs, and b is the bias of the neural unit. f is the activation function of the neural unit, used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of this activation function can be used as the input of the next convolutional layer, and the activation function can be the sigmoid function. A neural network is a network formed by connecting multiple of the above-mentioned individual neural units together, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field, which can be a region composed of several neural units.

[0169] (2) Transformer layer

[0170] The neural network includes an embedding layer and at least one transformer layer. The at least one transformer layer can be N transformer layers (N being an integer greater than 0). Each transformer layer includes sequentially adjacent attention layers, add and normalize layers, feed-forward layers, and add and normalize layers. In the embedding layer, the current input is embedded to obtain multiple embedding vectors. In the attention layer, P input vectors are obtained from the layer above the first transformer layer. Using any first input vector among the P input vectors as the center, intermediate vectors corresponding to the first input vector are obtained based on the correlation between each input vector within a preset attention window and the first input vector. This process determines P intermediate vectors corresponding to the P input vectors. In the pooling layer, the P intermediate vectors are merged into Q output vectors, where the multiple output vectors obtained from the last transformer layer are used as feature representations of the current input.

[0171] (3) Attention mechanism

[0172] Attention mechanisms mimic the internal processes of biological observation—aligning internal experience with external senses to increase the precision of observation in specific areas. They enable the rapid sifting of high-value information from a large volume of data using limited attentional resources. Attention mechanisms can quickly extract important features from sparse data and are therefore widely used in natural language processing tasks, particularly machine translation. Self-attention mechanisms, an improvement on attention mechanisms, reduce reliance on external information and are better at capturing the internal correlations of data or features. The core idea of ​​attention mechanisms can be rewritten as follows:

[0173] In this formula, Lx = ||Source|| represents the length of the Source. The meaning is that the elements in the Source are imagined as a series of data pairs. Given a Query element in the Target, the similarity or relevance between the Query and each Key is calculated to obtain the weight coefficient of the Value corresponding to each Key. Then, the Values ​​are weighted and summed to obtain the final Attention value. Therefore, the Attention mechanism essentially performs a weighted sum of the Values ​​of the elements in the Source, while the Query and Key are used to calculate the weight coefficients of their corresponding Values. Conceptually, Attention can be understood as selectively filtering a small amount of important information from a large amount of information and focusing on this important information, ignoring most of the unimportant information. The focusing process is reflected in the calculation of the weight coefficients; the larger the weight, the more focused it is on its corresponding Value. That is, the weight represents the importance of the information, and the Value is the corresponding information. Self-attention can be understood as intra attention. The attention mechanism occurs between the elements of the Target (Query) and all elements of the Source. Self-attention refers to the attention mechanism that occurs between elements within the Source or between elements within the Target. It can also be understood as the attention calculation mechanism in the special case where Target = Source. The specific calculation process is the same, only the calculation object changes.

[0174] (4) Natural Language Processing (NLP)

[0175] Natural language is human language, and Natural Language Processing (NLP) is the processing of human language. NLP is a systematic process of analyzing, understanding, and extracting information from text data in an intelligent and efficient manner. By using NLP and its components, we can manage very large amounts of text data, perform numerous automated tasks, and solve a wide variety of problems, such as automatic summarization, machine translation (MT), named entity recognition (NER), relation extraction (RE), information extraction (IE), sentiment analysis, speech recognition, question answering systems, and topic segmentation, among others.

[0176] (5) Backpropagation algorithm

[0177] Convolutional neural networks can employ backpropagation (BP) to correct the parameters in the initial super-resolution model during training, thereby reducing the reconstruction error loss. Specifically, forward propagation of the input signal to the output generates an error loss; this error loss information is then propagated back to update the parameters in the initial super-resolution model, leading to convergence of the error loss. The backpropagation algorithm is an error-loss-driven backpropagation process aimed at obtaining the optimal parameters of the super-resolution model, such as the weight matrix.

[0178] (6) Loss Function

[0179] In training a deep neural network, to ensure the output closely approximates the desired predicted value, we compare the network's prediction with the target value. Based on the difference, we update the weight vector of each layer (usually pre-configuring parameters before the initial update). For example, if the prediction is too high, the weight vector is adjusted to predict a lower value. This adjustment continues until the deep neural network predicts the target value or a value very close to it. Therefore, we need to predefine "how to compare the difference between the predicted and target values," which is the loss function or objective function. These are important equations used to measure the difference between the predicted and target values. Taking the loss function as an example, a higher output value (loss) indicates a greater difference, and training the deep neural network becomes a process of minimizing this loss.

[0180] (7) Diffusion model

[0181] A diffusion model is a generative model used to generate data such as images and text. The core idea of ​​a diffusion model is to diffuse noise into the data and then gradually remove the noise to recover the original data. The diffusion model consists of two stages: a forward process (noise diffusion) and a reverse process (noise removal and recovery).

[0182] (8) layout-to-image (L2I)

[0183] Semantic layout is a computer vision task whose goal is to generate a realistic image based on an input semantic layout. The semantic layout typically contains information about the object's category, location, and shape, which guides the object's appearance in the final image during the generation process.

[0184] In recent years, diffusion models have made significant progress and attracted considerable attention in the generative field. Although probabilistic diffusion models perform exceptionally well in content creation, becoming one of the most popular generative models, they still have certain limitations when applied to data generation for perceptual tasks such as object detection. Specifically, data generation for complex perceptual tasks, such as object detection and pose estimation, requires fine-grained geometric control, such as bounding box positions. However, existing diffusion models do not perform ideally in this regard, struggling to precisely control the positions and relative relationships of objects in the generated images.

[0185] To address the aforementioned problems, embodiments of this application provide a data processing method. The data processing method of this application embodiment will be described in detail below with reference to the accompanying drawings.

[0186] Reference Figure 5 , Figure 5 This is a flowchart illustrating a data processing method provided in an embodiment of this application, such as... Figure 5 As shown in the embodiment of this application, a data processing method may include steps 501 to 503, which are described in detail below.

[0187] 501. Obtain a first image and text information, wherein the text information indicates the positional constraints of at least one object in the image; the first image is an image obtained by adding noise through a noise-adding module in a diffusion model.

[0188] In one possible implementation, the first image can be an image obtained by adding noise to the original image through a noise-adding module in the diffusion model.

[0189] The original image can be pre-stored on the terminal or server, obtained by the terminal from the outside world (such as the Internet), or captured in real time by the terminal, such as by the terminal's camera.

[0190] Among them, noise addition processing can be a random noise addition process in the forward propagation of the diffusion model.

[0191] In one possible implementation, in order to generate an image that has a similar style to the original image and satisfies specific geometric constraints, an original image and text information representing the geometric constraints can be specified as a prompt.

[0192] In one possible implementation, text information can be obtained, which may contain geometric control constraints (including but not limited to positional constraints, pose control information, etc.) for the image to be generated by the diffusion model. For example, the text information may indicate the positional constraints of at least one object in the image. The object may be a vehicle, a person, etc.

[0193] The text information can be geometric control information used to describe the objects included in the original image. In this case, the image generated by the diffusion model is equivalent to an image with the same geometric features as the original image. This is commonly used, but not limited to, scenarios 1 (autonomous driving scene detection data generation) and 2 (dashboard image generation) mentioned above.

[0194] The text information can also be geometric control information indicating objects that are not included in the original image but need to be included in the generated image. This is commonly used, but not limited to, scenario 3 (AI model generation in e-commerce scenarios) mentioned above.

[0195] In one possible implementation, the text information specifically includes the size of the detection box corresponding to each object in the image, and the position of the detection box in the image.

[0196] For example, the size of the detection box and its position in the image can be indicated by the coordinates of the diagonal endpoints of the detection box.

[0197] For example, the image space coordinates can be divided into a grid, and the vertex of each bounding box is represented by a location token corresponding to its position in the grid. For example, the location token can be an indication of the grid in which it is located.

[0198] In scenarios 1 and 2 described above, it is necessary to generate an image that has a similar style to the objects contained in the original image and the same geometric and positional features.

[0199] To achieve the above functions, and to ensure that the final model generated by the diffusion model possesses the geometric and positional features of the objects in the original image, the size and position of the detection boxes containing the objects can be extracted from the original image.

[0200] In one possible implementation, to ensure the realism of objects in the generated image, the text information further includes: the category of the image content in the detection box, or the camera's perspective information when the first image was captured. Including the category of the image content in the detection box in the text information ensures that the categories of objects in the generated image are consistent with the categories of objects included in the original image. Including perspective information in the text information makes the size and positional relationships between objects in the generated image more realistic and accurate (e.g., satisfying constraints such as objects appearing larger when closer and smaller when farther away).

[0201] For example, the original image can be captured by a camera on the vehicle, and the viewpoint information can be the orientation of the viewpoint when the camera captured the original image, such as forward, left front, right front, left side, right side, etc.

[0202] Taking scenario 1 as an example, refer to Figure 6 and Figure 7 For scenarios involving the generation of detection task data, the text information can include three parts: the detection box category c i Detection box coordinates b i And additional geometric conditions v (e.g., viewpoint information), where c i Both 'v' and 'v' can be directly represented as corresponding text descriptions. An example of a text description is as follows:

[0203]

[0204] In order to express continuous bounding box coordinates b in text information iThe spatial coordinates of an image can be divided into a grid, and the degree of each bounding box vertex is represented by a location token corresponding to its position on the grid. Figure 6 As shown: the category of the detection box on the left is truck, and the position constraints are the grid where the top left vertex of the detection box is located (grid 24) and the grid where the bottom right vertex is located (grid 40). The category of the detection box on the right is car, and the position constraints are the grid where the top left vertex of the detection box is located (grid 27) and the grid where the bottom right vertex is located (grid 44).

[0205] For example, the following prompt template can be used to construct text information:

[0206] An image of{view}camera with{bbox};

[0207] Here, "view" represents the camera's field of view, and "bbox" represents the location and category of the detection box.

[0208] Taking scenario 2 as an example, you can input an image containing the watch face as the original image, and the text information can be the position information and category of the detection boxes of various elements in the watch face (such as pointers, day of the week display, date display, step count, heart rate monitoring, battery level, etc.).

[0209] In scenario 3 or similar scenarios described above, it is necessary to generate an image that meets certain human poses based on the original image. Therefore, the text information needs to indicate the human poses.

[0210] In one possible implementation, the object is key points on a person used to indicate pose. That is, text information can indicate the positional constraints of multiple key points of the person in the image; for example, key points can be the person's joints.

[0211] 502. Process the text information according to the text encoder to obtain the first feature representation.

[0212] In one possible implementation, the text information can be input into a text encoder to obtain the first feature representation corresponding to the text information. The text encoder can be a model such as BERT or GPT, and is not limited here.

[0213] 503. Based on the fusion result of the first image and the first feature representation, a second image is obtained through the image generator in the diffusion model.

[0214] In one possible implementation, the first image and the first feature representation can be fused, for example, through an attention-based interaction, to obtain the fused result. It should be understood that before fusion, the dimensions of the first feature representation or the first image can be adjusted so that the adjusted first image and the first feature representation have the same size, thereby enabling information interaction.

[0215] For a detailed introduction to the image generator, please refer to the existing descriptions of diffusion models; they will not be repeated here.

[0216] 504. Determine the loss based on the second image and the original image, and update the text encoder and the denoising model based on the loss.

[0217] In one possible implementation, a loss can be determined based on the second image and the original image, and the text encoder and the denoising model can be updated based on the loss. The updated text encoder and denoising model can generate images that are similar in style to the original image and satisfy the geometric constraints specified in the text information, based on the original image and text information. In this embodiment, the feature representation of the text information representing the positional constraints of objects in the generated image and the image are jointly input into the image generator. Compared with the prior art, which only uses the first image as the input to the image generator, the image generator in this application can more accurately obtain images that satisfy the geometric constraints specified in the text information.

[0218] Furthermore, by leveraging the portability of text encoders, it is possible to avoid designing specific conditional coding network modules for a particular geometric condition, thereby making the entire framework highly flexible and scalable.

[0219] In one possible implementation, to alleviate the imbalance problem in the foreground region of the generated image, the magnitude of the loss corresponding to the foreground region and the loss corresponding to the background region can be controlled during the training process. This helps the model focus more on the generation of foreground objects, thereby improving the generation effect of the foreground region.

[0220] In this embodiment, at least one object in the generated image (i.e., the second image in this application) can be located in the foreground region of the image; when constructing the loss, a first loss can be determined based on the foreground region of the second image and the foreground region of the original image; a second loss can be determined based on the background region of the second image and the background region of the original image; the first loss and the second loss are fused by weighting to obtain the loss; wherein the weight corresponding to the first loss is greater than the weight corresponding to the second loss.

[0221] In this embodiment, constant reweighting can be used to distinguish between foreground and background regions in order to better generate foreground objects and assist in perception tasks such as object detection.

[0222] In one possible implementation, to alleviate the imbalance problem in the foreground region of the generated image, the magnitude of the loss corresponding to small objects (or small objects) and the loss corresponding to large objects in the foreground region can be controlled during the training process to improve the generation effect of small objects.

[0223] In one possible implementation, the at least one object includes a first object and a second object; the first object is located in a first foreground region in the second image, and the second object is located in a second foreground region in the second image; when constructing the loss, a first sub-loss can be determined based on the first foreground region and a foreground region in the original image corresponding to the first foreground region; a second sub-loss can be determined based on the second foreground region and a foreground region in the original image corresponding to the second foreground region; the first sub-loss and the second sub-loss are fused by weighting to obtain a first loss; wherein the first loss is a portion of the loss, the area of ​​the first foreground region is larger than that of the second foreground region, and the weight corresponding to the first sub-loss is smaller than the weight corresponding to the second foreground region. It should be understood that the loss may also include a loss term corresponding to the background region.

[0224] It should be understood that the specific weight can be related to the area value; for example, the larger the area, the smaller the weight.

[0225] The aforementioned weighting of foreground and background, or foreground regions, can be termed a reweighting process. For example, this mechanism comprises two parts:

[0226] 1. Constant reweighting: The loss weight of the foreground region is set to w (w≥1) to distinguish between the foreground and background regions;

[0227] 2. Area reweighting: In order to enhance the model's generation effect for small objects, the area of ​​each foreground object is further considered, and the smaller the area, the greater the loss weight will be.

[0228] For example, the specific value of the weight can be determined by referring to the following formula:

[0229]

[0230]

[0231] Among them, c i,jp represents the area of ​​the bounding box to which pixel (i,j) belongs, and p is an adjustable parameter. To improve numerical stability during fine-tuning, the reweighted mask m is... ′ Normalization yields m. (Refer to...) Figure 7 and Figure 8 , Figure 7 and Figure 8 An example of area reweighting.

[0232] Reference Figure 9A , Figure 9A This is a specific flowchart of an embodiment of this application.

[0233] The following section introduces the beneficial effects of the embodiments of this application through experiments: By training on the public dataset NuImages, referring to Table 1, the embodiments of this application (GeoDiffusion) can obtain the current best generation results (including image quality FID and object localization mAP), proving that GeoDiffusion can strictly satisfy the geometric conditions of the input while generating highly realistic images.

[0234] Table 1

[0235]

[0236] In addition, refer to Figure 9B The data generated by the extended model can be used to aid in the training of object detection models. By using GeoDiffusion-generated data to augment the real training dataset, the object detection model can achieve consistent performance improvements across all categories, especially for long-tail categories with sparse annotations (truck, trailer, and bus, where labeled data accounts for only 7.2%).

[0237] Table 2

[0238]

[0239] Meanwhile, GeoDiffusion demonstrates strong generalization capabilities for unseen scene layouts, fully meeting users' needs for simulating entirely new scenarios. Even for rare scenes outside of normal distributions, GeoDiffusion exhibits exceptional robustness.

[0240] Taking the general detection dataset COCO as an example, the following operation process is performed: Based on the category labels and bounding boxes of objects in the training set, geometric conditions (such as bounding boxes) are converted into text prompts to obtain image-text pairs; the pre-trained Text-to-Image diffusion model is fine-tuned using the constructed image-text pairs, and a foreground reweighting mechanism is executed during training to adaptively assign higher loss weights to foreground regions, while also considering the area difference weighting between foreground objects at the same time.

[0241] Table 3 shows the data generation results on the COCO dataset:

[0242] Table 3

[0243]

[0244] Furthermore, embodiments of this application also provide a data processing method, and the above-mentioned Figure 5 When the corresponding embodiments differ, this embodiment is based on Figure 5 The model inference process performed by the trained model in the corresponding embodiment may include: acquiring a first image and text information, wherein the text information indicates the positional constraints of at least one object in the image; the first image is an image obtained by adding noise through a noise-adding module in a diffusion model; processing the text information according to a text encoder to obtain a first feature representation; obtaining a second image by using a denoising model in the diffusion model based on the fusion result of the first image and the first feature representation; wherein the objects included in the second image satisfy the positional constraints indicated by the text information.

[0245] For a detailed explanation of the reasoning process, please refer to [link / reference]. Figure 5 The feedforward process in the corresponding embodiments is similar and will not be repeated here.

[0246] In one possible implementation, the first image is an image obtained by adding noise to the original image through a noise-adding module in a diffusion model. The original image includes the at least one object, and the text information specifically includes the size of the detection box corresponding to each object in the original image and the position of the detection box in the original image.

[0247] In one possible implementation, the text information may further include: the category of the image content in the detection frame, or the camera's perspective information when the first image was captured.

[0248] In one possible implementation, the object is a key point on a person used to indicate posture.

[0249] In one possible implementation, the fusion result is obtained by interacting with the first image and the first feature representation based on an attention mechanism.

[0250] Reference Figure 10 , Figure 10 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application, such as... Figure 10 As shown in the embodiment of this application, a data processing apparatus 1000 is provided, the apparatus comprising:

[0251] The acquisition module 1001 is used to acquire a first image and text information, wherein the text information indicates the positional constraints of at least one object in the image; the first image is an image obtained by adding noise to the original image through the noise-adding module in the diffusion model.

[0252] For a detailed description of the acquisition module 1001, please refer to the description of step 501 in the above embodiment, which will not be repeated here.

[0253] Processing module 1002 is used to process the text information according to the text encoder to obtain a first feature representation;

[0254] Based on the fusion result of the first image and the first feature representation, a second image is obtained through the image generator in the diffusion model;

[0255] Based on the second image and the original image, a loss is determined, and the text encoder and the denoising model are updated according to the loss.

[0256] For a detailed description of the processing module 1002, please refer to the description of steps 502 to 504 in the above embodiments, which will not be repeated here.

[0257] In one possible implementation, the processing module 1002 is specifically used for:

[0258] A first loss is determined based on the foreground region of the second image and the foreground region of the original image;

[0259] The second loss is determined based on the background region of the second image and the background region of the original image;

[0260] The first loss and the second loss are combined by weighting to obtain the loss; wherein the weight corresponding to the first loss is greater than the weight corresponding to the second loss.

[0261] In one possible implementation, the at least one object includes a first object and a second object; the first object is located in a first foreground region of the second image, and the second object is located in a second foreground region of the second image; the processing module 1002 is specifically used for:

[0262] A first sub-loss is determined based on the first foreground region and the foreground region in the original image corresponding to the first foreground region;

[0263] The second sub-loss is determined based on the second foreground region and the foreground region in the original image corresponding to the second foreground region;

[0264] The first sub-loss and the second sub-loss are fused by weighting to obtain the first loss; wherein the first loss is a part of the loss, the area of ​​the first foreground region is larger than that of the second foreground region, and the weight corresponding to the first sub-loss is smaller than the weight corresponding to the second foreground region.

[0265] In one possible implementation, the first image is an image obtained by adding noise to the original image through a noise-adding module in a diffusion model. The original image includes the at least one object, and the text information specifically includes the size of the detection box corresponding to each object in the original image and the position of the detection box in the original image.

[0266] In one possible implementation, the text information may further include: the category of the image content in the detection frame, or the camera's perspective information when the first image was captured.

[0267] Furthermore, embodiments of this application also provide a data processing apparatus, the apparatus comprising:

[0268] An acquisition module is used to acquire a first image and text information, wherein the text information indicates the positional constraints of at least one object in the image; the first image is an image obtained by adding noise through a noise-adding module in a diffusion model.

[0269] The processing module is used to process the text information according to the text encoder to obtain a first feature representation;

[0270] Based on the fusion result of the first image and the first feature representation, a second image is obtained through the denoising model in the diffusion model; the objects included in the second image satisfy the positional constraints indicated by the text information.

[0271] In one possible implementation, the first image is an image obtained by adding noise to the original image through a noise-adding module in a diffusion model. The original image includes the at least one object, and the text information specifically includes the size of the detection box corresponding to each object in the original image and the position of the detection box in the original image.

[0272] In one possible implementation, the text information may further include: the category of the image content in the detection frame, or the camera's perspective information when the first image was captured.

[0273] In one possible implementation, the object is a key point on a person used to indicate posture.

[0274] In one possible implementation, the fusion result is obtained by interacting with the first image and the first feature representation based on an attention mechanism.

[0275] The following describes an execution device provided in an embodiment of this application. Please refer to [link / reference]. Figure 11 , Figure 11 This is a schematic diagram of an execution device provided in an embodiment of this application. The execution device 1100 can specifically be a virtual reality (VR) device, a mobile phone, a tablet, a laptop, a smart wearable device, a monitoring data processing device, or a server, etc., and is not limited thereto. Specifically, the execution device 1100 includes: a receiver 1101, a transmitter 1102, a processor 1103, and a memory 1104 (wherein the execution device 1100 may have one or more processors 1103). Figure 11 (Taking a processor as an example), processor 1103 may include application processor 11031 and communication processor 11032. In some embodiments of this application, receiver 1101, transmitter 1102, processor 1103 and memory 1104 may be connected via bus or other means.

[0276] Memory 1104 may include read-only memory and random access memory, and provides instructions and data to processor 1103. A portion of memory 1104 may also include non-volatile random access memory (NVRAM). Memory 1104 stores processor and operation instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.

[0277] Processor 1103 controls the operation of the execution device. In specific applications, the various components of the execution device are coupled together through a bus system, which may include not only the data bus, but also power buses, control buses, and status signal buses. However, for clarity, all buses are referred to as the bus system in the diagram.

[0278] The methods disclosed in the embodiments of this application can be applied to or implemented by the processor 1103. The processor 1103 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 1103 or by instructions in software form. The processor 1103 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and may further include an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The processor 1103 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 1104. Processor 1103 reads the information from memory 1104 and, in conjunction with its hardware, completes the steps involved in the model inference process described above.

[0279] Receiver 1101 can be used to receive input digital or character information, and to generate signal inputs related to the settings and function control of the execution device. Transmitter 1102 can be used to output digital or character information through the first interface; transmitter 1102 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; transmitter 1102 may also include a display device such as a display screen.

[0280] This application also provides a training device; please refer to [link / reference]. Figure 12 , Figure 12This is a schematic diagram of a training device provided in an embodiment of this application. Specifically, the training device 1200 is implemented by one or more servers. The training device 1200 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1212 (e.g., one or more processors) and memory 1232, and one or more storage media 1230 (e.g., one or more mass storage devices) for storing application programs 1242 or data 1244. The memory 1232 and storage media 1230 can be temporary or persistent storage. The program stored in the storage media 1230 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the training device. Furthermore, the CPU 1212 may be configured to communicate with the storage media 1230 and execute the series of instruction operations in the storage media 1230 on the training device 1200.

[0281] The training device 1200 may also include one or more power supplies 1226, one or more wired or wireless network interfaces 1250, one or more input / output interfaces 1258; or, one or more operating systems 1241, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0282] In this embodiment, the central processing unit 1212 is used to perform actions related to model training in the above embodiments.

[0283] This application also provides a computer program product that, when run on a computer, causes the computer to perform steps as performed by the aforementioned execution device, or causes the computer to perform steps as performed by the aforementioned training device.

[0284] This application also provides a computer-readable storage medium storing a program for signal processing, which, when run on a computer, causes the computer to perform steps as performed by the aforementioned execution device, or causes the computer to perform steps as performed by the aforementioned training device.

[0285] The execution device, training device, or terminal device provided in this application embodiment can specifically be a chip. The chip includes a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, pins, or circuits. The processing unit can execute computer execution instructions stored in the storage unit to cause the chip within the execution device to execute the data processing method described in the above embodiments, or to cause the chip within the training device to execute the data processing method described in the above embodiments. Optionally, the storage unit can be a storage unit within the chip, such as a register or cache. Alternatively, the storage unit can be a storage unit located outside the chip within the wireless access device, such as a read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, such as random access memory (RAM).

[0286] For details, please refer to Figure 13 , Figure 13 This is a schematic diagram of a chip provided in an embodiment of this application. The chip can be represented as a neural network processor (NPU) 1300. The NPU 1300 is mounted as a coprocessor on the host CPU, and tasks are assigned by the host CPU. The core part of the NPU is the arithmetic circuit 1303, which is controlled by the controller 1304 to extract matrix data from the memory and perform multiplication operations.

[0287] In some implementations, the arithmetic circuit 1303 internally includes multiple processing engines (PEs). In some implementations, the arithmetic circuit 1303 is a two-dimensional pulsating array. The arithmetic circuit 1303 can also be a one-dimensional pulsating array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 1303 is a general-purpose matrix processor.

[0288] For example, suppose we have an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from the weight memory 1302 and caches it in each PE of the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from the input memory 1301 and performs matrix operations with matrix B. The partial result or the final result of the obtained matrix is ​​stored in the accumulator 1308.

[0289] Unified memory 1306 is used to store input and output data. Weight data is directly transferred to weight memory 1302 via Direct Memory Access Controller (DMAC) 1305. Input data is also transferred to unified memory 1306 via DMAC.

[0290] BIU stands for Bus Interface Unit, which is used for interaction between the AXI bus and the DMAC and the Instruction Fetch Buffer (IFB) 1309.

[0291] The Bus Interface Unit (BIU) 1310 is used by the instruction fetch memory 1309 to fetch instructions from external memory, and also by the memory access controller 1305 to fetch the original data of the input matrix A or the weight matrix B from external memory.

[0292] The DMAC is mainly used to move input data from external memory DDR to unified memory 1306, or to weight data to weight memory 1302, or to input data to input memory 1301.

[0293] The vector computation unit 1307 includes multiple processing units that further process the output of the computation circuit 1303 when needed, such as vector multiplication, vector addition, exponential operations, logarithmic operations, size comparisons, etc. It is mainly used for computation in non-convolutional / fully connected layers of neural networks, such as Batch Normalization, pixel-level summation, and upsampling of feature planes.

[0294] In some implementations, the vector computation unit 1307 can store the processed output vector in the unified memory 1306. For example, the vector computation unit 1307 can apply a linear function, or a nonlinear function, to the output of the computation circuit 1303, such as performing linear interpolation on the feature planes extracted by the convolutional layer, or, for example, accumulating a vector of values ​​to generate activation values. In some implementations, the vector computation unit 1307 generates normalized values, pixel-level summed values, or both. In some implementations, the processed output vector can be used as an activation input to the computation circuit 1303, for example, for use in subsequent layers of the neural network.

[0295] The instruction fetch buffer 1309 connected to the controller 1304 is used to store the instructions used by the controller 1304;

[0296] Unified memory 1306, input memory 1301, weighted memory 1302, and instruction fetch memory 1309 are all on-chip memories. External memory is proprietary to this NPU hardware architecture.

[0297] The processor mentioned above can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the above program.

[0298] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0299] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0300] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0301] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A data processing method, characterized in that, The method includes: A first image and text information are acquired, wherein the text information indicates the positional constraints of at least one object in the image; the first image is an image obtained by adding noise to an original image through a noise-adding module in a diffusion model, the original image includes the at least one object, and the text information is used to describe the geometric control information of the objects included in the original image, or to describe the geometric control information of at least one object to be added to the original image, wherein the text information specifically includes the size of the detection box corresponding to each object in the original image, and the position of the detection box in the original image; The text information is processed according to the text encoder to obtain a first feature representation; Based on the fusion result of the first image and the first feature representation, a second image is obtained through the denoising model in the diffusion model; the objects included in the second image satisfy the positional constraints indicated by the text information.

2. The method according to claim 1, characterized in that, The text information also includes: the category of the image content in the detection frame, or the camera's perspective information when the first image was captured.

3. The method according to claim 1, characterized in that, The object refers to key points on a person used to indicate posture.

4. The method according to any one of claims 1 to 3, characterized in that, The fusion result is obtained by interacting with the first image and the first feature representation based on an attention mechanism.

5. A data processing method, characterized in that, The method includes: A first image and text information are acquired, wherein the text information indicates the positional constraints of at least one object in the image; the first image is an image obtained by adding noise to an original image through a noise-adding module in a diffusion model, the original image includes the at least one object, and the text information is used to describe the geometric control information of the objects included in the original image, or to describe the geometric control information of at least one object to be added to the original image, wherein the text information specifically includes the size of the detection box corresponding to each object in the original image, and the position of the detection box in the original image; The text information is processed according to the text encoder to obtain a first feature representation; Based on the fusion result of the first image and the first feature representation, a second image is obtained through the image generator in the diffusion model; Based on the second image and the original image, a loss is determined, and the text encoder and the denoising model in the diffusion model are updated according to the loss.

6. The method according to claim 5, characterized in that, The at least one object is located in the foreground region of the second image; the step of determining the loss based on the second image and the original image includes: A first loss is determined based on the foreground region of the second image and the foreground region of the original image; The second loss is determined based on the background region of the second image and the background region of the original image; The first loss and the second loss are combined by weighting to obtain the loss; wherein the weight corresponding to the first loss is greater than the weight corresponding to the second loss.

7. The method according to claim 5 or 6, characterized in that, The at least one object includes a first object and a second object; the first object is located in a first foreground region in the second image, and the second object is located in a second foreground region in the second image; The step of determining the loss based on the second image and the original image further includes: A first sub-loss is determined based on the first foreground region and the foreground region in the original image corresponding to the first foreground region; The second sub-loss is determined based on the second foreground region and the foreground region in the original image corresponding to the second foreground region; The first sub-loss and the second sub-loss are fused by weighting to obtain the first loss; wherein the first loss is a part of the loss, the area of ​​the first foreground region is larger than that of the second foreground region, and the weight corresponding to the first sub-loss is smaller than the weight corresponding to the second foreground region.

8. The method according to claim 1, characterized in that, The text information also includes: the category of the image content in the detection frame, or the camera's perspective information when the first image was captured.

9. A data processing apparatus, characterized in that, The device includes: An acquisition module is used to acquire a first image and text information, wherein the text information indicates the positional constraints of at least one object in the image; the first image is an image obtained by adding noise to an original image through a noise-adding module in a diffusion model, the original image includes the at least one object, and the text information is used to describe the geometric control information of the objects included in the original image, or to describe the geometric control information of at least one object to be added to the original image, wherein the text information specifically includes the size of the detection box corresponding to each object in the original image, and the position of the detection box in the original image; The processing module is used to process the text information according to the text encoder to obtain a first feature representation; Based on the fusion result of the first image and the first feature representation, a second image is obtained through the denoising model in the diffusion model; the objects included in the second image satisfy the positional constraints indicated by the text information.

10. The apparatus according to claim 9, characterized in that, The text information also includes: the category of the image content in the detection frame, or the camera's perspective information when the first image was captured.

11. The apparatus according to claim 9, characterized in that, The object refers to key points on a person used to indicate posture.

12. The apparatus according to any one of claims 9 to 11, characterized in that, The fusion result is obtained by interacting with the first image and the first feature representation based on an attention mechanism.

13. A data processing apparatus, characterized in that, The device includes: An acquisition module is used to acquire a first image and text information, wherein the text information indicates the positional constraints of at least one object in the image; the first image is an image obtained by adding noise to an original image through a noise-adding module in a diffusion model, the original image includes the at least one object, and the text information is used to describe the geometric control information of the objects included in the original image, or to describe the geometric control information of at least one object to be added to the original image, wherein the text information specifically includes the size of the detection box corresponding to each object in the original image, and the position of the detection box in the original image; The processing module is used to process the text information according to the text encoder to obtain a first feature representation; Based on the fusion result of the first image and the first feature representation, a second image is obtained through the image generator in the diffusion model; Based on the second image and the original image, a loss is determined, and the text encoder and the denoising model in the diffusion model are updated according to the loss.

14. The apparatus according to claim 13, characterized in that, The processing module is specifically used for: A first loss is determined based on the foreground region of the second image and the foreground region of the original image; The second loss is determined based on the background region of the second image and the background region of the original image; The first loss and the second loss are combined by weighting to obtain the loss; wherein the weight corresponding to the first loss is greater than the weight corresponding to the second loss.

15. The apparatus according to claim 13 or 14, characterized in that, The at least one object includes a first object and a second object; the first object is located in a first foreground region of the second image, and the second object is located in a second foreground region of the second image; the processing module is specifically used for: A first sub-loss is determined based on the first foreground region and the foreground region in the original image corresponding to the first foreground region; The second sub-loss is determined based on the second foreground region and the foreground region in the original image corresponding to the second foreground region; The first sub-loss and the second sub-loss are fused by weighting to obtain the first loss; wherein the first loss is a part of the loss, the area of ​​the first foreground region is larger than that of the second foreground region, and the weight corresponding to the first sub-loss is smaller than the weight corresponding to the second foreground region.

16. The apparatus according to claim 13, characterized in that, The text information also includes: the category of the image content in the detection frame, or the camera's perspective information when the first image was captured.

17. A computer storage medium, characterized in that, The computer storage medium stores one or more instructions, which, when executed by one or more computers, cause the one or more computers to perform the operation of the method according to any one of claims 1 to 8.

18. A computer program product, characterized in that, Includes computer-readable instructions that, when executed on a computer device, cause the computer device to perform the method as described in any one of claims 1 to 8.

19. A system comprising at least one processor and at least one memory; the processor and the memory are connected via a communication bus and communicate with each other. The at least one memory is used to store code; The at least one processor is used to execute the code to perform the method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Model training method and device, target detection method and device, equipment and storage medium

    CN112434753A

  • Image generation method, and training method and device of image denoising model

    CN115222630A