Target recognition model training method and device, electronic equipment, storage medium and program product

By performing illumination correction and noise reduction on the foreground and background regions of sample images, training data under different lighting conditions is generated, which solves the problem of recognition accuracy of visual models in scenarios with changing lighting and improves the recognition capability of robot visual models.

CN121884034APending Publication Date: 2026-04-17UBTECH ROBOTICS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202512024762.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-29
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing visual models are difficult to adapt accurately to changing lighting conditions, resulting in low target recognition accuracy. In particular, the performance of the models degrades significantly under extreme lighting conditions, failing to meet the high-precision application requirements such as robot vision.

Method used

By performing illumination correction on the foreground and background regions of the sample images separately, and adding noise to the foreground region, sample images under different lighting conditions are generated, enriching the training data and improving the model's ability to recognize different lighting conditions.

Benefits of technology

It improves the recognition accuracy of the target recognition model under different lighting conditions, enhances the model's performance in extreme lighting scenarios, and meets the high-precision requirements of robot vision applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121884034A_ABST
    Figure CN121884034A_ABST
Patent Text Reader

Abstract

The invention provides a target recognition model training method and device, electronic equipment, a storage medium and a program product. The method comprises the following steps: acquiring a plurality of first sample images and sample labeling information corresponding to the first sample images, wherein the first sample images comprise a first foreground region image and a first background region image; performing the following processing on each first sample image: performing illumination correction processing on the first foreground region image and the first background region image based on a preset gamma coefficient to obtain a second foreground region image and a second background region image; performing noise adding processing on the second foreground region image to obtain a third foreground region image; combining the third foreground region image and the second background region image into a second sample image; and training a target recognition model based on the plurality of second sample images and the sample labeling information. According to the invention, the recognition accuracy of the target recognition model for images with different illumination intensities can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to artificial intelligence technology, and more particularly to a method, apparatus, electronic device, storage medium, and program product for training a target recognition model. Background Technology

[0002] Machine vision is a technology that integrates multiple disciplines such as image processing, pattern recognition, and artificial intelligence. It acquires scene images through visual sensors such as cameras, and uses visual models to analyze and interpret the image information to achieve functions such as object recognition, localization, and segmentation. It is widely used in automated scenarios such as robot grasping, industrial inspection, and intelligent sorting.

[0003] Current mainstream visual models (such as real-time image segmentation models) are mostly based on deep learning architectures, and their performance is highly dependent on training with a large number of labeled sample images. Sufficient and diverse samples enable the model to learn target features in different scenarios and improve generalization ability. However, in practical applications, the sample collection process is limited by factors such as environment and cost, which can easily lead to uneven sample distribution, with sample loss due to changes in lighting being particularly prominent.

[0004] Illumination is a key factor affecting image quality. Different lighting conditions (such as strong light, weak light, and shadows) can cause significant changes in the grayscale values ​​and texture features of target objects. Due to the lack of samples covering multi-lighting scenarios, trained visual models struggle to accurately adapt to lighting fluctuations in real-world environments, leading to issues such as target misjudgment and blurred foreground-background segmentation. Ultimately, this results in decreased model accuracy, failing to meet the demands of applications like robot vision that require high accuracy and stability. Furthermore, the lack of learning from images with degraded lighting conditions results in low accuracy in identifying target objects during practical deployments. Summary of the Invention

[0005] This application provides a training method, apparatus, electronic device, computer-readable storage medium, and computer program product for a target recognition model, which can improve the accuracy of the target recognition model in recognizing images with different light intensities.

[0006] The technical solution of this application embodiment is implemented as follows: This application provides a method for training a target recognition model, the method comprising: Acquire multiple first sample images and sample annotation information corresponding to the first sample images, wherein the first sample images include a first foreground region image and a first background region image; For each of the first sample images, the following processing is performed: illumination correction processing is performed on the first foreground region image and the first background region image based on preset gamma coefficients to obtain a second foreground region image and a second background region image; noise is added to the second foreground region image to obtain a third foreground region image; the third foreground region image and the second background region image are combined to form a second sample image; The target recognition model is trained based on multiple second sample images and the sample annotation information.

[0007] This application provides a training device for a target recognition model, comprising: The data acquisition module is used to acquire multiple first sample images and sample annotation information corresponding to the first sample images, wherein the first sample images include a first foreground region image and a first background region image; The data augmentation module is used to perform the following processing for each of the first sample images: perform illumination correction processing on the first foreground region image and the first background region image based on preset gamma coefficients to obtain a second foreground region image and a second background region image; perform noise addition processing on the second foreground region image to obtain a third foreground region image; and combine the third foreground region image and the second background region image to form a second sample image. The model training module is used to train the target recognition model based on multiple second sample images and the sample annotation information.

[0008] This application provides an electronic device, the electronic device comprising: Memory is used to store executable instructions or computer programs. The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the training method for the target recognition model provided in the embodiments of this application.

[0009] This application provides a computer-readable storage medium storing computer-executable instructions or computer programs, which, when executed by a processor, implement the training method for the target recognition model provided in this application.

[0010] This application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, they implement the training method for the target recognition model provided in this application.

[0011] The embodiments of this application have the following beneficial effects: Multiple first sample images and their corresponding sample annotation information are acquired. The first sample images are divided into foreground region images and background region images. The foreground region images and background region images are processed in different ways. Noise is added to the foreground region images after illumination correction, which can simulate the situation in real scenes where the foreground is blurred and the background is more illuminated due to the intensity of illumination. This enriches the illumination types of the training sample images, enabling the target recognition model to recognize images under different illumination conditions and improving the accuracy of target recognition. Attached Figure Description

[0012] Figure 1 This is a schematic diagram illustrating the application mode of the training method for the target recognition model provided in the embodiments of this application; Figure 2A This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application; Figure 2B This is a schematic diagram of the server structure provided in an embodiment of this application; Figure 3 This is a schematic diagram of the first process of the training method for the target recognition model provided in the embodiments of this application; Figure 4 This is a schematic diagram of the second process of the training method for the target recognition model provided in the embodiments of this application; Figure 5 This is a schematic diagram of the sample image provided in the embodiments of this application; Figure 6 This is a schematic diagram of backlight enhancement provided in an embodiment of this application; Figure 7 This is a schematic diagram of low-light enhancement provided in an embodiment of this application.

[0013] It should be noted that the terms "first" and "second" mentioned above are only used to distinguish between different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation

