Container damaged surface picture generation method, system, device and storage medium

By generating high-quality, scene-adapted, and physically plausible damage images, the problems of data scarcity and poor quality of synthetic images in container inspection are solved, improving the model's recognition accuracy and robustness, and ensuring the rationality of damage location.

CN122265431APending Publication Date: 2026-06-23SHANGHAI WESTWELL INFORMATION & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-05
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing technologies for container damage detection suffer from problems such as data scarcity, poor quality of synthesized images, insufficient scene generalization ability, and unreasonable damage location, resulting in low model training efficiency and poor deployment effect.

Method used

By collecting massive amounts of container images, using a pre-trained large visual model to filter similar background images, and combining image quality assessment and segmentation models, high-quality, scene-adapted, and physically plausible damage images are generated using Poisson fusion or Gaussian feathering strategies, ensuring that the damage location is within a reasonable area on the container surface.

Benefits of technology

It achieves efficient generation of a large number of high-quality training images, improves the model's recognition accuracy and robustness, solves the problems of data scarcity and scene adaptation, ensures the rationality of the damage location, and improves the model's generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122265431A_ABST
    Figure CN122265431A_ABST
Patent Text Reader

Abstract

The application provides a container damaged surface picture generation method, system, equipment and storage medium, and the method comprises the following steps: collecting damaged small pictures, on-site damaged pictures and various undamaged pictures, and screening out undamaged background picture library similar to a target scene by using a visual large model. After the damaged small pictures are attached to the background, the image difference value before and after the attachment is calculated by using an image quality evaluation algorithm, and based on the image quality difference, the damaged small pictures are divided into two categories: the first category is directly attached to a reasonable position on the surface of the container iron sheet by using a Poisson fusion algorithm; and the second category is first subjected to edge Gaussian feathering and then attached, and finally all the attached pictures are added to a training picture set. The application can automatically generate a large number of high-quality, scene-adapted and physically reasonable damaged pictures, solves the problems of real data scarcity, boundary artifacts in traditional synthesis, poor scene generalization and unreasonable position and the like, and provides an efficient and low-cost data solution for training a robust automatic damage inspection model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of model training, and more specifically, to a method, system, device, and storage medium for generating images of damaged surfaces of shipping containers. Background Technology

[0002] As the core carrier of global cargo transportation, the structural integrity of containers directly affects the safety of the goods inside. During loading, unloading, storage, and transportation at ports, the surface of containers may suffer various types of damage, such as holes, dents, and cracks, due to collisions, compression, and corrosion. Traditional manual inspection methods are inefficient, costly, and susceptible to subjective factors. Therefore, utilizing computer vision technology to achieve automatic detection of container surface damage (automatic damage inspection) has become an urgent need for industry development.

[0003] Deep learning methods have achieved great success in fields such as object detection and image segmentation, but their performance heavily relies on large-scale, high-quality training data. In the specific scenario of container damage detection, obtaining sufficient real-world training data presents significant challenges: First, damage itself is a low-probability event (occurring typically less than 1%), making it extremely difficult and costly to intentionally collect a large number of container images containing various types of damage in real-world scenarios; second, the shape, size, location, and texture of damage vary greatly, requiring sufficiently diverse samples to train a robust model.

[0004] To alleviate the problem of data scarcity, traditional approaches employ data augmentation techniques such as random rotation, scaling, cropping, and color dithering. However, these methods can only perform simple transformations on existing limited samples and cannot "create" images with new content (i.e., new, realistic damaged appearances), thus offering limited improvement to the model's ability to learn complex damage features. Another approach is to use image synthesis techniques, such as directly pasting collected damaged small images onto intact container background images. However, this simple "copy-and-paste" method has significant drawbacks: (1) Boundary artifact problem: Unnatural hard boundaries will be generated between the bonding area and the background, which is visually very abrupt and reduces the realism of the synthesized image; (2) Illumination and color inconsistency: The lighting conditions and color tone of the damaged small image often do not match the background image to be attached, resulting in the synthesized image looking uncoordinated. The model is prone to learning these unrealistic pseudo-features. (3) Poor scene generalization ability: Randomly selecting background images may result in huge differences between the generated training data and the actual deployment scene of the model (such as a specific region, specific weather, or specific dock layout). This causes the recognition accuracy to drop sharply when the model trained in a certain region is deployed to other regions with different lighting, weather, and background styles (such as from the Middle East desert region to the high latitude region of Northern Europe). (4) Physical irrationality: The location of the damage should be random, but it must conform to common sense. For example, the damage should not appear on the metal rod of the lock bar or in the middle hole of the lock hole. Simple random fitting cannot guarantee this.

[0005] In view of this, the present invention provides a method, system, device and storage medium for generating images of damaged surfaces of containers. Summary of the Invention

[0006] To address the problems in the prior art, the present invention aims to provide a method, system, device, and storage medium for generating images of damaged surfaces of containers. It overcomes the difficulties of the prior art and can automatically generate a large number of high-quality, scene-adapted, and physically reasonable damaged images, providing an efficient and low-cost data solution for training robust automatic damage inspection models.

[0007] An embodiment of the present invention provides a method for generating an image of a damaged surface of a shipping container, comprising the following steps: S110. Collect a first image set of surface damage thumbnails extracted locally from massive container images, a second image set of several on-site images of damaged containers, and a third image set of undamaged container images containing different scenes, lighting conditions, and massive weather conditions. S120. Select images similar to at least one image in the second image set from the third image set using a pre-trained visual large model to establish a fourth image set. Paste the surface-damaged small image onto the container area of ​​the image similar to the undamaged container. Obtain the image difference value before and after pasting based on the image quality evaluation algorithm. The image difference value is greater than or equal to a preset threshold and is regarded as the first type of surface-damaged small image. The image difference value is less than the preset threshold and is regarded as the second type of surface-damaged small image. S130. For each of the first type of surface damage images, randomly select several similar images of undamaged containers, generate M candidate regions in the metal sheet surface area of ​​the undamaged container similar images, and the range of each candidate region belonging to the metal sheet surface area of ​​the container is greater than a preset threshold. Then, fit the first type of surface damage images to the M candidate regions using the Poisson fusion algorithm and add them to the training image set. S140. For each small image of the second type of surface damage, randomly select several similar images of undamaged containers, generate M candidate regions in the metal surface area of ​​the undamaged container similar images, and the range of each candidate region in the metal surface area of ​​the container is greater than a preset threshold. After Gaussian feathering the edge part of the small image of the second type of surface damage, it is attached to the M candidate regions and added to the training image set.

