A crane track joint real-time detection method and system
By extracting the activation consistency index and background perturbation sensitivity, and combining Gaussian process regression and spatial attention mechanism to optimize the convolutional neural network model, the problem of decreased recognition ability caused by background changes in crane rail joint detection is solved, and the model achieves high efficiency and stability under varying rail surface conditions.
Patent Information
- Application Number
- CN202510824752.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2045-06-19
AI Technical Summary
Existing convolutional neural network models are prone to decreased recognition ability and misjudgment in crane rail joint detection due to background changes. In addition, the models have poor generalization ability, which increases deployment costs and reduces system reliability.
By acquiring seam image samples under various track surface conditions, the activation consistency index and background perturbation sensitivity are extracted, the background dependence index is calculated, the CNN model is divided into high dependence and low dependence categories, and the Gaussian process regression is used to predict the recognition accuracy index. Adaptive optimization training is then performed in conjunction with the spatial attention mechanism.
This improved the model's robustness and generalization ability under varying track surface conditions, reduced the risk of misjudgment and the cost of repeated training, and enhanced the intelligence and stability of the crane track joint detection system.
Smart Images

Figure CN120707828B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of crane technology, specifically to a method and system for real-time detection of crane rail joints. Background Technology
[0002] Real-time detection of crane rail joints refers to the continuous online monitoring of joints on the crane's running rails using sensors, image recognition, or other detection technologies. Data is collected and analyzed in real time to determine if any abnormalities (such as misalignment, wear, or cracks) exist at the joints, thereby promptly identifying potential safety hazards and ensuring the stable operation and safety of the crane. This technology can significantly improve maintenance efficiency and reduce the cost of manual inspections.
[0003] The existing technology has the following shortcomings:
[0004] In crane rail joint detection, convolutional neural network (CNN) models are prone to learning non-essential correlations between background texture and cracks during training, creating background-driven artifacts. This means the model over-relies on background features in training images for judgment, leading to a significant drop in recognition ability when the rail background changes (e.g., the use of a black anti-corrosion coating or a different surface material). In some cases, the model may even misidentify normal areas as cracks. This problem results in poor model generalization, unstable performance when transferred to new environments, and in severe cases, requires re-collecting data and retraining the model, increasing deployment costs and reducing system reliability. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for real-time detection of crane rail joints to address the shortcomings in the prior art.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for real-time detection of crane rail joints, comprising:
[0007] We acquire seam image samples under various track surface conditions, preprocess the images, and extract the seam region as the region of interest.
[0008] A convolutional neural network model was used to train and recognize seam images, and the activation consistency index, which measures the model’s activation response to the same seam region under different backgrounds, was extracted, as well as the sensitivity of the model to background perturbation of the recognition output when the seam region is fixed.
[0009] The activation consistency index and background perturbation sensitivity are weighted and fused to calculate the background dependence index. Based on the background dependence index, the CNN model is divided into high dependence category and low dependence category.
[0010] For CNN models with high dependence on categories, the recognition accuracy of the CNN model under new background conditions is predicted based on the feature distribution under different track background conditions.
[0011] By combining the recognition accuracy prediction results with the background dependence index, the CNN model is improved.
[0012] Preferably, the step of acquiring image samples and extracting regions of interest includes:
[0013] Image samples covering various track surface conditions were collected, including standard rail surfaces, black anti-corrosion coated rail surfaces, rusted rail surfaces, wet or waterlogged surfaces, oil or dust-covered rail surfaces, and rail surfaces treated by different manufacturers. The seam areas were extracted as regions of interest using template matching, edge detection, or a lightweight CNN model.
[0014] Preferably, activate the consistency index The extraction method is as follows: Select a fixed seam image content and embed it into multiple backgrounds to form a test group; input each test image into a CNN model; select an intermediate convolutional layer; extract its feature map to generate a heatmap; perform structural similarity calculation between the activation heatmaps generated under different backgrounds and the heatmap under the reference background; let... Let the similarity between the activation image and the reference image under the i-th background image be the average value, expressed as: ; where n is the number of background transformation samples.
[0015] Preferably, the method for extracting the background perturbation sensitivity (BPS) is as follows: Let the seam image be the input. Where d = H × W × C, i.e., height, width, and channel; R is the set of real numbers;
[0016] The image is divided into xs (seam region), xb (background region), and a baseline image x′. The background portion is set to a constant value, while the seam region remains consistent with x. Linear interpolation is then performed on the background portion. For each background pixel dimension i∈xb, calculate its integral gradient. The expression is: Where F(x) is the output of the CNN model; Output the gradient of the model with respect to pixel i. For the interpolated image, the sum of the absolute values of the integral gradients of all pixels in the background region is calculated as the background perturbation sensitivity.
[0017] Preferably, the activation consistency index and background perturbation sensitivity are weighted and fused to calculate the background dependence index, specifically including:
[0018] The activation consistency index and background perturbation sensitivity are dimensionlessly normalized to be within the range of [0,1]. The background dependence index is obtained by weighted summation of the normalized activation consistency index and background perturbation sensitivity.
[0019] Preferably, classifying the CNN model into high-dependency and low-dependency categories based on the background dependency index includes: comparing the obtained background dependency index with a preset threshold; if the background dependency index is greater than or equal to the preset threshold, classifying the CNN model into the high-dependency category; if the background dependency index is less than the preset threshold, classifying the CNN model into the low-dependency category.
[0020] Preferably, the prediction accuracy of the CNN model under new background conditions specifically includes:
[0021] Establish a dataset to measure the actual recognition accuracy of CNN models under historical context: ;in: This represents the feature vector under the i-th background condition; The accuracy obtained from actual testing under this background, where N is the total number of features;
[0022] The similarity between any two backgrounds is calculated using radial basis functions, expressed as: Where: l is the length scale hyperparameter, which is used to predict the accuracy of new background features using GPR, i.e., the recognition accuracy index RAI, and its expression is: Where: K represents the kernel matrix between training samples, This represents the transpose of the kernel similarity vector between the new sample and the training samples, where A is the accuracy in the training set. For noise; RAI∈[0,1], is the predicted recognition accuracy index;
[0023] If the predicted recognition accuracy index is less than the accuracy threshold, an early warning will be issued or the system will switch to a low background dependency model.
[0024] Preferably, for the target CNN model, a joint index is obtained based on the calculated Background Dependency Index (BDI) and Recognition Accuracy Index (RAI). If the Risk Score exceeds 0.6, it indicates that the model performance is unstable and improvement steps need to be implemented.
[0025] By fixing the seam area, construct multiple image pairs with the same structure but different backgrounds. , Spatial attention mechanism is used to guide the model to focus on the seam region; during training, attention map α(x) is calculated, and a background invariance loss term is added to background interference image pairs. The goal is to make the model in and The prediction results are consistent with those above: ; For the model to the image The output; For the model to the image The output;
[0026] Redefine the final training loss: ;in: This represents the standard cross-entropy classification loss; β represents the attention weight; β is the adjustment coefficient.
[0027] The present invention also provides a real-time detection system for crane rail joints, including an image acquisition and preprocessing module, a CNN model training and evaluation module, a model background dependency analysis module, a background adaptive prediction module, and an adaptive optimization training module;
[0028] Image acquisition and preprocessing module: acquires joint image samples under various track surface conditions, preprocesses the images, and extracts the joint area as the region of interest;
[0029] CNN Model Training and Evaluation Module: Uses a convolutional neural network model to train and recognize seam images, and extracts the activation consistency index to measure the model's activation response to the same seam region under different backgrounds, as well as the sensitivity of the model to background perturbation of the recognition output when the seam region is fixed.
[0030] Model background dependency analysis module: The activation consistency index and background perturbation sensitivity are weighted and fused to calculate the background dependency index. Based on the background dependency index, the CNN model is divided into high dependency category and low dependency category.
[0031] Background Adaptive Prediction Module: For CNN models with high dependence on categories, based on the feature distribution under different track background conditions, predict the recognition accuracy of the CNN model under new background conditions;
[0032] Adaptive optimization training module: Combines the recognition accuracy prediction results with the background dependence index to improve the CNN model.
[0033] The technical effects and advantages provided by the present invention in the above technical solution are as follows:
[0034] 1. This invention introduces a dual-index evaluation mechanism of activation consistency index and background perturbation sensitivity, quantifying the background dependency of CNN models under different orbital background conditions for the first time. It also classifies models into high and low dependency categories using the background dependency index, solving the "background-driven artifact" problem caused by learning non-essential background features during training in traditional CNNs. Simultaneously, by combining background features such as texture, brightness, and color of the orbital image, Gaussian process regression (GPR) is used to predict the model's recognition accuracy index (RAI) in new environments, enabling accuracy prediction and adaptability assessment before model deployment. This significantly improves the model's robustness and generalization ability under varying orbital surface conditions.
[0035] 2. This invention integrates spatial attention and consistency loss functions to construct image pairs with identical seam structures but varying backgrounds. An adversarial training strategy is introduced to guide the model to focus on the seam region and reduce its dependence on the background, enabling adaptive optimization of the CNN model in high-risk background scenarios. The overall system establishes a closed-loop mechanism of evaluation-prediction-optimization, effectively reducing the risk of misjudgment and repetitive training costs caused by background migration, and improving the intelligence, stability, and reliability of the crane rail seam detection system in practical engineering environments. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0037] Figure 1 This is a mind map of the method of the present invention.
[0038] Figure 2 This is a mind map of the system modules of the present invention. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0040] Example 1, please refer to Figure 1 As shown in this embodiment, a real-time detection method for crane rail joints includes:
[0041] We acquire seam image samples under various track surface conditions, preprocess the images, and extract the seam region as the region of interest.
[0042] A convolutional neural network model was used to train and recognize seam images, and the activation consistency index, which measures the model’s activation response to the same seam region under different backgrounds, was extracted, as well as the sensitivity of the model to background perturbation of the recognition output when the seam region is fixed.
[0043] The activation consistency index and background perturbation sensitivity are weighted and fused to calculate the background dependence index. Based on the background dependence index, the CNN model is divided into high dependence category and low dependence category.
[0044] For CNN models with high dependence on categories, the recognition accuracy of the CNN model under new background conditions is predicted based on the feature distribution under different track background conditions.
[0045] By combining the recognition accuracy prediction results with the background dependence index, the CNN model is improved.
[0046] To improve the model's adaptability to complex real-world environments, the collected image samples should cover the following rail surface conditions: Standard rail surfaces: conventionally polished or ordinary anodized surfaces; Black anti-corrosion coated rail surfaces: characterized by matte finish, irregular texture, and low reflectivity; Rusty rail surfaces: uneven oxide layer with impurities and rust spots; Wet or waterlogged surfaces: exhibiting reflections, light spots, or fluid interference; Oily or dusty rail surfaces: background texture is severely affected by contamination; Manufacturer-differentiated surfaces: different materials and coating processes. Sampling should ensure that each of the above types covers multiple images under different lighting conditions and time periods (morning / evening, cloudy / sunny, backlighting, etc.) to reflect real-world operating conditions.
[0047] Employs an industrial-grade high-definition camera (resolution no less than 1080p) to support low-light imaging; mounted on crane wheel frame or guide wheel for on-the-go sampling; equipped with controllable LED fill light, supporting synchronous flash to avoid the influence of natural light; frame rate control is recommended at ≥30fps to avoid missing seam dynamic information; images are transmitted to edge server or memory card in real time and archived by timestamp and track number.
[0048] Images are uniformly scaled to the model input size (e.g., 224×224 or 416×416 pixels); converted to standard image formats (e.g., PNG, JPG, BMP); and RGB images are converted to grayscale images (if color features are not required) to reduce data dimensionality and enhance structural features.
[0049] Median filtering or bilateral filtering is used to eliminate random noise in the background texture; brightness / contrast equalization: the adaptive histogram equalization (CLAHE) algorithm is used to enhance the local contrast of the image, making cracks or misaligned edges more obvious; for geometrically distorted images caused by fisheye lenses or oblique angle shooting, perspective transformation correction is performed to ensure that the seams are displayed in the normal proportion.
[0050] During the Region of Interest (ROI) extraction stage, the following methods can be used to locate the track joint area:
[0051] Method 1: Template matching based: Establish a standard track joint template; perform template matching on the acquired images to calculate similar regions; extract the matching regions as ROIs.
[0052] Method 2: Structural feature-based localization: Detect straight lines on the track edge using Hough transform; extract the seam area based on the position between the two parallel lines; extract a fixed height area, such as ±10 pixels from the center of the track, as the ROI.
[0053] Method 3: Deep learning pre-localization: Use a lightweight CNN model (such as MobileNet) for fast detection; coarsely locate the seams in the image and output the bounding box; crop the bounding box region and use it as the final ROI input to the subsequent recognition model.
[0054] All extracted ROI regions are of a uniform size (e.g., 128×128 pixels); grayscale contrast enhancement and edge sharpening (e.g., Laplacian enhancement) are performed on the ROI regions; metadata (capture time, track number, acquisition environment) is bound to each ROI image for model training.
[0055] All ROI images are labeled with their status (normal, cracked, misaligned, worn, etc.) manually or semi-automatically; they are categorized and stored according to track surface type to form a structured dataset for model training and evaluation.
[0056] A convolutional neural network model is used to train and recognize seam images. An activation consistency index, which measures the model's activation response to the same seam region under different backgrounds, and a sensitivity index, which reflects the model's sensitivity to background perturbations in the recognition output when the seam region is fixed, are extracted. Specifically, these include:
[0057] Select a standard CNN model with image classification or defect detection capabilities, such as ResNet or EfficientNet (primarily for classification); YOLOv5 or Faster R-CNN (primarily for object detection); Input: track seam image or its ROI region; Output: category labels such as crack / misalignment / wear / normal, or bounding boxes with confidence scores.
[0058] The image samples cover different track background conditions (refer to the acquisition scheme in the previous answer); each seam area image is used as a training sample, and its defect type is labeled; data augmentation (rotation, cropping, brightness perturbation, etc.) can be used to improve generalization ability.
[0059] Use cross-entropy loss function or multi-class objective loss function; use GPU to accelerate training, record model accuracy and loss convergence during training; retain the trained model parameters for subsequent activation analysis.
[0060] The Activation Consistency Index (ACI) is used to measure whether the response of the convolutional layers of a CNN model is stable under the same seam region and different background conditions, reflecting whether the model focuses on structural features rather than background features.
[0061] The extraction method is as follows:
[0062] Select a fixed seam image and embed it into multiple different backgrounds (such as coating differences and texture differences) to form a test group; ensure that the seam image position and size are consistent, and only the background changes.
[0063] Input each test image into the CNN model; select an intermediate convolutional layer (such as Layer 3 of ResNet); extract the feature maps of this layer, and generate heatmaps using Grad-CAM or CAM-like methods.
[0064] All heatmaps are normalized to make them comparable at the same scale; a uniform resolution (e.g., 224×224) is applied.
[0065] For activation heatmaps generated under different backgrounds, perform structural similarity calculations (such as SSIM) or cosine similarity calculations with heatmaps under a reference background;
[0066] set up Let the similarity between the activation image and the reference image under the i-th background image be the average value, expressed as: ; where n is the number of background transformation samples.
[0067] A higher ACI indicates that the model activates the same region consistently under different backgrounds, focusing on the seam structure features and having low background dependence; a lower ACI indicates that the model is greatly affected by the background and has the risk of recognition bias.
[0068] Background Perturbation Sensitivity (BPS) is used to simulate different background perturbations while fixing the seam area, observe the degree of change in the confidence level of the model's recognition results, and quantify the model's sensitivity to background changes.
[0069] The extraction method is as follows: Let the seam image be the input. Where d = H × W × C, i.e., height, width, and channel; R is the set of real numbers;
[0070] Divide the image into two parts:
[0071] xs: Seam area (structural features);
[0072] xb: Background area (non-structural part);
[0073] Baseline image x′: Set the background portion to a constant value (such as black or a mean image), and keep the seam area consistent with x.
[0074] Perform linear interpolation on the background: That is, keep the seam unchanged, and only let the background gradually transition from the baseline to the original image.
[0075] For each background pixel dimension i∈xb, calculate its integral gradient. The expression is: Where F(x) is the output of the CNN model (usually the prediction confidence); Output the gradient of the model with respect to pixel i. For the interpolated image, the background has a linear transition. The sum of the absolute values of the integral gradients of all pixels in the background region is calculated as the background perturbation sensitivity.
[0076] The activation consistency index and background perturbation sensitivity are weighted and fused to calculate the background dependence index. Based on the background dependence index, the CNN model is divided into high-dependency and low-dependency categories, specifically including:
[0077] The activation consistency index and background perturbation sensitivity are dimensionlessly normalized to be within the range of [0,1]. The background dependence index is obtained by weighted summation of the normalized activation consistency index and background perturbation sensitivity.
[0078] The obtained background dependency index is compared with a preset threshold. If the background dependency index is greater than or equal to the preset threshold, the CNN model is classified as a high dependency category; if the background dependency index is less than the preset threshold, the CNN model is classified as a low dependency category.
[0079] For CNN models with high dependence on specific categories, based on the feature distribution under different orbital background conditions, the recognition accuracy of the CNN model under new background conditions is predicted, specifically including:
[0080] For each track background image, the following structural and statistical features are extracted:
[0081] Background texture orientation entropy (e.g., extracted by Gabor filter); Gray-scale contrast or average brightness (reflecting lighting conditions); Texture roughness (e.g., Local Binary Pattern (LBP) statistics); Mean value of color histogram (reflecting coating type);
[0082] Establish a dataset to measure the actual recognition accuracy of CNN models under historical context: ;in: This represents the feature vector under the i-th background condition; The accuracy obtained from actual testing under this background, where N is the total number of features;
[0083] The similarity between any two backgrounds is calculated using the radial basis function (RBF kernel), expressed as: Where: l is the length scale hyperparameter, which controls the sensitivity to background differences; the kernel function is used to measure the similarity between background conditions.
[0084] For new background features, the GPR is used to predict the corresponding accuracy, i.e., the recognition accuracy index (RAI), which is expressed as: Where: K represents the kernel matrix between training samples, This represents the transpose of the kernel similarity vector between the new sample and the training samples, where A is the accuracy in the training set. The noise term is represented by RAI ∈ [0,1], which is the predicted recognition accuracy index. If the predicted recognition accuracy index is less than the accuracy threshold (e.g., 0.80), an early warning can be issued or the model can be switched to a low background dependency model.
[0085] For the target CNN model, a joint index is obtained based on the calculated Background Dependency Index (BDI) and Recognition Accuracy Index (RAI): Recommendation weight settings: =0.6, =0.4; if the Risk Score exceeds the threshold (e.g., 0.6), it indicates that the model performance is unstable and improvement steps need to be implemented.
[0086] By fixing the seam area, construct multiple image pairs with the same structure but different backgrounds. , );ensure , The seam area is completely consistent, while the background area shows statistical differences; image pairs are generated using image fusion, simulation, or real acquisition methods.
[0087] Spatial attention mechanisms (such as CBAM or SE) are used to guide the model to focus on the seam region; during training, the attention map α(x) is calculated and used as a weighting factor for the subsequent loss function.
[0088] For image pairs with background interference, add a background invariance loss term. The goal is to make the model in and The prediction results are consistent with those above: ; For the model to the image The output; For the model to the image The output;
[0089] Redefine the final training loss: ;in: This represents the standard cross-entropy classification loss; β represents the attention weight (high for seam areas, low for background areas); β is the adjustment coefficient that controls the strength of decorrelation loss (recommended β=0.3~0.5); this loss function prompts the model to maintain consistent output under different backgrounds and prioritizes adjusting the response of regions with lower attention (background).
[0090] The above loss is used to fine-tune the training for several rounds; after each training cycle, the model's BDI and RAI are re-evaluated; if the Risk Score decreases (e.g., by more than 30%), fine-tuning is stopped and the model version is updated; otherwise, new perturbation image pairs are constructed and training is iterated.
[0091] Example 2, please refer to Figure 2 As shown in the figure, the real-time detection system for crane rail joints described in this embodiment includes an image acquisition and preprocessing module, a CNN model training and evaluation module, a model background dependency analysis module, a background adaptive prediction module, and an adaptive optimization training module.
[0092] Image acquisition and preprocessing module: acquires joint image samples under various track surface conditions, preprocesses the images, and extracts the joint area as the region of interest;
[0093] CNN Model Training and Evaluation Module: Uses a convolutional neural network model to train and recognize seam images, and extracts the activation consistency index to measure the model's activation response to the same seam region under different backgrounds, as well as the sensitivity of the model to background perturbation of the recognition output when the seam region is fixed.
[0094] Model background dependency analysis module: The activation consistency index and background perturbation sensitivity are weighted and fused to calculate the background dependency index. Based on the background dependency index, the CNN model is divided into high dependency category and low dependency category.
[0095] Background Adaptive Prediction Module: For CNN models with high dependence on categories, based on the feature distribution under different track background conditions, predict the recognition accuracy of the CNN model under new background conditions;
[0096] Adaptive optimization training module: Combines the recognition accuracy prediction results with the background dependence index to improve the CNN model.
[0097] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0098] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.
[0099] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0100] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for real-time detection of crane rail joints, characterized in that: include: We acquire seam image samples under various track surface conditions, preprocess the images, and extract the seam region as the region of interest. A convolutional neural network model was used to train and recognize seam images, and the activation consistency index, which measures the model’s activation response to the same seam region under different backgrounds, was extracted, as well as the sensitivity of the model to background perturbation of the recognition output when the seam region is fixed. Activate the consensus index The extraction method is as follows: Select a fixed seam image content and embed it into multiple backgrounds to form a test group; input each test image into a CNN model; select an intermediate convolutional layer; extract its feature map to generate a heatmap; perform structural similarity calculation between the activation heatmaps generated under different backgrounds and the heatmap under the reference background; let... Let the similarity between the activation image and the reference image under the i-th background image be the average value, expressed as: Where n is the number of background transformation samples; The method for extracting background disturbance sensitivity (BPS) is as follows: Let the seam image be the input. Where d = H × W × C, i.e., height, width, and channels; R is the set of real numbers; the image is divided into xs seam region; xb background region; baseline image x′: the background part is set to a constant value, and the seam region remains consistent with x; linear interpolation is performed on the background part: For each background pixel dimension i∈xb, calculate its integral gradient. The expression is: Where F(x) is the output of the CNN model; Output the gradient of the model with respect to pixel i. For the interpolated image, the sum of the absolute values of the integral gradients of all pixels in the background region is calculated as the background perturbation sensitivity. The activation consistency index and background perturbation sensitivity are weighted and fused to calculate the background dependence index. Based on the background dependence index, the CNN model is divided into high dependence category and low dependence category. For CNN models with high dependence on specific categories, based on the feature distribution under different orbital background conditions, the recognition accuracy of the CNN model under new background conditions is predicted, specifically including: Establish a dataset to measure the actual recognition accuracy of CNN models under historical context: ;in: This represents the feature vector under the i-th background condition; The accuracy obtained from actual testing under this background, where N is the total number of features; The similarity between any two backgrounds is calculated using radial basis functions, expressed as: Where: l is the length scale hyperparameter, which is used to predict the accuracy of new background features using GPR, i.e., the recognition accuracy index RAI, and its expression is: Where: K represents the kernel matrix between training samples, This represents the transpose of the kernel similarity vector between the new sample and the training samples, where A is the accuracy in the training set. , which is the noise term; RAI∈[0,1], is the predicted recognition accuracy index; if the predicted recognition accuracy index is less than the accuracy threshold, an early warning is issued or the model is switched to a low background dependency model. The CNN model is improved by combining the recognition accuracy prediction results with the background dependence index; For the target CNN model, a joint index is obtained based on the calculated Background Dependency Index (BDI) and Recognition Accuracy Index (RAI). If the Risk Score exceeds 0.6, it indicates that the model performance is unstable and improvement steps need to be implemented. By fixing the seam area, construct multiple image pairs with the same structure but different backgrounds. , Spatial attention mechanism is used to guide the model to focus on the seam region; during training, attention map α(x) is calculated, and a background invariance loss term is added to background interference image pairs. The goal is to make the model in and The prediction results are consistent with those above: ; For the model to the image The output; For the model to the image The output; Redefine the final training loss: ;in: This represents the standard cross-entropy classification loss; This represents the attention weight; β is the adjustment coefficient. Fine-tuning is performed using the loss function for several rounds of training. After each training cycle, the model's BDI and RAI are re-evaluated. If the Risk Score drops by more than 30%, fine-tuning is stopped and the model version is updated. Otherwise, new perturbation image pairs are constructed and training is iterated.
2. The method for real-time detection of crane rail joints according to claim 1, characterized in that: The process of acquiring image samples and extracting regions of interest includes: Image samples covering various track surface conditions were collected, including standard rail surfaces, black anti-corrosion coated rail surfaces, rusted rail surfaces, wet or waterlogged surfaces, oil or dust-covered rail surfaces, and rail surfaces treated by different manufacturers. The seam areas were extracted as regions of interest using template matching, edge detection, or a lightweight CNN model.
3. The method for real-time detection of crane rail joints according to claim 1, characterized in that: The activation consistency index and background perturbation sensitivity are weighted and fused to calculate the background dependence index, which specifically includes: The activation consistency index and background perturbation sensitivity are dimensionlessly normalized to be within the range of [0,1]. The background dependence index is obtained by weighted summation of the normalized activation consistency index and background perturbation sensitivity.
4. The method for real-time detection of crane rail joints according to claim 3, characterized in that: The CNN model is classified into high-dependency and low-dependency categories based on the background dependency index. This includes comparing the obtained background dependency index with a preset threshold. If the background dependency index is greater than or equal to the preset threshold, the CNN model is classified into the high-dependency category; if the background dependency index is less than the preset threshold, the CNN model is classified into the low-dependency category.
5. A real-time detection system for crane rail joints, used to implement the real-time detection method for crane rail joints as described in any one of claims 1-4, characterized in that: It includes an image acquisition and preprocessing module, a CNN model training and evaluation module, a model background dependency analysis module, a background adaptive prediction module, and an adaptive optimization training module; Image acquisition and preprocessing module: acquires joint image samples under various track surface conditions, preprocesses the images, and extracts the joint area as the region of interest; CNN Model Training and Evaluation Module: Uses a convolutional neural network model to train and recognize seam images, and extracts the activation consistency index to measure the model's activation response to the same seam region under different backgrounds, as well as the sensitivity of the model to background perturbation of the recognition output when the seam region is fixed. Model background dependency analysis module: The activation consistency index and background perturbation sensitivity are weighted and fused to calculate the background dependency index. Based on the background dependency index, the CNN model is divided into high dependency category and low dependency category. Background Adaptive Prediction Module: For CNN models with high dependence on categories, based on the feature distribution under different track background conditions, predict the recognition accuracy of the CNN model under new background conditions; Adaptive optimization training module: Combines the recognition accuracy prediction results with the background dependence index to improve the CNN model.
Citation Information
Patent Citations
Deep learning concrete bridge crack real-time detection method based on domain adaptation
CN114693615A
Track deformation detection method for track sliding door
CN118570140A