[0014] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0015] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0016] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0017] It should be noted that the data collection and processing (e.g., environmental images) in this application should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0018] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit the scope of this application.

[0020] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0021] 1) Embodied intelligent robots: These are artificial intelligence systems with physical entities that interact with the environment through multimodal sensors and integrate technologies such as machine vision and natural language understanding to achieve closed-loop control of perception, decision-making, and execution.

[0022] 2) Machine Vision: This is a rapidly developing branch of artificial intelligence. Simply put, machine vision uses machines to replace human eyes for measurement and judgment. A machine vision system uses machine vision products (i.e., image acquisition devices, which are divided into charge-coupled devices (CCD) and complementary metal-oxide-semiconductor (CMOS)) to convert the captured target into an image signal, which is then transmitted to a dedicated image processing system to obtain the target's shape information. Based on pixel distribution, brightness, color, and other information, this information is converted into a digital signal. The image system performs various calculations on these signals to extract the target's features, and then controls the on-site equipment based on the judgment results.

[0023] 3) Real-time segmentation models: These are techniques designed to quickly classify each pixel in an image while maintaining high accuracy. They are widely used in fields such as autonomous driving, medical image analysis, and video surveillance. These models typically achieve low latency (e.g., 30 frames per second or higher) through lightweight network design and optimized computation processes. YOLOv8-seg is an instance segmentation model in the You Only Look Once (YOLO) real-time object detection model family. By fusing object detection and pixel-level segmentation capabilities, it achieves efficient and accurate object recognition and contour extraction in fields such as agriculture, medicine, and industrial inspection.

[0024] 4) Gamma Transform: Also known as power-law transform, this is a transformation performed by a computer system after reading a digital photo file and before outputting it to the display. The underlying principle of the gamma transform is based on the physical properties of light, simulating the human eye's perception of brightness under different lighting conditions. In practical applications, the gamma transform is often used to correct the brightness and contrast of images, making them more consistent with human visual perception.

[0025] In related technologies, lightweight real-time segmentation models (such as YOLOv8-S-Seg) have become the mainstream choice for edge-side box perception tasks due to their efficient deployment and fast inference speed. However, the training quality of lightweight real-time segmentation models is highly dependent on data diversity and the degree of real-world environment coverage. In actual data acquisition, due to limitations in scene setup, manpower costs, and acquisition conditions, it is difficult to acquire a large number of extreme lighting scenarios (such as strong backlight, low light, backlight, uneven lighting, and reflection interference). In addition, traditional lighting enhancement mainly focuses on overall brightness changes, which is difficult to realistically simulate the visual phenomenon of "foreground and background lighting differences," resulting in significant performance degradation of the model in real low-light and backlight scenarios, leading to problems such as blurred box edges, broken segmentation masks, and lost contours. For example, the number of backlight and low-light samples in real scenes is insufficient, and the model lacks learning from images with lighting degradation, resulting in unstable performance in practical deployments. Traditional brightness and contrast only uniformly transform the entire image and cannot simulate the lighting differences between the foreground and background. The lack of sample images under different lighting conditions affected the accuracy of the model in recognizing images with different lighting intensities.

[0026] This application provides a training method for a target recognition model, a training device for a target recognition model, an electronic device, a computer-readable storage medium, and a computer program product, which can improve the accuracy of the target recognition model in recognizing images with different light intensities.

[0027] The following describes exemplary applications of the electronic devices provided in the embodiments of this application. These electronic devices can be implemented as terminal devices, such as laptops, tablets, desktop computers, set-top boxes, smart TVs, in-vehicle terminals, virtual reality (VR) devices, augmented reality (AR) devices, and other various types of terminals. They can also be implemented as servers. The following will describe exemplary applications when the electronic device is implemented as a terminal device or a server.

[0028] refer to Figure 1 , Figure 1 This is a schematic diagram illustrating the application mode of the training method for the target recognition model provided in the embodiments of this application; for example, Figure 1 The system involves server 200, network 300, terminal device 400, and database 500. Terminal device 400 is connected to server 200 through network 300, which can be a wide area network, a local area network, or a combination of both.

[0029] In some embodiments, the terminal device 400 may be a terminal device for a technician, the database 500 stores a large number of original sample images, and the server 200 stores a target recognition model.

[0030] For example, in response to a training instruction input operation on terminal device 400, terminal device 400 sends the training instruction to server 200 via network 300. Server 200 extracts a large number of sample images stored in database 500 based on the training instruction. Server 200 calls the target recognition model training method provided in this application embodiment and generates sample images under different lighting conditions using the original sample images. Based on the sample images under different lighting conditions, the model is trained to obtain the trained model, which is then sent to terminal device 400 via network 300. Assuming terminal device 400 is a terminal device installed on a robot or the robot itself, it can identify obstacles and target objects in the environment based on the trained model, and then plan a path or have the robot perform corresponding actions.

[0031] In some embodiments, the training method for the target recognition model provided in this application can also be applied in the following application scenarios: (1) In the warehousing and logistics scenario, sample images under different lighting conditions are generated based on the target recognition model training method provided in the embodiment of this application. The model is trained based on the sample images under different lighting conditions to obtain the trained model. The robot calls the trained model to identify boxes and obstacles in the warehouse, and then the robot plans the path and transports the boxes according to the position of the boxes and obstacles.

[0032] (2) Household robot, based on the target recognition model training method provided in the embodiments of this application, generates sample images under different lighting conditions, trains the model based on the sample images under different lighting conditions, obtains the trained model, the robot calls the trained model to identify obstacles and target objects in the room, and then the robot plans the path and transports the box according to the position of the box and obstacles.

[0033] In some embodiments, server 200 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminals and servers can be connected directly or indirectly via wired or wireless communication, which is not limited in this embodiment.

[0034] See Figure 2A , Figure 2A This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application. The terminal device can be... Figure 1 400 terminal devices Figure 2A The terminal device 400 shown includes at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. The various components in the terminal device 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to implement communication between these components. In addition to a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2A The general labeled all buses as Bus System 440.

[0035] Processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0036] User interface 430 includes one or more output devices 431 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0037] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices physically located away from the processor 410.

[0038] The memory 450 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 450 described in this application embodiment is intended to include any suitable type of memory.