[0008] Preferably, step S110 includes: S111. Small images of surface damage extracted locally from massive container images using AI image recognition; S112. Collect several on-site images of the target site, including the damaged container; S113. Collect images of undamaged containers under different scenes, lighting and weather conditions.

[0009] Preferably, step S120 includes: S121. Extract the first feature vector of each image in the second image set and the second feature vector of each image in the third image set using a pre-trained large visual model. S122. Calculate the distance metric between the second feature vector of each image in the third image set and the first feature vector of each image in the second image set, and select similar images of undamaged containers that are similar to the second image set as the fourth image set; S123. Each of the surface damage images is pasted onto the container area of ​​any one image in the fourth image set to form a test composite image; S124. Calculate the difference value of the similar image of the undamaged container before and after attaching it to the surface damage image using an image quality evaluation algorithm, and determine whether the difference value is greater than or equal to a preset threshold. If yes, the surface damage image is a first type of surface damage image; otherwise, the surface damage image is a second type of surface damage image.

[0010] Preferably, step S123 includes: S1231. For each of the surface damage images, select a similar image of an undamaged container from the fourth image set. S1232. The selected undamaged container similar image is identified by segmentation model to obtain a first local image region of the metal sheet surface area of ​​the container and a second local image region representing the container lock and locking bar. S1233, The surface damage image is then pasted onto the first local image region using a Poisson fusion algorithm.

[0011] Preferably, step S130 includes: S131. For each small image of the first type of surface damage, randomly select several similar images of undamaged containers, and perform image recognition on the selected similar images of undamaged containers using a pre-trained image segmentation model to obtain the target pixel area of ​​the iron sheet surface area of ​​the container and the remaining non-target pixel areas. S132. In the target pixel area, M candidate areas are generated according to the outline of the first type of surface damage small image. Each candidate area satisfies the following: the image center is located in the target pixel area, and the number of pixels or the proportion of pixels in the candidate area located in the target pixel area is greater than a preset threshold. S133. The first type of surface damage small image is attached to the M candidate regions using the Poisson fusion algorithm and added to the training image set.

[0012] Preferably, step S140 includes: S141. For each small image of the second type of surface damage, randomly select several similar images of undamaged containers, and perform image recognition on the selected similar images of undamaged containers using a pre-trained image segmentation model to obtain the target pixel area of ​​the iron sheet surface area of ​​the container and the remaining non-target pixel areas. S142. In the target pixel area, M candidate areas are generated according to the outline of the second type of surface damage small image. Each candidate area satisfies the following: the image center is located in the target pixel area, and the number of pixels or the proportion of pixels in the candidate area located in the target pixel area is greater than a preset threshold. S143. After Gaussian feathering the edge portion of the second type of surface damage image, it is attached to the M candidate regions and added to the training image set.

[0013] Preferably, the candidate regions generated from similar images of the same undamaged container do not overlap with each other.

[0014] Embodiments of the present invention also provide an image generation system for a damaged container surface, used to implement the above-described image generation method for a damaged container surface, the image generation system for a damaged container surface comprising: The image collection module collects a first image set of small images of surface damage extracted from a large number of container images, a second image set of several on-site images of damaged containers, and a third image set of images of undamaged containers with different scenes, lighting, and a large number of weather conditions. The image classification module selects images similar to undamaged containers from the third image set using a pre-trained visual large model, which are similar to at least one image in the second image set, to establish a fourth image set. The surface-damaged small images are then pasted onto the container regions of the undamaged container similar images. The image difference values ​​before and after pasting are calculated based on an image quality evaluation algorithm. Images with a difference value greater than or equal to a preset threshold are classified as first-class surface-damaged small images, and images with a difference value less than the preset threshold are classified as second-class surface-damaged small images. The first bonding module randomly selects several similar images of undamaged containers for each small image of the first type of surface damage. M candidate regions are generated in the metal sheet surface area of ​​the undamaged container similar images. The range of each candidate region belonging to the metal sheet surface area of ​​the container is greater than a preset threshold. The small image of the first type of surface damage is bonded to the M candidate regions through the Poisson fusion algorithm and added to the training image set. The second bonding module randomly selects several similar images of undamaged containers for each small image of the second type of surface damage. M candidate regions are generated in the metal surface area of ​​the undamaged container similar image. The range of each candidate region in the metal surface area of ​​the container is greater than a preset threshold. The edge part of the small image of the second type of surface damage is Gaussian feathered and then bonded to the M candidate regions and added to the training image set.

[0015] Embodiments of the present invention also provide an image generation device for a damaged surface of a container, comprising: processor; A memory in which executable instructions of the processor are stored; The processor is configured to execute the steps of the above-described method for generating an image of a damaged surface of a container by executing the executable instructions.

[0016] Embodiments of the present invention also provide a computer-readable storage medium for storing a program, which, when executed, implements the steps of the above-described method for generating images of the damaged surface of a container.

[0017] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. Systematically solve the problems of data scarcity and quality: This invention provides a complete automated data generation pipeline that can generate a near-infinite number of high-quality training images from limited raw materials (a small number of damaged images and on-site images), fundamentally solving the core pain points of difficult and costly collection of real damaged data.

[0018] 2. Significantly enhances the realism of synthesized images: By introducing a damage image classification mechanism based on image quality evaluation and applying differentiated image fusion strategies (Poisson fusion or edge feathering) to different types of damage, the hard boundary artifacts and lighting inconsistencies generated by the traditional "copy-and-fit" method are effectively eliminated, making the synthesized damage look as natural as if it were originally on the surface of the container.

[0019] 3. Significantly enhances the model's scene generalization ability: Innovatively utilizing a pre-trained large visual model, based on a small number of images of the target scene, a background image library with similar visual styles is selected from a massive database of undamaged images. The training data generated in this way is highly consistent with the real-world scenes where the model will be deployed in terms of lighting, weather, and background style, thereby significantly improving the recognition accuracy and robustness of the trained model in new scenes and solving the problem of performance degradation when the model is deployed across regions.

[0020] 4. Ensure the physical plausibility of damage locations: By integrating an image segmentation model, the system accurately identifies "damageable" and "non-damageable" areas in container images, and strictly constrains damage to be placed only on reasonable areas of the container's sheet metal surface during the synthesis process. This avoids generating physically impossible damage samples, making the training data more consistent with real-world patterns, thereby guiding the model to learn more generalizable and realistic damage features.

[0021] 5. High degree of automation and scalability: The entire method has a clear workflow and a high degree of modularity, requiring minimal manual intervention to run. The pre-trained model, distance metric, image quality assessment algorithm, segmentation model, etc., can all be replaced with more advanced versions, enabling the method to continuously evolve with advancements in underlying technology, exhibiting good scalability and foresight.

