Method and system for detecting appearance defects and stability of warehouse containers based on ai vision, and medium
By using an AI vision-based approach that combines image acquisition and deep learning models, the system integrates the detection of appearance defects in storage containers with stability analysis. This solves the problems of low efficiency and fragmented systems in existing technologies, enabling comprehensive monitoring and efficient assessment of the safety status of storage containers.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 深圳智眸未来科技有限公司
- Filing Date
- 2026-03-12
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies for detecting external defects and assessing structural stability of industrial storage tanks suffer from problems such as low efficiency, reliance on manual inspections, poor generalization ability of traditional algorithms, high hardware costs, and fragmented assessments, lacking a systematic and integrated safety management solution.
An AI vision-based approach is adopted, which uses image acquisition, target detection, deep learning models and dual-branch deep learning models to achieve precise identification of appearance defects of storage containers and simultaneous evaluation of static and dynamic stability. The image preprocessing is combined with algorithms such as Gaussian filtering and adaptive contrast-limited histogram equalization. The target detection algorithm is used to distinguish between static and dynamic targets, and the deep learning model is used for defect detection and stability analysis.
It enables comprehensive and systematic monitoring of the safety status of storage containers, overcomes the bottleneck of limited sample size and difficulty in generalization, possesses excellent engineering practicality and system scalability, is suitable for diverse industrial environments, reduces dependence on a large number of defective samples, and improves detection efficiency and accuracy.
Smart Images