[0039] In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0040] Operating system 451 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks; The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc. Presentation module 453 is configured to enable the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 (e.g., a display screen, a speaker, etc.) associated with user interface 430. The input processing module 454 is used to detect and translate one or more user inputs or interactions from one or more input devices 432.

[0041] In some embodiments, the apparatus provided in this application can be implemented in software. Figure 2A A training device 455 for a target recognition model stored in memory 450 is shown. It can be software in the form of programs and plug-ins, including the following software modules: data acquisition module 4551, data augmentation module 4552, and model training module 4553. These modules are logically related and can therefore be arbitrarily combined or further split according to the functions they implement.

[0042] See Figure 2B , Figure 2B This is a schematic diagram of the structure of the server provided in the embodiments of this application. The server can be... Figure 1 Server 200, Figure 2B The server 200 shown includes at least one processor 210, memory 250, and at least one network interface 220. The various components of server 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to implement communication between these components. In addition to a data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2B The general labeled all buses as Bus System 240.

[0043] Processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0044] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 250 may optionally include one or more storage devices physically located away from the processor 210.

[0045] The memory 250 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 250 described in this application embodiment is intended to include any suitable type of memory.

[0046] In some embodiments, memory 250 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0047] Operating system 251 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks; The network communication module 252 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 220, such as Bluetooth, WiFi, and Universal Serial Bus (USB).

[0048] In some embodiments, the apparatus provided in this application can be implemented in software. Figure 2B A training device 255 for a target recognition model stored in memory 250 is shown. It can be software in the form of programs and plug-ins, including the following software modules: data acquisition module 2551, data augmentation module 2552, and model training module 2553. These modules are logically related and can therefore be arbitrarily combined or further split according to the functions they implement.

[0049] The training method of the target recognition model provided in this application will be described in conjunction with exemplary applications and implementations of the server or terminal device provided in the embodiments of this application.

[0050] The following describes the training method of the target recognition model provided in the embodiments of this application. As mentioned above, the electronic device implementing the training method of the target recognition model in the embodiments of this application can be a terminal device or a server, or a combination of both. Therefore, the executing entity of each step will not be described again below.

[0051] It should be noted that the target recognition processing example below is illustrated using a box as the target object. Those skilled in the art can apply the training method of the target recognition model provided in the embodiments of this application to the recognition processing of other types of target objects based on their understanding of the following text.

[0052] See Figure 3 , Figure 3 This is a flowchart illustrating the training method of the target recognition model provided in this application embodiment, which will be combined with... Figure 3 The steps shown are explained. Figure 3 The entity responsible for executing the steps is Figure 1 The server is 200 or the terminal device is 400.

[0053] In step 301, multiple first sample images and sample annotation information corresponding to the first module sample images are obtained.

[0054] Here, the first sample image includes a first foreground region image and a first background region image.

[0055] For example, the first sample image is an initial sample image without any enhancement processing. The sample annotation information includes: the category and confidence score of the target object in the first sample image, the location of the detection box corresponding to the target object, and the segmentation mask information of the target object. The first foreground region image and the first background region image are obtained by segmentation based on the segmentation mask information of the target object in the sample annotation information. The segmentation mask information is represented as a binary image, used to accurately label whether each pixel in the image belongs to a specific object or region. In the segmentation mask, a pixel value of 1 indicates a region where a target object exists, and a pixel value of 0 indicates a region where a target object does not exist. Multiplying the first sample image by the segmentation mask yields the first foreground region image and the first background region image. In this embodiment, the target recognition model can be a YOLOv8-seg series model. The YOLOv8-seg series models include five configurations in order of parameter size: X, L, M, S, and N. Among them, YOLOv8n-seg (YOLOv8 Nano Seg) is the smallest model but the fastest; while YOLOv8x-seg (YOLOv8 Extra Large Seg) is the most accurate model but the slowest. The following example illustrates the application scenario of a robot recognizing target objects in its environment.

[0056] In some embodiments, before step 302, the following process is performed: random probability generation processing is performed on the first sample image to obtain a first random generation probability; in response to the first random generation probability being less than or equal to a first preset probability threshold, the process proceeds to step 302.

[0057] For example, random probability generation refers to the process of generating random values ​​or event sequences that conform to a preset probability distribution law through algorithms, physical devices, or mathematical models. In this embodiment of the application, the random probability generation process is to generate random probabilities uniformly distributed within the value range [0,1]. The first preset probability threshold is set according to the needs of the actual application scenario. If there are many second sample images required, it can be set to a larger value. For example, the first preset probability threshold is 0.8. The random generation probability being less than or equal to the first preset probability threshold is the execution condition of step 302. Assume that: the first sample images are obtained by traversing or in parallel, and random probability generation is performed for each first sample object to obtain the first random generation probability P1. The first random generation probability P1 is compared with the preset probability threshold P0. If the first random generation probability P1 is less than the preset probability threshold P0, the process proceeds to step 302 for the first sample image.

[0058] In some embodiments, the illumination correction processing includes a backlight enhancement method and a dark light enhancement method; the specific illumination correction processing type is determined by the following method: in response to a first random generation probability being less than or equal to a first preset probability threshold, a random probability generation process is performed on the first sample image to obtain a second random generation probability; in response to a second random generation probability being less than or equal to a second preset probability threshold, step 302 is executed in the backlight enhancement method; in response to a second random generation probability being greater than a second preset probability threshold, step 302 is executed in the dark light enhancement method.

[0059] For example, Backlight Augmentation aims to simulate the phenomenon of a bright background, a dark foreground, and blurred details in a strong backlight scene. Low-light Augmentation is used to simulate the phenomenon of low overall brightness, cool colors, and increased noise in a low-light environment. If the first randomly generated probability is less than or equal to a first preset probability threshold, illumination correction processing is performed. Then, a second random probability generation process is performed to obtain a second random probability, which is used to determine which illumination correction process to perform. The second preset probability threshold can be set according to the actual application scenario. If a sufficient number of sample images are required to be processed using both methods, the second preset probability threshold can be 0.5, meaning the second random probability has a 50% chance of being less than 0.5 and a 50% chance of being greater than 0.5. For example: For each first sample object, a random probability is generated to obtain a second random generation probability P2. The second random generation probability P2 is compared with a second preset probability threshold P4. If the second random generation probability P2 is less than the second preset probability threshold P4, step 302 is performed for the first sample image in a backlight enhancement mode. Conversely, if the second random generation probability P2 is greater than the second preset probability threshold P4, step 302 is performed for the first sample image in a dark light enhancement mode.