[0022] The purpose of this invention is to provide a method, system, device, and storage medium for generating images of damaged surfaces of containers. It can automatically generate a large number of high-quality, scene-adapted, and physically reasonable damaged images, solving problems such as the scarcity of real data, boundary artifacts in traditional synthesis, poor scene generalization, and unreasonable location. It provides an efficient and low-cost data solution for training robust automatic damage inspection models. Attached Figure Description

[0023] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings.

[0024] Figure 1 This is a flowchart of the method for generating images of the damaged surface of a container according to the present invention.

[0025] Figure 2 This is a schematic diagram illustrating the process of generating an image of a damaged surface of a container according to the present invention.

[0026] Figure 3 This is an overall architecture diagram of the container damage surface image generation system of the present invention.

[0027] Figure 4 This is a schematic diagram of the structure of the container damaged surface image generation device of the present invention.

[0028] Figure 5This is a schematic diagram of the structure of a computer-readable storage medium according to an embodiment of the present invention. Detailed Implementation

[0029] The following specific examples illustrate the implementation methods of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed herein. This application can also be implemented or applied through other different specific embodiments, and various details in this application can be modified or changed according to different viewpoints and application systems without departing from the spirit of this application. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other.

[0030] The embodiments of this application will now be described in detail with reference to the accompanying drawings, so that those skilled in the art can easily implement the application. This application may be embodied in many different forms and is not limited to the embodiments described herein.

[0031] In this application, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics represented in connection with that embodiment or example, which are included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics represented may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate different embodiments or examples represented in this application, as well as features of different embodiments or examples.

[0032] Furthermore, the terms "first" and "second" are used for illustrative purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the representation of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0033] For the purpose of clearly describing this application, devices that are not relevant to the description are omitted, and the same or similar components throughout the specification are given the same reference numerals.

[0034] Throughout this specification, when it is said that a device is "connected" to another device, this includes not only "direct connection" but also "indirect connection" by placing other components in between. Furthermore, when it is said that a device "comprises" a certain constituent element, unless otherwise stated otherwise, this does not exclude other constituent elements, but rather implies that other constituent elements may be included.

[0035] When we say that a device is "above" another device, this can mean that it is directly above the other device, or it can mean that other devices are present in between. Conversely, when we say that a device is "directly" "above" another device, there are no other devices present in between.

[0036] Although the terms first, second, etc., are used in some instances herein to refer to various elements, these elements should not be limited by these terms. These terms are used only to distinguish one element from another. For example, first interface and second interface, etc., are used. Furthermore, as used herein, the singular forms “a,” “an,” and “the” are intended to also include the plural forms unless the context indicates otherwise. It should be further understood that the terms “comprising,” “including,” indicate the presence of features, steps, operations, elements, components, items, kinds, and / or groups, but do not exclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, items, kinds, and / or groups. The terms “or” and “and / or” as used herein are interpreted as inclusive, or mean any one or any combination thereof. Thus, “A, B, or C” or “A, B, and / or C” means “any one of: A; B; C; A and B; A and C; B and C; A, B, and C.” Exceptions to this definition will only occur if the combination of elements, functions, steps, or operations is inherently mutually exclusive in some way.

[0037] The technical terms used herein are for reference only to specific embodiments and are not intended to limit the scope of this application. The singular form used herein includes the plural form unless the statement explicitly indicates otherwise. The word "comprising" as used in the specification means to specify a particular characteristic, region, integer, step, operation, element, and / or component, and does not exclude the presence or addition of other characteristics, regions, integers, steps, operations, elements, and / or components.

[0038] Although not explicitly defined, all terms, including technical and scientific terms used herein, shall have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. Terms defined in commonly used dictionaries shall be further interpreted as having a meaning consistent with the relevant technical literature and the content of this present application, and shall not be over-interpreted as having an ideal or overly formulaic meaning unless otherwise defined.

[0039] Figure 1 This is a flowchart of the method for generating images of the damaged surface of a container according to the present invention. Figure 1 As shown, the method for generating images of damaged surfaces of containers according to the present invention includes: S110, Material Collection Steps: Collect a first image set of surface damage thumbnails extracted from a large number of container images, a second image set of several on-site images containing damaged containers, and a third image set of undamaged container images containing different scenes, lighting conditions, and a large number of weather conditions.

[0040] S120. Material Selection and Damaged Image Classification Steps: From the third image set, select undamaged container-like images that are similar in scene features to at least one image in the second image set using a pre-trained large visual model (such as CLIP, DINOv2, etc.) to establish a fourth image set (undamaged background image library) that matches the visual style of the target scene. Then, paste the surface-damaged small images onto the container areas of the images in the fourth image set, and calculate the image difference value before and after pasting based on image quality evaluation algorithms (such as SSIM, LPIPS, etc.). According to a preset threshold, the damaged small images are divided into two categories: those with an image difference value greater than or equal to the preset threshold are classified as the first category of surface-damaged small images (Group A), indicating that the damage features are obvious after pasting and the fusion algorithm can be used directly; those with an image difference value less than the preset threshold are classified as the second category of surface-damaged small images (Group B), indicating that the damage is easily integrated into the background after pasting and requires special processing.

[0041] S130. Generation steps for the first type of damage image: For each small image of the first type of surface damage, randomly select several similar images (background images) of undamaged containers from the fourth image set. Process each background image using a pre-trained image segmentation model to accurately identify the target pixel region (the area that can safely fit the damage) and the non-target pixel regions representing areas that cannot be fitted, such as locks and latches. Within the target pixel region, based on the contour of the first type of damage image, generate M physically plausible candidate fitting regions (ensuring the center of the region is within the target region and most of its area belongs to the target region). Finally, fit the first type of surface damage image to these M candidate regions using the Poisson fusion algorithm to generate M composite images, which are then added to the final training image set. Poisson fusion effectively eliminates boundaries, allowing the damage to blend naturally into the background.

[0042] S140. Second-type damaged image generation steps: For each second-type surface damaged small image, several background images are randomly selected, and the target pixel region is identified using a segmentation model. M reasonable candidate regions are generated within the target pixel region. Unlike the first-type processing, before pasting, the edges of the second-type damaged small image are first subjected to Gaussian feathering to soften their edges. Then, the feathered damaged small image is directly pasted (e.g., alpha blending) to the M candidate regions. This method avoids the problem of damaged features disappearing due to direct use of Poisson fusion, while feathering reduces hard boundary artifacts. The generated images are also added to the training image set.

