Method, system, device and medium for inspecting container damage degree
By using an end-to-end deep learning model and the U-Net architecture, pixel-level segmentation and quantitative evaluation of various types of container surface damage are achieved, solving the problem of insufficient robustness in existing technologies and realizing full-process automation of accurate segmentation and quantitative evaluation of container damage.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- QINGDAO PORT INT CO LTD
- Filing Date
- 2026-03-09
- Publication Date
- 2026-07-21
Smart Images

Figure CN122435255A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of container identification technology, and specifically to a method, system, equipment, and medium for inspecting the degree of damage to containers. Background Technology
[0002] Container damage inspection is a crucial step in ensuring logistics safety and equipment recycling. Currently, some automated container inspection systems attempt to use traditional computer vision methods, such as contour extraction based on edge detection or defect segmentation based on grayscale thresholds, to screen for damage on container surfaces. However, these methods rely on manually designed feature operators, which lack robustness under complex conditions such as changes in lighting, rust contamination, and container reflection, making them prone to missed and false detections. Furthermore, they can only output a binary judgment of whether damage exists, failing to quantitatively describe damage attributes such as dent depth, tear elongation, and rust area ratio, and lacking a multi-dimensional comprehensive evaluation mechanism that integrates damage morphology, texture features, and spatial distribution.
[0003] In recent years, deep learning technology has made progress in the field of industrial defect detection. However, existing models are mostly designed for small defects in homogeneous backgrounds such as planar steel and textile fabrics. When directly applied to the surface of containers, they are difficult to effectively deal with complex scenarios where large-scale structural deformation, through-hole damage and rusted areas coexist. Moreover, the model output is only a pixel-level segmentation mask, which fails to map visual features to industry-standard quantitative indicators of container damage. As a result, the inspection results still rely on subsequent manual interpretation and cannot form a closed automated decision-making chain.
[0004] Therefore, it is crucial to develop an intelligent inspection method that can adapt to the complex surface conditions of containers and simultaneously achieve accurate segmentation of multiple types of damage and quantitative calculation of damage severity. Summary of the Invention
[0005] The purpose of this invention is to provide a method, system, equipment, and medium for inspecting the degree of container damage. It achieves pixel-level accurate segmentation of various types of container damage through an end-to-end deep learning model, exhibiting strong robustness in complex environments. By fusing geometric, textural, and spatial distribution features and automatically mapping them into quantified damage degree values, it achieves full-process automation from damage identification to level assessment, providing a structured decision-making basis for operation and maintenance damage assessment.
[0006] To achieve the above objectives, embodiments of the present invention provide a method for inspecting the degree of damage to a container, comprising: Digital images of the container surface are acquired and preprocessed to obtain an enhanced image to be analyzed. Using an image recognition model pre-built based on the U-Net architecture, at least one box damage region is identified and segmented from the image to be analyzed, wherein the box damage region includes at least one of a dented region, a through-break region, a tear region, and a rusted region; Extract image features from the box-damaged area, wherein the image features include geometric features, texture features, and location distribution features; The damage level is calculated based on the geometric features, texture features, and location distribution features, as well as the preset damage evaluation formula. An evaluation result including the damage level, maintenance suggestions, and inspection confidence level is generated based on the damage level.
[0007] Optionally, the digital image is preprocessed to obtain an enhanced image to be analyzed, including: Set the size of the filter window, replace the center pixel value of the digital image with the median gray value of the pixels within the filter window, and use mirror expansion to fill in missing pixels for the boundary areas to obtain a denoising image. The denoised image is converted to a preset color space, and the luminance component channel is separated and extracted. The luminance component channel is divided into several non-overlapping image sub-blocks. For each image sub-block, its gray-level histogram is calculated, and the frequency corresponding to each gray level in the histogram is cropped to no greater than a preset cropping threshold. The frequencies of the cropped pixels are uniformly redistributed to all gray levels; the histogram after cropping and redistribution is subjected to equalization mapping transformation, and the mapping values of the boundary regions of adjacent image sub-blocks are smoothly fused to obtain the processed luminance component channels. The processed luminance component channel is merged with the original chrominance component channel and converted back to the original color space to obtain the enhanced image to be analyzed.
[0008] Optionally, the architecture of the image recognition model includes: The input layer is used to receive the image to be input. The encoder consists of four downsampling modules connected in sequence. Each downsampling module contains two consecutive 3×3 convolutional layers, a batch normalization layer, a ReLU activation function layer, and a 2×2 max pooling layer. The decoder consists of four upsampling modules connected in sequence. Each upsampling module includes a 2×2 deconvolution layer, a feature concatenation operation that skips to the corresponding level of the encoder, two consecutive 3×3 convolution layers, a batch normalization layer, and a ReLU activation function layer. The output layer contains a 1×1 convolutional layer with 5 kernels, corresponding to 5 categories: normal region, concave region, through-damage region, tear region, and rust region. It is followed by a Softmax activation function to output a pixel-level classification probability map.
[0009] Optionally, the image recognition model is trained using a hybrid loss function:
[0010] In the formula, The weighted cross-entropy loss function is... Here, λ is the multi-class Dice loss function, and λ is the weighted cross-entropy loss function. With multi-class Dice loss function The balancing weighting coefficients in the hybrid loss function.
[0011] Optionally, using an image recognition model pre-built based on the U-Net architecture, at least one box-loss region is identified and segmented from the image to be analyzed, including: The image to be analyzed is input into the image recognition model, and the size of the input image is adapted and adjusted to match the resolution required by the input layer of the image recognition model. The encoder downsamples the input image to be analyzed multiple times. Each downsampling extracts semantic features through a 3×3 convolutional layer and reduces the spatial resolution of the feature map through a max pooling layer, thereby obtaining multiple layers of feature maps from shallow detail features to deep semantic features. The decoder performs multiple upsampling on the hierarchical feature map. Each upsampling restores the resolution of the hierarchical feature map through a 2×2 deconvolution layer. The decoder then uses hierarchical skip connections to concatenate and fuse the current layer feature map of the decoder with the corresponding layer feature map of the encoder to supplement shallow spatial detail information in the semantic features. The output layer performs pixel-by-pixel classification on the feature map output by the decoder. It maps the number of feature map channels to the total number of categories through a 1×1 convolutional layer and uses the Softmax function to calculate the probability that each pixel belongs to the normal region and various types of box-loss regions, generating a pixel-level classification probability map.
[0012] Optionally, the formula for the Softmax function is as follows:
[0013] In the formula, C represents the total number of categories. This represents the logical value of the c-th category corresponding to the pixel position in the output layer feature map. This is the logical value for the k-th category corresponding to that pixel. This represents the probability that the pixel belongs to category c. This is the feature vector of the pixel location to be classified in the final output feature map of the decoder.
[0014] Optionally, the box damage level value is calculated based on the geometric features, texture features, and location distribution features, as well as a preset box damage evaluation formula, including: Geometric features, texture features, and depth features are extracted from the image features. The geometric features include the total area, total perimeter, and number of all box-loss regions. The texture features include the average gray-level co-occurrence matrix contrast of all box-loss regions. The depth features include the average depth of all concave regions. Substitute the total area, total perimeter, number of damaged areas, average contrast of the gray-level co-occurrence matrix, and average depth into the first linear weighted formula to calculate the initial box damage level. The location distribution features, including the distribution of each damaged container area on the key structural parts of the container, are extracted from the image features. Based on the area ratio of each damaged container area falling within each key structural part, and combined with the preset risk coefficient of each key structural part, the location risk weighting coefficient is calculated. The key structural parts include at least the corner post area, the door lock bar area, the top plate side beam area, and the side plate corrugated groove area. The weight coefficients of the first linear weighted formula are dynamically corrected using the location hazard weighting coefficient to obtain the corrected weighting coefficients. The corrected weighting coefficients are then substituted into the first linear weighted formula for recalculation to obtain the box damage value after location correction. Extract container structure deformation features from the image features, including the normal displacement of each sampling point obtained through contour comparison, and calculate the degree of deformation index based on the normal displacement. When the deformation degree index exceeds the preset deformation threshold, a penalty term is applied to the box damage degree value after position correction to obtain the final box damage degree value.
[0015] Secondly, the present invention also provides a system for inspecting the degree of damage to containers, comprising: The image acquisition module is used to acquire digital images of the container surface and preprocess the digital images to obtain an enhanced image to be analyzed. The image recognition module is used to identify and segment at least one box damage region from the image to be analyzed using an image recognition model pre-built based on the U-Net architecture, wherein the box damage region includes at least one of a dented region, a through-break region, a tear region, and a rusted region; The feature extraction module is used to extract image features of the box-damaged area, wherein the image features include geometric features, texture features, and location distribution features; The box damage calculation module is used to calculate the box damage degree value based on the geometric features, texture features, location distribution features and preset box damage evaluation formula, and generate an evaluation result including box damage level, maintenance suggestions and inspection confidence level based on the box damage degree value.
[0016] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the above-described method for inspecting the degree of damage to containers.
[0017] Fourthly, the present invention also provides a storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described method for inspecting the degree of damage to a container.
[0018] The above technical solution constructs an end-to-end deep learning image recognition model to directly and accurately segment multi-class damaged areas of container surface images at the pixel level, without relying on manually designed feature operators. It still has strong robustness under complex lighting, rust interference, and heterogeneous backgrounds. On this basis, by integrating the geometric shape, texture features, and spatial distribution attributes of the damaged areas and combining them with a preset damage evaluation formula for linear weighting and nonlinear mapping, visual features are automatically mapped into quantifiable damage severity values, realizing full automation from damage identification and morphological quantification to level assessment.
[0019] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0020] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a method for inspecting the degree of damage to a container provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a container damage inspection system provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention.
[0021] In a specific implementation, digital images of the container surface are acquired and preprocessed to obtain an enhanced image to be analyzed. Various embodiments of this disclosure will be described more fully in the following detailed description. This disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of this disclosure to the specific embodiments disclosed herein, but rather this disclosure should be understood to cover all adjustments, equivalents, and / or alternatives falling within the spirit and scope of the various embodiments of this disclosure.
[0022] In the following, the terms “comprising” or “may include”, which may be used in various embodiments of this disclosure, indicate the presence of the disclosed functions or operations and do not limit the addition of one or more functions or operations. Furthermore, as used in various embodiments of this disclosure, the terms “comprising,” “having,” and their cognates are intended only to indicate a specific feature, number, step, operation, or combination of the foregoing and should not be construed as primarily excluding the presence of one or more other features, numbers, steps, operations, or combinations of the foregoing, or the possibility of adding one or more features, numbers, steps, operations, or combinations of the foregoing.
[0023] In various embodiments of this disclosure, the expression "or" or "at least one of A and / or B" includes any combination or all combinations of the words listed simultaneously. For example, the expression "A or B" or "at least one of A and / or B" may include A, may include B, or may include both A and B.
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] See Figure 1 The diagram shows a flowchart of a method for inspecting the degree of damage to a container in a specific embodiment, including the following steps: Step 100: Acquire digital images of the container surface and preprocess the digital images to obtain enhanced images to be analyzed.
[0026] Specifically, when executing step 100, the following steps can be performed: S100: Set the size of the filter window and replace the center pixel value of the digital image with the median gray value of the pixels within the filter window. For the boundary area, use mirror expansion to fill in the missing pixels and obtain a denoising image.
[0027] S101: Convert the denoised image to a preset color space, separate and extract the luminance component channel; divide the luminance component channel into several non-overlapping image sub-blocks, calculate the grayscale histogram for each image sub-block, and crop the frequency corresponding to each grayscale level in the histogram to no greater than a preset cropping threshold.
[0028] S102: The frequencies of the cropped pixels are uniformly redistributed to all gray levels; the histogram after cropping and redistribution is subjected to equalization mapping transformation, and the mapping values of the boundary regions of adjacent image sub-blocks are smoothly fused to obtain the processed luminance component channels.
[0029] S103: Merge the processed luminance component channel with the original chrominance component channel and convert it back to the original color space to obtain the enhanced image to be analyzed.
[0030] Step 101: Using an image recognition model pre-built based on the U-Net architecture, identify and segment at least one box-loss region from the image to be analyzed.
[0031] The damaged area of the box includes at least one of the following: a dented area, a through-hole damaged area, a torn area, and a corroded area.
[0032] Specifically, the architecture of the image recognition model includes: The input layer is used to receive the image to be input. The encoder consists of four downsampling modules connected in sequence. Each downsampling module contains two consecutive 3×3 convolutional layers, a batch normalization layer, a ReLU activation function layer, and a 2×2 max pooling layer. The decoder consists of four upsampling modules connected in sequence. Each upsampling module includes a 2×2 deconvolution layer, a feature concatenation operation that skips to the corresponding level of the encoder, two consecutive 3×3 convolution layers, a batch normalization layer, and a ReLU activation function layer. The output layer contains a 1×1 convolutional layer with 5 kernels, corresponding to 5 categories: normal region, concave region, through-damage region, tear region, and rust region. It is followed by a Softmax activation function to output a pixel-level classification probability map.
[0033] Specifically, the image recognition model is trained using a hybrid loss function:
[0034] In the formula, The weighted cross-entropy loss function is... Here, λ is the multi-class Dice loss function, and λ is the weighted cross-entropy loss function. With multi-class Dice loss function The balancing weighting coefficients in the hybrid loss function.
[0035] In one specific implementation, when performing step 101, the following steps may be specifically performed: S1010: Input the image to be analyzed into the image recognition model, and adjust the size of the input image to match the resolution required by the input layer of the image recognition model.
[0036] S1011: The encoder downsamples the input image to be analyzed multiple times. Each downsampling extracts semantic features through a 3×3 convolutional layer and reduces the spatial resolution of the feature map through a max pooling layer, thereby obtaining multiple layers of feature maps from shallow detail features to deep semantic features.
[0037] S1012: The decoder performs multiple upsamplings on the hierarchical feature map. Each upsampling restores the resolution of the hierarchical feature map through a 2×2 deconvolution layer. The decoder then uses hierarchical skip connections to concatenate and fuse the current layer feature map of the decoder with the corresponding layer feature map of the encoder to supplement shallow spatial detail information in the semantic features.
[0038] S1013: The output layer performs pixel-by-pixel classification on the feature map output by the decoder. It maps the number of feature map channels to the total number of categories through a 1×1 convolutional layer and uses the Softmax function to calculate the probability that each pixel belongs to the normal region and various types of box-loss regions, generating a pixel-level classification probability map.
[0039] The formula for the Softmax function is as follows:
[0040] In the formula, C represents the total number of categories. This represents the logical value of the c-th category corresponding to the pixel position in the output layer feature map. This is the logical value for the k-th category corresponding to that pixel. This represents the probability that the pixel belongs to category c. This is the feature vector of the pixel location to be classified in the final output feature map of the decoder.
[0041] Step 102: Extract the image features of the damaged box area.
[0042] The image features include geometric features, texture features, and positional distribution features.
[0043] Step 103: Calculate the damage level value of the box based on the geometric features, texture features, location distribution features, and the preset box damage evaluation formula, and generate an evaluation result including box damage level, maintenance suggestions, and inspection confidence level based on the damage level value.
[0044] Specifically, when executing step 103, the following steps can be performed: S1030: Extract geometric features, texture features, and depth features from the image features.
[0045] The geometric features include the total area, total perimeter, and number of all box-damaged regions; the texture features include the average gray-level co-occurrence matrix contrast of all box-damaged regions; and the depth features include the average depth of all recessed regions.
[0046] S1031: Substitute the total area, total perimeter, number of damaged areas, average contrast of the gray-level co-occurrence matrix, and average depth into the first linear weighting formula to calculate the initial damage level value.
[0047] Specifically, the initial box damage value D1 is calculated according to the following formula:
[0048] In the formula, A sum Let A0 be the total area of all damaged areas of the container, P0 be the surface area of one side of the container, and P be the perimeter of one side of the container's outline. sum For the total perimeter, This represents the maximum texture contrast in the training samples. The gray-level co-occurrence matrix contrast ratio is the average value for all regions with box loss. Based on the number of damaged areas, As the depth baseline threshold, The average depth of all the depressions. , , , , These are the weighting coefficients.
[0049] S1032: Extract location distribution features from the image features, including the distribution of each damaged area on the key structural parts of the container; calculate the location hazard weighting coefficient based on the area ratio of each damaged area falling within each key structural part and the preset hazard coefficient of each key structural part.
[0050] The key structural components include at least the corner column area, the door lock rod area, the top plate side beam area, and the side plate wave groove area.
[0051] Specifically, the location hazard weighting factor is calculated according to the following formula:
[0052] In the formula, M represents the number of categories of key structural parts. Let be the total area of the box-damaged area located within the j-th type of critical structural component. Let be the risk factor of the j-th critical structural component.
[0053] S1033: The weight coefficients of the first linear weighted formula are dynamically corrected using the location hazard weighting coefficient to obtain the corrected weighting coefficients. The corrected weighting coefficients are then substituted into the first linear weighted formula for recalculation to obtain the box damage value after location correction.
[0054] Calculate the corrected weighting coefficients using the following formula:
[0055] S1034: Extract container structure deformation features from the image features, including the normal displacement of each sampling point obtained through contour comparison, and calculate the degree of deformation index based on the normal displacement.
[0056] Specifically, the deformation index M is calculated using the following formula:
[0057] In the formula, This represents the location-related tolerance threshold, where N is the total number of sampling points. This represents the normal displacement at each sampling point.
[0058] S1035: When the deformation degree index exceeds the preset deformation threshold, a penalty term is applied to the box damage degree value after position correction to obtain the final box damage degree value.
[0059] Specifically, the final box damage value D is obtained according to the following formula:
[0060] In the formula, This is the deformation influence coefficient.
[0061] In one specific implementation, generating the container damage level assessment result specifically includes: comparing the calculated container damage severity value D with a preset threshold range; when D < 0.2, it is determined to be a minor container damage level, and a normal usage recommendation is generated; when 0.2 ≤ D < 0.5, it is determined to be a moderate container damage level, and a time-limited maintenance recommendation is generated, along with the coordinates of the specific damaged area; when 0.5 ≤ D < 0.8, it is determined to be a severe container damage level, and a shutdown and repair recommendation is generated, along with an estimated repair cost; when D ≥ 0.8, it is determined to be a scrap level, and a total loss assessment report is generated. Simultaneously, the confidence level is calculated.
[0062] In the formula, This represents the maximum probability value predicted by the image recognition model for the bin loss category to which the pixel belongs. This is the second most probable value. The scale factor is a pre-defined factor.
[0063] In this embodiment, by constructing an end-to-end deep learning image recognition model, the container surface image is directly segmented into pixel-level multi-class damaged areas with high precision. This eliminates the need for manually designed feature operators and maintains strong robustness even under complex lighting, rust interference, and heterogeneous backgrounds. Furthermore, by fusing the geometric shape, texture features, and spatial distribution attributes of the damaged areas and combining them with a preset damage evaluation formula for linear weighting and nonlinear mapping, the visual features are automatically mapped into quantifiable damage severity values, achieving full automation from damage identification and morphological quantification to grade assessment.
[0064] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0065] like Figure 2 As shown, the following are embodiments of the container damage inspection system provided in this disclosure. The container damage inspection method in the above embodiments belongs to the same inventive concept. For details not described in detail in the embodiments of the container damage inspection system, please refer to the embodiments of the container damage inspection method described above.
[0066] A system for inspecting the degree of damage to shipping containers, comprising: The image acquisition module is used to acquire digital images of the container surface and preprocess the digital images to obtain an enhanced image to be analyzed. The image recognition module is used to identify and segment at least one box damage region from the image to be analyzed using an image recognition model pre-built based on the U-Net architecture, wherein the box damage region includes at least one of a dented region, a through-break region, a tear region, and a rusted region; The feature extraction module is used to extract image features of the box-damaged area, wherein the image features include geometric features, texture features, and location distribution features; The box damage calculation module is used to calculate the box damage degree value based on the geometric features, texture features, location distribution features and preset box damage evaluation formula, and generate an evaluation result including box damage level, maintenance suggestions and inspection confidence level based on the box damage degree value.
[0067] Figure 3 This is a schematic diagram of the hardware structure of an electronic device that implements various embodiments of the present invention.
[0068] The container damage inspection method provided in this application can be applied to electronic devices. Those skilled in the art will understand that the electronic device structure involved in the embodiments of this invention does not constitute a limitation on the electronic device. An electronic device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. In the embodiments of this invention, the electronic device includes, but is not limited to, laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of this application described and / or claimed herein.
[0069] Electronic devices may include processors, external memory interfaces, internal memory, universal serial bus (USB) interfaces, charging management modules, power management modules, batteries, wireless communication modules, audio modules, speakers, microphones, sensor modules, buttons, cameras, displays, and SIM card interfaces, etc.
[0070] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0071] A processor may include one or more processing units, such as: a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.
[0072] The processor can serve as the nerve center and command center of an electronic device. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.
[0073] The processor may also include memory for storing instructions and data. In some embodiments, the memory in the processor is a cache memory. This memory can store instructions or data that the processor has just used or that are used repeatedly. If the processor needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces processor latency, and thus improves system efficiency.
[0074] An external storage interface (ESI) can be used to connect external memory cards, such as microSD cards, to expand the storage capacity of electronic devices. The external memory card communicates with the processor through the ESI to perform data storage functions, such as saving music and video files on the external memory card.
[0075] Internal memory can be used to store computer executable program code, which includes instructions. The processor executes various functional applications and data processing of electronic devices by running the instructions stored in internal memory. Internal memory can include a program storage area and a data storage area. Internal memory can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0076] Wireless communication functionality in electronic devices can be achieved through antennas, wireless communication modules, modem processors, and baseband processors.
[0077] Wireless communication modules can provide solutions for wireless communication applications in electronic devices, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies.
[0078] Electronic devices can implement audio functions through audio modules, speakers, receivers, microphones, headphone jacks, and application processors.
[0079] Electronic devices can achieve shooting functions through ISPs, cameras, video codecs, GPUs, displays, and application processors.
[0080] Electronic devices can achieve display functions through GPUs, displays, and application processors.
[0081] A GPU is a microprocessor for image processing, connected to the display screen and application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. A processor may include one or more GPUs, which execute program instructions to generate or modify display information.
[0082] A display screen is used to display images, videos, etc. A display screen includes a display panel.
[0083] The storage medium provided in this application stores a program product capable of implementing a method for inspecting the degree of damage to containers.
[0084] The method for inspecting the degree of container damage includes: acquiring digital images of the container surface and preprocessing the digital images to obtain enhanced images to be analyzed; using an image recognition model pre-built based on the U-Net architecture to identify and segment at least one damaged area from the image to be analyzed, wherein the damaged area includes at least one of dented areas, through-damage areas, torn areas, and corroded areas; extracting image features of the damaged area, wherein the image features include geometric features, texture features, and location distribution features; calculating the degree of container damage value based on the geometric features, texture features, location distribution features, and a preset container damage evaluation formula, and generating an evaluation result including the damage level, maintenance recommendations, and inspection confidence level based on the degree of container damage value.
[0085] In some possible implementations, the subject matter of this disclosure, namely, the method and system for inspecting the degree of damage to containers, can 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 "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.
[0086] The storage medium disclosed herein may be 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 (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, 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 device, magnetic storage device, or any suitable combination thereof.
[0087] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for inspecting the degree of damage to a container, characterized in that, include: Digital images of the container surface are acquired and preprocessed to obtain an enhanced image to be analyzed. Using an image recognition model pre-built based on the U-Net architecture, at least one box damage region is identified and segmented from the image to be analyzed, wherein the box damage region includes at least one of a dented region, a through-break region, a tear region, and a rusted region; Extract image features from the box-damaged area, wherein the image features include geometric features, texture features, and location distribution features; The damage level is calculated based on the geometric features, texture features, and location distribution features, as well as the preset damage evaluation formula. An evaluation result including the damage level, maintenance suggestions, and inspection confidence level is generated based on the damage level.
2. The method for inspecting the degree of damage to a container according to claim 1, characterized in that, The digital image is preprocessed to obtain an enhanced image to be analyzed, including: Set the size of the filter window, replace the center pixel value of the digital image with the median gray value of the pixels within the filter window, and use mirror expansion to fill in missing pixels for the boundary areas to obtain a denoising image. The denoised image is converted to a preset color space, and the luminance component channel is separated and extracted. The luminance component channel is divided into several non-overlapping image sub-blocks. For each image sub-block, its gray-level histogram is calculated, and the frequency corresponding to each gray level in the histogram is cropped to no greater than a preset cropping threshold. The frequencies of the cropped pixels are uniformly redistributed to all gray levels; the histogram after cropping and redistribution is subjected to equalization mapping transformation, and the mapping values of the boundary regions of adjacent image sub-blocks are smoothly fused to obtain the processed luminance component channels. The processed luminance component channel is merged with the original chrominance component channel and converted back to the original color space to obtain the enhanced image to be analyzed.
3. The method for inspecting the degree of damage to a container according to claim 1, characterized in that, The architecture of the image recognition model includes: The input layer is used to receive the image to be input. The encoder consists of four downsampling modules connected in sequence. Each downsampling module contains two consecutive 3×3 convolutional layers, a batch normalization layer, a ReLU activation function layer, and a 2×2 max pooling layer. The decoder consists of four upsampling modules connected in sequence. Each upsampling module includes a 2×2 deconvolution layer, a feature concatenation operation that skips to the corresponding level of the encoder, two consecutive 3×3 convolution layers, a batch normalization layer, and a ReLU activation function layer. The output layer contains a 1×1 convolutional layer with 5 kernels, corresponding to 5 categories: normal region, concave region, through-damage region, tear region, and rust region. It is followed by a Softmax activation function to output a pixel-level classification probability map.
4. The method for inspecting the degree of damage to a container according to claim 1, characterized in that, The image recognition model is trained using a hybrid loss function: In the formula, The weighted cross-entropy loss function is... Here, λ is the multi-class Dice loss function, and λ is the weighted cross-entropy loss function. With multi-class Dice loss function The balancing weighting coefficients in the hybrid loss function.
5. The method for inspecting the degree of damage to a container according to claim 3, characterized in that, Using an image recognition model pre-built based on the U-Net architecture, at least one box-loss region is identified and segmented from the image to be analyzed, including: The image to be analyzed is input into the image recognition model, and the size of the input image is adapted and adjusted to match the resolution required by the input layer of the image recognition model. The encoder downsamples the input image to be analyzed multiple times. Each downsampling extracts semantic features through a 3×3 convolutional layer and reduces the spatial resolution of the feature map through a max pooling layer, thereby obtaining multiple layers of feature maps from shallow detail features to deep semantic features. The decoder performs multiple upsampling on the hierarchical feature map. Each upsampling restores the resolution of the hierarchical feature map through a 2×2 deconvolution layer. The decoder then uses hierarchical skip connections to concatenate and fuse the current layer feature map of the decoder with the corresponding layer feature map of the encoder to supplement shallow spatial detail information in the semantic features. The output layer performs pixel-by-pixel classification on the feature map output by the decoder. It maps the number of feature map channels to the total number of categories through a 1×1 convolutional layer and uses the Softmax function to calculate the probability that each pixel belongs to the normal region and various types of box-loss regions, generating a pixel-level classification probability map.
6. The method for inspecting the degree of damage to a container according to claim 5, characterized in that, The formula for the Softmax function is as follows: In the formula, C represents the total number of categories. This represents the logical value of the c-th category corresponding to the pixel position in the output layer feature map. This is the logical value for the k-th category corresponding to that pixel. This represents the probability that the pixel belongs to category c. This is the feature vector of the pixel location to be classified in the final output feature map of the decoder.
7. The method for inspecting the degree of damage to a container according to claim 1, characterized in that, The box damage level is calculated based on the geometric features, texture features, and location distribution features, as well as a preset box damage evaluation formula, including: Geometric features, texture features, and depth features are extracted from the image features. The geometric features include the total area, total perimeter, and number of all box-loss regions. The texture features include the average gray-level co-occurrence matrix contrast of all box-loss regions. The depth features include the average depth of all concave regions. Substitute the total area, total perimeter, number of damaged areas, average contrast of the gray-level co-occurrence matrix, and average depth into the first linear weighted formula to calculate the initial box damage level. The location distribution features, including the distribution of each damaged container area on the key structural parts of the container, are extracted from the image features. Based on the area ratio of each damaged container area falling within each key structural part, and combined with the preset risk coefficient of each key structural part, the location risk weighting coefficient is calculated. The key structural parts include at least the corner post area, the door lock bar area, the top plate side beam area, and the side plate corrugated groove area. The weight coefficients of the first linear weighted formula are dynamically corrected using the location hazard weighting coefficient to obtain the corrected weighting coefficients. The corrected weighting coefficients are then substituted into the first linear weighted formula for recalculation to obtain the box damage value after location correction. Extract container structure deformation features from the image features, including the normal displacement of each sampling point obtained through contour comparison, and calculate the degree of deformation index based on the normal displacement. When the deformation degree index exceeds the preset deformation threshold, a penalty term is applied to the box damage degree value after position correction to obtain the final box damage degree value.
8. A system for inspecting the degree of damage to containers, characterized in that, include: The image acquisition module is used to acquire digital images of the container surface and preprocess the digital images to obtain an enhanced image to be analyzed. The image recognition module is used to identify and segment at least one box damage region from the image to be analyzed using an image recognition model pre-built based on the U-Net architecture, wherein the box damage region includes at least one of a dented region, a through-break region, a tear region, and a rusted region; The feature extraction module is used to extract image features of the box-damaged area, wherein the image features include geometric features, texture features, and location distribution features; The box damage calculation module is used to calculate the box damage degree value based on the geometric features, texture features, location distribution features and preset box damage evaluation formula, and generate an evaluation result including box damage level, maintenance suggestions and inspection confidence level based on the box damage degree value.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the container damage inspection method as described in any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the container damage inspection method as described in any one of claims 1 to 7.