[0060] In step 302, the following processing is performed on each first sample image: illumination correction processing is performed on the first foreground region image and the first background region image based on preset gamma coefficients to obtain the second foreground region image and the second background region image.

[0061] For example, illumination correction processing is a process that updates the illumination intensity of an image based on gamma transformation. Depending on the type of illumination correction processing, the preset gamma coefficients used for illumination correction processing of the first foreground region image and the first background region image can be the same or different.

[0062] In some embodiments, when the illumination correction process is performed in a backlight enhancement manner, step 302 can be implemented as follows: standardize the initial brightness value of the first background region image to obtain a first brightness value; correct the first brightness value based on a first preset gamma coefficient to obtain a second brightness value; replace the initial brightness value of the first background region image with the second brightness value to obtain a second background region image; standardize the initial brightness value of the first foreground region image to obtain a third brightness value; correct the third brightness value based on a second preset gamma coefficient to obtain a fourth brightness value; replace the initial brightness value of the first foreground region image with the fourth brightness value to obtain a second foreground region image, wherein the first preset gamma coefficient is less than a first value, and the second preset gamma coefficient is greater than a first value.

[0063] For example, the first value is 1. Before brightness enhancement, the initial brightness value I needs to be standardized: if the original pixel value is [0, 255], it needs to be converted to [0, 1], i.e., Inorm = Iraw / 255, where Inorm is the standardized brightness value and Iraw is the initial brightness value. The corrected brightness value is then restored to [0, 255] to avoid numerical overflow caused by exponentiation. The second and fourth brightness values ​​are brightness values ​​restored to the range [0, 255]. The characteristics of the Gamma correction curve are: when At that time, there was no change in brightness; when When low-brightness pixels are suppressed and high-brightness pixels are magnified, the overall image becomes darker. The "high / low" of brightness is a quantitative division relative to the overall brightness range. The core basis is the ratio of the original pixel brightness value to the upper limit of brightness. The industry-standard division logic is as follows: low brightness pixels: brightness value ≤ 30% of the overall brightness range; medium brightness pixels: 30% < brightness value < 70%; high brightness pixels: brightness value ≥ 70% of the overall brightness range.

[0064] At the same time, low-brightness pixels are magnified, while high-brightness pixels change more gradually, resulting in a brighter overall image that is suitable for scenes with dark backgrounds, such as nighttime surveillance and low-light image enhancement.

[0065] The principle of backlight enhancement is explained below. Gamma correction is applied to the first background area to brighten the background area, as expressed in the following formula (1.1): (1.1) Where I is the initial brightness. It is the Gamma correction coefficient applied to the first background region, the first preset gamma coefficient. Indicates the process The brightness of the first background area after correction by the correction factor, and the second brightness value. This causes low-brightness pixels in the first background region to be magnified, while high-brightness pixels show a more gradual change, resulting in a brighter background image compared to before correction. Applying a smaller or inverse Gamma correction (where "smaller" or "inverse" refers to the intensity of the Gamma correction, not the magnitude of the Gamma coefficient) to the first foreground region darkens it, as shown in the following formula (1.2): (1.2) in, It is the Gamma correction coefficient applied to the first foreground region, and the second preset gamma coefficient. Indicates the process The brightness of the foreground area after correction by the correction coefficient, the fourth brightness value. This causes low-brightness pixels to be suppressed and high-brightness pixels to be magnified, resulting in a darker image in the first foreground area. (Reference) Figure 6 , Figure 6 This is a schematic diagram of backlight enhancement provided in the embodiments of this application. The first sample image 601 is the original sample image, and the second sample image 602 is the sample image after backlight enhancement. The background area 603 is the area located at the same position in the first sample image 601 and the second sample image 602. The background area 603 in the first sample image 601 is darker than the background area in the second sample image 602. The background area in the second sample image 602 is blurry due to excessive brightness.

[0066] In this embodiment, by applying different gamma coefficients to the foreground and background images, the background becomes brighter and the foreground becomes darker, simulating the effect of the background area becoming brighter and the foreground area becoming darker under extreme lighting conditions. This enriches the types of sample images and improves the accuracy of model training.

[0067] In some embodiments, when the illumination correction process is performed in a dark light enhancement manner, step 302 can be implemented in the following manner: determining the overall brightness values ​​of the first foreground region image and the first background region image; correcting the overall brightness value based on a third preset gamma coefficient to obtain a fifth brightness value, wherein the third preset gamma coefficient is greater than a first value; replacing the initial brightness value of the first background region image with the fifth brightness value to obtain a second background region image; replacing the initial brightness value of the first foreground region image with the fifth brightness value to obtain a second foreground region image.

[0068] For example, a uniform Gamma darkening is applied to the brightness values ​​of the entire first sample image, as expressed by the following formula (2): (2) in, This represents the Gamma correction factor used for darkening, the third preset gamma factor. It is the fifth brightness value of the first sample image after darkening.

[0069] In this embodiment, by applying the same gamma coefficient less than 1 to the foreground and background images, the background and foreground darken together, simulating the effect of a dark image under extreme lighting conditions, which enriches the types of sample images and improves the accuracy of model training.

[0070] In step 303, the second foreground region image is subjected to noise addition processing to obtain the third foreground region image.

[0071] For example, different noise processing is applied to the second foreground region image for different lighting correction processes to simulate the corresponding lighting effects.

[0072] In some embodiments, when the illumination correction process is a backlight enhancement method, the noise addition process includes at least one of the following: adding Gaussian blur noise and adding Poisson noise. In the case of backlight enhancement, it is necessary to simulate the phenomenon of detail loss caused by backlight. Gaussian blur noise is used to simulate backlight blur, and Poisson noise simulates the exposure graininess caused by uneven illumination.