[0043] By repeatedly executing steps S130 and S140, a massive number of training images can be generated in batches. Each generated image satisfies the following characteristics: (1) the damage features are realistic and coordinated with the lighting and color of the background; (2) the damage appears in physically reasonable locations such as the surface of the box metal sheet, avoiding impossible areas such as locks; (3) the background image comes from a library with a visual style similar to the target deployment scene, ensuring a high degree of correlation between the generated data and the real application scene; (4) through classification and differentiated fusion strategies, the characteristics of different damage images are taken into account, ensuring the optimization of the synthesis effect.

[0044] In a preferred embodiment, in step S110, the surface damage images can be automatically located and cropped from a large number of container images using an artificial intelligence image recognition model, covering various damage types such as holes, dents, cracks, scratches, and rust spots. The second image set (on-site damage images) is used to define the visual style of the target scene; the number does not need to be large, but it should be representative. The third image set (undamaged images) should cover as widely as possible various weather conditions (sunny, rainy, foggy, snowy), lighting (morning, noon, evening, night, backlight, sidelight), scenes (different docks, yards, backgrounds), and container models and colors.

[0045] In a preferred embodiment, step S120 includes: S121. Extract the first feature vector of each image in the second image set and the second feature vector of each image in the third image set using a pre-trained large visual model. S122. Calculate the distance metric between the second feature vector of each image in the third image set and the first feature vector of each image in the second image set, and select similar images of undamaged containers that are similar to the second image set as the fourth image set; S123. Paste each small image of surface damage onto the container area of ​​any image selected from the fourth image set to form a test composite image; S124. Calculate the difference value of similar images of undamaged containers before and after the surface damage small image by using an image quality evaluation algorithm. Determine whether the difference value is greater than or equal to a preset threshold. If so, the surface damage small image is a first-class surface damage small image. If not, the surface damage small image is a second-class surface damage small image, but this is not a limitation.

[0046] In a preferred embodiment, step S123 includes: S1231. For each small image of surface damage, select a similar image of an undamaged container from the fourth image set. S1232. By using a segmentation model, container block recognition is performed on the selected undamaged container similar images to obtain a first local image region of the container sheet metal surface area and a second local image region representing the container locks and locking bars. S1233. The surface damage small image is attached to the first local image region using the Poisson fusion algorithm, but not limited to this.

[0047] In this embodiment, high-dimensional feature vectors of images are extracted using a pre-trained large visual model, and the similarity between images is quantified by calculating distance metrics (such as cosine similarity) between feature vectors. Selecting undamaged images similar to the damaged images at the scene is essentially a background image selection guided by the target scene, which is key to improving the scene adaptability of the generated data. Image quality evaluation is used to determine the "difficulty" of merging the damaged small image with the background. A large difference value indicates that the damaged area is significantly different from the background, making Poisson fusion suitable; a small difference value indicates that the damaged area and the background have similar tones and textures, and Poisson fusion may cause it to "disappear," so feathering is required.

[0048] In a preferred embodiment, step S130 includes: S131. For each small image of surface damage in the first category, randomly select several similar images of undamaged containers, and use a pre-trained image segmentation model to perform image recognition on the selected similar images of undamaged containers to obtain the target pixel area of ​​the iron sheet surface area of ​​the container and the remaining non-target pixel areas. S132. Generate M candidate regions in the target pixel region based on the outline of the first type of surface damage small image. Each candidate region satisfies the following: the image center is located in the target pixel region, and the number of pixels or the proportion of pixels in the candidate region located in the target pixel region is greater than a preset threshold. S133. The small images of the first type of surface damage are fitted to the M candidate regions using the Poisson fusion algorithm and added to the training image set.

[0049] In a preferred embodiment, step S140 includes: S141. For each small image of surface damage of the second type, randomly select several similar images of undamaged containers, and use a pre-trained image segmentation model to perform image recognition on the selected similar images of undamaged containers to obtain the target pixel area of ​​the iron sheet surface area of ​​the container and the remaining non-target pixel areas. S142. Generate M candidate regions in the target pixel region based on the outline of the second type of surface damage small image. Each candidate region satisfies the following: the image center is located in the target pixel region, and the number of pixels or the proportion of pixels in the candidate region located in the target pixel region is greater than a preset threshold. S143. After Gaussian feathering the edge parts of the second type of surface damage small image, fit them to M candidate regions and add them to the training image set.

[0050] In a preferred embodiment, the candidate regions generated in similar images of the same undamaged container do not overlap with each other.

[0051] In steps S130 and S140, the validity of the candidate regions must be ensured during generation. Specifically, each candidate region is a rectangular area with an area equivalent to the bounding rectangle of the damaged small image. Its center coordinates are randomly generated within the target pixel area. Then, the number or proportion of pixels within this rectangular area that belong to the target pixel area (i.e., the fitting area) is calculated. It must be greater than a preset threshold (e.g., 90%) to be considered a valid candidate region. If the randomly generated region is invalid, it is regenerated until M valid regions are obtained. This mechanism, at the algorithmic level, enforces that the damage is only placed in reasonable locations such as the surface of the box's sheet metal. In addition, to increase diversity, multiple candidate regions generated for the same damaged image on the same background image should not overlap with each other.

[0052] The following details the specific implementation process of this invention: Figure 2 This is a schematic diagram illustrating the process of generating an image of the damaged surface of a container according to the present invention. (Reference) Figure 1 and 2 As shown in the figure, this embodiment describes in detail a method for generating images of damaged surfaces of containers. The method mainly includes four core stages: material preparation (S110), material screening and damage image classification (S120), generation of the first type of damage image (S130), and generation of the second type of damage image (S140).

[0053] Phase 1: Material Preparation (S110)

[0054] The goal of this phase is to collect all the raw materials needed to build the data generation pipeline, which requires preparing three types of image sets: Image Set 1 (Damage Mini-Image Library): This set contains mini-images of surface damage extracted from a large number of container images. These damage mini-images can be obtained through manual annotation and cropping, or by using a pre-trained damage detection model to scan a massive number of container images, automatically detecting and cropping areas suspected of being damaged. Damage types should be as diverse as possible, including but not limited to: holes (edge ​​tears or complete penetration), dents (surface dents caused by impact), cracks (linear cracks), scratches or curling (paint peeling or metal curling caused by surface scratches), oxidation rust spots (metal surface corrosion), weld zone ablation (damage around weld points), etc. Each mini-image should mainly contain the damaged area and a small amount of surrounding context.

