Data processing method and apparatus, electronic device, and computer program product
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA PETROLEUM & CHEMICAL CORP
- Filing Date
- 2024-12-23
- Publication Date
- 2026-06-23
AI Technical Summary
Existing semantic segmentation models have stringent data requirements, demanding large amounts of labeled image data, and pixel-level labeling is time-consuming and tedious, lacking effective data augmentation methods.
By randomly selecting images from the original semantic segmentation dataset and performing random transformations and copy-paste operations, target images are generated, thereby enhancing the diversity of the dataset.
It effectively improves the diversity and scale of semantic segmentation datasets, and enhances the accuracy and robustness of the model.
Smart Images

Figure CN122265640A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer vision technology, and in particular to a data processing method, apparatus, electronic device, and computer program product. Background Technology
[0002] Semantic segmentation is an important task in computer vision with many important applications. State-of-the-art semantic segmentation models based on convolutional networks typically have stringent data requirements, demanding large amounts of labeled image data for training, while pixel-level annotation is time-consuming and tedious. Summary of the Invention
[0003] This disclosure provides a data processing method, apparatus, electronic device, and computer program product that can enhance semantic segmentation datasets and effectively improve the diversity of the original datasets.
[0004] Firstly, this disclosure provides a data processing method, including:
[0005] Randomly select the first and second images from the original semantic segmentation dataset;
[0006] The first and second images are randomly transformed to obtain the third and fourth images;
[0007] Select a first identification object and its pixel label from the third image;
[0008] The first identified object and its pixel label are pasted onto a random position in the third image to obtain the target image.
[0009] In some embodiments, the step of randomly transforming the first image and the second image to obtain the third image and the fourth image includes:
[0010] The first and second images are randomly jittered and randomly horizontally flipped to obtain the third and fourth images.
[0011] In some embodiments, the step of randomly jittering and randomly horizontally flipping the first image and the second image to obtain the third image and the fourth image includes:
[0012] If the size of the image corresponding to the first image after random jitter and random horizontal flipping is smaller than the first image, the pixels corresponding to the smaller portion are filled with gray pixel values to obtain the third image, or...
[0013] If the size of the image corresponding to the second image after random jitter and random horizontal flip is smaller than that of the second image, the pixels corresponding to the smaller portion are filled with gray pixel values to obtain the fourth image.
[0014] In some embodiments, the method further includes:
[0015] Based on the target image, determine whether the second identification object in the second image is completely covered by the first identification object;
[0016] If the second identified object in the second image is completely covered by the first identified object, the target image is deleted.
[0017] In some embodiments, the method further includes:
[0018] If the second identified object in the second image is not completely covered by the first identified object, the target image is added to the original semantic segmentation dataset.
[0019] Secondly, this disclosure provides a data processing apparatus, including:
[0020] The random selection module is used to randomly select the first and second images from the original semantic segmentation dataset;
[0021] The transformation module is used to randomly transform the first image and the second image respectively to obtain the third image and the fourth image;
[0022] The selection module is used to select a first identification object and the pixel label of the first identification object from the third image;
[0023] The pasting module is used to paste the first identified object and its pixel label to a random position in the third image to obtain the target image.
[0024] In some embodiments, the step of randomly transforming the first image and the second image to obtain the third image and the fourth image includes:
[0025] The first and second images are randomly jittered and randomly horizontally flipped to obtain the third and fourth images.
[0026] In some embodiments, the step of randomly jittering and randomly horizontally flipping the first image and the second image to obtain the third image and the fourth image includes:
[0027] If the size of the image corresponding to the first image after random jitter and random horizontal flipping is smaller than the first image, the pixels corresponding to the smaller portion are filled with gray pixel values to obtain the third image, or...
[0028] If the size of the image corresponding to the second image after random jitter and random horizontal flip is smaller than that of the second image, the pixels corresponding to the smaller portion are filled with gray pixel values to obtain the fourth image.
[0029] Thirdly, this disclosure provides an electronic device including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described above.
[0030] Fourthly, this disclosure provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the methods described in the above aspects.
[0031] Fifthly, this disclosure provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the methods described in the foregoing aspects.
[0032] The data processing method disclosed herein involves randomly selecting a first image and a second image from an original semantic segmentation dataset; randomly transforming the first image and the second image to obtain a third image and a fourth image; selecting a first recognition object and its pixel label from the third image; and pasting the first recognition object and its pixel label to a random position in the third image to obtain a target image. This method can enhance the semantic segmentation dataset and effectively improve the diversity of the original dataset. Attached Figure Description
[0033] The present disclosure will be described in more detail below based on embodiments and with reference to the accompanying drawings:
[0034] Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of the present disclosure.
[0035] Figure 2 A schematic diagram illustrating the implementation flow of a data processing method provided in an embodiment of this application;
[0036] Figure 3 This is a schematic diagram of a data processing apparatus provided in an embodiment of this application.
[0037] In the accompanying drawings, the same parts are referred to by the same reference numerals, and the drawings are not drawn to scale. Detailed Implementation
[0038] To enable those skilled in the art to better understand the technical solutions of this disclosure, and to fully understand and implement the process of how this disclosure applies technical means to solve technical problems and achieve corresponding technical effects, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, not all embodiments. The embodiments of this disclosure and the various features within them can be combined with each other without conflict, and the resulting technical solutions are all within the protection scope of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort should fall within the protection scope of this disclosure.
[0039] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0040] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0041] Example 1
[0042] This application provides a data processing method that can be applied to electronic devices such as mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). This application does not limit the specific type of electronic device. The electronic device can be a processor for a seismograph.
[0043] Figure 1This is a flowchart illustrating a data processing method provided in an embodiment of this disclosure. Figure 1 As shown, the data processing method includes:
[0044] Step S101: Randomly select the first image and the second image from the original semantic segmentation dataset.
[0045] In this embodiment, the original semantic segmentation dataset is a collection of a large number of images, each with a corresponding pixel-level label. These labels indicate the category (e.g., person, car, tree, etc.) of each pixel in the image. The goal of the semantic segmentation task is to train a model based on these labels, enabling it to automatically perform pixel-level classification of new images.
[0046] In this embodiment, the first image and the second image are randomly selected from the original semantic segmentation dataset. They can be any image containing multiple semantic categories, used for subsequent data augmentation processing.
[0047] In this embodiment of the application, a random number generator or a similar mechanism can be used to select two images from the dataset as the first image and the second image.
[0048] Step S102: Randomly transform the first image and the second image respectively to obtain the third image and the fourth image.
[0049] In this embodiment, random transformation is a series of random operations performed on the image to increase the diversity of the data. These operations may include rotation, scaling, translation, color dithering, etc.
[0050] In this embodiment, the third image and the fourth image are obtained by randomly transforming the first image and the second image, respectively.
[0051] Step S103: Select a first identification object and its pixel label from the third image.
[0052] In this embodiment, a specific semantic object (such as a car, a person, etc.) is selected from the third image, and its pixel label is category information associated with each pixel in the image. In semantic segmentation tasks, each pixel has a unique label representing its semantic category.
[0053] In this embodiment, image processing or machine learning algorithms (such as object detection, semantic segmentation, etc.) can be used to identify objects of interest from a third image. Pixel labels of the object are extracted, and these labels will be used to preserve the semantic information of the object in the target image.
[0054] Step S104: Paste the first identification object and its pixel label to a random position in the third image to obtain the target image.
[0055] In this embodiment, the target image is generated by pasting a first identified object and its pixel labels onto a random position in a third image. This image will be used to expand the original semantic segmentation dataset or to train a semantic segmentation model.
[0056] In this embodiment, a random location is selected on the third image, and then the first identification object and its pixel label are pasted onto that location. This can be done using an image combination method similar to Mixup and CutMix. However, unlike directly mixing all pixels in two images or a rectangle, only the target object and its pixel label are mixed, thereby improving the object recognition capability of the data sample.
[0057] The method provided in this application embodiment enhances the semantic segmentation dataset by randomly selecting a first image and a second image from the original semantic segmentation dataset; randomly transforming the first image and the second image respectively to obtain a third image and a fourth image; selecting a first recognition object and a pixel label of the first recognition object from the third image; and pasting the first recognition object and the pixel label of the first recognition object to a random position in the third image to obtain a target image.
[0058] In some embodiments, the step of randomly transforming the first image and the second image to obtain the third image and the fourth image includes: randomly jittering and randomly horizontally flipping the first image and the second image to obtain the third image and the fourth image.
[0059] In this embodiment, image jitter mainly involves adjusting and cropping the image size, with the standard random adjustment range typically ranging from 0.8 to 1.2 times the original image size.
[0060] In this embodiment, a large-scale jitter strategy is adopted, which expands the random adjustment range to 0.1 to 2.0 times the original image size.
[0061] In some embodiments, the step of randomly jittering and randomly horizontally flipping the first image and the second image to obtain the third image and the fourth image includes:
[0062] If the size of the image corresponding to the first image after random jitter and random horizontal flipping is smaller than the first image, the pixels corresponding to the smaller portion are filled with gray pixel values to obtain the third image, or...
[0063] If the size of the image corresponding to the second image after random jitter and random horizontal flip is smaller than that of the second image, the pixels corresponding to the smaller portion are filled with gray pixel values to obtain the fourth image.
[0064] In this embodiment, a large-scale dithering strategy is employed, expanding the random adjustment range to 0.1 to 2.0 times the original image size. If the size of the dithered image is smaller than the original image size, the excess portion is filled with gray pixel values. This large-scale dithering method improves the complexity of the data samples compared to standard dithering. After random dithering adjustment, the image is then randomly horizontally flipped to obtain the processed images, namely the third and fourth images.
[0065] In some embodiments, after step S104, the method further includes:
[0066] Step S105: Determine whether the second identification object in the second image is completely covered by the first identification object based on the target image;
[0067] Step S106: If the second identification object in the second image is completely covered by the first identification object, the target image is deleted.
[0068] Step S107: If the second identified object in the second image is not completely covered by the first identified object, the target image is added to the original semantic segmentation dataset.
[0069] Example 2
[0070] Based on the above embodiments, this application further provides a data processing method, including:
[0071] Step 1: Randomly select a pair of images from the original semantic segmentation dataset.
[0072] Step 2: Perform random proportional jitter and random horizontal flipping on the selected image pairs.
[0073] Step 3: Randomly select a type of object to be identified and its pixel label from the first image in the image pair, and paste it into a random position on the second image.
[0074] Step 4: Adjust the combined labeled images. If the object to be identified in the second image is completely covered, delete it; if the object to be identified is partially covered, update the corresponding pixel labels.
[0075] The method provided in this application introduces a data augmentation strategy based on random copy and paste, which can paste different objects of different scales into a new background image, thereby efficiently expanding the scale and diversity of the original dataset and improving the training effect of the semantic segmentation model.
[0076] The method provided in this application can efficiently improve the diversity of semantic segmentation datasets and enhance the accuracy and robustness of semantic segmentation models. By pasting different objects at different scales into a new background image, this application only mixes the pixel labels of the target objects, rather than directly mixing all pixels from two images or within a rectangle. Furthermore, compared to traditional methods that require modeling the surrounding environment to determine the pasting location of the copied object, this method employs a simpler random pasting strategy, further enhancing the randomness and diversity of the data. This random combination method can quickly and effectively expand the original dataset, helping to improve the training effect of the semantic segmentation model.
[0077] Example 3
[0078] Based on the above embodiments, this application further provides a data processing method, including:
[0079] Figure 2 This is a schematic diagram illustrating the implementation flow of a data processing method provided in an embodiment of this application, such as... Figure 2 As shown, it includes:
[0080] Randomly select a pair of images from the original semantic segmentation dataset.
[0081] Semantic segmentation models typically have stringent data requirements, and the training process demands a large amount of image data, while manually labeling pixels is time-consuming and tedious. Traditional data augmentation methods, though widely used, are inherently more general and lack object-awareness, not specifically designed for semantic segmentation. To improve the accuracy and robustness of semantic segmentation models, a random copy-and-paste approach is introduced to expand the randomness and diversity of the dataset. This method effectively increases the richness of the dataset, contributing to improved performance of the semantic segmentation model.
[0082] Specifically, from the original semantic segmentation dataset Data M Randomly select a pair of images (I) a I b ), where M represents the number of images in the original dataset, I a I b The selected images are represented by a, b = 1, 2, ..., M, which represent the index numbers of the selected images.
[0083] Subsequently, the selected image pairs are subjected to random proportional jitter and random horizontal flipping.
[0084] Image jitter mainly involves adjusting and cropping the size of an image. The standard random adjustment range is typically 0.8 to 1.2 times the original image size.
[0085] This embodiment employs a large-scale dithering strategy, expanding the random adjustment range to 0.1 to 2.0 times the original image size. If the size of the dithered image is smaller than the original image size, the excess portion is filled with gray pixel values. This large-scale dithering method improves the complexity of the data samples compared to standard dithering. After random proportional dithering adjustment, the image is then randomly horizontally flipped to obtain the processed image pair (I). ′ a I ′ b ).
[0086] Among them, I ′ a I ′ b This is represented as an image that has been randomly adjusted.
[0087] Randomly select a class of objects and their pixel labels from the first image in the image pair, and paste them into a random position on the second image.
[0088] This embodiment employs an image combination method similar to Mixup and CutMix, but unlike directly mixing all pixels in two images or within a rectangle, it only mixes the target object and its pixel labels, thereby improving the object recognition capability of the data samples. Unlike previous studies that modeled the environment surrounding the object to determine the paste location, we use a simpler random copy-paste enhancement method to generate new training data. This method offers several possibilities: (1) randomly selecting the source image and the target image to be pasted; (2) randomly selecting the object to be copied from the source image; and (3) randomly selecting where to paste the copied object onto the target image. Therefore, this method can further enhance the randomness and diversity of the semantic segmentation dataset.
[0089] Specifically, I′ a As the source image, I′ b As the target image to be pasted, from I′ a A random selection of a class of recognition objects O a and its pixel label, and paste it into I′ b Random positions within.
[0090] Among them, O a It is a type of object to be identified in the source image.
[0091] Adjust the annotated image after combining the images.
[0092] If the object to be identified in the second image is completely covered, it is deleted; if the object to be identified is partially covered, the corresponding pixel label is updated.
[0093] In the combined image, the proportions of the target objects may differ significantly from the original proportions, and different identified objects may appear adjacent to each other or occlude each other. This random combination method can effectively expand the size and diversity of the original dataset, thereby improving the accuracy and robustness of the semantic segmentation model.
[0094] Specifically, in this embodiment, the combined image I′ b Make adjustments if I′ b The original object of recognition O b O a Complete coverage, then O b Delete, if the identified object O b If the image is partially obscured, the pixel label at the corresponding location is updated, resulting in the adjusted new image I. new In practice, the original dataset can be augmented as needed to expand it to the required amount of image data, resulting in the final semantic segmentation dataset.
[0095] This application proposes a data augmentation method suitable for semantic segmentation tasks, focusing on its pixel-by-pixel recognition characteristics. By introducing a random copy-and-paste strategy, this method specifically enhances the ability to identify objects in a dataset, efficiently increasing the scale and diversity of the semantic segmentation dataset, thereby improving the model's accuracy and robustness. Its core idea is to paste different objects at different scales into a new background image. Similar to traditional methods, this method only mixes the pixel labels of the target objects, rather than directly mixing all pixels from two images or within a rectangle. Secondly, compared to traditional methods that require modeling the surrounding environment to determine the pasting location of copied objects, this method employs a simpler random paste strategy, further increasing the randomness and diversity of the data. This random combination method can quickly and effectively expand the original dataset, helping to improve the training effect of the semantic segmentation model.
[0096] Example 4
[0097] This application provides a data processing apparatus. Figure 3 This is a schematic diagram of a data processing apparatus provided in an embodiment of this application, such as... Figure 3 As shown, it includes:
[0098] The random selection module is used to randomly select the first and second images from the original semantic segmentation dataset;
[0099] The transformation module is used to randomly transform the first image and the second image respectively to obtain the third image and the fourth image;
[0100] The selection module is used to select a first identification object and the pixel label of the first identification object from the third image;
[0101] The pasting module is used to paste the first identified object and its pixel label to a random position in the third image to obtain the target image.
[0102] In some embodiments, the step of randomly transforming the first image and the second image to obtain the third image and the fourth image includes:
[0103] The first and second images are randomly jittered and randomly horizontally flipped to obtain the third and fourth images.
[0104] In some embodiments, the step of randomly jittering and randomly horizontally flipping the first image and the second image to obtain the third image and the fourth image includes:
[0105] If the size of the image corresponding to the first image after random jitter and random horizontal flipping is smaller than the first image, the pixels corresponding to the smaller portion are filled with gray pixel values to obtain the third image, or...
[0106] If the size of the image corresponding to the second image after random jitter and random horizontal flip is smaller than that of the second image, the pixels corresponding to the smaller portion are filled with gray pixel values to obtain the fourth image.
[0107] In some embodiments, the data processing apparatus is further configured to:
[0108] Based on the target image, determine whether the second identification object in the second image is completely covered by the first identification object;
[0109] If the second identified object in the second image is completely covered by the first identified object, the target image is deleted.
[0110] In some embodiments, the data processing apparatus is further configured to:
[0111] If the second identified object in the second image is not completely covered by the first identified object, the target image is added to the original semantic segmentation dataset.
[0112] Example 5
[0113] Based on the above embodiments, this embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described in the above embodiments.
[0114] Example 6
[0115] In some embodiments of this example, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the method described in the above embodiments.
[0116] In some embodiments of this example, a computer program product is provided, including a computer program / instructions, which, when executed by a processor, implements the steps of the method described in the above embodiments.
[0117] The processor may include, but is not limited to, one or more processors or microprocessors. Each processor may be implemented as an Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), controller, microcontroller, microprocessor, or other electronic component, for executing the methods in the above embodiments.
[0118] Computer-readable storage media can be implemented by any type of volatile or non-volatile storage device or a combination thereof. Computer-readable storage media may include, but are not limited to, random access memory (RAM), read-only memory (ROM), flash memory, EPROM memory, EEPROM memory, registers, and computer storage media (e.g., hard disks, floppy disks, solid-state drives, removable disks, CD-ROMs, DVD-ROMs, Blu-ray discs, etc.).
[0119] Computer-readable storage media may also store at least one computer-executable program / instruction, such as computer-readable instructions. Computer-readable storage media include, but are not limited to, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Computer-readable storage media may include, for example, read-only memory (ROM), hard disk, flash memory, etc. For example, a non-transitory computer-readable storage medium may be connected to a computing device such as a computer, and then, when the computing device executes the computer-readable instructions stored on the computer-readable storage medium, the various methods described above can be performed.
[0120] In addition, the computer device may include (but is not limited to) a data bus, an input / output (I / O) bus, a display, and input / output devices (e.g., keyboard, mouse, speakers, etc.).
[0121] The processor can communicate with external devices via the I / O bus through wired or wireless networks.
[0122] In one embodiment, the at least one computer-executable instruction may also be compiled into or comprise a software product / computer program product, wherein one or more computer-executable instructions are executed by a processor to perform the steps of the various functions and / or methods in the embodiments described herein.
[0123] In the embodiments provided in this disclosure, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0124] It should be noted that, in this disclosure, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element limited by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0125] While the embodiments disclosed herein are as described above, the foregoing content is merely for the purpose of facilitating understanding of this disclosure and is not intended to limit this disclosure. Any person skilled in the art to which this disclosure pertains may make any modifications and changes in form and detail of the implementation without departing from the spirit and scope of this disclosure; however, the scope of patent protection of this disclosure shall still be determined by the scope defined in the appended claims.
Claims
1. A data processing method, characterized in that, include: Randomly select the first and second images from the original semantic segmentation dataset; The first and second images are randomly transformed to obtain the third and fourth images; Select a first identification object and its pixel label from the third image; The first identified object and its pixel label are pasted onto a random position in the third image to obtain the target image.
2. The method according to claim 1, characterized in that, The step of randomly transforming the first image and the second image to obtain the third image and the fourth image includes: The first and second images are randomly jittered and randomly horizontally flipped to obtain the third and fourth images.
3. The method according to claim 2, characterized in that, The step of randomly jittering and randomly horizontally flipping the first and second images to obtain the third and fourth images includes: If the size of the image corresponding to the first image after random jitter and random horizontal flipping is smaller than the first image, the pixels corresponding to the smaller portion are filled with gray pixel values to obtain the third image, or... If the size of the image corresponding to the second image after random jitter and random horizontal flip is smaller than that of the second image, the pixels corresponding to the smaller portion are filled with gray pixel values to obtain the fourth image.
4. The method according to claim 1, characterized in that, The method further includes: Based on the target image, determine whether the second identification object in the second image is completely covered by the first identification object; If the second identified object in the second image is completely covered by the first identified object, the target image is deleted.
5. The method according to claim 4, characterized in that, The method further includes: If the second identified object in the second image is not completely covered by the first identified object, the target image is added to the original semantic segmentation dataset.
6. A data processing apparatus, characterized in that, include: The random selection module is used to randomly select the first and second images from the original semantic segmentation dataset; The transformation module is used to randomly transform the first image and the second image respectively to obtain the third image and the fourth image; The selection module is used to select a first identification object and the pixel label of the first identification object from the third image; The pasting module is used to paste the first identified object and its pixel label to a random position in the third image to obtain the target image.
7. The data processing apparatus according to claim 6, characterized in that, The step of randomly transforming the first image and the second image to obtain the third image and the fourth image includes: The first and second images are randomly jittered and randomly horizontally flipped to obtain the third and fourth images.
8. The data processing apparatus according to claim 7, characterized in that, The step of randomly jittering and randomly horizontally flipping the first and second images to obtain the third and fourth images includes: If the size of the image corresponding to the first image after random jitter and random horizontal flipping is smaller than the first image, the pixels corresponding to the smaller portion are filled with gray pixel values to obtain the third image, or... If the size of the image corresponding to the second image after random jitter and random horizontal flip is smaller than that of the second image, the pixels corresponding to the smaller portion are filled with gray pixel values to obtain the fourth image.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 5.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 5.