[0073] In some embodiments, when the illumination correction processing is a backlight enhancement method, the noise addition processing includes at least one of the following: adding color shift noise, adding a combination of Gaussian noise and salt-and-pepper noise, and motion blur processing. Backlight enhancement is used to obtain a darker image than backlight enhancement. In this case, it is necessary to simulate the random interference signals that appear in the output image when the image sensor receives insufficient photon signals under low-light conditions (such as nighttime, low indoor light, and shadow areas). Color shift noise is a channel-level color distortion, which refers to the non-uniform shift of the pixel values ​​of the red (R), green (G), and blue (B) channels of the image, causing the overall image to be biased towards a certain color system (such as reddish or yellowish). Essentially, it is an artificially introduced destruction of color consistency by simulating the imaging characteristics under different color temperature lights. ISO refers to the camera's sensitivity to light. The higher the ISO value, the higher the sensitivity, and the brighter the photo will be, and vice versa. However, excessively high ISO will also increase the noise in the photo. High ISO noise simulates the composite noise generated when a camera increases its ISO in low-light conditions. It uses the superposition of Gaussian noise and salt-and-pepper noise to reproduce the graininess and sudden pixel anomalies of a real sensor. Motion blur is a directional spatial distortion caused by the movement of the subject (such as a box) or camera, resulting in a trailing effect on the sensor along the direction of motion during shutter opening. Essentially, it simulates the imaging effect of motion trajectories captured by slow shutter speeds in low-light scenes. (Reference) Figure 7 , Figure 7This is a schematic diagram of dark light enhancement provided in the embodiments of this application. The first sample image 701 is the unprocessed original image, and the second sample image 702 is the processed image. The second sample image 702 is darker than the first sample image 701 and has ghosting (motion blur).

[0074] In step 304, the third foreground region image and the second background region image are combined to form a second sample image.

[0075] For example, a third foreground region image obtained by processing the same first sample image is combined with a second background region image to form a second sample image.

[0076] In step 305, a target recognition model is trained based on multiple second sample images and sample annotation information.

[0077] For example, multiple second sample images and sample annotation information are input into the object recognition model. The output of the object recognition model is the predicted type of the target object, the prediction confidence, the predicted detection box, and the predicted segmentation mask for the box. For the above predicted output, the classification loss, regression loss, and segmentation mask loss are obtained respectively, and the overall loss is calculated. This can be expressed as the following formula (3): (3) in, It is the bounding box regression loss. These are the weight values ​​of the bounding box regression loss. It is the classification loss for box categories (box front / box top); It is the weight value of the classification loss for the box category; It is the segmentation mask loss; These are the weights of the segmentation mask loss, which can be set according to the needs of the application scenario. Based on the overall loss, backpropagation is used to update the parameters of the target recognition model along the gradient direction with the goal of reducing the overall loss, resulting in the trained target recognition model. The trained target recognition model can be applied to box recognition in robots, enabling robots to recognize boxes, the front of boxes, and the top of boxes in environmental images, improving the robot's path planning and movement capabilities in the environment.

[0078] In this embodiment, multiple first sample images and corresponding sample annotation information are obtained. The first sample images are divided into foreground region images and background region images. The foreground region images and background region images are processed in different ways. Noise is added to the foreground region image after illumination correction, which can simulate the situation in real scenes where the foreground is blurred and the background is more illuminated due to the intensity of illumination. This enriches the illumination types of the training sample images, enabling the target recognition model to recognize images under different illumination conditions and improving the accuracy of target recognition.

[0079] The following will describe an exemplary application of the target recognition model training method of this application in a real-world application scenario.

[0080] With the rapid development of embodied intelligent robots and artificial intelligence technologies, humanoid robots are widely used in tasks such as handling, stacking, sorting, and warehousing logistics. Visual perception is a crucial supporting capability for humanoid robots to achieve autonomous operation and intelligent decision-making. Especially in tasks involving the grasping, positioning, posture estimation, and obstacle avoidance planning of boxes and cartons, deep learning image segmentation models in the field of computer vision are essential for the accurate segmentation and recognition of the outer contours and regions of the boxes, thereby ensuring the reliability and safety of the handling process.

[0081] In related technologies, lightweight real-time segmentation models (such as YOLOv8-S-Seg) have become the mainstream choice for edge-side box perception tasks due to their efficient deployment and fast inference speed. However, the training quality of lightweight real-time segmentation models is highly dependent on data diversity and the degree of real-world environment coverage. In actual data acquisition, due to limitations in scene setup, manpower costs, and acquisition conditions, it is difficult to acquire a large number of extreme lighting scenarios (such as strong backlight, low light, backlight, uneven lighting, and reflection interference). In addition, traditional lighting enhancement mainly focuses on overall brightness changes, which is difficult to realistically simulate the visual phenomenon of "foreground and background lighting differences," resulting in significant performance degradation of the model in real low-light and backlight scenarios, leading to problems such as blurred box edges, broken segmentation masks, and lost contours. For example, the number of backlight and low-light samples in real scenes is insufficient, and the model lacks learning from images with lighting degradation, resulting in unstable performance in practical deployments. Traditional brightness and contrast only uniformly transform the entire image and cannot simulate the lighting differences between the foreground and background.

[0082] Therefore, there is an urgent need for an efficient and targeted lighting enhancement method that can simulate complex lighting conditions such as backlight and low light to obtain training samples under different lighting conditions. This would allow the image segmentation model to fully learn extreme lighting distributions during the training phase, thereby improving the model's box perception robustness in real deployment environments.

[0083] This application provides a training method for a target recognition model to address the aforementioned problems in related technologies. It constructs a controllable illumination enhancement strategy to generate illumination degradation samples online, thereby improving the illumination diversity of training data and solving the problem of difficulty in collecting data in extreme illumination scenarios. Furthermore, it achieves foreground / background region separation based on a segmentation mask and applies differentiated enhancement to different regions to achieve an enhancement effect that conforms to the characteristics of real illumination degradation, thus solving the problem that traditional illumination enhancement does not conform to the laws of real visual degradation.

[0084] See Figure 4 , Figure 4 This is a flowchart illustrating the training method of the target recognition model provided in this application embodiment, which will be combined with... Figure 4 The steps shown are explained. Figure 4 The entity responsible for executing the steps is Figure 1 The server is 200 or the terminal device is 400.

[0085] In step 401, the first sample image and sample annotation are obtained.

[0086] Taking a robot as an example, this paper illustrates the application scenario of the target recognition model. In a real-world deployment environment, such as a warehouse, there are numerous boxes. Using the target recognition model to identify the front, sides, and top of these boxes facilitates the robot's planning of its movement trajectory and posture. In this embodiment, considering the limited computing resources and real-time response requirements of humanoid robots in real-world deployment environments, the lightweight YOLOv8-S-Seg model is selected as the target model framework for training. The YOLOv8-seg series models include five configurations in order of parameter size: X, L, M, S, and N. Among them, YOLOv8n-seg (YOLOv8 Nano Seg) is the smallest model but the fastest; while YOLOv8x-seg (YOLOv8 Extra Large Seg) is the most accurate model but the slowest.