[0055] Image Set 2 (On-site Damage Image Library): This set contains several images of damaged containers taken on-site at the target deployment dock or similar scenario. The number of these images does not need to be very large (e.g., dozens to hundreds), but their core value lies in defining the "visual style" of the target scene, including the dock's layout features, ground material, sky color, lighting characteristics, common container paint schemes, and degree of aging. For example, if the target deployment location is a desert port in the Middle East, images of damaged containers taken at that port against a backdrop of strong sunlight and dust should be collected.

[0056] The third image set (a massive library of undamaged images): This set requires a broad collection of intact container images taken from around the world under various conditions. Sources can include public datasets, web scraping, and images provided by partner ports. The key is to cover a wide range of diversity: different geographical locations (ports in Asia, Europe, and the Americas), different weather conditions (sunny, cloudy, rainy, foggy, snowy), different times of day (dawn, noon, dusk, night), different shooting angles and distances, different container types (20-foot, 40-foot, high cube containers, etc.), and colors (blue, red, green, rust-colored, etc.). The larger and more diverse this library, the greater the flexibility for subsequent filtering.

[0057] In addition, a pre-trained semantic segmentation model for container images is required. This model should be able to perform pixel-level classification on the input container images, distinguishing at least areas such as "the surface of the container's sheet metal," "locks (including lock bars and lock heads)," "lock holes," and "door gaps." This model is fundamental to ensuring the physical plausibility of the damaged fit location.

[0058] Phase Two: Material Selection and Damage Image Classification (S120)

[0059] This phase includes two key sub-tasks: selecting background images similar to the target scene, and classifying damaged small images.

[0060] Subtask 1: Filter similar background images (create the fourth image set 41).

[0061] We utilize a powerful pre-trained large-scale vision model (e.g., CLIP image encoder, DINOv2, or ResNet / ViT trained on a large dataset) as the feature extractor. We process the second image set (damaged images) and the third image set (a large number of undamaged images) separately. For each image I_site in the second set, we extract its high-dimensional feature vector V_site. For each image I_intact in the third set, we extract its high-dimensional feature vector V_intact.

[0062] Next, for each undamaged image in the third set, calculate its average similarity (or minimum distance) to the feature vectors of all on-site images in the second set. Specific distance metrics can be chosen such as cosine distance, Euclidean distance, etc. For example, to calculate cosine similarity: Similarity(I_intact) = avg( cosine_similarity(V_intact, V_site_i) ),for all V_site_i in the second set.

[0063] Then, the undamaged images in the third set are sorted according to similarity scores, and the top-ranked images (e.g., the top 20% or those with a set similarity threshold) are selected to form a new image set, called "Fourth Image Set 41" (equivalent to "Undamaged Background Image Library"). The images in this library are visually closest to the target scene. For example, if the scene image has strong desert lighting characteristics, then the selected background images will be container images taken under similar strong lighting conditions. This step is one of the core innovations of this invention in improving the scene adaptability of the generated data.

[0064] Subtask 2: Classification of damaged small images (Group A / B).

[0065] The purpose of this step is to determine the degree of damage to each damaged small image when it is merged with the background image, so as to decide which fusion strategy to use subsequently.

[0066] For each damaged thumbnail P_defect in the first image set 1: a. Randomly select an undamaged background image B from the newly established fourth image set 41 (background image library).

[0067] b. Use a pre-trained segmentation model to process the background image B and identify the "metal sheet surface area" Mask_plate (a binary mask, where the metal sheet area is 1 and other areas are 0) of the container in the image.

[0068] c. Within the area represented by Mask_plate, randomly select a location as a temporary bonding point.

[0069] d. Using the Poisson fusion algorithm, the damaged small image P_defect is initially attached to the selected position of the background image B to generate a temporary test composite image B'.

[0070] e. Using an image quality assessment algorithm, calculate the difference value D between the background image B and the corresponding region of the test composite image B' in the vicinity of the fitting area (or globally). Available evaluation metrics include structural similarity (SSIM) (the difference is calculated as 1-SSIM) and depth-aware LPIPS (Learned Perceptual Image Patch Similarity). These metrics can effectively reflect the differences between the two images in terms of structure, texture, and perception.

[0071] f. Compare the difference value D with a preset threshold T. If D >= T, it indicates that the image in that area has changed significantly after the bonding is damaged, and the damaged features are visually prominent and not easily "submerged" by the background. These damaged images are labeled "Type I Surface Damage Images" (Group A). ​​Conversely, if D < T, it indicates that the texture and color of the damaged image are too similar to the background area, and the difference is not obvious after Poisson fusion, potentially blurring the damaged features. These damaged images are labeled "Type II Surface Damage Images" (Group B).

[0072] After traversing all the damaged images, we obtain the classified sets of damaged images, group A and group B. The threshold T can be determined experimentally on the validation set based on the selected evaluation index.

[0073] Phase Three: Category I Damage Figure 4 A is generated (S130)

[0074] This stage specifically processes the damaged small images in Group A, with the goal of fusing them into appropriate positions in multiple background images with high quality, generating a large number of training images.

[0075] For each damaged small image P_A in group A: a. Randomly select N different background images {B1, B2, …, Bn}, all of which are from the fourth image set 41. N is an adjustable parameter that controls the number of samples generated for each damaged image.

[0076] b. For each selected background image Bi: i. Process Bi using a segmentation model to obtain an accurate mask for the "container sheet metal surface area" (target pixel area, value 255 / 1) and a mask for "non-target areas" (such as locks, keyholes, etc., value 0). The segmentation model clearly separates the container's sheet metal surface (gray grid area) from the lock bars and keyholes (black area).

[0077] ii. Determine the dimensions (width w, height h) of the damaged small image P_A based on its outer contour (or minimum bounding rectangle). M valid "alternative fitting regions" need to be generated on Mask_plate_i. Each alternative region can be defined as a rectangle R centered at point (cx, cy) with width w and height h.

[0078] iii. The algorithm for generating a valid region R is as follows: 1. Within the image area, randomly generate a center coordinate (cx, cy).

[0079] 2. Check if (cx, cy) falls within Mask_plate_i (i.e., the pixel value of that point is 255). If not, return to step 1 and regenerate.

[0080] 3. Determine the rectangle R with (cx, cy) as the center.

[0081] 4. Calculate the number of pixels belonging to Mask_plate_i (value 255) among all pixels within the rectangle R: Count_valid.

[0082] 5. Calculate the effective pixel ratio: Ratio_valid = Count_valid / (w h).