Figure CN122115403A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of defect detection technology, and more specifically, to a method, system, and medium for detecting and analyzing the appearance defects and stability of storage containers based on AI vision. Background Technology
[0002] In the fields of industrial energy, chemical industry, and logistics warehousing, large storage tanks, pressure vessels, and other equipment serve as core storage and processing units. Their structural integrity and operational stability are crucial for ensuring safe production and preventing major accidents. During manufacturing, installation, and long-term service, the condition of these devices is primarily reflected in two aspects: external defects and overall stability.
[0003] External defects in storage containers, such as surface cracks, corrosion perforations, localized dents and deformations, coating peeling, and stains, are direct manifestations of material fatigue, stress concentration, or external corrosion, and are the initial source of safety hazards. Overall structural stability includes static and dynamic stability. Static stability refers to tilting and support deformation caused by uneven settlement of the tank foundation, as well as dynamic stability. Dynamic stability refers to the vibration response and anti-overturning ability during wind loads, internal fluid sloshing, and tank movement. Both together determine the safety of the equipment under static and dynamic load conditions.
[0004] Currently, the industry's monitoring and assessment of the aforementioned problems still heavily relies on traditional methods, resulting in significant technological bottlenecks. In terms of visual defect detection, periodic manual inspections remain the primary method. Inspectors often rely on visual inspection and experience for judgment. This method is not only inefficient but also limited by human subjectivity, fatigue, and accessibility to harsh or high-risk environments, leading to high rates of missed and false alarms and failing to generate traceable quantitative data. Some attempts to adopt traditional image processing algorithms based on fixed rules, such as edge detection, threshold segmentation, and template matching, while achieving some degree of automation, suffer from severely insufficient flexibility and robustness. For complex textures on tank surfaces, varying lighting conditions, diverse defect morphologies, and changes in the type of inspection object, traditional algorithms require frequent, empirical parameter readjustments, exhibiting extremely poor generalization ability and failing to meet the demands of large-scale, continuous industrial applications.
[0005] In terms of stability assessment, the approach is more passive and isolated. Static stability is often only checked once after installation or major repair using specialized measuring instruments such as levels and total stations to detect foundation settlement, making continuous monitoring impossible. Dynamic stability typically relies on physical sensors installed on the tank to capture vibration data. This approach is not only costly to deploy and difficult to maintain, but also has limited sensor placement, making it difficult to comprehensively reflect the overall dynamic behavior of large structures, and even less capable of retrospective analysis of historical conditions.
[0006] In addition, existing technical solutions generally separate appearance defect detection and structural stability analysis into two independent stages, each using different technical systems. This results in a lack of systematic and integrated assessment, leaving significant loopholes in safety management.
[0007] Therefore, there is an urgent need for an innovative and integrated intelligent inspection paradigm. This paradigm should leverage advanced artificial intelligence technology within a unified framework, employing simple and efficient sensing technologies to simultaneously achieve precise identification of appearance defects and intelligent assessment of static and dynamic stability, thereby meeting the safety and efficiency demands of modern industry. Summary of the Invention
[0008] The purpose of this application is to provide a method, system, and medium for detecting appearance defects and analyzing stability of storage containers based on AI vision. By working together image acquisition, target detection, defect identification, and stability analysis, multiple key quality inspection tasks can be completed simultaneously, achieving comprehensive and systematic monitoring of the safety status of storage containers.
[0009] This application also provides a method for detecting appearance defects and analyzing stability of storage containers based on AI vision, including: Static and dynamic images of storage containers under different lighting conditions are collected to obtain an image set. The image set is then preprocessed to obtain a preprocessed image set. The preprocessed image is localized and analyzed based on the target detection algorithm to obtain the analysis results. Based on the analysis results, the storage container is divided into static targets and dynamic operating targets. Defect data is obtained by detecting appearance defects on static targets using a deep learning model. The dynamic operating target is analyzed to extract vibration and displacement characteristics and evaluate the stability of the dynamic operating target. The static target is analyzed to evaluate the stability of the static target. The stability evaluation result is obtained based on the stability of the dynamic operating target and the stability of the static target. Defect data and stability assessment results are transmitted to the terminal in real time.
[0010] Optionally, in the AI vision-based method for detecting and analyzing the appearance defects of storage containers described in this application embodiment, the image set is preprocessed, specifically including: Based on the Gaussian filtering algorithm, a two-dimensional Gaussian kernel is defined to perform convolution calculation on the image set, which performs background smoothing and noise suppression on the image. The image is segmented into multiple local regions based on the adaptive contrast-limited histogram equalization algorithm. Histogram equalization is then performed on each local region to obtain a preprocessed image set. The preprocessed image set is then normalized using the following formula: ; in For the pixel data of the image, This is the result after normalization.
[0011] Optionally, in the AI vision-based method for detecting and analyzing the appearance defects of storage containers described in this application embodiment, the preprocessed image is located and analyzed based on a target detection algorithm to obtain analysis results. Based on the analysis results, the storage container is divided into static targets and dynamic operating targets, specifically including: The processed image is input into the target detection algorithm, which outputs the bounding box coordinates, confidence score, and target contour features of the candidate region of the storage container. Set a confidence threshold, filter candidate regions based on the confidence threshold, and remove regions with confidence scores lower than the confidence threshold to obtain the effective location results of the storage container; Multiple consecutive preprocessed images are acquired, and the location information of the storage container in each frame is obtained through a target detection algorithm. Calculate the bounding box center coordinate offset or contour feature similarity of the positioning results of the same storage container between consecutive frames; Set an offset threshold or a similarity threshold. If the offset between consecutive frames is less than the offset threshold and the contour feature similarity is greater than the similarity threshold, then it is determined to be a static target. If the offset is greater than or equal to the offset threshold or the contour feature similarity is less than or equal to the similarity threshold, it is determined to be a dynamically running target.
[0012] Optionally, in the AI vision-based method for detecting and analyzing the appearance defects of storage containers described in this application embodiment, appearance defect detection of static targets is performed based on a deep learning model to obtain defect data, specifically including: Obtain static targets, extract valid image regions of static storage container exteriors, and remove invalid background at image edges; Input the effective image region into the deep learning model to extract the appearance features of the static target; The extracted appearance features are classified and identified, and candidate defect regions and identification confidence scores are output. Non-maximum suppression processing is performed on the defect candidate region to remove duplicate candidate regions with an overlap degree higher than a preset overlap threshold, thereby obtaining the effective defect region; The actual size, location, and shape of the defect are calculated based on the pixel information of the effective defect area to obtain defect data.
[0013] Optionally, in the AI vision-based method for detecting and analyzing the appearance defects of storage containers described in this application embodiment, a static stability branch and a dynamic stability branch are constructed based on a dual-branch deep learning model, and the stability analysis of static targets is performed based on the static stability branch, as follows: Let the stability state of the container be S. S A set of potential physical factors P={p1, p2,..., p n The physical factors include the supporting polygon, the centroid projection, and the stability margin. The criterion for static stability is: ; in and The threshold is set in advance.
[0014] Optionally, in the AI vision-based method for detecting and analyzing the appearance defects of storage containers described in this application embodiment, the dynamic target stability analysis method is as follows: From the video stream V={f1,f2,...,f T In}, where f i Given a video stream of frames, select a subsequence containing important dynamic information from the video stream and locate it as the keyframe sequence K={k1,k2,...,k...}. M}( ); Based on frames and Analyzing inter-frame motion measures the degree of change between adjacent frames. The formula is as follows: ; in () represents the feature extraction function, specifically the neural network that performs feature extraction; Based on probability Formula analysis of the current frame The probability of a keyframe. The formula is as follows: ; in, These are learnable weight parameters. It is a learnable bias parameter. This indicates the amount of exercise. With frame index The concatenated feature vector; By setting a probability threshold, multiple keyframes are acquired, resulting in a keyframe sequence K. This keyframe sequence is then input into a temporal feature extractor for encoding to obtain long-term dependencies between frames. Finally, a Transformer network outputs a context feature vector f that incorporates temporal dynamic information. dyn The dynamic stability level is obtained. Regression Quantity of Dynamic Pattern Dynamic stability level The calculation formula is as follows: ; Dynamic pattern regression The calculation formula is as follows: ; in For speed, For acceleration, These are the displacement offsets in the x and y directions, respectively; Based on dynamic stability level Regression Quantity with Dynamic Pattern The stability analysis results of the dynamically operating target were obtained.
[0015] Secondly, embodiments of this application provide an AI vision-based system for detecting and analyzing the appearance defects of storage containers and its stability. The system includes a memory and a processor. The memory includes a program for a method of detecting and analyzing the appearance defects of storage containers based on AI vision. When the program is executed by the processor, it performs the following steps: Static and dynamic images of storage containers under different lighting conditions are collected to obtain an image set. The image set is then preprocessed to obtain a preprocessed image set. The preprocessed image is localized and analyzed based on the target detection algorithm to obtain the analysis results. Based on the analysis results, the storage container is divided into static targets and dynamic operating targets. Defect data is obtained by detecting appearance defects on static targets using a deep learning model. The dynamic operating target is analyzed to extract vibration and displacement characteristics and evaluate the stability of the dynamic operating target. The static target is analyzed to evaluate the stability of the static target. The stability evaluation result is obtained based on the stability of the dynamic operating target and the stability of the static target. Defect data and stability assessment results are transmitted to the terminal in real time.
[0016] Optionally, in the AI vision-based warehouse container appearance defect detection and stability analysis system described in this application embodiment, the image set is preprocessed, specifically including: Based on the Gaussian filtering algorithm, a two-dimensional Gaussian kernel is defined to perform convolution calculation on the image set, which performs background smoothing and noise suppression on the image. The image is segmented into multiple local regions based on the adaptive contrast-limited histogram equalization algorithm. Histogram equalization is then performed on each local region to obtain a preprocessed image set. The preprocessed image set is then normalized using the following formula: .
[0017] Optionally, in the AI vision-based warehouse container appearance defect detection and stability analysis system described in this application embodiment, the preprocessed image is located and analyzed based on the target detection algorithm to obtain the analysis result. Based on the analysis result, the warehouse container is divided into static targets and dynamic operating targets, specifically including: The processed image is input into the target detection algorithm, which outputs the bounding box coordinates, confidence score, and target contour features of the candidate region of the storage container. Set a confidence threshold, filter candidate regions based on the confidence threshold, and remove regions with confidence scores lower than the confidence threshold to obtain the effective location results of the storage container; Multiple consecutive preprocessed images are acquired, and the location information of the storage container in each frame is obtained through a target detection algorithm. Calculate the bounding box center coordinate offset or contour feature similarity of the positioning results of the same storage container between consecutive frames; Set an offset threshold or a similarity threshold. If the offset between consecutive frames is less than the offset threshold and the contour feature similarity is greater than the similarity threshold, then it is determined to be a static target. If the offset is greater than or equal to the offset threshold or the contour feature similarity is less than or equal to the similarity threshold, it is determined to be a dynamically running target.
[0018] Thirdly, embodiments of this application also provide a computer-readable storage medium, which includes a program for detecting and analyzing the appearance defects of storage containers based on AI vision. When the program for detecting and analyzing the appearance defects of storage containers based on AI vision is executed by a processor, it implements the steps of the method for detecting and analyzing the appearance defects of storage containers based on AI vision as described in any of the above claims.
[0019] As can be seen from the above, the AI vision-based method, system, and medium for detecting appearance defects and analyzing stability of storage containers provided in this application collect static and dynamic images of storage containers under different lighting conditions to obtain an image set. The image set is then preprocessed to obtain a preprocessed image set. A target detection algorithm is used to perform localization analysis on the preprocessed images to obtain analysis results. Based on these results, the storage containers are divided into static targets and dynamic targets. A deep learning model is used to detect appearance defects in the static targets to obtain defect data. The dynamic targets are analyzed to extract vibration and displacement features and assess their stability. The static targets are also analyzed to assess their stability. A stability assessment result is obtained based on the stability of the dynamic and static targets. The defect data and stability assessment results are transmitted to the terminal in real time. Through the collaborative work of image acquisition, target detection, defect identification, and stability analysis, multiple key quality inspection tasks can be completed simultaneously, achieving comprehensive and systematic monitoring of the safety status of storage containers. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 A flowchart of an AI vision-based method for detecting and analyzing the appearance defects of storage containers, provided in an embodiment of this application; Figure 2 A block diagram of an AI vision-based system for detecting and analyzing the appearance defects of storage containers, provided in an embodiment of this application. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0023] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, the terms "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0024] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating an AI vision-based method for detecting and analyzing the appearance defects of storage containers, as described in some embodiments of this application. This AI vision-based method for detecting and analyzing the appearance defects of storage containers is used in a terminal device and includes the following steps: S101: Collect static and dynamic images of storage containers under different lighting conditions to obtain an image set; preprocess the image set to obtain a preprocessed image set. S102, Based on the target detection algorithm, the preprocessed image is located and analyzed to obtain the analysis results. Based on the analysis results, the storage container is divided into static targets and dynamic operating targets. S103, Based on a deep learning model, perform appearance defect detection on static targets to obtain defect data; S104: Analyze the dynamic operating target, extract vibration and displacement characteristics, and evaluate the stability of the dynamic operating target; analyze the static target, evaluate the stability of the static target, and obtain the stability evaluation result based on the stability of the dynamic operating target and the stability of the static target. S105 transmits defect data and stability assessment results to the terminal in real time.
[0025] According to an embodiment of the present invention, the image set is preprocessed, specifically including: Based on the Gaussian filtering algorithm, a two-dimensional Gaussian kernel is defined to perform convolution calculation on the image set, which performs background smoothing and noise suppression on the image. The image is segmented into multiple local regions based on the adaptive contrast-limited histogram equalization algorithm. Histogram equalization is then performed on each local region to obtain a preprocessed image set. The preprocessed image set is then normalized using the following formula: .
[0026] According to an embodiment of the present invention, a target detection algorithm is used to perform localization analysis on a preprocessed image to obtain analysis results. Based on the analysis results, the storage container is divided into static targets and dynamic operating targets, specifically including: The processed image is input into the target detection algorithm, which outputs the bounding box coordinates, confidence score, and target contour features of the candidate region of the storage container. Set a confidence threshold, filter candidate regions based on the confidence threshold, and remove regions with confidence scores lower than the confidence threshold to obtain the effective location results of the storage container; Multiple consecutive preprocessed images are acquired, and the location information of the storage container in each frame is obtained through a target detection algorithm. Calculate the bounding box center coordinate offset or contour feature similarity of the positioning results of the same storage container between consecutive frames; Set an offset threshold or a similarity threshold. If the offset between consecutive frames is less than the offset threshold and the contour feature similarity is greater than the similarity threshold, then it is determined to be a static target. If the offset is greater than or equal to the offset threshold or the contour feature similarity is less than or equal to the similarity threshold, it is determined to be a dynamically running target.
[0027] According to an embodiment of the present invention, appearance defect detection of static targets is performed based on a deep learning model to obtain defect data, specifically including: Obtain static targets, extract valid image regions of static storage container exteriors, and remove invalid background at image edges; Input the effective image region into the deep learning model to extract the appearance features of the static target; The extracted appearance features are classified and identified, and candidate defect regions and identification confidence scores are output. Non-maximum suppression processing is performed on the defect candidate region to remove duplicate candidate regions with an overlap degree higher than a preset overlap threshold, thereby obtaining the effective defect region; The actual size, location, and shape of the defect are calculated based on the pixel information of the effective defect area to obtain defect data.
[0028] According to an embodiment of the present invention, a static stability branch and a dynamic stability branch are constructed based on a dual-branch deep learning model, and the stability analysis of a static target is performed based on the static stability branch. The method is as follows: Let the stability state of the container be S. S A set of potential physical factors P={p1, p2,..., p n The determination of static stability is based on physical factors including the supporting polygon, the centroid projection, and the stability margin. ; in and The threshold is set in advance.
[0029] According to an embodiment of the present invention, the dynamic target stability analysis method is as follows: From the video stream V={f1,f2,...,f T In}, where f i Given a video stream of frames, select a subsequence containing important dynamic information from the video stream and locate it as the keyframe sequence K={k1,k2,...,k...}. M}( ); Based on frames and Analyzing inter-frame motion measures the degree of change between adjacent frames. The formula is as follows: ; Based on probability Formula analysis of the probability that the current frame ft is a keyframe, probability The formula is as follows: ; in, These are learnable weight parameters. It is a learnable bias parameter. exercise volume With frame index The concatenated feature vector.
[0030] By setting a probability threshold, multiple keyframes are acquired, resulting in a keyframe sequence K. This keyframe sequence is then input into a temporal feature extractor for encoding, obtaining long-term dependencies between frames, and outputting a context feature vector f that incorporates temporal dynamic information. dyn The dynamic stability level is obtained. Regression Quantity of Dynamic Pattern Dynamic stability level The calculation formula is as follows: ; Dynamic pattern regression The calculation formula is as follows: ; in For speed, For acceleration, These are the displacement offsets in the x and y directions, respectively. and These are the learnable parameters.
[0031] Based on dynamic stability level Regression Quantity with Dynamic Pattern The stability analysis results of the dynamically operating target were obtained.
[0032] In summary, the method for detecting appearance defects and analyzing stability of industrial storage tank warehousing containers based on AI vision provided by the present invention has the following remarkable beneficial effects: First, it realizes the integrated integration of appearance defect detection and stability analysis. The present invention for the first time deeply integrates the appearance defect detection (cracks, deformations, stains) of industrial storage tanks and the structural stability assessment (static, dynamic) into a unified AI vision framework. Through the collaborative work of multiple modules such as image acquisition, target detection, defect recognition, and stability analysis, the system can synchronously complete multiple key quality inspection tasks, completely solving the problems of low efficiency, complex configuration, and lack of linkage warning caused by independent detection systems and fragmented data in traditional methods, and realizing the comprehensive and systematic monitoring of the safety status of storage tanks.
[0033] Second, it adopts an advanced unsupervised anomaly detection algorithm to break through the bottleneck of "few samples and difficult generalization". The defect detection module is based on the PatchCore algorithm and only needs to be trained with normal samples to accurately identify various unknown defects including tiny cracks, local deformations, and stains. This method significantly reduces the dependence on a large number of defect samples, overcomes the defects of poor adaptability and insufficient generalization ability of traditional supervised learning in real industrial scenarios, and is especially suitable for complex environments with diverse defect types and difficult to pre-define.
[0034] Third, it has excellent engineering practicability and system scalability. The overall design fully considers the light changes, noise interference, and multi-target scenarios in the industrial field. The image acquisition module supports dynamic dimming and multi-mode switching, and the stability analysis module realizes the collaborative reasoning of static and dynamic evaluations through a dual-branch structure. The overall architecture is modular and the interfaces are standardized, facilitating the integration of the latest algorithms or the adaptation to new containers and detection standards, ensuring the long-term stable operation and rapid deployment ability of the system in diverse industrial environments.
[0035] As Figure 2 shown, in the second aspect, the embodiment of the present application provides a system for detecting appearance defects and analyzing stability of a warehousing container based on AI vision. The system includes: a memory and a processor. The memory includes a program for the method for detecting appearance defects and analyzing stability of a warehousing container based on AI vision. When the program for the method for detecting appearance defects and analyzing stability of a warehousing container based on AI vision is executed by the processor, the following steps are implemented: Collect static images and dynamic operation images of the warehousing container under different lighting conditions to obtain an image set, and preprocess the image set to obtain a preprocessed image set; Perform positioning analysis on the preprocessed image based on a target detection algorithm to obtain an analysis result, and divide the warehousing container into static targets and dynamic operation targets based on the analysis result; Perform appearance defect detection on the static target based on a deep learning model to obtain defect data; The dynamic operating target is analyzed to extract vibration and displacement characteristics and evaluate the stability of the dynamic operating target. The static target is analyzed to evaluate the stability of the static target. The stability evaluation result is obtained based on the stability of the dynamic operating target and the stability of the static target. Defect data and stability assessment results are transmitted to the terminal in real time.
[0036] It should be noted that the system specifically includes an image acquisition module, a data preprocessing module, a target detection module, a defect detection module, a stability analysis module, and a result output module, and these modules work together.
[0037] The image acquisition module mainly includes an industrial camera that supports high-resolution still image capture and high-frame-rate video streaming recording, and is equipped with an optical lens and adjustable illumination. This module features a high-performance optical lens and adjustable illumination. The system allows for dynamic adjustment of the aperture, light intensity, and incident angle based on the lighting conditions and spatial location of the inspection environment, ensuring clear visible light images are acquired in various environments, whether for high-resolution static capture or continuous video recording. The industrial camera can be dynamically adjusted according to usage. For example, when fine inspection of the tank surface is required, it can switch to still image mode to capture details such as minute defects at the highest resolution; while when continuous monitoring of the container's dynamic stability is needed, video streaming mode is activated to ensure information integrity over time through a high frame rate.
[0038] The image preprocessing module is designed for visible light images acquired by industrial cameras. Its processing flow includes noise suppression, image equalization, contrast enhancement, and data normalization. To address Gaussian and salt-and-pepper noise that may be introduced in industrial environments due to electrical interference, lighting fluctuations, or inherent sensor characteristics, the preprocessing module first employs a Gaussian filtering algorithm. This involves convolving the image with a defined two-dimensional Gaussian kernel to achieve background smoothing and high-frequency noise suppression, while preserving the morphological features of defect edges to avoid false detections in subsequent stages. To further overcome the problem of concentrated image grayscale caused by uneven lighting, this module introduces an adaptive contrast-limited histogram equalization (CLAHE) algorithm. CLAHE divides the image into multiple local regions, performs histogram equalization within each region, and uses cropping to limit noise amplification. This method effectively enhances defect features in low-contrast regions while suppressing over-enhancement, making it particularly suitable for industrial material images with reflective surfaces or localized shadows. Finally, to match the input specifications of deep learning models, this module performs a normalization operation on the preprocessed image data, the mathematical expression of which is as follows: ; The target detection module, as the front-end perception unit of the entire analysis process, is responsible for efficient and accurate multi-target recognition and localization of input image and video data, providing an important data foundation for subsequent analysis. This module is built on the YOLOv8 architecture and employs a transfer learning strategy. It fine-tunes a pre-trained model by importing an industrial scene annotation dataset to adapt to specific material appearances and label shapes. During fine-tuning, the system uses annotated images as input, calculates predicted bounding boxes and category information through forward propagation, quantifies the difference between the predicted results and the actual annotations using a loss function, and iteratively optimizes the network weights through backpropagation, gradually converging the loss function to a stable range. Ultimately, it accurately detects various types of container targets in the input images. This module is designed to be compatible with both static images and real-time video streams as input. For static image data, this module directly performs multi-scale feature extraction and decoding on the input screen, outputting all detected industrial container targets at once. Each bounding box (bboxi) output by the detection module is used to crop a single image patch (Ii) containing only the target with minimal background interference from the original image. These image patches are distributed in parallel to the static stability analysis branches of the surface defect detection module and the stability analysis module. For video stream data, the module employs a strategy combining frame-level processing and temporal information. First, independent target detection is performed on each frame. Then, through collaboration with a lightweight tracking algorithm, the same target is associated across frames to form a stable target trajectory, providing a coherent data sequence for subsequent dynamic stability analysis. These discrete detection results are fed into a DeepSORT-based multi-target tracker, assigning an independent and stable Track ID to each physical target. Subsequently, the system constructs a unique temporal image sequence for each target using the Track ID as an index. Based on these target-separated, clean temporal sequences, keyframe selection and temporal modeling are performed to accurately assess its vibration modes and dynamic stability.
[0039] Specifically, DeepSORT is a multi-target tracking algorithm that integrates target motion models and deep appearance features. Based on frame-by-frame target detection, it predicts the target's motion position in the next frame using Kalman filtering and constructs a short-term motion model. Then, the algorithm uses a two-level association strategy to match newly detected targets with existing trajectories: first, it calculates the Mahalanobis distance between the detection box and the predicted box for coarse screening; then, it uses a pre-trained deep convolutional network to extract the feature vector of each target and calculates the cosine distance to accurately measure appearance similarity, thus effectively solving the identity switching problem caused by occlusion and intersection. Simultaneously, the algorithm incorporates a trajectory lifecycle management mechanism, delaying the confirmation of new targets and preserving the trajectory of targets that temporarily disappear, further ensuring the continuity and stability of tracking markers. This algorithm provides a continuous and clean temporal data stream, unit by unit, for the dynamic stability analysis in this invention, and is a key module connecting frame-level detection and temporal analysis.
[0040] The defect detection module includes a region segmentation unit and a defect detection unit. The region segmentation unit further processes the input, and the target detection unit, built using YOLOv8, can detect the pressure control structure, inlet / outlet structure, and other accessory structures of industrial storage tanks and containers.
[0041] Specifically, YOLOv8 (You Only Look Once version 8): YOLOv8 employs an anchor-free design. Its detection head no longer predefines anchor boxes of different shapes for each grid cell; instead, it directly predicts the offset of the bounding box relative to the top-left corner of the grid cell, as well as the box's width and height, thereby reducing conflicts between predictions and accelerating model convergence. Its backbone and neck network continue to use efficient CSP (Cross-Stage Partial Connection) and PAN-FPN (Path Aggregation Network-Feature Pyramid Network) structures to fuse feature maps from different scales, effectively detecting objects of small, medium, and large sizes. During training, a combination of binary cross-entropy loss, commonly used in classification tasks, and CIoU loss, used in regression tasks, is employed.
[0042] The container to be detected is segmented into different regions through object detection to ensure that subsequent detection can proceed normally. The defect detection unit is based on the Patchcore algorithm to automatically identify defects such as scratches, no damage, breakage, and deformation on the container surface. The Patchcore algorithm uses a backbone feature extraction network (WideResNet-50) with tens of millions of parameters. This network contains feature maps at multiple levels and uses features from intermediate layers to balance feature abstraction and spatial resolution. Patch-level feature embedding vectors are extracted from samples labeled as normal and added to a dynamic memory. Specifically, for the input image xi, feature maps are extracted... Where j represents the network layer, For the number of channels, and This represents the height and width of the feature map.
[0043] To capture local context, a neighborhood Np(h,w) is defined for each location (h,w), where p is the patch size (neighborhood radius). The neighborhood is defined by the following formula: ; Next, adaptive average pooling is used as the aggregation function fagg to aggregate the features within the neighborhood, resulting in a patch feature vector that is locally perceptive of all normal samples: ; For all normal samples Extract all patch features to form an initial memory M, where s represents the step size and P represents the set of all patch features of the image: ; To reduce storage and computational costs, a core set selection method is used to downsample the memory M. The goal is to select a subset Mi from M. C This ensures that its coverage in the feature space is as close as possible to the original memory. A minimum-maximum facility location core set selection method is used: ; Since this optimization problem is NP-hard, a greedy approximation algorithm is used to solve it. First, MC needs to be initialized as an empty set. Then, the location mi is iteratively selected such that its minimum distance from MC is maximized. This is a random linear projection used to reduce the feature dimension and accelerate computation. ; The sampled memory can be significantly compressed compared to the original memory.
[0044] During inference, the 1536-dimensional feature embedding vector of each patch of the test sample is compared with the memory, and FAISS indexing is used for acceleration. The basic anomaly score and image-level anomaly score are calculated sequentially. Specifically, for the input image x... test Extract its Patch feature set P(x) test For each test image, the extracted patch features m test ∈P(x test ), calculate its distance to its nearest neighbor in the memory MC as the base anomaly score: ; The image-level anomaly score *s* is based on the maximum anomaly score across all patches, with neighbor weighting introduced to improve robustness. First, the patch pair with the maximum base distance needs to be found: ; consider The b nearest neighbors Nb(m*) in the memory are reweighted using softmax scaling. This weighting strategy reduces the risk of misclassification for rare normal patches. ; Finally, the anomaly scores calculated for each test patch are arranged according to their spatial location to form an initial heatmap. Then, bilinear interpolation is used to upsample the heatmap to the input image resolution, and finally, a Gaussian kernel is used for smoothing to obtain the final heatmap. Its mathematical expression is: ; The final heatmap is overlaid on the original image with a color gradient, highlighting abnormal areas for intuitive defect location identification. The input data for this unit has undergone segmentation processing to ensure the separation of different regions of the container under inspection, and different thresholds are set for different regions for processing, outputting detection results and a heatmap.
[0045] The stability detection module incorporates a dual-branch deep learning model, the core idea of which is to decouple stability analysis into two tasks. The static stability analysis branch infers the static stability state of the container from a single image. The dynamic stability analysis branch analyzes the temporal dynamic behavior patterns of the container from a video clip. Both branches share a backbone feature extraction network pre-trained on a large dataset, enabling efficient feature reuse.
[0046] Static stability refers to a container's ability to resist tipping over when at rest, primarily determined by the projection of its center of gravity onto the supporting polygon. This branch aims to learn the mapping from a single image to a physically stable state. Assume the container's stability state is S. S A set of potential physical factors P={p1, p2,..., p n The factors determining static stability include the supporting polygon, the centroid projection, and the stability margin. The supporting polygon is defined as the polygon formed by the contact points between the container and the ground or foundation, and the stability margin is defined as the shortest distance from the centroid projection to the boundary of the supporting polygon. Therefore, the criterion for static stability can be formalized as: ; in and The threshold is set in advance.
[0047] The static stability analysis branch does not directly calculate the aforementioned geometric quantities, but instead learns a stability scoring function from image I through a deep learning network. Mapping fs: ; This branch enhances the physical features of the network after sharing the backbone. This part guides the model to implicitly learn feature representations related to the physical factor P. Its input is the image features extracted by the backbone network. The output is a hybrid vector f that combines appearance features and physical features. phys Ultimately, the static stability prediction head is a multilayer perceptron that maps the mixed feature vectors to a probability distribution, Ps=(p s0 ,p s1 ,p s2 The confidence levels are denoted as "stable", "critical", and "unstable", respectively. ; The goal of training the network is to minimize the cross-entropy loss between the predicted distribution and the true labels: ; The design concept of the dynamic stability analysis branch is similar to that of the static branch, focusing more on the attitude changes and vibration characteristics of the container during changes (such as external wind loads, mechanical vibrations, and container movement). This module first needs to analyze the video stream V={f1,f2,...,f... T In the sequence}, select a subsequence K={k1,k2,...,k} that contains important dynamic information. M}( This step introduces a lightweight adaptive keyframe selector inspired by the TIG (Time-Interval-Guided) framework. The selection decision is based on two core metrics: inter-frame motion and information entropy. Inter-frame motion measures the degree of change between adjacent frames. For frames ft and ft−1, their motion Mt can be approximated by the difference between their features extracted by the backbone network: ; Content information entropy measures the richness of information in a single frame of an image. We use a lightweight convolutional network to estimate the "information content" of the frame's features. This metric is defined primarily to avoid selecting frames with low information content due to blurring or other issues.
[0048] Specifically, the TIG (Time-Interval-Guided) framework is an adaptive keyframe selection framework for video temporal analysis. Its core idea is to abandon fixed sampling intervals and instead intelligently and non-uniformly determine the keyframes to be fed into the deep analysis model based on the dynamic changes and information content of the video content. This framework typically includes a lightweight evaluation network that decides whether the current frame is selected as a keyframe by calculating two key metrics: inter-frame motion (measuring the magnitude of changes in features or pixels between adjacent frames) and content information entropy (evaluating the richness and complexity of information in a single frame). In this way, the TIG framework can save significant computational resources on redundant frames when analyzing long video sequences, while ensuring that all important dynamic events and state changes are effectively captured, thereby significantly improving the system's processing efficiency while maintaining analytical accuracy.
[0049] Keyframe selection is a binary classification decision process. For the current frame ft, the probability that it will be selected as a keyframe is... It is determined by the following formula: ; in, and These are learnable parameters. A threshold is set to dynamically determine whether the current frame should be sent to the subsequent depth analysis module.
[0050] The selected keyframe sequence K is fed into a temporal feature extractor for encoding. This encoder captures long-term dependencies between frames and outputs a context feature vector f that incorporates temporal dynamic information. dyn The feature vector is fed into the dynamic stability prediction head and outputs two results, namely the dynamic stability level. Regression Quantity of Dynamic Pattern The dynamic stability level is used to assess conditions such as stability, slight vibration, and moderate swaying. The dynamic mode regression is a continuous vector used to quantify the physical characteristics of the vibration, such as the dominant frequency component ν, the average amplitude a, and the dominant vibration directions dx and dy. Its mathematical expression is as follows: ; ; The loss function of this branch is composed of classification loss. and regression loss Weighted composition: ; The entire two-branch model is trained end-to-end. The total loss function is a weighted sum of the losses from both branches: ; The model training process is divided into two stages. The pre-training stage is conducted on the ShapeStacks physics simulation dataset, utilizing its accurate stability labels to enable the model to learn basic physical predictions. The fine-tuning stage involves transfer learning on real-world datasets in the target industrial domain to narrow the gap between simulation and reality and improve the model's generalization ability.
[0051] The results output module serves as the human-computer interaction and decision support terminal of the system, and comprehensively presents the processing results of each stage, including appearance defect identification, static stability assessment and dynamic stability analysis, through a visual interface.
[0052] This module targets surface defects such as cracks, deformations, and stains on storage tanks. It employs a heatmap-based display method, overlaying the anomaly scores of defect areas onto the original image using color gradients (warm colors for high risk, cool colors for low risk). This visually presents the distribution and severity of defects, aiding staff in rapid location and decision-making analysis. For static stability analysis, the module graphically displays the container's stability state (stable, critical, unstable) and its confidence level, marking possible support areas and center-of-gravity projections in the image to enhance interpretability. For dynamic stability analysis, the module outputs dynamic stability levels (e.g., stable, slight vibration, moderate sway) and compares them with historical data, supporting trend analysis. All detection and analysis results support structured output and report generation, including key information such as defect type, location coordinates, stability score, timestamp, and tracking ID, facilitating data traceability and system integration.
[0053] A third aspect of the present invention provides a computer-readable storage medium including a program for detecting and analyzing the appearance defects of a storage container based on AI vision. When the program is executed by a processor, it implements the steps of the method for detecting and analyzing the appearance defects of a storage container based on AI vision as described above.
[0054] This invention discloses an AI vision-based method, system, and medium for detecting appearance defects and analyzing the stability of storage containers. It involves acquiring static and dynamic images of storage containers under different lighting conditions to obtain an image set, which is then preprocessed to obtain a preprocessed image set. A target detection algorithm is used to perform localization analysis on the preprocessed images, resulting in an analysis of the storage containers into static and dynamic targets. A deep learning model is used to detect appearance defects in the static targets, obtaining defect data. The dynamic targets are analyzed to extract vibration and displacement features and assess their stability. Similarly, the static targets are analyzed to assess their stability, resulting in a stability assessment. The defect data and stability assessment results are transmitted to a terminal in real time. Through the collaborative work of image acquisition, target detection, defect identification, and stability analysis, multiple key quality inspection tasks can be completed simultaneously, achieving comprehensive and systematic monitoring of the safety status of storage containers.
[0055] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0056] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0057] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0058] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0059] Alternatively, if the integrated units of the present invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
Claims
1. A method for detecting appearance defects and analyzing stability of storage containers based on AI vision, characterized in that, include: Static and dynamic images of storage containers under different lighting conditions are collected to obtain an image set. The image set is then preprocessed to obtain a preprocessed image set. The preprocessed image is localized and analyzed based on the target detection algorithm to obtain the analysis results. Based on the analysis results, the storage container is divided into static targets and dynamic operating targets. Defect data is obtained by detecting appearance defects on static targets using a deep learning model. The dynamic operating target is analyzed to extract vibration and displacement characteristics and evaluate the stability of the dynamic operating target. The static target is analyzed to evaluate the stability of the static target. The stability evaluation result is obtained based on the stability of the dynamic operating target and the stability of the static target. Defect data and stability assessment results are transmitted to the terminal in real time.
2. The method for detecting and analyzing the appearance defects of storage containers based on AI vision according to claim 1, characterized in that, The image set is preprocessed, specifically including: Based on the Gaussian filtering algorithm, a two-dimensional Gaussian kernel is defined to perform convolution calculation on the image set, which performs background smoothing and noise suppression on the image. The image is segmented into multiple local regions based on the adaptive contrast-limited histogram equalization algorithm. Histogram equalization is then performed on each local region to obtain a preprocessed image set. The preprocessed image set is then normalized using the following formula: ; in For the pixel data of the image, This is the result after normalization.
3. The method for detecting and analyzing the appearance defects of storage containers based on AI vision according to claim 2, characterized in that, Based on the target detection algorithm, the preprocessed image is localized and analyzed to obtain the analysis results. Based on the analysis results, the storage containers are divided into static targets and dynamic operating targets, specifically including: The processed image is input into the target detection algorithm, which outputs the bounding box coordinates, confidence score, and target contour features of the candidate region of the storage container. Set a confidence threshold, filter candidate regions based on the confidence threshold, and remove regions with confidence scores lower than the confidence threshold to obtain the effective location results of the storage container; Multiple consecutive preprocessed images are acquired, and the location information of the storage container in each frame is obtained through a target detection algorithm. Calculate the bounding box center coordinate offset or contour feature similarity of the positioning results of the same storage container between consecutive frames; Set an offset threshold or a similarity threshold. If the offset between consecutive frames is less than the offset threshold and the contour feature similarity is greater than the similarity threshold, then it is determined to be a static target. If the offset is greater than or equal to the offset threshold or the contour feature similarity is less than or equal to the similarity threshold, it is determined to be a dynamically running target.
4. The method for detecting and analyzing the appearance defects of storage containers based on AI vision according to claim 3, characterized in that, Defect detection of static targets is performed based on a deep learning model to obtain defect data, specifically including: Obtain static targets, extract valid image regions of static storage container exteriors, and remove invalid background at image edges; Input the effective image region into the deep learning model to extract the appearance features of the static target; The extracted appearance features are classified and identified, and candidate defect regions and identification confidence scores are output. Non-maximum suppression processing is performed on the defect candidate region to remove duplicate candidate regions with an overlap degree higher than a preset overlap threshold, thereby obtaining the effective defect region; The actual size, location, and shape of the defect are calculated based on the pixel information of the effective defect area to obtain defect data.
5. The method for detecting and analyzing the appearance defects of storage containers based on AI vision according to claim 4, characterized in that, Based on a dual-branch deep learning model, static stability branches and dynamic stability branches are constructed. Stability analysis of static targets is performed based on the static stability branch. The method is as follows: Let the stability state of the container be S. S A set of potential physical factors P={p1, p2,..., p n The physical factors include the supporting polygon, the centroid projection, and the stability margin. The criterion for static stability is as follows: ; in and The threshold is set in advance.
6. The method for detecting and analyzing the appearance defects of storage containers based on AI vision according to claim 5, characterized in that, The method for dynamic target stability analysis is as follows: From the video stream V={f1,f2,...,f T In}, where f i Given a video stream of frames, select a subsequence containing important dynamic information from the video stream and locate it as the keyframe sequence K={k1,k2,...,k...}. M }( ); Based on frames and Analyzing inter-frame motion measures the degree of change between adjacent frames. The formula is as follows: ; in () represents the feature extraction function, specifically the neural network that performs feature extraction; Based on probability Formula analysis of the current frame The probability of a keyframe. The formula is as follows: ; in, These are learnable weight parameters. It is a learnable bias parameter. This indicates the amount of exercise. With frame index The concatenated feature vector; By setting a probability threshold, multiple keyframes are acquired, resulting in a keyframe sequence K. This keyframe sequence is then input into a temporal feature extractor for encoding to obtain long-term dependencies between frames. Finally, a Transformer network outputs a context feature vector f that incorporates temporal dynamic information. dyn The dynamic stability level is obtained. Regression Quantity of Dynamic Pattern Dynamic stability level The calculation formula is as follows: ; Dynamic pattern regression The calculation formula is as follows: ; in For speed, For acceleration, These are the displacement offsets in the x and y directions, respectively; Based on dynamic stability level Regression Quantity with Dynamic Pattern The stability analysis results of the dynamically operating target were obtained.
7. A system for detecting and analyzing the appearance defects and stability of storage containers based on AI vision, characterized in that, The system includes a memory and a processor. The memory contains a program for an AI vision-based method for detecting and analyzing the appearance defects of storage containers. When the processor executes the program for detecting and analyzing the appearance defects of storage containers based on AI vision, it performs the following steps: Static and dynamic images of storage containers under different lighting conditions are collected to obtain an image set. The image set is then preprocessed to obtain a preprocessed image set. The preprocessed image is localized and analyzed based on the target detection algorithm to obtain the analysis results. Based on the analysis results, the storage container is divided into static targets and dynamic operating targets. Defect data is obtained by detecting appearance defects on static targets using a deep learning model. The dynamic operating target is analyzed to extract vibration and displacement characteristics and evaluate the stability of the dynamic operating target. The static target is analyzed to evaluate the stability of the static target. The stability evaluation result is obtained based on the stability of the dynamic operating target and the stability of the static target. Defect data and stability assessment results are transmitted to the terminal in real time.
8. The AI vision-based warehouse container appearance defect detection and stability analysis system according to claim 7, characterized in that, The image set is preprocessed, specifically including: Based on the Gaussian filtering algorithm, a two-dimensional Gaussian kernel is defined to perform convolution calculation on the image set, which performs background smoothing and noise suppression on the image. The image is segmented into multiple local regions based on the adaptive contrast-limited histogram equalization algorithm. Histogram equalization is then performed on each local region to obtain a preprocessed image set. The preprocessed image set is then normalized using the following formula: 。 9. The AI vision-based warehouse container appearance defect detection and stability analysis system according to claim 8, characterized in that, Based on the target detection algorithm, the preprocessed image is localized and analyzed to obtain the analysis results. Based on the analysis results, the storage containers are divided into static targets and dynamic operating targets, specifically including: The processed image is input into the target detection algorithm, which outputs the bounding box coordinates, confidence score, and target contour features of the candidate region of the storage container. Set a confidence threshold, filter candidate regions based on the confidence threshold, and remove regions with confidence scores lower than the confidence threshold to obtain the effective location results of the storage container; Multiple consecutive preprocessed images are acquired, and the location information of the storage container in each frame is obtained through a target detection algorithm. Calculate the bounding box center coordinate offset or contour feature similarity of the positioning results of the same storage container between consecutive frames; Set an offset threshold or a similarity threshold. If the offset between consecutive frames is less than the offset threshold and the contour feature similarity is greater than the similarity threshold, then it is determined to be a static target. If the offset is greater than or equal to the offset threshold or the contour feature similarity is less than or equal to the similarity threshold, it is determined to be a dynamically running target.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a program for detecting and analyzing the appearance defects of storage containers based on AI vision. When the program is executed by a processor, it implements the steps of the method for detecting and analyzing the appearance defects of storage containers based on AI vision as described in any one of claims 1 to 6.