[0087] For example, the first sample image is an initial sample image without any enhancement processing. The sample annotations are used to represent the category, confidence level, bounding box location of the target object, and segmentation mask information of the target object in the first sample image. The target object can be a box, such as a cardboard box, wooden box, or plastic box. (Reference) Figure 5 , Figure 5This is a schematic diagram of the sample image provided in the embodiments of this application. The first sample image 501 includes the target object (box 502). The first sample image also corresponds to multiple sample annotations, including the category (box front, box top) corresponding to each box, the confidence level (e.g., box front 0.84), the detection box position corresponding to the target object, and the segmentation mask information of the target object.

[0088] By training the model extensively on a multi-scenario dataset covering boxes such as bins and cartons, we ensure that the model possesses high accuracy and robustness in box detection and segmentation tasks. After training, the model can perform feature extraction and target segmentation on the input image, and output box category, confidence score, detection box position, and corresponding segmentation mask information.

[0089] In step 402, for each first sample image, the enhancement operation for the first sample image is determined according to the relationship between the preset probability threshold and the random generation probability, and a second sample image is obtained.

[0090] For example, determining the enhancement operation for the first sample image based on the relationship between a preset probability and a random probability means that for each first sample image, a random probability generation process is performed to obtain a random generation probability P1. The random generation probability P1 is compared with a preset probability threshold P0. If the random generation probability P1 is less than or equal to the preset probability threshold P0, then one of the enhancement operations is performed on the first sample image. The enhancement operations in this embodiment include backlight enhancement and low-light enhancement. If the random generation probability P1 is greater than the preset probability threshold P0, then no enhancement operation is performed on the first sample image.

[0091] In some embodiments, when it is determined that an enhancement operation will be performed, a random probability can be generated again to obtain a random probability P2. If the random probability P2 is less than or equal to 0.5, then backlight enhancement is performed on the sample image. If the random probability P2 is greater than 0.5 and less than or equal to 1, then backlight enhancement is performed on the sample image.

[0092] Before performing the enhancement operation, the foreground and background regions of the first sample image are separated. Based on the segmentation mask information in the training sample annotation information (sample annotation), a binary segmentation mask for the first sample image is determined, dividing the first sample image into a foreground region (box) and a background region. The foreground region can be represented as... The background area can be represented as ,but 1 represents the entire first sample image, and the segmented first sample image is used for subsequent differential illumination enhancement processing.

[0093] For example, backlight enhancement aims to simulate the phenomenon of a bright background, a dark foreground, and blurred details in a strong backlight scene. Backlight enhancement is achieved by applying Gamma correction to the background area to brighten it, as shown in the following formula (1.1): (1.1) Where I is luminance, It is the Gamma correction coefficient applied to the background region. Indicates the process The brightness of the background area after correction by the correction coefficient. Before brightness enhancement, the brightness I needs to be normalized: if the original pixel value is [0,255], it needs to be converted to [0,1] (i.e., Inorm=Iraw / 255), corrected, and then restored to [0,255] to avoid numerical overflow caused by exponentiation.

[0094] The characteristics of the Gamma correction curve are: when At that time, there was no change in brightness; when When low-brightness pixels are suppressed and high-brightness pixels are magnified, the overall image becomes darker. The "high / low" of brightness is a quantitative division relative to the overall brightness range. The core basis is the ratio of the original pixel brightness value to the upper limit of brightness. The industry-standard division logic is as follows: low brightness pixels: brightness value ≤ 30% of the overall brightness range; medium brightness pixels: 30% < brightness value < 70%; high brightness pixels: brightness value ≥ 70% of the overall brightness range.

[0095] At the same time, low-brightness pixels are magnified, while high-brightness pixels change more gradually, resulting in a brighter overall image that is suitable for scenes with dark backgrounds, such as nighttime surveillance and low-light image enhancement.

[0096] Applying a smaller or inverse Gamma correction to the foreground region compared to the background region (where "smaller" or "inverse" refers to the intensity of the Gamma correction, not the magnitude of the Gamma coefficient) darkens the foreground region, as shown in the following formula (1.2): (1.2) in, It is the Gamma correction coefficient applied to the foreground region. Indicates the process The brightness of the foreground area after correction by the correction factor.

[0097] Illumination attenuation noise (such as brightness attenuation noise and blur noise) is superimposed on the foreground area to simulate the loss of detail caused by backlighting. The noise types include Gaussian blur noise (used to simulate backlight blur) and Poisson noise (simulating exposure graininess caused by uneven illumination). The first sample image after complete backlight enhancement is represented as follows: .

[0098] refer to Figure 6 , Figure 6 This is a schematic diagram of backlight enhancement provided in the embodiments of this application. The first sample image 601 is the original sample image, and the second sample image 602 is the sample image after backlight enhancement. The background area 603 is the area located at the same position in the first sample image 601 and the second sample image 602. The background area 603 in the first sample image 601 is darker than the background area in the second sample image 602. The background area in the second sample image 602 is blurry due to excessive brightness.

[0099] Low-light Augmentation: Used to simulate the phenomenon of low overall brightness, cool colors, and increased noise in low-light environments. Low-light Augmentation is achieved by applying a uniform Gamma darkening to the entire first sample image, expressed as the following formula (2): (2) in, This represents the Gamma correction factor used for darkening. This is the first sample image after darkening.

[0100] Dark light noise is superimposed on the foreground, and the noise types include color shift noise (RGB channel shift to simulate light color cast), high sensitivity (ISO) noise (a combination of Gaussian noise and salt and pepper noise to simulate low-light photosensitive grains), and motion blur (simulating the shadowing of the box edges caused by the decrease in shutter speed in a dark scene).