[0083] 6. Determine if Ratio_valid is greater than the preset threshold R_th (e.g., 0.9). If it is greater, region R is considered valid, as most of its area is on a plating sheet metal surface, and damage is not placed in unreasonable locations such as lock bars. If it is less than or equal to, region R is invalid, and return to step 1 to regenerate.

[0084] 7. To increase diversity, it is generally required that the M valid regions generated on the same background image Bi for the same damaged image P_A do not overlap. This can be checked for excessive overlap with existing regions when generating new regions after recording the coordinates of already generated regions.

[0085] iv. Repeat the above process until M valid, non-overlapping candidate regions {R1,R2, …, Rm} are generated for the background image Bi.

[0086] v. For each candidate region Rj, the Poisson blending algorithm is used to fit the damaged small image P_A to the corresponding position of the background image Bi (aligned with the center of Rj). Poisson blending solves a Poisson equation to ensure that the edges of the damaged small image blend seamlessly with the background while preserving the internal gradient (i.e., the damaged texture), thus generating a very natural composite effect. The holes blend seamlessly with the rust and shadows on the container surface.

[0087] vi. Save the resulting composite image after fusion and add it to the final "Training Image Set 42".

[0088] c. After processing N background images for P_A, a total of N images are generated. M composite images.

[0089] By iteratively processing all the damaged small images in group A, a large number of composite images of type A can be generated in batches.

[0090] Phase 4: Type II Damage Figure 4 B is generated (S140)

[0091] This stage specifically handles the damaged thumbnails in group B. Since the differences between the thumbnails in group B and the background are small, direct Poisson fusion might weaken the damage features; therefore, a different strategy is adopted. For each damaged thumbnail P_B in group B, the process is similar to the third stage: a. Randomly select N background images.

[0092] b. For each background image Bi, use the segmentation model to obtain Mask_plate_i, and generate M valid, non-overlapping candidate regions {R1, R2, …, Rm} (the generation logic is exactly the same as S130 to ensure physical rationality, and will not be repeated here).

[0093] c. For each candidate region Rj, perform the following operations: i. Preprocess the damaged small image P_B: Perform "Gaussian feathering" on its edges. Specifically, generate a corresponding Alpha channel (transparency channel) for P_B, keeping it opaque at the center of the damaged area (Alpha=1) and gradually transitioning to complete transparency (Alpha=0) towards the edges. This gradient process can be implemented using Gaussian kernel convolution, resulting in soft feathered edges.

[0094] ii. The feathered, damaged small image P_B' (with an alpha channel) is directly pasted onto the Rj position of the background image Bi using alpha blending. Alpha blending is a simple image compositing method that can proportionally blend the foreground and background based on transparency.

[0095] iii. Save the synthesized image and add it to "Training Image Set 42".

[0096] Edge feathering mitigates the potentially harsh boundaries that might result from direct bonding. Furthermore, by avoiding the use of strong gradient reconstruction (such as Poisson blending), the texture and color characteristics of the damaged area are preserved to the greatest extent possible, preventing the "disappearance" problem. A light-colored scratch, after edge feathering, naturally "attaches" to the container surface.

[0097] Finally, by integrating all the images generated in the third and fourth stages, a large-scale, high-quality, scene-adapted, and physically plausible training dataset of container damage surfaces is obtained. This dataset can be used to train or fine-tune various deep learning damage detection models (such as YOLO, Faster R-CNN, Mask R-CNN, Segment Anything Model, etc.), significantly improving the detection performance and robustness of the models in real-world complex scenarios.

[0098] This invention, through systematic design, organically integrates scene adaptation screening, damage characteristic classification, physical rationality constraints, and differentiated image fusion technology, forming a complete and efficient automated generation scheme for training data on damaged container surfaces. Its core innovation and advantages lie in: Breakthrough in data collection bottleneck: The problem of collecting low-probability real damaged data is transformed into the problem of creatively utilizing a large number of readily available undamaged images and a small number of damaged samples, achieving large-scale production of training data with near-zero marginal cost.

[0099] A leap in generated quality has been achieved: by using Poisson fusion and adaptive feathering strategies, the problems of boundary artifacts and inconsistent lighting in traditional synthesis methods have been fundamentally solved, and the generated damaged images have extremely high visual realism, enough to "deceive the real thing".

[0100] We have built a scene-aware data generation capability: by using a large visual model for scene similarity matching, the generated data naturally possesses visual feature adaptability to specific deployment environments, which greatly improves the generalization performance and robustness of models trained on this data in real-world scenarios. This is an effective way to solve the problem of computer vision models not being able to adapt to local conditions when deployed.

[0101] It incorporates prior knowledge of the physical world: by encoding the physical fact that "damage must occur on the surface of the box" into the data generation algorithm through the image segmentation model, it avoids generating absurd training samples and guides the model to learn damage characteristics that conform to real-world laws.

[0102] It possesses high practicality and scalability: the methodology is clear, highly modular, and easy to implement and integrate into existing model training platforms. Its components, such as pre-trained models and segmentation models, can be replaced and upgraded as technology advances, ensuring the long-term effectiveness of the method.

[0103] Figure 3 This is an overall architecture diagram of the container damage surface image generation system of the present invention. (See diagram below.) Figure 3 As shown, the image generation system for the damaged surface of a container according to the present invention includes: Image collection module 51 is used to collect a first image set of surface damage thumbnails extracted locally from massive container images, a second image set of several on-site images of damaged containers, and a third image set of images of undamaged containers with different scenes, lighting and massive weather conditions. Image classification module 52 is used to select images similar to undamaged containers from the third image set and at least one image in the second image set through a pre-trained visual large model to establish a fourth image set. The surface-damaged small images are pasted onto the container area of ​​the undamaged container similar images to obtain the image difference value before and after pasting calculated based on the image quality evaluation algorithm. The image difference value is greater than or equal to a preset threshold as the first type of surface-damaged small images, and the image difference value is less than the preset threshold as the second type of surface-damaged small images. The first bonding module 53 is used to randomly select several similar images of undamaged containers for each small image of the first type of surface damage, generate M candidate regions in the metal sheet surface area of ​​the undamaged container similar images, and the range of each candidate region belonging to the metal sheet surface area of ​​the container is greater than a preset threshold. The small image of the first type of surface damage is bonded to the M candidate regions through the Poisson fusion algorithm and added to the training image set. The second bonding module 54 is used to randomly select several similar images of undamaged containers for each small image of the second type of surface damage, generate M candidate regions in the metal sheet surface area of ​​the undamaged container similar image, and the range of each candidate region in the metal sheet surface area of ​​the container is greater than a preset threshold. The edge part of the small image of the second type of surface damage is Gaussian feathered and then bonded to the M candidate regions and added to the training image set.

