Container residual life prediction method and device
By constructing a target detection model and a multi-task prediction model, and combining the container's inspection images and usage records, accurate prediction of the container's remaining lifespan was achieved. This solves the problem of the lack of effective paths in existing technologies and improves detection accuracy and transportation safety.
Patent Information
- Application Number
- CN202511618403.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2026-02-24
AI Technical Summary
Existing technologies for container condition assessment have not yet established an effective path from surface damage information to remaining life prediction, resulting in low efficiency, subjective judgment, high omission rate, and high cost and inconvenient installation of high-end solutions, making them difficult to promote on a large scale.
By acquiring current inspection images and usage records of containers, a target detection model and a multi-task prediction model are constructed. Damage detection and life prediction are performed by combining multimodal data, including using an improved YOLOv8 network and a multi-task prediction model, fusing visual inspection data and usage records, and establishing a standard for classifying container condition levels.
It enables accurate prediction of the remaining life of containers, improves detection accuracy, optimizes resource utilization, ensures transportation safety, provides container condition level classification based on damage level and usage parameters, and supports predictive maintenance and resource scheduling.
Smart Images

Figure CN121564360A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of container inspection technology, and in particular to a method and apparatus for predicting the remaining life of a container. Background Technology
[0002] In modern international logistics and port transportation systems, containers, as standardized carriers, undertake the task of handling a large volume of goods. With the increase in service life and the accumulation of loading and unloading operations, containers are prone to structural damage such as rust, deformation, cracks, and holes, which seriously affect transportation safety and economic value.
[0003] Currently, most container condition assessments still rely on manual inspections, which suffers from low efficiency, subjective judgment, and high omission rates. Some high-end solutions introduce RFID or sensors for monitoring, but due to high costs, inconvenient installation, and limited data dimensions, large-scale deployment is difficult. Meanwhile, while existing image recognition methods can identify damage types, an effective path from "surface damage information" to "remaining life prediction" has not yet been established.
[0004] Therefore, there is an urgent need to propose a method and device for predicting the remaining life of containers, in order to solve the technical problem that the existing container condition assessment has not yet established an effective path from "surface damage information" to "remaining life prediction". Summary of the Invention
[0005] In view of this, it is necessary to provide a method and apparatus for predicting the remaining life of containers, in order to solve the technical problem that the container condition assessment in the prior art has not yet established an effective path from "surface damage information" to "remaining life prediction".
[0006] To address the aforementioned problems, in a first aspect, the present invention provides a method for predicting the remaining life of a container, comprising: Acquire the current detection image and current usage record of the container, and construct an object detection model and a multi-task prediction model; The current detected image is input into the target detection model to obtain the damage detection result; Multimodal analysis is performed on the current usage records to obtain multimodal data. The multimodal data is then fused with the damage detection results and input into the multi-task prediction model for container condition level classification and remaining service life prediction to obtain container condition level and remaining service life prediction results. The multimodal data includes container age, usage time and usage frequency, and maintenance records.
[0007] In one possible implementation, the method further includes: Obtain historical container usage records and historical container image sets; The container condition level is determined by classifying the container's condition based on its usage. Based on the damage status of the containers in the historical container image set, the damage types of the images are labeled to obtain target detection label files; The number of uses and the usage time are determined based on the historical container usage records and the historical container image set; The images in the historical container image set are classified according to the target detection tag file, the number of times of use, the time of use, and the container condition level to obtain the target container image set; The target detection model and the multi-task prediction model are trained based on the target container image set.
[0008] In one possible implementation, after acquiring historical container usage records and a set of historical container images, the process includes: The images in the historical container image set are preprocessed to obtain a preprocessed image set; the preprocessing includes image resolution unification, color normalization, and noise reduction. Data augmentation is performed on the images in the preprocessed image set to obtain an enhanced image set; the data augmentation includes random rotation, scaling, contrast adjustment, and illumination perturbation. The historical container image set is updated using the enhanced image set.
[0009] In one possible implementation, the container condition rating includes brand new containers, containers in excellent condition, cargo-ready containers, and windproof and waterproof containers; the process of classifying the container condition rating based on its usage includes: The container that has been used less than a first preset number of times, has been used for less than a first preset time, and is undamaged is defined as the brand new container. The container whose number of uses is greater than the first preset number of uses, whose usage time is between the first preset time and the second preset time, and whose damage level is at the first damage level is defined as the container in good condition. The container whose usage time is between the second preset time and the third preset time and whose damage level is at the second damage level is determined as the suitable cargo container; The container whose usage time is greater than the third preset time and whose damage level is at the third damage level is identified as the windproof and waterproof container; the damage level of the first damage level is less than the damage level of the second damage level is less than the damage level of the third damage level.
[0010] In one possible implementation, the target detection model is an improved YOLOv8 network; the improved YOLOv8 network includes a small target fusion detection module and a bounding box regression loss function; the step of inputting the current detected image into the target detection model to obtain the damage detection result includes: The improved YOLOv8 network is used to detect the current image to obtain a damage detection result; the small target fusion detection module of the improved YOLOv8 network is used to fuse the shallow high-resolution detail features and deep high semantic features of the current image to obtain a small target detection result; the bounding box regression loss function is used to constrain the predicted box during the detection process.
[0011] In one possible implementation, the bounding box regression loss function is a weighted sum of an angle matching term, a distance penalty term, a shape matching term, and an IoU overlap term; the angle matching term is used to constrain the directional difference of the line connecting the center points of the predicted box and the ground truth box; the distance penalty term is used to measure the Euclidean distance between the center points of the predicted box and the ground truth box; the shape matching term is used to measure the difference in aspect ratio between the predicted box and the ground truth box; and the IoU overlap term is used to measure the ratio of the overlap area between the predicted box and the ground truth box to their union.
[0012] In one possible implementation, the multi-task prediction model includes a feature encoder, a shared convolutional module, a classification module, and a lifespan prediction module. The feature encoder processes the container age, usage time, usage frequency, and maintenance records into an intermediate vector using a multilayer perceptron. This intermediate vector is then concatenated with the damage detection result and input into the shared convolutional module. The shared convolutional module transmits the concatenated data in parallel to the classification module and the lifespan prediction module. The classification module classifies the container condition level. The lifespan prediction module predicts the remaining lifespan of the container.
[0013] In one possible implementation, the step of fusing the multimodal data with the damage detection results and then inputting it into the multi-task prediction model for container condition level classification and remaining service life prediction, to obtain container condition level and remaining service life prediction results, includes: The multimodal data is fused with the damage detection results to obtain multimodal fused data; The multimodal fusion data is input into the multi-task prediction model for container condition level classification to obtain the container condition level; The remaining life prediction result of the container is determined based on the container condition level and the multimodal fusion data.
[0014] In one possible implementation, determining the number of uses and usage time based on the historical container usage records and the historical container image set includes: Based on the historical container usage records, the first container lacking complete records and the second container with complete transport records were identified. Based on the damage type, quantity, and distribution range of the first container in the historical container image set, the number of times the first container was used and the usage time are determined. The second container is analyzed based on the historical usage records to determine the number of times and duration of use of the second container.
[0015] Secondly, the present invention also provides a container remaining life prediction device, comprising: The image acquisition module is used to acquire the current detection image and current usage record of the container, and to build the object detection model and the multi-task prediction model; The damage detection module is used to input the current detection image into the target detection model to obtain the damage detection result; The life prediction module is used to perform multimodal analysis on the current usage records to obtain multimodal data. After fusing the multimodal data with the damage detection results, the data is input into the multi-task prediction model for container condition level classification and remaining service life prediction, resulting in container condition level and remaining service life prediction results. The multimodal data includes container age, usage time and usage frequency, and maintenance records.
[0016] The beneficial effects of this invention are as follows: It acquires the current inspection image and current usage record of the container, and constructs a target detection model and a multi-task prediction model; it inputs the current inspection image into the target detection model to obtain damage detection results; it performs multimodal analysis on the current usage record to obtain multimodal data, and after fusing the multimodal data with the damage detection results, it inputs the data into the multi-task prediction model for container condition level classification and remaining service life prediction, obtaining container condition level and remaining service life prediction results; it achieves damage target detection through the target detection model, and combines visual inspection data and usage records with the multi-task prediction model to establish a container condition level classification standard based on damage degree and usage parameters, ultimately achieving accurate prediction of the container's remaining service life. This invention has the advantages of improving detection accuracy, optimizing resource utilization, and ensuring transportation safety. Attached Figure Description
[0017] Figure 1 A schematic flowchart of an embodiment of the container remaining life prediction method provided by the present invention; Figure 2 A schematic diagram of an embodiment of the system flowchart provided by the present invention; Figure 3 For the present invention Figure 1 A schematic diagram of an embodiment of step S101; Figure 4 A schematic diagram of an embodiment of the improved YOLOv8 network provided by the present invention; Figure 5 A schematic diagram of an embodiment of the container remaining life prediction device provided by the present invention. Detailed Implementation
[0018] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.
[0019] like Figure 1 As shown, a specific embodiment of the present invention discloses a method for predicting the remaining life of a container, comprising: S101. Obtain the current detection image and current usage record of the container, and construct the target detection model and multi-task prediction model.
[0020] The sources of the currently detected images include on-site photography, drone inspections, and video surveillance frames. The current usage record can be the usage status of containers in the port management system. The target detection model can be a YOLOv8 network, and the multi-task prediction model can be a deep learning neural network. The specific settings can be made according to the actual situation, and this embodiment of the invention does not impose any limitations.
[0021] S102. Input the current detection image into the target detection model to obtain the damage detection result.
[0022] The current detection image can be input into the target detection model, which can then perform detection on the image to obtain the damage detection result.
[0023] S103. Perform multimodal analysis on the current usage records to obtain multimodal data. After fusing the multimodal data with the damage detection results, input the data into the multi-task prediction model to classify the container condition level and predict the remaining service life, and obtain the container condition level and remaining service life prediction results. The multimodal data includes container age, usage time and usage frequency, and maintenance records.
[0024] Specifically, the current detected image is processed by the target detection model, which outputs a damage result with location and category information. The multi-task prediction model concatenates the damage detection result vector with the current usage record, maps it through a multilayer perceptron, and outputs the box condition level. Finally, it generates a predicted remaining lifetime value based on a preset level-lifetime mapping relationship.
[0025] The container remaining life prediction method of this invention is applied to a host computer system, such as... Figure 2 As shown, Figure 2 The system flowchart shows that the host computer system can acquire image information of the container, and can predict the container data based on the image information using the container remaining life prediction method of this invention. It can output container condition data and can also be managed through the host computer system of the port management system.
[0026] Compared with existing technologies, this embodiment provides the following advantages: acquiring the current inspection image and current usage record of the container, and constructing a target detection model and a multi-task prediction model; inputting the current inspection image into the target detection model to obtain damage detection results; performing multimodal analysis on the current usage record to obtain multimodal data, and then fusing the multimodal data with the damage detection results before inputting it into the multi-task prediction model for container condition level classification and remaining service life prediction, thereby obtaining container condition level and remaining service life prediction results; realizing damage target detection through the target detection model, and combining visual inspection data and usage records with the multi-task prediction model to establish a container condition level classification standard based on damage degree and usage parameters, ultimately achieving accurate prediction of the remaining service life of the container, which has the advantages of improving detection accuracy, optimizing resource utilization, and ensuring transportation safety.
[0027] In some embodiments of the present invention, such as Figure 3 As shown, step S101 includes: S301. Obtain historical container usage records and historical container image sets.
[0028] Historical container usage records refer to the maintenance records, transportation task records, and environmental exposure records of containers during their service life. These records can be retrieved through the logistics management system database and used to correlate image data with usage status. The container image set refers to historical data of container images obtained through on-site photography, extraction of existing surveillance video frames, etc., covering various service years, damage conditions, and background environments. Specifically, multi-angle photography can be used to cover all parts of the container to ensure the completeness of damage information.
[0029] In some embodiments of the present invention, after step S301, the following is included: Images from the historical container image set are preprocessed to obtain a preprocessed image set. The preprocessing includes basic steps such as image resolution unification, color normalization, and noise reduction.
[0030] Image resolution unification refers to adjusting input images of different sizes to the same resolution, which can be achieved using bilinear interpolation algorithms to eliminate image size inconsistencies caused by differences in acquisition devices. Color normalization refers to converting the image color space to the standard RGB format, which can be achieved using histogram equalization methods to eliminate the interference of differences in lighting conditions on image feature extraction. Denoising processing refers to reducing random noise in the image, which can be achieved using Gaussian filters or median filters to improve image quality.
[0031] Data augmentation is performed on the images in the preprocessed image set to obtain the augmented image set. Data augmentation includes data augmentation strategies such as random rotation, scaling, contrast adjustment, and illumination perturbation to expand the sample set and improve the model's adaptability in multiple environments.
[0032] In data augmentation, random rotation refers to rotating the image at random angles, which can be achieved using an affine transformation matrix, increasing the model's adaptability to changes in target orientation. Scaling refers to proportionally adjusting the image size, which can be achieved using region interpolation algorithms, enhancing the model's ability to detect targets at different scales. Contrast adjustment refers to changing the distribution range of image pixel values, which can be achieved through linear stretching or gamma correction, improving the discernibility of image details. Illumination perturbation refers to simulating image effects under different lighting conditions, which can be achieved by randomly adjusting brightness and color temperature parameters, improving the model's robustness in complex lighting environments.
[0033] The historical container image set was updated by enhancing the image set.
[0034] Specifically, during the construction of the training dataset, the original container images exhibited differences in resolution, color deviation, and noise interference. Resolution unification ensured consistent input data size, color normalization eliminated the impact of ambient lighting differences on damage identification, and denoising effectively suppressed salt-and-pepper noise generated during image acquisition. Building upon this, random rotation and scaling enhancement simulated detection scenarios of containers at different placement angles and distances in real-world use. Contrast adjustment strengthened the distinction between damaged areas and the background, while lighting perturbation expanded the model's adaptability to the port's day and night operating environment. Updating the enhanced image set to the training data increased data diversity and prevented overfitting due to insufficient training samples.
[0035] S302. Container condition levels are determined based on the usage of the containers.
[0036] Among them, the container condition classification refers to classifying the condition of containers based on the intensity of use and the degree of damage. Specifically, containers can be divided into different levels by setting threshold ranges, providing a quantitative basis for subsequent life prediction.
[0037] S303. Based on the damage status of containers in the historical container image set, the damage types of the images are labeled to obtain the target detection label file.
[0038] The damage types are mainly divided into five categories: rust, bump, hole, repair, and crack. Damage type annotation refers to marking defects such as rust, bump, hole, repair, and crack in the image. This can be achieved using a combination of bounding box annotation tools and manual annotation to form standardized training data. Specifically, after image cleaning, typical damaged areas in the image are manually annotated using annotation tools, and the target detection label file is output in YOLO format.
[0039] S304. Determine the number of times and the time of use based on historical container usage records and historical container image sets.
[0040] Among them, the number of uses and the usage time refer to the cumulative number of times the container has participated in transportation tasks and the total duration of use. Specifically, these can be calculated through the timestamp data of the logistics scheduling system to reflect the degree of mechanical fatigue and aging.
[0041] In some embodiments of the present invention, step S304 includes: Based on historical container usage records, the first container lacking complete records and the second container with complete transport records were identified. Based on the damage type, quantity, and distribution range of the first container in the historical container image set, the number of times and the duration of use of the first container are determined. The second container was analyzed based on historical usage records to determine the number of times and duration of its use.
[0042] To achieve a basic estimate of the container's usage status, this invention proposes a method for inferring the number of times a container is used and its usage time based on historical usage records and the degree of surface damage. Logical reasoning and rule-based judgment are performed using known management information and observable damage features in images. For a second container with complete transport records, its loading and unloading records, dispatch trajectory, and maintenance records are queried in the port or transport management system using the container number. Information such as the cumulative number of times it enters and leaves the port, transport batches, and maintenance cycles are statistically analyzed as a direct estimation of the actual number of uses, thus obtaining the first number of uses and the first usage time. For a first container lacking complete records, the number of uses and the service life can be indirectly inferred based on the damage type, quantity, and distribution range identified in the image, combined with empirical rules, thus obtaining the second number of uses and the second usage time.
[0043] S305. Classify the images in the historical container image set according to the target detection tag file, number of times used, usage time and container condition level to obtain the target container image set.
[0044] Image grading refers to classifying and storing labeled images according to box condition level, damage type, and usage parameters. This can be achieved using a tree-like directory structure, which facilitates data retrieval as needed during model training.
[0045] S306. Train the target detection model and the multi-task prediction model based on the target container image set.
[0046] Specifically, the process begins by extracting historical container usage records from the logistics management system and acquiring raw image datasets from image acquisition devices. Next, based on the usage records and damage data in the packing diagrams (including task frequency and service duration), and combined with preset container condition level thresholds, containers are categorized into different condition classes. Damaged areas in the images are then manually labeled, generating tag files containing damage location and type. By statistically analyzing the usage frequency and time data for each container, and combining this with the pre-defined container condition levels, the labeled images are classified and stored according to three dimensions: damage type, usage intensity, and condition level, forming a structured historical container image set. This process effectively integrates multi-source data, providing a high-quality dataset with clear semantic relationships for subsequent model training. This dataset is then used to train object detection and multi-task prediction models.
[0047] In some embodiments of the present invention, the container condition level includes brand new container, container in good condition, cargo-ready container, and windproof and waterproof container; step S302 includes: Containers that have been used within a first preset number of times, have been used for less than a first preset time, and are undamaged are identified as brand new containers.
[0048] Containers that have been used more than the first preset number of times, have been used for a period of time between the first preset time and the second preset time, and have been damaged to the first damage level are identified as containers in good condition. Containers whose usage time is between the second and third preset times and whose damage level is at the second damage level are identified as suitable cargo containers. Containers that have been used for more than the third preset time and whose damage level is at the third damage level are identified as windproof and waterproof containers; the damage level of the first damage level is less than the damage level of the second damage level, which is less than the damage level of the third damage level.
[0049] The container condition rating refers to a classification system based on the number of uses, usage time, and degree of damage. This can be quantified by setting different threshold ranges; for example, the first preset number of uses could be 1. The damage rating is a quantitative indicator based on the area, depth, and density of surface damage. Specifically, image segmentation algorithms can be used to calculate the proportion of damaged areas, combined with structural mechanics models to assess the impact of damage on the container's strength. For example, the first damage rating indicates a structurally intact container with a good appearance, only minor scratches or small dents, not affecting normal loading and use; the second damage rating indicates possible obvious scratches, dents, or repair marks, with reduced rust resistance; and the third damage rating indicates significant structural deformation but maintaining the container's closure. The preset time refers to a service life threshold for containers based on historical data statistics; for example, the first preset time could be 1 year, the second could be 5 years, and the third could be 10 years.
[0050] In this specific implementation, based on industry standards and operational experience, container condition is classified into four levels: Brand New, Excellent Condition, Cargo-Worthy Container, and WWT Container. A Brand New container refers to a container that has only been transported once (first preset number of times), has minimal wear, is at most one year old (first preset time), has an intact structure, meets IICL standards in appearance, is 99% free of dents, and is completely sealed internally (first damage level). The standard implemented for this container is IICL-6. Excellent Condition containers have been used multiple times but are structurally intact, have a good appearance, and only minor scratches or small dents (second damage level), which do not affect normal loading and use. Cargo-Worthy containers meet the cargo-worthiness standards stipulated by IICL or CIC (China Container Inspection Standard), and are typically 1–5 years old (between the first and second preset times). These types of containers are suitable for general international transport and have a long remaining service life. Cargo-friendly containers meet the safety requirements for carrying goods, but may have obvious scratches, dents, or repair marks, and their rust resistance is reduced (Level 3 damage). They still meet CIC or CSC (International Maritime Organization) cargo safety requirements. These containers are mostly used for routine cargo transport, with a typical lifespan of 5–10 years (second and third preset times), gradually entering a decline phase. Windproof and waterproof containers primarily meet weather protection requirements; their structure is no longer suitable for transporting high-value goods, but they can be used as storage warehouses, ground stacking containers, etc., and usually exceed 10 years of service life. Their structure shows significant deformation but maintains the closure of the outer shell (Level 4 damage).
[0051] In some embodiments of the present invention, the target detection model is an improved YOLOv8 network; the improved YOLOv8 network includes a small target fusion detection module and a bounding box regression loss function; step S102 includes: The improved YOLOv8 network is used to detect the current image and obtain the damage detection result. The small target fusion detection module of the improved YOLOv8 network is used to fuse the shallow high-resolution detail features and deep high semantic features of the current image to obtain the small target detection result. The bounding box regression loss function is used to constrain the predicted box during the detection process.
[0052] The original YOLOv8 network mainly includes an input module, a backbone network, a Neck feature fusion module, and a multi-scale detection head. Based on this, this embodiment adds a set of detection heads to the Neck structure, namely a small target fusion detection module, specifically used to extract and predict small-scale, low-contrast damaged targets in the image. The loss function is also modified. The overall process is shown in the attached figure. Figure 4 As shown, the improved YOLOv8 network refers to the addition of a small target fusion detection module to the standard YOLOv8 architecture. This module enhances the network's ability to capture features of small damages by fusing feature maps from different convolutional layers through cross-layer connections. Figure 4 The c2f(2) and concat(17) are connected to transmit damaged targets with small scale and low contrast. This part fuses shallow high-resolution detail features and deep high semantic features to improve the richness of feature expression and gradient flow path. The model improves detection accuracy while maintaining the stability of the overall structure. The multimodal deep neural network adopts a dual-channel input structure. One channel processes image feature vectors, and the other channel processes numerical data containing usage frequency and time dimension. Cross-modal feature fusion is achieved through fully connected layers.
[0053] In some embodiments of the present invention, the bounding box regression loss function is a weighted sum of an angle matching term, a distance penalty term, a shape matching term, and an IoU overlap term; the angle matching term is used to constrain the directional difference of the line connecting the center of the predicted box and the ground truth box; the distance penalty term is used to measure the Euclidean distance between the center points of the predicted box and the ground truth box; the shape matching term is used to measure the difference in the aspect ratio between the predicted box and the ground truth box; and the IoU overlap term is used to measure the ratio of the overlapping area of the predicted box and the ground truth box to their union.
[0054] The loss term includes several components: Angle Matching, Distance Penalty, and IoU. An Angle Matching term quantifies the angular deviation between the predicted and ground truth bounding boxes by calculating the direction cosine of the line connecting their centers. This can be implemented using a cosine similarity function to optimize the spatial alignment of the predicted and ground truth boxes. Distance Penalty, Distance Penalty, Distance Penalty constrains positional deviation by calculating the squared Euclidean distance between the center points of the predicted and ground truth boxes. This can be implemented using a normalized distance function to reduce target localization errors. Shape Matching, Shape Matching, Shape Similarity, and IoU Evaluation term evaluates shape similarity by calculating the logarithmic difference between the aspect ratios of the predicted and ground truth boxes. This can be implemented using a logarithmic proportional difference function to improve the geometric consistency between the predicted and ground truth boxes. IoU Overlap, Intersection over Union (IoU), Intersection over Union (IoU) ratio evaluates region coverage by calculating the IoU ratio. This can be implemented using an IoU calculation function to directly optimize the overlap accuracy of the detection boxes.
[0055] In a specific embodiment, the bounding box regression loss function further integrates multiple factors such as orientation matching, distance penalty, and shape alignment on the basis of traditional IoU series losses, more comprehensively constraining the convergence process of the predicted box to the ground truth box. It mainly consists of the following four components: 1. Angle Cost This term is used to constrain the directional difference between the center lines of the predicted bounding box and the ground truth bounding box, and is defined as shown in formula (1): (1) In the formula, θ This is the angle difference between the line connecting the center of the predicted bounding box and the center of the ground truth bounding box relative to the coordinate axis. This factor encourages the predicted bounding box to align its direction of movement as closely as possible to the center of the ground truth bounding box, thus accelerating convergence.
[0056] 2. Distance Cost The Euclidean distance used to measure the center point of the predicted bounding box and the ground truth bounding box is shown in formula (2): (2) In the formula, Cp , Cg These represent the center coordinates of the predicted bounding box and the ground truth bounding box, respectively. d This is the length of the image diagonal. This parameter, based on orientation alignment, penalizes predicted bounding boxes that deviate from the center, thus improving localization accuracy.
[0057] 3. Shape Cost Formula (3) is used to measure the difference in aspect ratio between the predicted bounding box and the actual bounding box. (3) In the formula, wp , hpThese are the predicted bounding box width and height, respectively. wg , hg These represent the width and height of the true bounding box, respectively; this constraint ensures that the predicted bounding box, while being close to the position of the true bounding box, also tends to have a similar shape and proportion.
[0058] 4. IoU overlap (IoU Cost) The basic IoU loss term, used to measure the ratio of the overlapping area of the two boxes to the union, is shown in formula (4): (4) In the formula, Bp For the prediction box, Bg This is a true bounding box.
[0059] The bounding box regression loss function is shown in formula (5): (5) In the formula, Angle_Cost For angle matching items; Distance_Cost This is a distance penalty term; Shape_Cost For shape matching items; IoU_Cost α represents the IoU overlap term; α, β, γ, and δ are the weights of the angle matching term, distance penalty term, shape matching term, and IoU overlap term, respectively.
[0060] The model training in this embodiment of the invention adopts a standard end-to-end approach, completed within the PyTorch framework. The AdamW optimizer is used for parameter updates, and the loss function comprises three parts: bounding box regression loss, target confidence loss, and classification loss. During training, the image input size is uniformly set to 640×640, the batch size is set to 16, and the number of training epochs is 300. Each training epoch involves alternating evaluation between the training and validation sets to prevent overfitting. After model training is complete, performance is evaluated on an independent test set, primarily using map50, map50-95, precision, and recall. mAP50 represents the mean average precision when the IoU between the predicted and ground truth bounding boxes is greater than 0.5, measuring the model's basic detection capability. mAP50–95 represents the mean precision increasing by 0.05 between IoU thresholds of 0.5 and 0.95, comprehensively reflecting the model's adaptability to different precision requirements. Precision and Recall measure the false positive and false negative rates, respectively, used to analyze the robustness of various damage detection methods. The model ultimately selects the weight parameters with the highest mAP on the validation set as the deployment version. Through the above standardized training process, the object detection model can be ensured to have good detection performance and practical deployment feasibility.
[0061] Furthermore, to achieve integrated intelligent assessment of the overall health status of the container, a multimodal deep neural network prediction method is proposed based on the detection of damaged targets. Steps S102 and S103 are used to output the container condition level and remaining service life. This method not only utilizes the features of the detected damaged areas but also integrates structured data such as container age, usage frequency, and maintenance records. Thus, through joint modeling of image features and historical maintenance information, a complete closed loop from defect identification to service life prediction is achieved.
[0062] In some embodiments of the present invention, the multi-task prediction model includes a feature encoder, a shared convolutional module, a classification module, and a life prediction module. The feature encoder is used to process container age, usage time, usage frequency, and maintenance records into intermediate vectors using a multilayer perceptron. The intermediate vectors are then concatenated with the damage detection results and input into the shared convolutional module. The shared convolutional module transmits the concatenated data in parallel to the classification module and the life prediction module. The classification module is used to classify the container condition level. The life prediction module is used to predict the remaining life of the container.
[0063] The feature encoder, serving as the backbone of the multi-task network, is responsible for fusing and encoding the image region features output by the detection module with structural metadata to extract a high-dimensional semantic representation. The encoder employs a lightweight CNN as the image backbone network, and a cropped image of the damaged area is input into the encoder's front layer to preserve damage details. Simultaneously, non-image inputs (such as box age, usage time, number of uses, and maintenance records) are processed into intermediate vectors using a multilayer perceptron (MLP), concatenated with the damage detection results, and then fed into a shared convolutional module for unified representation. These shared features are then fed in parallel into two task branches: classification and regression (i.e., the grading classification module and the lifespan prediction module).
[0064] In some embodiments of the present invention, step S103 includes: Multimodal data is fused with damage detection results to obtain multimodal fused data; Multimodal fusion data is input into a multi-task prediction model to classify container condition levels and obtain container condition levels. The remaining life prediction results of the container are determined based on the container condition level and multimodal fusion data.
[0065] The multi-task prediction model first detects the container condition level, then predicts the remaining service life of the container based on the condition level, obtaining the remaining service life prediction result. The container condition level classification branch adopts a fully connected layer stacked structure and outputs multi-class container condition labels using a Softmax function. Cross-entropy loss function is used as a supervision signal during the training of this branch. The model also introduces label smoothing technology to alleviate the prediction instability caused by fuzzy class boundaries. The classification output can be used for container condition display and to provide maintenance priority or retirement suggestions for the decision-making system. This branch uses a similar structure to the classification branch, but the output is a single continuous value representing the estimated remaining service life. The output layer uses a linear activation function, and the loss function is Mean Squared Error (MSE) loss and cross-entropy loss, used to measure the difference between the predicted value and the actual service life label. The model can perform supervised learning based on the actual end-of-use time of containers in the training data, learning the correlation between damage type and service life, providing a direct basis for predictive maintenance and full life cycle management.
[0066] To simultaneously optimize classification and regression tasks, this embodiment of the invention designs a joint loss function as shown in formula (6): (6) in, The cross-entropy loss represents the classification of box conditions. This represents the mean squared error loss during lifetime regression. and These are weighting coefficients, which can be set according to the actual situation to balance the contribution of the two tasks to the total loss. The model is then updated based on the total loss. During training, stochastic gradient descent or the Adam optimizer is used for backpropagation updates, combined with an Early Stopping mechanism to avoid overfitting.
[0067] This invention introduces a small target detection branch and an optimized SIoU loss function into the improved YOLOv8 framework, significantly improving the detection accuracy and positioning stability of container surface defects (such as cracks, rust, and perforations). While maintaining the high inference speed required for real-time detection, it effectively reduces the false negative and false positive rates, providing more reliable data input for subsequent container condition grading and lifespan prediction. Through multimodal feature fusion and multi-task learning mechanisms, image damage information is jointly modeled with structured data such as container age, maintenance history, and usage frequency. This not only improves the accuracy of container condition level determination but also enhances the model's ability to interpret complex business scenarios. Compared to traditional detection methods that rely on a single visual input, this multimodal mechanism can output more credible health assessment results. The proposed remaining lifespan regression prediction method also overcomes the limitation of existing detection results only reflecting the "current state," achieving quantitative prediction of future usage time. These prediction results can be directly applied to predictive maintenance, resource scheduling, and asset lifespan management, helping port and shipping logistics companies optimize maintenance plans, reduce operating costs, and extend the full lifespan value of containers. Unlike existing single-defect identification methods, this invention achieves integrated output of detection, grading, and prediction, with results directly accessible to the digital asset management system of ports and shipping logistics. By linking with business processes, this invention not only enhances the intelligence level of the detection process but also transforms detection data into actionable decision-making data, thereby increasing the industrial value and commercial prospects of the technology.
[0068] To better implement the container remaining life prediction method in the embodiments of the present invention, correspondingly, the embodiments of the present invention also provide a container remaining life prediction device, such as... Figure 5 As shown, the container remaining life prediction device 500 includes: The image acquisition module 501 is used to acquire the current detection image and current usage record of the container, and to construct the target detection model and the multi-task prediction model; Damage detection module 502 is used to input the current detection image into the target detection model to obtain damage detection results; The life prediction module 503 is used to perform multimodal analysis on the current usage records to obtain multimodal data. After fusing the multimodal data with the damage detection results, it is input into the multi-task prediction model for container condition level classification and remaining service life prediction to obtain the container condition level and remaining service life prediction results. The multimodal data includes container age, usage time and usage frequency, and maintenance records.
[0069] The container remaining life prediction device 500 provided in the above embodiments can realize the technical solutions described in the above container remaining life prediction method embodiments. The specific implementation principles of each module or unit can be found in the corresponding content in the above container remaining life prediction method embodiments, and will not be repeated here.
[0070] The container remaining life prediction method and apparatus provided by the present invention have been described in detail above. Specific examples have been used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core idea of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for predicting the remaining life of a container, characterized in that, include: Acquire the current detection image and current usage record of the container, and construct an object detection model and a multi-task prediction model; The current detected image is input into the target detection model to obtain the damage detection result; Multimodal analysis is performed on the current usage records to obtain multimodal data. The multimodal data is then fused with the damage detection results and input into the multi-task prediction model for container condition level classification and remaining service life prediction to obtain container condition level and remaining service life prediction results. The multimodal data includes container age, usage time and usage frequency, and maintenance records.
2. The method for predicting the remaining life of a container according to claim 1, characterized in that, The method further includes: Obtain historical container usage records and historical container image sets; The container condition level is determined by classifying the container's condition based on its usage. Based on the damage status of the containers in the historical container image set, the damage types of the images are labeled to obtain target detection label files; The number of uses and the usage time are determined based on the historical container usage records and the historical container image set; The images in the historical container image set are classified according to the target detection tag file, the number of times of use, the time of use, and the container condition level to obtain the target container image set; The target detection model and the multi-task prediction model are trained based on the target container image set.
3. The method for predicting the remaining life of a container according to claim 2, characterized in that, After acquiring historical container usage records and historical container image sets, the process includes: The images in the historical container image set are preprocessed to obtain a preprocessed image set; the preprocessing includes image resolution unification, color normalization, and noise reduction. Data augmentation is performed on the images in the preprocessed image set to obtain an enhanced image set; the data augmentation includes random rotation, scaling, contrast adjustment, and illumination perturbation. The historical container image set is updated using the enhanced image set.
4. The method for predicting the remaining life of a container according to claim 2, characterized in that, The container condition rating includes brand new containers, containers in excellent condition, containers suitable for cargo transport, and windproof and waterproof containers; the container condition rating is determined based on the container's usage, including: The container that has been used less than a first preset number of times, has been used for less than a first preset time, and is undamaged is defined as the brand new container. The container whose number of uses is greater than the first preset number of uses, whose usage time is between the first preset time and the second preset time, and whose damage level is at the first damage level is defined as the container in good condition. The container whose usage time is between the second preset time and the third preset time and whose damage level is at the second damage level is determined as the suitable cargo container; The container whose usage time is greater than the third preset time and whose damage level is at the third damage level is identified as the windproof and waterproof container; the damage level of the first damage level is less than the damage level of the second damage level is less than the damage level of the third damage level.
5. The method for predicting the remaining life of a container according to claim 1, characterized in that, The target detection model is an improved YOLOv8 network; the improved YOLOv8 network includes a small target fusion detection module and a bounding box regression loss function; The step of inputting the current detected image into the target detection model to obtain the damage detection result includes: The improved YOLOv8 network is used to detect the current image to obtain a damage detection result; the small target fusion detection module of the improved YOLOv8 network is used to fuse the shallow high-resolution detail features and deep high semantic features of the current image to obtain a small target detection result; the bounding box regression loss function is used to constrain the predicted box during the detection process.
6. The method for predicting the remaining life of a container according to claim 5, characterized in that, The bounding box regression loss function is a weighted sum of angle matching, distance penalty, shape matching, and IoU overlap terms. The angle matching term is used to constrain the directional difference of the line connecting the center of the predicted box and the ground truth box. The distance penalty term is used to measure the Euclidean distance between the center points of the predicted box and the ground truth box. The shape matching term is used to measure the difference in aspect ratio between the predicted box and the ground truth box. The IoU overlap term is used to measure the ratio of the overlap area between the predicted box and the ground truth box to their union.
7. The method for predicting the remaining life of a container according to claim 2, characterized in that, The multi-task prediction model includes a feature encoder, a shared convolutional module, a classification module, and a lifespan prediction module. The feature encoder processes the container age, usage time, usage frequency, and maintenance records into an intermediate vector using a multilayer perceptron. This intermediate vector is then concatenated with the damage detection results and input into the shared convolutional module. The shared convolutional module transmits the concatenated data in parallel to the classification module and the lifespan prediction module. The classification module classifies the container condition level. The lifespan prediction module predicts the remaining lifespan of the container.
8. The method for predicting the remaining life of a container according to claim 1, characterized in that, The process involves fusing the multimodal data with the damage detection results and then inputting it into the multi-task prediction model for container condition level classification and remaining service life prediction, resulting in container condition level and remaining service life prediction results, including: The multimodal data is fused with the damage detection results to obtain multimodal fused data; The multimodal fusion data is input into the multi-task prediction model for container condition level classification to obtain the container condition level; The remaining life prediction result of the container is determined based on the container condition level and the multimodal fusion data.
9. The method for predicting the remaining life of a container according to claim 2, characterized in that, The step of determining the number of uses and usage time based on the historical container usage records and the historical container image set includes: Based on the historical container usage records, the first container lacking complete records and the second container with complete transport records were identified. Based on the damage type, quantity, and distribution range of the first container in the historical container image set, the number of times the first container was used and the usage time are determined. The second container is analyzed based on the historical usage records to determine the number of times and duration of use of the second container.
10. A container remaining life prediction device, characterized in that, include: The image acquisition module is used to acquire the current detection image and current usage record of the container, and to build the object detection model and the multi-task prediction model; The damage detection module is used to input the current detection image into the target detection model to obtain the damage detection result; The life prediction module is used to perform multimodal analysis on the current usage records to obtain multimodal data. After fusing the multimodal data with the damage detection results, the data is input into the multi-task prediction model for container condition level classification and remaining service life prediction, resulting in container condition level and remaining service life prediction results. The multimodal data includes container age, usage time and usage frequency, and maintenance records.