[0101] For example, low-light noise is a random interference signal appearing in the output image when the image sensor receives insufficient photon signals in low-light environments (such as at night, in dim indoor light, or in shadow areas). Color shift noise is a channel-level color distortion, referring to the non-uniform shift of pixel values ​​in the red (R), green (G), and blue (B) channels of an image, causing the overall image to be biased towards a certain color scheme (such as reddish or yellowish). Essentially, it artificially introduces a disruption of color consistency by simulating the imaging characteristics under different color temperature lighting. ISO refers to the camera's sensitivity to light. The higher the ISO value, the higher the sensitivity, and the brighter the photo will be; conversely, the lower the ISO value, the darker the photo will be. However, excessively high ISO will also increase the noise in the photo. High ISO noise simulates the composite noise generated when a camera increases its sensitivity in low-light environments. It uses the superposition of Gaussian noise and salt-and-pepper noise to reproduce the graininess and sudden pixel anomalies of a real sensor. Motion blur is a type of directional spatial distortion that refers to the blurring effect caused by the movement of the subject (such as a box) or camera, resulting in a trailing image of pixels on the sensor along the direction of motion during shutter opening. Essentially, it simulates the imaging effect of motion trajectories captured by slow shutter speeds in low-light scenes. (Reference) Figure 7 , Figure 7 This is a schematic diagram of dark light enhancement provided in the embodiments of this application. The first sample image 701 is the unprocessed original image, and the second sample image 702 is the processed image. The second sample image 702 is darker than the first sample image 701 and has ghosting (motion blur).

[0102] In this embodiment, a box segmentation mask is used to distinguish between the foreground and background regions, and different enhancement strategies are applied to each region to realistically simulate illumination degradation phenomena such as foreground darkening and background overbrightness under backlighting, and insufficient global brightness and increased noise under low light. Two modes are employed: backlight enhancement simulates strong backlighting by brightening the foreground and darkening the background and applying blur attenuation; low light enhancement simulates image degradation in low-light environments by darkening the entire image and adding noise, thus enabling the model to generalize. During training, illumination enhancement modes are randomly activated, and diverse illumination samples are dynamically generated using random Gamma coefficients and noise intensity to enhance model robustness and avoid overfitting to fixed illumination types.

[0103] In step 403, the target recognition model is trained based on the first sample image, the second sample image, and the corresponding sample annotations to obtain the trained model.

[0104] For example, during the training process, the output of the object recognition model is the predicted type of the box, the predicted confidence score, the predicted detection box, and the predicted segmentation mask of the box. For the above predicted output, the classification loss, regression loss, and segmentation mask loss are obtained respectively, and the overall loss is calculated. This can be expressed as the following formula (3): (3) in, It is the bounding box regression loss. These are the weight values ​​of the bounding box regression loss. It is the classification loss for box categories (box front / box top); It is the weight value of the classification loss for the box category; It is the segmentation mask loss; These are the weight values ​​for the segmentation mask loss, and these weight values ​​can be set according to the needs of the application scenario.

[0105] Based on the overall loss described above, the gradient of each network parameter (such as convolutional kernel weights and biases) is calculated layer by layer using the chain rule. The optimizer (such as SGD / Adam) adjusts the parameters according to the gradient and learning rate. The gradient itself points in the direction of the fastest increase of the loss function, so the opposite direction of the gradient is the direction of the fastest decrease of the loss, which can efficiently bring the model closer to the optimal solution. The model parameters are iteratively updated until the loss converges.

[0106] In this embodiment, sample images are acquired through an enhancement method based on illumination degradation modeling, and the model is trained based on the enhanced sample images, which effectively expands the illumination distribution range of the training data. A segmentation mask is used to decouple the foreground and background illumination enhancements, and two realistic illumination degradation modes, backlight and low light, are constructed respectively. During model training, an online random enhancement mechanism is used to randomly generate sample images with different illumination distributions, allowing the target recognition model to fully learn the characteristics of extreme illumination scenes. This significantly improves the robustness of the target recognition model in box edge recognition and segmentation under backlight, backlight, and low light scenes, enhancing the box perception capability and task execution stability of humanoid robots under complex illumination conditions.

[0107] The following description continues to illustrate the exemplary structure of the training device 455 for the target recognition model provided in this application embodiment as a software module. In some embodiments, such as... Figure 2AAs shown, the software modules in the training device 455 for the target recognition model stored in the memory 450 may include: a data acquisition module 4551, used to acquire multiple first sample images and sample annotation information corresponding to the first sample images, wherein the first sample images include a first foreground region image and a first background region image; a data enhancement module 4552, used to perform the following processing for each first sample image: perform illumination correction processing on the first foreground region image and the first background region image based on preset gamma coefficients to obtain a second foreground region image and a second background region image; perform noise addition processing on the second foreground region image to obtain a third foreground region image; combine the third foreground region image and the second background region image to form a second sample image; and a model training module 4553, used to train the target recognition model based on multiple second sample images and the sample annotation information.

[0108] In some embodiments, the data enhancement module 4552 is further configured to perform random probability generation processing on the first sample image to obtain a first random generation probability before performing illumination correction processing on the first foreground region image and the first background region image based on preset gamma coefficients to obtain a second foreground region image and a second background region image; in response to the first random generation probability being less than or equal to a first preset probability threshold, the process of performing illumination correction processing on the first foreground region image and the first background region image based on preset gamma coefficients to obtain a second foreground region image and a second background region image is initiated.

[0109] In some embodiments, the illumination correction processing includes a backlight enhancement method and a dark light enhancement method; the data enhancement module 4552 is further configured to, in response to the first random generation probability being less than or equal to a first preset probability threshold, perform random probability generation processing on the first sample image to obtain a second random generation probability; in response to the second random generation probability being less than or equal to the second preset probability threshold, switch to the backlight enhancement method and perform illumination correction processing on the first foreground region image and the first background region image based on preset gamma coefficients respectively to obtain a second foreground region image and a second background region image; in response to the second random generation probability being greater than the second preset probability threshold, switch to the dark light enhancement method and perform illumination correction processing on the first foreground region image and the first background region image based on preset gamma coefficients respectively to obtain a second foreground region image and a second background region image.

[0110] In some embodiments, the data enhancement module 4552 is further configured to, when the illumination correction processing is performed in a backlight enhancement manner, standardize the initial brightness value of the first background region image to obtain a first brightness value; correct the first brightness value based on a first preset gamma coefficient to obtain a second brightness value; replace the initial brightness value of the first background region image with the second brightness value to obtain a second background region image; standardize the initial brightness value of the first foreground region image to obtain a third brightness value; correct the third brightness value based on a second preset gamma coefficient to obtain a fourth brightness value; replace the initial brightness value of the first foreground region image with the fourth brightness value to obtain a second foreground region image, wherein the first preset gamma coefficient is less than a first value, and the second preset gamma coefficient is greater than the first value.