[0104] In a preferred embodiment, the image collection module 51 is configured to extract small images of surface damage from a large number of container images using AI image recognition; collect several on-site images of the target site containing damaged containers; and collect several images of undamaged containers under different scenes, lighting and weather conditions, but is not limited thereto.

[0105] In a preferred embodiment, the image classification module 52 is configured to extract the first feature vector of each image in the second image set and the second feature vector of each image in the third image set using a pre-trained large visual model; calculate the distance metric between the second feature vector of each image in the third image set and the first feature vector of each image in the second image set; select similar images of undamaged containers that are similar to those in the second image set as the fourth image set; attach each small image of surface damage to a container region in any randomly selected image in the fourth image set to form a test composite image; calculate the difference value of the similar image of undamaged containers before and after attaching the small image of surface damage using an image quality evaluation algorithm; determine whether the difference value is greater than or equal to a preset threshold; if so, the small image of surface damage is a first type of surface damage small image; if not, the small image of surface damage is a second type of surface damage small image, but this is not a limitation.

[0106] In a preferred embodiment, the image classification module 52 is further configured to, for each small image of surface damage, randomly select a similar image of an undamaged container from the fourth image set; perform container block recognition on the selected similar image of an undamaged container using a segmentation model to obtain a first local image region of the surface area of ​​the container sheet metal and a second local image region representing the container locks and locking bars; and fit the small image of surface damage to the first local image region using a Poisson fusion algorithm, but is not limited thereto.

[0107] In a preferred embodiment, the first bonding module 53 is configured to randomly select several similar images of undamaged containers for each small image of the first type of surface damage, and perform image recognition on the selected similar images of undamaged containers using a pre-trained image segmentation model to obtain the target pixel region of the metal surface area of ​​the container and the remaining non-target pixel regions; generate M candidate regions in the target pixel region based on the contour of the small image of the first type of surface damage, each candidate region satisfying the following: the image center is located within the target pixel region, and the number of pixels or the proportion of pixels located within the target pixel region in the candidate region is greater than a preset threshold; and bond the small image of the first type of surface damage to the M candidate regions using a Poisson fusion algorithm and add it to the training image set, but not limited to this.

[0108] In a preferred embodiment, the second bonding module 54 is configured to randomly select several similar images of undamaged containers for each small image of the second type of surface damage, and perform image recognition on the selected similar images of undamaged containers using a pre-trained image segmentation model to obtain the target pixel region of the metal surface area of ​​the container and the remaining non-target pixel regions; generate M candidate regions in the target pixel region based on the contour of the small image of the second type of surface damage, each candidate region satisfying the following: the image center is located within the target pixel region, and the number of pixels or the proportion of pixels located within the target pixel region in the candidate region is greater than a preset threshold; after Gaussian feathering the edge part of the small image of the second type of surface damage, it is bonded to the M candidate regions and added to the training image set, but not limited to this.

[0109] In a preferred embodiment, the candidate regions generated in similar images of the same undamaged container do not overlap with each other, but this is not a limitation.

[0110] In summary, the container damage surface image generation system of the present invention can automatically generate a large number of high-quality, scene-adapted and physically reasonable damage images, solving the problems of scarce real data, boundary artifacts in traditional synthesis, poor scene generalization and unreasonable position, and providing an efficient and low-cost data solution for training robust automatic damage detection models.

[0111] This invention also provides an image generation device for a damaged container surface, including a processor and a memory storing executable instructions for the processor. The processor is configured to execute steps of an image generation method for a damaged container surface by executing the executable instructions.

[0112] As shown above, the container damage surface image generation device of this embodiment can automatically generate a large number of high-quality, scene-adapted and physically reasonable damage images, solving the problems of scarce real data, boundary artifacts in traditional synthesis, poor scene generalization and unreasonable position, and providing an efficient and low-cost data solution for training robust automatic damage inspection models.

[0113] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "platform."

[0114] Figure 4 This is a schematic diagram of the structure of the container damaged surface image generation device of the present invention. See below for reference. Figure 4 To describe an electronic device 600 according to this embodiment of the present invention. Figure 4 The electronic device 600 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0115] like Figure 4 As shown, the electronic device 600 is presented in the form of a general-purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including storage unit 620 and processing unit 610), a display unit 640, etc.

[0116] The storage unit stores program code, which can be executed by the processing unit 610 to perform the steps described in the method section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 610 can perform actions such as... Figure 1 The steps are shown in the figure.

[0117] Storage unit 620 may include readable media in the form of volatile storage units, such as random access memory (RAM) 6201 and / or cache memory 6202, and may further include read-only memory (ROM) 6203.

[0118] Storage unit 620 may also include a program / utility 6204 having a set (at least one) program module 6205, such program module 6205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0119] Bus 630 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the multiple bus structures.

[0120] Electronic device 600 can also communicate with one or more external devices 700 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 600, and / or with any device that enables electronic device 600 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 650. Furthermore, electronic device 600 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 660. Network adapter 660 can communicate with other modules of electronic device 600 via bus 630. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.

[0121] This invention also provides a computer-readable storage medium for storing a program, which, when executed, implements the steps of a method for generating an image of a damaged surface of a container. In some possible implementations, various aspects of this invention can also be implemented as a program product comprising program code that, when run on a terminal device, causes the terminal device to perform the steps described in the above-described method section of this specification according to various exemplary embodiments of the invention.

[0122] As shown above, the container damage surface image generation system of this invention in this embodiment can automatically generate a large number of high-quality, scene-adapted and physically reasonable damage images, solving the problems of scarce real data, boundary artifacts in traditional synthesis, poor scene generalization and unreasonable position, and providing an efficient and low-cost data solution for training robust automatic damage inspection models.

[0123] Figure 5 This is a schematic diagram of the structure of the computer-readable storage medium of the present invention. (Reference) Figure 5 As shown, a program product 800 for implementing the above-described method according to an embodiment of the present invention is described. It may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0124] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0125] Computer-readable storage media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0126] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0127] In summary, the purpose of this invention is to provide a method, system, device, and storage medium for generating images of damaged surfaces of containers. This invention can automatically generate a large number of high-quality, scene-adapted, and physically reasonable damaged images, solving problems such as the scarcity of real data, boundary artifacts in traditional synthesis, poor scene generalization, and unreasonable location. It provides an efficient and low-cost data solution for training robust automatic damage detection models.

[0128] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.

Claims