[0111] In some embodiments, when the illumination correction process is a backlight enhancement method, the type of noise addition process includes at least one of the following: adding Gaussian blur noise, adding Poisson noise.

[0112] In some embodiments, the data enhancement module 4552 is further configured to, when the illumination correction processing is performed in a dark light enhancement manner, determine the overall brightness value of the first foreground region image and the first background region image; correct the overall brightness value based on a third preset gamma coefficient to obtain a fifth brightness value, wherein the third preset gamma coefficient is greater than a first value; replace the initial brightness value of the first background region image with the fifth brightness value to obtain a second background region image; and replace the initial brightness value of the first foreground region image with the fifth brightness value to obtain a second foreground region image.

[0113] In some embodiments, when the illumination correction process is a backlight enhancement method, the type of noise addition process includes at least one of the following: adding color shift noise, adding a combination of Gaussian noise and salt-and-pepper noise, and motion blur processing.

[0114] This application provides a computer program product, which includes a computer program or computer executable instructions. A processor executes the computer program or computer executable instructions to implement the target recognition model training method described in this application.

[0115] This application provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will execute the training method of the target recognition model provided in this application. For example, ... Figure 3 The training method for the target recognition model is shown.

[0116] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.

[0117] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.

[0118] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., a file that stores one or more modules, subroutines, or code sections).

[0119] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located in one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.

[0120] In summary, through the embodiments of this application, multiple first sample images and corresponding sample annotation information are obtained. The first sample images are divided into foreground region images and background region images. The foreground region images and background region images are processed using different methods. Noise is added to the foreground region image after illumination correction processing separately, which can simulate the situation in real scenes where the foreground is blurred due to illumination intensity and the background is more illuminated. This enriches the illumination types of the training sample images, enabling the target recognition model to recognize images under different illumination conditions and improving the accuracy of target recognition.

[0121] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A training method for a target recognition model, characterized in that, The method includes: Acquire multiple first sample images and sample annotation information corresponding to the first sample images, wherein the first sample images include a first foreground region image and a first background region image; For each of the first sample images, the following processing is performed: Based on preset gamma coefficients, illumination correction processing is performed on the first foreground region image and the first background region image respectively to obtain the second foreground region image and the second background region image. The second foreground region image is subjected to noise processing to obtain the third foreground region image; The third foreground region image and the second background region image are combined to form a second sample image; The target recognition model is trained based on multiple second sample images and the sample annotation information.

2. The method of claim 1, wherein, Before performing illumination correction processing on the first foreground region image and the first background region image based on preset gamma coefficients to obtain the second foreground region image and the second background region image, the method further includes: The first sample image is subjected to random probability generation processing to obtain the first random generation probability; In response to the first random generation probability being less than or equal to the first preset probability threshold, the process proceeds to the illumination correction processing of the first foreground region image and the first background region image based on preset gamma coefficients, respectively, to obtain the second foreground region image and the second background region image.

3. The method of claim 2, wherein, The illumination correction processing methods include: backlight enhancement and low-light enhancement; the method further includes: In response to the first random generation probability being less than or equal to the first preset probability threshold, random probability generation processing is performed on the first sample image to obtain the second random generation probability; In response to the second random generation probability being less than or equal to the second preset probability threshold, the backlight enhancement method is used to switch to the process of performing illumination correction processing on the first foreground region image and the first background region image based on preset gamma coefficients to obtain the second foreground region image and the second background region image. In response to the second random generation probability being greater than the second preset probability threshold, the image is switched to the process of performing illumination correction on the first foreground region image and the first background region image based on preset gamma coefficients in a dark light enhancement manner to obtain the second foreground region image and the second background region image.

4. The method of claim 1, wherein, When the illumination correction processing is performed in a backlight enhancement mode, the illumination correction processing of the first foreground region image and the first background region image based on preset gamma coefficients to obtain the second foreground region image and the second background region image includes: The initial brightness value of the first background region image is standardized to obtain the first brightness value; The first brightness value is corrected based on the first preset gamma coefficient to obtain the second brightness value. The initial brightness value of the first background region image is replaced with the second brightness value to obtain the second background region image. The initial brightness value of the first foreground region image is standardized to obtain the third brightness value; The third brightness value is corrected based on the second preset gamma coefficient to obtain a fourth brightness value. The initial brightness value of the first foreground region image is replaced with the fourth brightness value to obtain a second foreground region image. The first preset gamma coefficient is less than the first value, and the second preset gamma coefficient is greater than the first value.

5. The method of claim 4, wherein, When the illumination correction process is a backlight enhancement method, the noise addition process includes at least one of the following: adding Gaussian blur noise, adding Poisson noise.

6. The method of claim 1, wherein, When the illumination correction process is performed in a dark light enhancement mode, the illumination correction process is applied to the first foreground region image and the first background region image based on preset gamma coefficients to obtain a second foreground region image and a second background region image, including: Determine the overall brightness values ​​of the first foreground region image and the first background region image; The overall brightness value is corrected based on the third preset gamma coefficient to obtain a fifth brightness value, wherein the third preset gamma coefficient is greater than the first value; The initial brightness value of the first background region image is replaced with the fifth brightness value to obtain the second background region image; The initial brightness value of the first foreground region image is replaced with the fifth brightness value to obtain the second foreground region image.

7. The method according to claim 6, characterized in that, When the illumination correction process is a backlight enhancement method, the noise addition process includes at least one of the following: adding color shift noise, adding a combination of Gaussian noise and salt-and-pepper noise, and motion blur processing. 8.A device for training a target recognition model, characterized in that, The device includes: The data acquisition module is used to acquire multiple first sample images and sample annotation information corresponding to the first sample images, wherein the first sample images include a first foreground region image and a first background region image; The data augmentation module is used to perform the following processing for each of the first sample images: perform illumination correction processing on the first foreground region image and the first background region image based on preset gamma coefficients to obtain a second foreground region image and a second background region image; perform noise addition processing on the second foreground region image to obtain a third foreground region image; and combine the third foreground region image and the second background region image to form a second sample image. The model training module is used to train the target recognition model based on multiple second sample images and the sample annotation information.

9. An electronic device, comprising: The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the training method of the target recognition model according to any one of claims 1 to 7.

10. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, the training method of the target recognition model according to any one of claims 1 to 7 is implemented.

11. A computer program product comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, the training method of the target recognition model according to any one of claims 1 to 7 is implemented.