1. A method for generating an image of a damaged surface of a shipping container, characterized in that, Includes the following steps: S110. Collect a first image set of surface damage thumbnails extracted locally from massive container images, a second image set of several on-site images of damaged containers, and a third image set of undamaged container images containing different scenes, lighting conditions, and massive weather conditions. S120. Select images similar to at least one image in the second image set from the third image set using a pre-trained visual large model to establish a fourth image set. Paste the surface-damaged small image onto the container area of ​​the image similar to the undamaged container. Obtain the image difference value before and after pasting based on the image quality evaluation algorithm. The image difference value is greater than or equal to a preset threshold and is regarded as the first type of surface-damaged small image. The image difference value is less than the preset threshold and is regarded as the second type of surface-damaged small image. S130. For each of the first type of surface damage images, randomly select several similar images of undamaged containers, generate M candidate regions in the metal sheet surface area of ​​the undamaged container similar images, and the range of each candidate region belonging to the metal sheet surface area of ​​the container is greater than a preset threshold. Then, fit the first type of surface damage images to the M candidate regions using the Poisson fusion algorithm and add them to the training image set. S140. For each small image of the second type of surface damage, randomly select several similar images of undamaged containers, generate M candidate regions in the metal surface area of ​​the undamaged container similar images, and the range of each candidate region in the metal surface area of ​​the container is greater than a preset threshold. After Gaussian feathering the edge part of the small image of the second type of surface damage, it is attached to the M candidate regions and added to the training image set.

2. The method for generating images of damaged surfaces of a container according to claim 1, characterized in that, Step S110 includes: S111. Small images of surface damage extracted locally from massive container images using AI image recognition; S112. Collect several on-site images of the target site, including the damaged container; S113. Collect images of undamaged containers under different scenes, lighting and weather conditions.

3. The method for generating images of damaged surfaces of a container according to claim 1, characterized in that, Step S120 includes: S121. Extract the first feature vector of each image in the second image set and the second feature vector of each image in the third image set using a pre-trained large visual model. S122. Calculate the distance metric between the second feature vector of each image in the third image set and the first feature vector of each image in the second image set, and select similar images of undamaged containers that are similar to the second image set as the fourth image set; S123. Each of the surface damage images is pasted onto the container area of ​​any one image in the fourth image set to form a test composite image; S124. Calculate the difference value of the similar image of the undamaged container before and after attaching it to the surface damage image using an image quality evaluation algorithm, and determine whether the difference value is greater than or equal to a preset threshold. If yes, the surface damage image is a first type of surface damage image; otherwise, the surface damage image is a second type of surface damage image.

4. The method for generating images of damaged surfaces of a container according to claim 3, characterized in that, Step S123 includes: S1231. For each of the surface damage images, select a similar image of an undamaged container from the fourth image set. S1232. The selected undamaged container similar image is identified by segmentation model to obtain a first local image region of the metal sheet surface area of ​​the container and a second local image region representing the container lock and locking bar. S1233, The surface damage image is then pasted onto the first local image region using a Poisson fusion algorithm.

5. The method for generating images of damaged surfaces of a container according to claim 3, characterized in that, Step S130 includes: S131. For each small image of the first type of surface damage, randomly select several similar images of undamaged containers, and perform image recognition on the selected similar images of undamaged containers using a pre-trained image segmentation model to obtain the target pixel area of ​​the iron sheet surface area of ​​the container and the remaining non-target pixel areas. S132. In the target pixel area, M candidate areas are generated according to the outline of the first type of surface damage small image. Each candidate area satisfies the following: the image center is located in the target pixel area, and the number of pixels or the proportion of pixels in the candidate area located in the target pixel area is greater than a preset threshold. S133. The first type of surface damage small image is attached to the M candidate regions using the Poisson fusion algorithm and added to the training image set.

6. The method for generating images of damaged surfaces of a container according to claim 3, characterized in that, Step S140 includes: S141. For each small image of the second type of surface damage, randomly select several similar images of undamaged containers, and perform image recognition on the selected similar images of undamaged containers using a pre-trained image segmentation model to obtain the target pixel area of ​​the iron sheet surface area of ​​the container and the remaining non-target pixel areas. S142. In the target pixel area, M candidate areas are generated according to the outline of the second type of surface damage small image. Each candidate area satisfies the following: the image center is located in the target pixel area, and the number of pixels or the proportion of pixels in the candidate area located in the target pixel area is greater than a preset threshold. S143. After Gaussian feathering the edge portion of the second type of surface damage image, it is attached to the M candidate regions and added to the training image set.

7. The method for generating images of damaged surfaces of a container according to claim 5 or 6, characterized in that, The candidate regions generated from similar images of the same undamaged container do not overlap with each other.

8. A system for generating images of damaged surfaces of a shipping container, used to implement the method for generating images of damaged surfaces of a shipping container as described in claim 1, characterized in that, include: The image collection module collects a first image set of small images of surface damage extracted from a large number of container images, a second image set of several on-site images of damaged containers, and a third image set of images of undamaged containers with different scenes, lighting, and a large number of weather conditions. The image classification module selects images similar to undamaged containers from the third image set using a pre-trained visual large model, which are similar to at least one image in the second image set, to establish a fourth image set. The surface-damaged small images are then pasted onto the container regions of the undamaged container similar images. The image difference values ​​before and after pasting are calculated based on an image quality evaluation algorithm. Images with a difference value greater than or equal to a preset threshold are classified as first-class surface-damaged small images, and images with a difference value less than the preset threshold are classified as second-class surface-damaged small images. The first bonding module randomly selects several similar images of undamaged containers for each small image of the first type of surface damage. M candidate regions are generated in the metal sheet surface area of ​​the undamaged container similar images. The range of each candidate region belonging to the metal sheet surface area of ​​the container is greater than a preset threshold. The small image of the first type of surface damage is bonded to the M candidate regions through the Poisson fusion algorithm and added to the training image set. The second bonding module randomly selects several similar images of undamaged containers for each small image of the second type of surface damage. M candidate regions are generated in the metal surface area of ​​the undamaged container similar image. The range of each candidate region in the metal surface area of ​​the container is greater than a preset threshold. The edge part of the small image of the second type of surface damage is Gaussian feathered and then bonded to the M candidate regions and added to the training image set.

9. A device for generating images of damaged surfaces of a shipping container, characterized in that, include: processor; A memory in which executable instructions of the processor are stored; The processor is configured to perform the steps of the image generation method for the damaged surface of a container according to any one of claims 1 to 7 by executing the executable instructions.

10. A computer-readable storage medium for storing a program, characterized in that, When the program is executed by the processor, it implements the steps of the image generation method for the damaged surface of the container as described in any one of claims 1 to 7.