Heat treatment cross shaft sleeve quality inspection method based on deep learning

By using a deep learning-based recognition model, the accuracy and stability issues of quality inspection of heat-treated cross shaft bushings were resolved, achieving automated and consistent quality inspection results.

CN121937464AActive Publication Date: 2026-04-28WANXIANGQIANCHAO CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WANXIANGQIANCHAO CO LTD
Filing Date
2026-03-31
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In the existing technology, the quality inspection of heat-treated cross shaft bushings relies on human experience or traditional machine vision, which makes it difficult to accurately extract complex surface features. Furthermore, the inspection accuracy and stability are low when faced with diverse defect morphologies, uneven distribution, and changing working conditions.

Method used

A deep learning-based recognition model, including an improved convolutional neural network-bidirectional long short-term memory network, is adopted. Through feature extraction, time series modeling, and time series feature weighting, a weighted time series feature representation is generated, and the recognition result is output.

Benefits of technology

It enables automated identification and quality inspection of heat-treated cross shaft bushings, improving the stability and consistency of inspection, reducing reliance on manual experience and rules, and making it suitable for mass production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121937464A_ABST
    Figure CN121937464A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of industrial product quality detection, in particular to a heat treatment cross shaft sleeve quality inspection method based on deep learning, which comprises the following steps: acquiring a to-be-identified shaft sleeve picture, and inputting the to-be-identified shaft sleeve picture into a trained identification model for identification to obtain an identification result; the recognition model is an improved convolutional neural network-bidirectional long short-term memory network model, and comprises a convolutional neural network used for performing feature extraction on a picture input into the recognition model to obtain an input feature sequence; the at least two layers of bidirectional long-short-term memory networks are used for carrying out time sequence modeling on the input feature sequence and outputting an enhanced time sequence feature sequence; the Bahdanau attention-based time sequence feature weighting mechanism is arranged at the output end of the last layer in the bidirectional long-short-term memory network and is used for carrying out weighted fusion on features corresponding to time steps in the enhanced time sequence feature sequence to generate weighted time sequence feature representation; and the output layer is used for outputting a recognition result based on the weighted time sequence feature representation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of industrial product quality inspection technology, and in particular to a deep learning-based method for quality inspection of heat treatment cross shaft sleeves. Background Technology

[0002] In modern machinery manufacturing and industrial production, cross shaft bushings, as key components in transmission systems, are widely used in automobiles, construction machinery, agricultural equipment, and other applications. These bushings typically require heat treatment to improve their hardness, wear resistance, and service life. However, the heat treatment process is affected by various factors such as temperature, time, and cooling method, which can easily lead to quality problems such as burns, cracks, abnormal microstructure, and surface defects on the surface or inside the bushing. Therefore, quality inspection of the cross shaft bushings after heat treatment is a crucial step in ensuring product consistency and reliability.

[0003] Currently, quality inspection of heat-treated cross shaft bushings in industrial settings still primarily relies on manual visual inspection or traditional machine vision-based methods. Manual visual inspection depends heavily on the operator's experience, judging the appearance of the bushing with the naked eye or simple magnification equipment. This method is not only inefficient but also highly susceptible to subjective factors, easily leading to missed or false inspections, and is difficult to meet the demands of mass production with high consistency. Summary of the Invention

[0004] (a) Technical problems to be solved

[0005] In view of the above-mentioned shortcomings and deficiencies of the prior art, this application provides a deep learning-based quality inspection method for heat-treated cross shaft bushings, which solves the technical problems of relying on manual experience or based on manually designed features for inspection, making it difficult to accurately extract the complex surface features of the bushing after heat treatment, and having low detection accuracy and stability when facing diverse defect morphologies, uneven distribution and changing working conditions.

[0006] (II) Technical Solution

[0007] To achieve the above objectives, the main technical solutions adopted in this application include:

[0008] This application provides a deep learning-based quality inspection method for heat treatment cross-shaped bushings, including:

[0009] A bushing image to be identified is obtained, and the bushing image is input into a trained recognition model for recognition to obtain a recognition result; wherein, the recognition model is trained in advance using a training dataset to obtain a trained recognition model;

[0010] The training dataset includes the sleeve training images used to train the recognition model and their corresponding type labels;

[0011] The recognition model is an improved convolutional neural network-bidirectional long short-term memory network model, including:

[0012] A convolutional neural network with residual connections is used to extract features from the image input to the recognition model to obtain an input feature sequence; at least two layers of bidirectional long short-term memory network are used to perform time series modeling on the input feature sequence and output an enhanced time series feature sequence that integrates forward time dependency information and backward time dependency information.

[0013] The Bahdanau attention-based temporal feature weighting mechanism, set at the output of the last layer in the at least two-layer bidirectional long short-term memory network, is used to weight and fuse the features corresponding to each time step in the enhanced temporal feature sequence to generate a weighted temporal feature representation.

[0014] The output layer is used to output the recognition result based on the weighted temporal feature representation, and the recognition result is used to characterize the type of the sleeve in the image input to the recognition model.

[0015] Preferably, in some embodiments of this application, the convolutional neural network with residual connections includes multiple deep layers, each deep layer including a convolutional layer, a batch normalization layer, an activation layer, and a residual block;

[0016] The convolutional neural network is used to extract features from the image input to the recognition model to obtain an input feature sequence, specifically including:

[0017] In a convolutional neural network, each deep layer performs convolution operations on the feature map of the input image to generate a convolution output feature map. The convolution output feature map is then added to and fused with the input of the residual block. After processing by batch normalization layers and activation layers, the output feature map of that deep layer is formed.

[0018] Based on the output feature maps of all deep layers in the convolutional neural network, a multi-level spatial feature representation is constructed to characterize the local structural features of the frame image at different scales.

[0019] The multi-level spatial feature representations are aggregated in the spatial dimension to obtain global structural features;

[0020] Based on the global structural features, the multi-level spatial feature representations are arranged and serialized according to the global structural distribution direction of the image's axis, to form the input feature sequence of the bidirectional long short-term memory network.

[0021] Preferably, in some embodiments of this application, determining the global structural distribution direction of the bushing in the image specifically includes:

[0022] Global average pooling is performed on the feature maps output by each layer of the convolutional neural network in the spatial dimension to obtain the spatial feature vector of each feature map. The spatial feature vector is used to reflect the overall structural distribution of the axis in the image.

[0023] Calculate the variance of the spatial feature vector in the horizontal and vertical directions respectively, and take the direction with larger variance as the global structural distribution direction of the axis in the image;

[0024] The horizontal variance represents the degree of dispersion of the feature distribution in the horizontal direction, while the vertical variance represents the degree of dispersion of the feature distribution in the vertical direction.

[0025] Preferably, in some embodiments of this application, the multi-level spatial feature representation of the convolutional neural network includes multiple feature extraction lines for extracting different types of features on the surface of the sleeve image, including sleeve color features, main edge features, texture features, dirt grayscale distribution features, and correlation features between edges and textures;

[0026] The extraction of the bushing color features is achieved by at least one circuit consisting of a convolutional layer and a pooling layer, which is used to capture the color distribution information on the bushing surface.

[0027] The extraction of main edge features is achieved by at least one convolutional layer, which is used to capture the geometry and regularity of the bushing edge;

[0028] Texture feature extraction is based on the set formed by the extraction results of the object color features and main edge features, and is achieved through at least one convolutional layer to capture the texture details of the bushing surface.

[0029] The extraction of dirt grayscale distribution features is achieved by at least one convolutional layer circuit, which is used to detect the distribution of dirt or deposits on the bushing surface;

[0030] The number of convolutional layer circuits used to extract the correlation features between edges and textures is greater than the number of convolutional layer circuits used to extract individual axis color features, main edge features, and texture features.

[0031] The extracted features, including bushing color, main edge, texture, dirt grayscale distribution, and the correlation between edge and texture, are fused in a multi-level spatial feature representation to form an input feature sequence for input into the bidirectional long short-term memory network.

[0032] Preferably, in some embodiments of this application, the object color feature line includes two convolutional layers, each with a kernel size of 3×3 and a stride of 1, followed by a 2×2 max pooling layer;

[0033] Main edge feature line: includes three convolutional layers, with kernel sizes of 3×3, 5×5, and 3×3 for each layer, stride of 1, and a 2×2 max pooling layer at the end;

[0034] Texture feature circuitry: It consists of four convolutional layers with kernel sizes of 3×3 and strides of 1. Every two convolutional layers are followed by a 2×2 max pooling layer.

[0035] The line for the grayscale distribution characteristics of dirt includes two convolutional layers with a kernel size of 5×5 and a stride of 1, followed by a 2×2 max pooling layer.

[0036] Edge and texture association feature circuit: includes five convolutional layers, with convolutional kernel sizes of 3×3 and stride of 1, followed by a 2×2 average pooling layer after every two convolutional layers;

[0037] Each feature extraction circuit processes the input features layer by layer through convolutional and pooling layers and outputs the results, which are then fused in a multi-level spatial feature representation to form the input feature sequence for inputting the bidirectional long short-term memory network.

[0038] Preferably, in some embodiments of this application, the process of obtaining an enhanced temporal feature sequence from at least two layers of bidirectional long short-term memory networks includes:

[0039] The first layer of the bidirectional long short-term memory network encodes the forward and backward dependency information of the input feature sequence formed by fusing the output features of multiple layers of the convolutional neural network, and outputs the initial temporal feature sequence.

[0040] The second-layer bidirectional long short-term memory network employs residual connections, adding the initial temporal feature sequence output from the first layer to the input feature sequence of the first layer element by element as the input feature sequence of the second layer, and modeling its forward and backward dependencies to form an enhanced temporal feature sequence.

[0041] The initial temporal feature sequence consists of multiple time step features arranged in sequence. Each time step feature corresponds to a local region feature vector formed by the fusion of multiple feature extraction lines after the multi-layer output feature map of the convolutional neural network is fused in the spatial dimension.

[0042] Preferably, in some embodiments of this application, the process of generating weighted temporal feature representations by a Bahdanau attention-based temporal feature weighting mechanism set at the output of the last layer in the at least two-layer bidirectional long short-term memory network includes:

[0043] For the local region feature vector at each time step, the attention score is calculated based on the similarity between the feature vector and the global structural feature vector formed by the spatial aggregation of the input feature sequence output by the convolutional neural network.

[0044] The calculated attention scores are normalized and used as weights in the local region feature vectors at the corresponding time steps. The feature vectors at all time steps are then summed in a weighted manner to obtain a weighted temporal feature representation.

[0045] Preferably, in some embodiments of this application, the type labels of the training dataset bushing training images include: a first type label for identifying bushings as qualified, a second type label for identifying bushings as rusted, and a third type label for identifying bushings as dirty;

[0046] The recognition model is trained using a training dataset, and the training method includes:

[0047] The parameters of the recognition model are iteratively updated using an optimization algorithm with a learning rate of 0.001;

[0048] In each training round, the function value of the pre-defined loss function for the training dataset is calculated;

[0049] If the training loss function converges in several consecutive training rounds, the recognition model is determined to be a well-trained recognition model and can be used for feature extraction and defect recognition of subsequent sleeve images.

[0050] Preferably, in some embodiments of this application, the method further includes:

[0051] The image of the bushing to be identified is processed to obtain the coordinates of the abnormal region in the image; the processing includes:

[0052] Gaussian filtering is applied to the image of the bushing to be identified to remove noise, and adaptive histogram equalization is used to enhance edge contrast, resulting in the denoised and enhanced image.

[0053] The Canny edge detection algorithm was used to extract the edge contour of the bushing body from the denoised and enhanced image;

[0054] Protruding structures in the edge contour that deviate from the main edge curve and meet the preset deviation conditions are identified as abnormal regions.

[0055] The main edge curve is a continuous curve obtained by locally smoothing and fitting the bushing edge profile in the horizontal or vertical direction.

[0056] The deviation condition is that the length of the protrusion structure is greater than or equal to 5 pixels, the width is less than or equal to 2 pixels, and the angle between it and the main edge curve is greater than 30°.

[0057] For each anomalous region, perform connectivity analysis to obtain its two-dimensional coordinate range and record it as a set of anomalous region coordinates.

[0058] Preferably, in some embodiments of this application, the abnormal regions in the image of the bushing to be identified are statistically analyzed to obtain the number of burrs, burr density, burr length variation coefficient, and main edge regularity corresponding to the image of the bushing to be identified.

[0059] The number of burrs is: the total number of protrusions in the bushing image to be identified that deviate from the main edge curve and meet the preset deviation conditions.

[0060] The burr density is calculated by dividing the number of burrs by the total length of the main edge curve, resulting in the burr density per unit pixel.

[0061] The coefficient of variation for burr length is the ratio of the standard deviation to the mean of all burr lengths.

[0062] The principal edge regularity is the degree of fit between the principal edge curve of the image to be identified and the minimum circumscribed ellipse.

[0063] (III) Beneficial Effects

[0064] This application provides a deep learning-based quality inspection method for heat-treated cross-shaped bushings. By inputting the acquired bushing image into a trained recognition model, it enables automated recognition and quality inspection of heat-treated cross-shaped bushings. The recognition model includes a convolutional neural network with residual connections, at least two layers of bidirectional long short-term memory networks, and a temporal feature weighting mechanism based on attention. This allows feature information in the bushing image to be extracted and fused step by step, providing a more sufficient feature basis for generating recognition results.

[0065] The convolutional neural network with residual connections is used to extract features from the axle-and-loop image input to the recognition model, resulting in an input feature sequence. This approach mitigates the gradient vanishing problem during network training while maintaining feature depth, thus improving the stability and effectiveness of feature extraction. Furthermore, the input feature sequence is modeled using a time series model through at least two layers of bidirectional long short-term memory network. This allows for the simultaneous utilization of forward and backward time dependencies, generating an enhanced temporal feature sequence containing bidirectional temporal correlations, thereby more comprehensively representing the relationships between different features in the axle-and-loop image.

[0066] Building upon this, a weighted temporal feature processing based on an attention mechanism is implemented at the output of the last layer of the at least two-layer bidirectional long short-term memory network. This process weights and fuses the features corresponding to each time step in the temporal feature sequence to generate a weighted temporal feature representation. This allows features that contribute significantly to the recognition result to receive higher weights, thereby reducing the influence of irrelevant features on the recognition result. Finally, the output layer generates the recognition result based on the weighted temporal feature representation, ensuring a stable and reliable recognition result even when the surface features of the bushing are complex and subtle.

[0067] Furthermore, the quality inspection method of this application trains the recognition model based on a training dataset, which includes training images of bushings and their corresponding type labels, enabling the recognition model to learn the feature differences of different types of bushing images. In the actual detection process, quality inspection can be completed without manually setting recognition rules or adjusting feature parameters, thereby improving the consistency and automation of the quality inspection process. It is suitable for batch quality inspection scenarios of heat-treated cross bushings. Attached Figure Description

[0068] Figure 1 This is a flowchart illustrating a deep learning-based quality inspection method for heat treatment cross-shaped bushings according to an embodiment of this application.

[0069] Figure 2 This is a schematic diagram of the structure of an identification model according to an embodiment of this application. Detailed Implementation

[0070] To better explain and facilitate understanding of this application, the following detailed description of the application is provided in conjunction with the accompanying drawings and specific embodiments.

[0071] In related technologies, the quality inspection methods for heat-treated cross shaft bushings can be mainly summarized into the following two categories:

[0072] The first type is the manual visual inspection method for bushing quality control. This method typically involves inspectors visually examining the heat-treated cross-shaped bushings with the naked eye or with the aid of simple magnifying equipment, judging whether there are burns, cracks, or surface abnormalities based on their personal experience. However, this method is highly dependent on the inspector's experience, the results are subjective, and fatigue can easily occur under prolonged, high-intensity inspection work, leading to missed or false positives. Furthermore, manual visual inspection is inefficient and cannot meet the requirements for consistency and stability in mass production of heat-treated cross-shaped bushings.

[0073] The second category is the bushing quality inspection solution based on traditional machine vision. This type of solution acquires bushing images using industrial cameras and analyzes these images using image processing methods such as edge detection, threshold segmentation, morphological operations, or manually designed texture features to generate inspection results. While this solution improves the level of automation to some extent, its feature extraction method relies on manually designed rules, making it poorly adaptable to changes in lighting conditions, the complexity of bushing surface textures, and differences between different batches of bushings. When the surface features of the bushing are subtle after heat treatment, and the defect morphology is diverse or unevenly distributed, the relevant methods struggle to accurately extract effective features, resulting in limited stability and accuracy of the identification results.

[0074] To address this, this application provides a deep learning-based quality inspection method for heat-treated cross-shaped bushings. This method constructs a recognition model comprising a convolutional neural network with residual connections, at least two layers of bidirectional long short-term memory networks, and an attention-based mechanism. It extracts features from the acquired bushing images, performs time-series modeling, and weighted processing of temporal features to generate a weighted temporal feature representation. The recognition result is then output based on this weighted temporal feature representation. This technical solution can fully integrate forward and backward time-dependent information from the input feature sequence, even when bushing images have complex features and subtle differences, highlighting features that contribute significantly to the recognition result. This achieves stable and reliable recognition of heat-treated cross-shaped bushings, reducing reliance on manual experience and rules, and improving the automation level of the quality inspection process and the consistency of the recognition results.

[0075] To better understand the above technical solutions, exemplary embodiments of this application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application can be understood more clearly and thoroughly, and that the scope of this application can be fully conveyed to those skilled in the art.

[0076] Figure 1 This is a flowchart illustrating a deep learning-based quality inspection method for heat treatment cross-shaped bushings according to an embodiment of this application. Figure 1 As shown, the deep learning-based quality inspection method for heat treatment cross-shaped bushings includes:

[0077] A bushing image to be identified is obtained, and the bushing image is input into a trained recognition model for recognition to obtain a recognition result; wherein, the recognition model is trained in advance using a training dataset to obtain a trained recognition model;

[0078] Specifically, the process begins by acquiring an image of the bushing to be identified using an industrial camera under preset lighting conditions and shooting distance. This image accurately reflects the color distribution, texture features, and local anomalies on the bushing surface. Subsequently, the image is input into a pre-trained recognition model, which extracts features and classifies the image, outputting the corresponding recognition result. This process automatically determines the quality status of the bushing.

[0079] The training dataset includes the sleeve training images used to train the recognition model and their corresponding type labels;

[0080] The training dataset for bushing training images includes three types of labels: a first type label for identifying bushings as qualified, a second type label for identifying bushings as rusted, and a third type label for identifying bushings as dirty. For example, training images of bushings with smooth surfaces, no obvious oxidation marks, and no foreign matter attached are labeled with the first type label; training images of bushings with rust spots, oxide layers, or abnormal color areas on the surface are labeled with the second type label; and training images of bushings with oil stains, dust, or other impurities attached to the surface are labeled with the third type label. By constructing the training dataset in this way, the recognition model can fully learn the differences in appearance features of different types of bushings during training, thereby improving the classification accuracy in subsequent recognition processes.

[0081] The recognition model is an improved convolutional neural network-bidirectional long short-term memory network model, such as... Figure 2 As shown, it includes:

[0082] A convolutional neural network with residual connections is used to extract features from the image input to the recognition model to obtain an input feature sequence;

[0083] At least two layers of bidirectional long short-term memory network are used to perform time series modeling on the input feature sequence and output an enhanced time series feature sequence that integrates forward time dependency information and backward time dependency information.

[0084] The Bahdanau attention-based temporal feature weighting mechanism, set at the output of the last layer in the at least two-layer bidirectional long short-term memory network, is used to weight and fuse the features corresponding to each time step in the enhanced temporal feature sequence to generate a weighted temporal feature representation.

[0085] The output layer is used to output the recognition result based on the weighted temporal feature representation, and the recognition result is used to characterize the type of the sleeve in the image input to the recognition model.

[0086] The improved convolutional neural network-bidirectional long short-term memory network model used in this embodiment effectively preserves low-level image features during deep feature extraction by setting up a convolutional neural network with residual connections. This avoids the loss of subtle texture information due to the increasing number of network layers, thereby enhancing the ability to perceive slight abnormal features on the bushing surface and improving the reliability of feature extraction under complex appearance conditions. Furthermore, by constructing a feature sequence from the features output by the convolutional neural network and introducing at least two layers of bidirectional long short-term memory network to model the feature sequence, the model, when determining the bushing type, not only relies on the local features of a single region but also comprehensively considers the correlation between different regions on the bushing surface and the overall distribution characteristics. This effectively avoids the misjudgment problem caused by judging based solely on local features in the prior art, and is particularly suitable for actual working conditions where rust or dirt is continuously distributed or irregularly extended. Furthermore, a temporal feature weighting mechanism based on Bahdanau attention is introduced at the output of the last layer of the bidirectional long short-term memory network. This enables the model to adaptively weight the features at each time step according to their contribution to the final classification result, thereby highlighting key regional features that are highly correlated with the sleeve abnormality and suppressing redundant regional features that are less correlated with the classification result.

[0087] In this embodiment, the convolutional neural network with residual connections includes multiple deep layers, each deep layer including a convolutional layer, a batch normalization layer, an activation layer, and a residual block;

[0088] The convolutional neural network is used to extract features from the image input to the recognition model to obtain an input feature sequence, specifically including:

[0089] In a convolutional neural network, each deep layer performs convolution operations on the feature map of the input image to generate a convolutional output feature map. The convolutional output feature map is then added to and fused with the input of the residual block. After processing through batch normalization layers and activation layers, the output feature map of that deep layer is formed. Through the above residual connection structure, the low-level structural information in the halo image can be effectively preserved in multiple layers of the network, avoiding feature information attenuation due to the increase in the number of network layers, thereby improving the stability and reliability of the feature extraction process.

[0090] Based on the output feature maps of all deep layers in the convolutional neural network, a multi-level spatial feature representation is constructed to characterize the local structural features of the frame image at different scales.

[0091] Specifically, the bushing image is passed layer by layer in the convolutional neural network. The output feature maps of different depth layers reflect the structural features of the bushing at different scales. The shallow output feature maps mainly represent the edge contours, texture changes, and other details of the bushing surface, while the deep output feature maps further represent high-level semantic features related to appearance anomalies such as rust and dirt. Based on the output feature maps of all depth layers in the convolutional neural network, a multi-level spatial feature representation is constructed, thus forming a comprehensive description of the bushing image at multiple scales and levels. Through this multi-level spatial feature representation, both local detail features and overall structural features can be taken into account, enabling the model to still have strong discriminative ability when faced with bushing appearance defects where local anomalies are obvious but overall differences are small.

[0092] The multi-level spatial feature representation is aggregated in the spatial dimension to obtain global structural features. Through the aggregation operation, the local features scattered on the surface of the bushing are integrated so that the global structural features can reflect the overall surface state of the bushing and the overall distribution of abnormal areas. This avoids the instability caused by judging based solely on local features and improves the utilization of the overall structural consistency in the subsequent identification process.

[0093] Based on the aforementioned global structural features, the multi-level spatial feature representations are arranged and serialized according to the global structural distribution direction of the bushing in the image to form the input feature sequence of the bidirectional long short-term memory network. This serialization process allows the bidirectional long short-term memory network to fully utilize the spatial continuity and correlation of the bushing surface structure when performing time-series modeling, thereby more accurately capturing the extension features and distribution patterns of rusted or dirty areas on the bushing surface.

[0094] In this embodiment, determining the global structural distribution direction of the bushing in the image specifically includes:

[0095] Global average pooling is performed on the feature maps output by each layer of the convolutional neural network in the spatial dimension to obtain the spatial feature vector of each feature map. The spatial feature vector is used to reflect the overall structural distribution of the axis in the image.

[0096] Calculate the variance of the spatial feature vector in the horizontal and vertical directions respectively, and take the direction with larger variance as the global structural distribution direction of the axis in the image;

[0097] The horizontal variance represents the degree of dispersion of the feature distribution in the horizontal direction, while the vertical variance represents the degree of dispersion of the feature distribution in the vertical direction.

[0098] For example, in this embodiment, to accurately determine the global structural distribution direction of the bushing in the image, global average pooling is first performed on the feature maps output by each deep layer of the convolutional neural network in the spatial dimension. Specifically, for any feature map output by a deep layer, the corresponding spatial feature vector is obtained by averaging its feature values ​​in the horizontal and vertical directions. This spatial feature vector is used to comprehensively reflect the overall structural distribution of the bushing in the entire image. Since the feature maps output by the convolutional neural network have already encoded the local structure and texture information of the bushing, the spatial feature vector obtained by global average pooling can retain the significant distribution characteristics of the overall structure of the bushing while suppressing the influence of local noise. After obtaining the spatial feature vector, the variance of the spatial feature vector in the horizontal and vertical directions is calculated respectively to quantify the dispersion of the bushing structural features in different directions. The horizontal variance is used to characterize the magnitude of feature variation and the degree of uneven distribution in the horizontal direction of the image, while the vertical variance is used to characterize the magnitude of feature variation and the degree of uneven distribution in the vertical direction of the image. For example, when the bushing is placed horizontally in an image, its structural features typically exhibit greater extensibility and variation in the horizontal direction, resulting in a significantly larger horizontal variance than the vertical variance. Conversely, when the bushing is placed vertically, its structural features are more dispersed in the vertical direction, leading to a larger vertical variance than the horizontal variance. Based on these variance calculations, the direction with the larger horizontal or vertical variance is identified as the global structural distribution direction of the bushing in the image. This method adaptively determines the main distribution direction of the bushing based on its actual spatial distribution, without relying on pre-defined fixed direction rules or manual experience, thus improving the objectivity and stability of the global structural distribution direction determination process. By using the above-mentioned method to determine the global structural distribution direction, on the one hand, by performing global average pooling on the convolutional features and combining it with variance analysis, the influence of local noise, local defects, or small changes in shooting angle on the direction judgment results can be effectively reduced, making the determined global structural distribution direction more consistent with the true overall structural characteristics of the bushing; on the other hand, by determining the direction based on the discreteness of the feature distribution, the subsequent arrangement and serialization process of multi-level spatial feature representations can be carried out along the direction of the most significant changes in the bushing structural information, thereby enhancing the correlation between adjacent time steps in the sequence features, providing a more reasonable input basis for the subsequent bidirectional long short-term memory network to perform effective temporal modeling, and ultimately helping to improve the accuracy of the overall recognition model in judging the appearance quality type of the bushing.

[0099] Preferably, in some embodiments of this application, the multi-level spatial feature representation of the convolutional neural network includes multiple feature extraction lines for extracting different types of features on the surface of the sleeve image, including sleeve color features, main edge features, texture features, dirt grayscale distribution features, and correlation features between edges and textures;

[0100] Specifically, the multiple feature extraction lines include those for extracting sleeve color features, main edge features, texture features, dirt grayscale distribution features, and features related to the relationship between edges and textures. Each feature extraction line is differentiated in terms of structure and focus to adapt to the different types of features in the image.

[0101] The extraction of bushing color features is achieved through a circuit consisting of at least one convolutional layer and a pooling layer, used to capture the color distribution information on the bushing surface. The color distribution on the bushing surface is encoded through convolution operations, and pooling operations are used to suppress interference from local illumination fluctuations, ensuring that the extracted color features reflect the overall color consistency of the bushing and the distribution of color-abnormal areas. This method helps distinguish between qualified bushings with uniform surface color and those with rust or color abnormalities, providing a stable color discrimination basis for subsequent classification. Specifically, the input bushing image is fed into the convolutional layer of the feature extraction circuit. Multiple convolutional kernels perform sliding convolution operations on the image in the spatial dimension, locally perceiving and encoding the color information at different locations on the bushing surface. This allows each channel in the convolutional output feature map to represent different color components and their spatial distribution. Through this convolution operation, the color intensity variations, color consistency, and color-abnormal area distribution features of the bushing surface in different regions can be effectively extracted. Following the convolutional layer, the feature extraction circuit further downsamples the convolutional output feature map using a pooling layer. By aggregating the color responses within local areas, the impact of local illumination variations, reflection differences, or imaging noise on the color feature extraction results is reduced. This makes the extracted color features more focused on the overall color distribution trend of the bushing surface rather than local instantaneous fluctuations. Through the combination of convolutional and pooling layers, the color features retain color difference information between different areas of the bushing surface while possessing a certain degree of spatial translation invariance. This allows for a stable reflection of whether there are color anomalies, oxidation discoloration, or local hue inconsistencies on the bushing surface. The bushing color features extracted in this way can effectively characterize the overall color uniformity and local color anomaly distribution of the bushing, providing a reliable feature basis for subsequently distinguishing qualified bushings from those with rust or color anomalies. Furthermore, because the color feature extraction process is based on a hierarchical processing method of convolution and pooling, it can capture color distribution information at different scales, enabling the recognition model to maintain good color feature stability and discrimination ability even when facing actual working conditions such as changes in shooting angle and fluctuations in lighting conditions.

[0102] The extraction of main edge features is achieved through at least one convolutional layer, used to capture the geometry and regularity of the bushing edge. This layer focuses on extracting features from the bushing contour edge and key geometric structures, capturing the geometry, continuity, and regularity of the bushing edge. Since the bushing's outer contour and key structures have relatively stable geometric features after molding and heat treatment, setting a separate main edge feature extraction layer can effectively enhance the model's ability to perceive the overall structural integrity of the bushing, avoiding the influence of local color or texture interference on the judgment of the main structure of the bushing. Specifically, by setting convolutional kernels sensitive to edge response, areas with significant grayscale or color changes in the bushing image are given a focused response, making the feature response values ​​corresponding to edge positions in the convolution output feature map significantly higher than those of non-edge areas. Through this convolution operation, the bushing contour boundary, end structure, and key geometric transition positions can be highlighted, thereby achieving the initial extraction of the main edge structure of the bushing. Based on the edge information enhancement response of the convolutional layer, through the superposition of multiple convolution operations, the model can gradually learn the overall geometric shape features of the bushing edge from local edge responses. For example, for a bushing with a regular cylindrical or ring-shaped outer contour, its edge response exhibits continuity and consistency in spatial distribution. However, when the bushing has structural defects, irregular edges, or abnormal edge morphology due to corrosion or obstruction by deposits, the corresponding edge response will show significant differences in continuity, smoothness, or symmetry. Encoding these differences through convolutional layers allows the extracted master edge features to reflect the geometry and regularity of the bushing's edges. Furthermore, by progressively expanding the receptive field layer by layer in the convolutional layer circuitry, the model can comprehensively analyze the distribution of edge features over a larger spatial range, thereby avoiding judgments based solely on local edge fragments and improving the ability to characterize the overall edge structure consistency of the bushing. The master edge features extracted in this way not only characterize the location of the bushing's edges but also reflect whether its overall geometric structure is regular, continuous, and complete. By using the above-mentioned main edge feature extraction method, this embodiment can effectively utilize the stability of the bushing edge geometry as an important discrimination criterion in the subsequent feature fusion and classification process, thereby reducing the impact of factors such as color change and local texture interference on the bushing type recognition result, and improving the overall recognition model's discrimination accuracy and robustness under complex appearance conditions.

[0103] Texture feature extraction is based on a set of extracted object color features and main edge features, implemented through at least one convolutional layer to capture detailed texture information on the bushing surface. This feature extraction method can further uncover subtle differences in surface texture beyond color and edge information, enabling the model to identify texture disturbances on the bushing surface caused by slight corrosion, processing marks, or attachments, thereby improving the detection capability for minor anomalies. Specifically, the feature map extracted from color features and the feature map extracted from main edge features are first fused along the channel dimension to form a joint feature set containing information on the bushing surface color distribution and edge structure. This joint feature set serves as input to the texture feature extraction circuit, preserving both color variation trends and geometric constraints during subsequent feature extraction. Subsequently, the joint feature set is input to at least one texture feature extraction circuit composed of convolutional layers. By setting a small-sized convolutional kernel, the feature map is scanned locally to respond to grayscale changes, subtle color differences, and structural repetition patterns on the bushing surface within adjacent pixel regions. The convolutional operation effectively enhances the ability to express subtle undulations, stripes, granular distributions, and surface microstructure differences introduced by heat treatment processes on the bushing surface, enabling the model to capture texture information with local consistency and periodicity. In this process, the convolutional layer weights and superimposes local features at different spatial locations in the input feature set, ensuring that continuously distributed details in the texture region form a stable response in the output feature map, while random noise or isolated pixel variations are suppressed, thereby improving the discriminative power and robustness of the texture features. Through this method, the texture feature extraction circuit, based on the fusion of color and edge information, can further extract texture details reflecting the micro-processing state and heat treatment quality of the bushing surface, providing a more comprehensive and refined feature basis for subsequent bushing quality assessment.

[0104] The extraction of dirt grayscale distribution features is achieved by at least one convolutional layer circuit, used to detect the distribution of stains or deposits on the bushing surface. This circuit focuses on analyzing the grayscale change patterns on the bushing surface to detect the distribution of oil, dust, or deposits on the bushing surface. By specifically extracting features for grayscale distribution, the risk of misjudging dirt conditions with inconspicuous color changes but abnormal grayscale distribution as acceptable can be effectively reduced, improving the accuracy of identifying dirt-related defects. Specifically, the bushing image is input into the convolutional layer circuit, and the image is scanned and feature-encoded through the local receptive field of the convolutional layer, so that the convolutional output feature map can reflect the grayscale value distribution and local brightness differences in different regions. For example, stains or deposits usually manifest as local grayscale anomalies or abrupt changes in grayscale gradients, which can produce significant responses in the feature map through convolution operations. Based on the convolution operation, the convolutional layer circuit further incorporates pooling operations to spatially aggregate local grayscale responses, reducing the interference of illumination changes, reflected highlights, or imaging noise on grayscale feature extraction, making the dirt features more robustly characterize abnormal areas on the bushing surface. Simultaneously, through the superposition of multiple convolutional layers, the model can gradually learn the overall grayscale distribution pattern from local grayscale anomalies. This allows the output dirt grayscale features to not only reflect the location of local stains but also characterize the extent, density, and directionality of stain distribution on the bushing surface. The dirt grayscale distribution feature extraction method achieved through the above combination of convolution and pooling enables the model to accurately distinguish between uniform grayscale areas on the surface of a qualified bushing and abnormal areas containing stains or deposits during subsequent feature fusion and classification. Compared to methods that rely solely on color or edge features for discrimination, this embodiment enhances the model's sensitivity to local grayscale anomalies and improves the accuracy of identifying dirt-related defects, thus providing a reliable feature basis for judging the appearance quality of bushings.

[0105] The number of convolutional layers used to extract the correlation features between edges and textures is greater than the number of convolutional layers used to extract individual bushing color features, main edge features, and texture features. In this embodiment, the number of convolutional layers set for the correlation features between the bushing surface edges and textures is greater than the number of convolutional layers used to extract bushing color features, main edge features, or texture features individually. By increasing the depth and complexity of this type of feature extraction circuitry, the model can focus on learning the correlation between texture changes in the area near the edge and the overall structure, thereby more accurately distinguishing normal structural edges from edge texture anomalies caused by rust, dirt, etc., and avoiding misjudgments caused by judging based on only a single feature.

[0106] The extracted features of the bushing's color, main edge, texture, dirt grayscale distribution, and the correlation between edges and textures are fused in a multi-level spatial feature representation to form an input feature sequence for the bidirectional long short-term memory network. In this embodiment, the convolutional neural network extracts various features of the bushing through multiple feature extraction lines, including color features, main edge features, texture features, dirt grayscale distribution features, and the correlation between edges and textures. Each feature line generates a set of feature representations, which describe the surface information of the bushing from different perspectives. The term "fusion in a multi-level spatial feature representation" means combining these features from different sources so that the model can simultaneously perceive the correlation information between color, shape, texture, dirt, and structure, rather than processing each feature in isolation. For example, the bushing's color feature can tell the model whether the surface is rusted or discolored, the main edge feature can tell the model whether the outline is complete, the texture feature can capture subtle processing marks, the dirt grayscale distribution can show the surface dirt situation, and the edge-texture correlation feature allows the model to understand the pattern of texture anomalies near the edge. The fused result forms a multi-dimensional feature sequence, which is the input feature sequence. This sequence is arranged according to the spatial distribution of the bushing surface structure and serves as the input to the bidirectional long short-term memory network. The bidirectional long short-term memory network learns the dependencies between features in the temporal dimension of the sequence, that is, it captures the overall change pattern of the bushing from one local to another, thereby more accurately identifying the bushing type (qualified, rusted, dirty, etc.).

[0107] Specifically, the object color feature circuit includes two convolutional layers, each with a kernel size of 3×3 and a stride of 1, followed by a 2×2 max pooling layer. The circuit uses a small kernel and two layers because color features mainly reflect the color distribution changes between local pixels. The small kernel can sensitively capture local color differences, while the combination of two convolutional layers and pooling can take into account both local information and the overall surface color distribution, thus robustly representing color anomalies such as rust and discoloration.

[0108] The main edge feature path consists of three convolutional layers, with kernel sizes progressively increasing from 3×3 to 5×5 to 3×3, all with a stride of 1, and ending with a 2×2 max-pooling layer. The use of multiple convolutional layers and kernels of different sizes is intended to simultaneously capture both local details and the overall contour of the axis's edge. The 3×3 convolutional kernel excels at extracting subtle edge variations, while the 5×5 kernel captures larger-scale edge continuity. Finally, a pooling layer reduces noise, ensuring that the main edge features accurately reflect the geometric shape while maintaining structural integrity.

[0109] Texture feature circuitry: It consists of four convolutional layers with kernel sizes of 3×3 and strides of 1. Every two convolutional layers are followed by a 2×2 max pooling layer. This circuitry extracts texture details based on color and edge features. The four convolutional layers facilitate the gradual learning of higher-level texture patterns from local textures. At the same time, the pooling layer reduces lighting variations and noise interference, making the texture features stable and reliable, and able to reflect subtle differences such as processing marks and surface microstructures.

[0110] The dirt and grime grayscale distribution feature circuitry consists of two convolutional layers with a kernel size of 5×5 and a stride of 1, followed by a 2×2 max-pooling layer. The large convolutional kernels are used because dirt and deposits are typically distributed over a large area; a large kernel can cover more pixel areas, capturing the overall pattern of grayscale anomalies. The pooling layer further converges local responses, making the grayscale anomaly features more robust, reducing local noise interference, and improving sensitivity to dirt and grime and recognition reliability.

[0111] Edge and texture association feature circuit: It consists of five convolutional layers with kernel sizes of 3×3 and strides of 1. Every two convolutional layers are followed by a 2×2 average pooling layer. This circuit is designed to be relatively deep in order to learn more complex spatial association patterns from the joint features of edges and textures. The setting of average pooling instead of max pooling helps to smooth the feature response, enabling the model to more accurately capture the overall variation of textures near the edges, thereby identifying edge texture anomalies caused by corrosion or deposits.

[0112] Each feature extraction circuit processes the input features layer by layer through convolutional and pooling layers and outputs the results, which are then fused in a multi-level spatial feature representation to form the input feature sequence for inputting the bidirectional long short-term memory network.

[0113] Preferably, the process of obtaining an enhanced temporal feature sequence from at least two layers of bidirectional long short-term memory networks includes:

[0114] The first layer of the bidirectional long short-term memory network encodes the forward and backward dependency information of the input feature sequence formed by fusing the output features of multiple layers of the convolutional neural network, and outputs the initial temporal feature sequence.

[0115] The second-layer bidirectional long short-term memory network employs residual connections, adding the initial temporal feature sequence output from the first layer to the input feature sequence of the first layer element by element as the input feature sequence of the second layer, and modeling its forward and backward dependencies to form an enhanced temporal feature sequence.

[0116] The initial temporal feature sequence consists of multiple time step features arranged in sequence. Each time step feature corresponds to a local region feature vector formed by the fusion of multiple feature extraction lines after the multi-layer output feature map of the convolutional neural network is fused in the spatial dimension.

[0117] Specifically, the first-layer bidirectional long short-term memory network receives the input feature sequence formed by fusing the multi-layer output features of the convolutional neural network through color, main edge, texture, dirt grayscale, and edge-texture correlation feature lines, and encodes the forward and backward dependency information for each time step feature. Each time step feature here corresponds to a local region feature vector formed by expanding the multi-layer output feature map of the convolutional neural network in the spatial dimension, such as the color, edge, texture, and dirt distribution features of a small area on the surface of the bushing. Through bidirectional processing, the first-layer network can capture the forward and backward dependencies of local features within the overall spatial structure of the bushing, outputting an initial temporal feature sequence containing both local and overall structural information. The second-layer bidirectional long short-term memory network enhances the output of the first layer. Specifically, residual connections are used to element-wise add the initial temporal feature sequence output by the first layer to the input feature sequence of the first layer, forming the input feature sequence of the second layer. The design of residual connections can alleviate the gradient vanishing problem that may occur during deep network training, while ensuring that the original local feature information captured by the first layer is preserved and further optimized in the second layer. In the second layer of the network, forward and backward dependency modeling is also performed on the input feature sequence, enabling the model to learn the complex spatial relationships between local regions and the overall structure at a higher level. For example, the distribution of rust, texture anomalies, or stains near the edge of the bushing is not only influenced by neighboring regions but also related to the structural pattern of the entire bushing surface. Through bidirectional modeling, local and global information can be comprehensively analyzed, improving the sensitivity to anomalous regions. Through the aforementioned bidirectional long short-term memory network processing, the features at each time step not only reflect the fused features of a single local region but also encode the forward and backward spatial dependencies of that local region on the entire bushing surface, thus forming an enhanced temporal feature sequence. Compared to single-layer or unidirectional processing networks, this design can more accurately capture the spatial continuity and anomalous patterns of bushing surface features, allowing subsequent weighted processing based on the Bahdanau attention mechanism to fully utilize the importance of each local region, thereby significantly improving the accuracy and applicability of identifying qualified, rusted, and dirty bushings. This method reasonably combines multi-layer convolutional feature fusion, bidirectional temporal modeling, and residual enhancement mechanism, achieving effective integration of local and global features. It provides a reliable and stable technical means for quality inspection of heat-treated cross shaft sleeves and has significant beneficial effects.

[0118] In this embodiment, the process of generating weighted temporal feature representations by the Bahdanau attention-based temporal feature weighting mechanism set at the output of the last layer in the at least two-layer bidirectional long short-term memory network includes:

[0119] For each time step's local region feature vector, an attention score is calculated based on the similarity between this feature vector and the global structural feature vector formed by spatially aggregating the input feature sequence output by the convolutional neural network. Specifically, for each time step's local region feature vector output by the bidirectional long short-term memory network, a similarity calculation is performed between it and the global structural feature vector formed by spatially aggregating the input feature sequence output by the convolutional neural network. For example, when processing features near the bushing edge, each time step's feature vector corresponds to local region features fused from multiple feature extraction lines of the convolutional neural network, such as color distribution, edge shape, texture details, and dirt distribution. By calculating the similarity between the local feature vector and the global structural feature vector, the attention mechanism can quantify the importance of each local region in the overall bushing surface structure, thus generating an attention score for each time step.

[0120] The calculated attention scores are normalized and used as weights for the local region feature vectors at the corresponding time steps. The feature vectors from all time steps are then summed using weighted averages to obtain a weighted temporal feature representation. Specifically, the calculated attention scores are normalized so that the sum of the scores at all time steps equals 1, forming the weight coefficients. The local region feature vector at each time step is multiplied by the corresponding weight coefficient, and then the feature vectors from all time steps are summed using weighted averages to obtain the final weighted temporal feature representation. For example, if certain local areas on the bushing surface have obvious rust or dirt, while other areas have normal features, the attention mechanism will automatically assign higher weights to these abnormal areas, thus highlighting these key abnormal features in the weighted feature representation.

[0121] In this embodiment, by weighting the correlation between local features and global structural features, the model can automatically identify which local regions are more critical for bushing type determination, thereby avoiding interference from local noise or irrelevant features. Simultaneously, this mechanism can consider both local details and overall structure, making the weighted feature representation more discriminative. Compared to simple averaging or fully connected aggregation methods without attention mechanisms, this embodiment can significantly improve the accuracy and robustness of identifying qualified, corroded, and dirty bushings, achieving intelligent attention and fine characterization of bushing surface features, thereby enhancing the reliability, stability, and applicability of the heat-treated cross-shaped bushing quality inspection method.

[0122] The recognition model is trained using a training dataset, and the training method includes:

[0123] The parameters of the recognition model are iteratively updated using an optimization algorithm with a learning rate of 0.001;

[0124] In each training round, the function value of the pre-defined loss function for the training dataset is calculated;

[0125] If the training loss function converges in several consecutive training rounds, the recognition model is determined to be a well-trained recognition model and can be used for feature extraction and defect recognition of subsequent sleeve images.

[0126] In this embodiment, the recognition model is trained using a training dataset to accurately extract surface features and identify defects in the bushing. During training, an optimization algorithm with a learning rate of 0.001 is used to iteratively update the parameters of the recognition model. For example, for the convolutional layer weights, long short-term memory unit gating parameters, and attention mechanism weights in the improved convolutional neural network-bidirectional long short-term memory network model, the optimization algorithm calculates gradients and updates parameters along the negative gradient direction, gradually approximating the true distribution of bushing type labels in the training dataset. In each training round, the model uses the training dataset to calculate the value of a pre-defined loss function, typically a classification cross-entropy function, used to measure the difference between the model's predicted class probability and the true type label. For example, for a bushing image labeled as rusted, if the model predicts a rust probability of 0.85, the cross-entropy loss value reflects the magnitude of the deviation between the prediction and the true label. During training, when the loss function value converges over several consecutive training rounds (i.e., the change is less than a preset threshold), the recognition model is considered well-trained. For example, after multiple iterations, the training loss function value gradually decreased from the initial 2.3 and stabilized at around 0.05, indicating that the model was able to fit the training data well and accurately capture the relationship between the multi-dimensional features of the bushing surface, such as color, edges, texture, and dirt, and the corresponding type labels. At this point, the trained recognition model can be used for feature extraction and defect identification of subsequent bushing images, ensuring the accuracy and stability of the quality inspection process.

[0127] Using a smaller learning rate ensures smooth parameter updates during training, avoiding oscillations or overfitting. By judging the model's training state through the continuous convergence of the loss function, the learning effect can be objectively evaluated, ensuring the model fully learns the mapping relationship between bushing surface features and type labels. Furthermore, this training method allows the trained model to accurately identify various bushing surface anomalies (such as rust, dirt, or texture abnormalities), improving the accuracy, stability, and robustness of the quality inspection method for heat-treated cross-shaped bushings. This ensures reliable and rapid defect detection of bushings in actual production, improving inspection efficiency and product qualification rate.

[0128] Preferably, in some embodiments of this application, the method further includes:

[0129] The image of the bushing to be identified is processed to obtain the coordinates of the abnormal region in the image; the processing includes:

[0130] The image of the bushing to be identified is denoised using Gaussian filtering, and edge contrast is enhanced using adaptive histogram equalization to obtain the denoised and enhanced image. Specifically, Gaussian filtering is applied to the image of the bushing to be identified to eliminate random noise generated during shooting or sensing, while adaptive histogram equalization enhances the edge contrast of the image, making the bushing edge contour more obvious. For example, for bushings with slight dust or uneven texture on the surface, denoising can smooth out noise points, while the enhanced image can highlight the overall contour of the bushing edge, making subsequent edge extraction more accurate.

[0131] The Canny edge detection algorithm was used to extract the edge contour of the bushing body from the denoised and enhanced image;

[0132] Protrusions in the edge contour that deviate from the main edge curve and meet preset deviation conditions are identified as abnormal regions. The Canny algorithm can suppress noise interference while maintaining edge continuity, resulting in clear edge contours and accurate positioning. For the extracted edge contour, the main edge curve of the bushing is obtained by local smoothing fitting in the horizontal or vertical direction, representing the continuous structure of the bushing edge. Then, protrusions in the edge contour that deviate from the main edge curve are identified as abnormal regions. The deviation conditions include a protrusion length greater than or equal to 5 pixels, a width less than or equal to 2 pixels, and an angle greater than 30° with the main edge curve. For example, protrusions with localized rust or welding spatter on the bushing edge, with a length greater than 5 pixels, a width not exceeding 2 pixels, and a direction significantly deviating from the main edge curve, will be identified as abnormal regions.

[0133] The main edge curve mentioned above is a continuous curve obtained by locally smoothing and fitting the bushing edge profile in the horizontal or vertical direction;

[0134] The deviation condition is that the length of the protrusion structure is greater than or equal to 5 pixels, the width is less than or equal to 2 pixels, and the angle between it and the main edge curve is greater than 30°.

[0135] For each anomalous region, connected component analysis is performed to obtain its two-dimensional coordinate range, which is then recorded as an anomalous region coordinate set. This process accurately marks the location of potential defects on the bushing surface, such as rust spots, dirt protrusions, or slight deformations, providing a basis for subsequent feature comparison in deep learning models or manual quality inspection.

[0136] In the practical application of this embodiment, the abnormal areas in the image of the bushing to be identified are statistically analyzed to obtain the number of burrs, burr density, burr length variation coefficient, and main edge regularity of the image of the bushing to be identified.

[0137] The number of burrs is: the total number of protrusions in the bushing image to be identified that deviate from the main edge curve and meet the preset deviation conditions.

[0138] The burr density is calculated by dividing the number of burrs by the total length of the main edge curve, resulting in the burr density per unit pixel.

[0139] The coefficient of variation for burr length is the ratio of the standard deviation to the mean of all burr lengths.

[0140] The principal edge regularity is the degree of fit between the principal edge curve of the image to be identified and the minimum circumscribed ellipse.

[0141] For example, based on the set of abnormal region coordinates obtained by the aforementioned abnormal region extraction method, the total number of protrusions that deviate from the main edge curve and meet preset deviation conditions is counted as the number of burrs in the image. For instance, if 10 protrusions deviating from the main edge are detected in an image, the number of burrs is 10. Burr density is obtained by dividing the number of burrs by the total length of the main edge curve to obtain the burr density per unit pixel, reflecting the distribution of abnormal protrusions on a unit length of the main edge. For example, if the length of the main edge curve is 500 pixels and the number of burrs is 10, the burr density is 0.02 burrs / pixel. The coefficient of variation for burr length is used to measure the consistency of burr length, and it is calculated as the ratio of the standard deviation to the mean of all burr lengths. For example, for 10 burrs with lengths of 6, 7, 5, 6, 6, 7, 5, 6, 6, 6 pixels, the mean is 6 pixels, the standard deviation is approximately 0.7 pixels, and therefore the coefficient of variation for burr length is 0.7 / 6 ≈ 0.117. This indicator reflects the uniformity of burr length on the bushing surface, aiding in the assessment of processing quality or the stability of the heat treatment process. The main edge regularity is calculated by fitting the main edge curve of the bushing image to its smallest circumscribed ellipse; a higher fit indicates a more regular main edge shape. For example, if the bushing edge does not undergo significant deformation during heat treatment, its main edge regularity may reach above 0.95; if local deformation or warping occurs, the fit will significantly decrease, indicating an anomaly in the main edge. By quantifying the number of burrs, burr density, and length variation coefficient, the quantity, distribution, and morphological characteristics of bushing surface anomalies can be comprehensively evaluated; while the main edge regularity provides a quantitative indicator of the overall edge shape, helping to identify systematic defects generated during heat treatment or processing. Statistical analysis of bushing surface anomalies and main edge features not only assists deep learning recognition models in classification and judgment but also provides quantitative basis for production process control, achieving high-precision and interpretable detection of bushing surface defects, significantly improving the reliability, accuracy, and practicality of the quality inspection method for heat-treated cross-shaped bushings.

[0142] In this embodiment, "burrs" and their quantitative indicators are defined for abnormal areas and main edge features on the bushing surface, and automatic classification and judgment of the bushing surface are achieved based on these indicators. A burr is defined as a raised structure in the bushing edge contour that deviates from the main edge curve, has a length greater than or equal to 5 pixels, a width less than or equal to 2 pixels, and an angle greater than 30° with the main edge. Based on this definition, several quantitative indicators are established, including burr quantity (N), burr density (D), burr length variation coefficient (CV), and main edge regularity (R). Among them, the number of burrs N is used to count the total number of effective burrs in a single frame image; the burr density D is the ratio of the number of burrs to the total length of the main edge curve, used to measure the density of burr distribution per unit length (unit: burrs / pixel); the coefficient of variation of burr length CV is the ratio of the standard deviation of all effective burr lengths to the mean, used to reflect the consistency of burr length; the regularity of the main edge R is calculated by fitting the main edge curve to the minimum circumscribed ellipse, reflecting the edge regularity, and its value range is [0,1]. The closer the value is to 1, the more regular the edge is.

[0143] The main edge regularity R of the heat-treated color block area is ≥0.85, and the number of burrs N≤3; the main edge regularity R of the rusted area is ≤0.6, the number of burrs N≥15, and the burr density D≥0.02; the dirty area usually does not have effective burrs (N≤5), the main edge regularity has no fixed range, but there are grayscale features of dirt adhesion. Based on the above quantitative indicators, this embodiment establishes a classification rule for direct judgment: when the number of burrs N≤3, the main edge regularity R≥0.85, and there are no grayscale features of dirt in the image, the bushing area is directly judged as a heat-treated color block, i.e., a qualified area; when the number of burrs N≥15, the burr density D≥0.02, and the main edge regularity R≤0.6, it is directly judged as a rusted area, i.e., an unqualified area; when the number of burrs N≤5, and there are grayscale features of dirt in the image, it is directly judged as a dirty area, i.e., it needs to be cleaned, without additional cleaning simulation or manual intervention. By strictly defining burrs and their quantitative indicators, and combining edge regularity and grayscale characteristics, direct and automatic identification of different defect types on the bushing surface can be achieved. It can quickly and accurately classify heat-treated color patches, rust, and dirt on the bushing surface without manual intervention, improving quality inspection efficiency and reliability, while providing quantifiable data for production process control, cleaning, or repair.

[0144] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

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

[0146] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make modifications, alterations, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A deep learning-based quality inspection method for heat-treated cross-shaped bushings, characterized in that, include: A bushing image to be identified is obtained, and the bushing image is input into a trained recognition model for recognition to obtain a recognition result; wherein, the recognition model is trained in advance using a training dataset to obtain a trained recognition model; The training dataset includes the sleeve training images used to train the recognition model and their corresponding type labels; The recognition model is an improved convolutional neural network-bidirectional long short-term memory network model, including: A convolutional neural network with residual connections is used to extract features from the image input to the recognition model to obtain an input feature sequence; At least two layers of bidirectional long short-term memory network are used to perform time series modeling on the input feature sequence and output an enhanced time series feature sequence that integrates forward time dependency information and backward time dependency information. The Bahdanau attention-based temporal feature weighting mechanism, set at the output of the last layer in the at least two-layer bidirectional long short-term memory network, is used to weight and fuse the features corresponding to each time step in the enhanced temporal feature sequence to generate a weighted temporal feature representation. The output layer is used to output the recognition result based on the weighted temporal feature representation, and the recognition result is used to characterize the type of the sleeve in the image input to the recognition model.

2. The deep learning-based quality inspection method for heat treatment cross-shaped bushings according to claim 1, characterized in that, The convolutional neural network with residual connections includes multiple deep layers, each deep layer including a convolutional layer, a batch normalization layer, an activation layer, and a residual block; The convolutional neural network is used to extract features from the image input to the recognition model to obtain an input feature sequence, specifically including: In a convolutional neural network, each deep layer performs convolution operations on the feature map of the input image to generate a convolution output feature map. The convolution output feature map is then added to and fused with the input of the residual block. After processing by batch normalization layers and activation layers, the output feature map of that deep layer is formed. Based on the output feature maps of all deep layers in the convolutional neural network, a multi-level spatial feature representation is constructed to characterize the local structural features of the frame image at different scales. The multi-level spatial feature representations are aggregated in the spatial dimension to obtain global structural features; Based on the global structural features, the multi-level spatial feature representations are arranged and serialized according to the global structural distribution direction of the axis in the image to form the input feature sequence of the bidirectional long short-term memory network.

3. The deep learning-based quality inspection method for heat treatment cross-shaped bushings according to claim 2, characterized in that, The determination of the global structural distribution direction of the bushing in the image specifically includes: Global average pooling is performed on the feature maps output by each layer of the convolutional neural network in the spatial dimension to obtain the spatial feature vector of each feature map. The spatial feature vector is used to reflect the overall structural distribution of the axis in the image. Calculate the variance of the spatial feature vector in the horizontal and vertical directions respectively, and take the direction with larger variance as the global structural distribution direction of the axis in the image; The horizontal variance represents the degree of dispersion of the feature distribution in the horizontal direction, while the vertical variance represents the degree of dispersion of the feature distribution in the vertical direction.

4. The deep learning-based quality inspection method for heat treatment cross-shaped bushings according to claim 3, characterized in that, The multi-level spatial feature representation of the convolutional neural network includes multiple feature extraction lines, which are used to extract different types of features on the surface of the sleeve image, including sleeve color features, main edge features, texture features, dirt grayscale distribution features, and the correlation features between edges and textures. The extraction of the bushing color features is achieved by at least one circuit consisting of a convolutional layer and a pooling layer, which is used to capture the color distribution information on the bushing surface. The extraction of main edge features is achieved by at least one convolutional layer, which is used to capture the geometry and regularity of the bushing edge; Texture feature extraction is based on the set formed by the extraction results of the object color features and main edge features, and is achieved through at least one convolutional layer to capture the texture details of the bushing surface. The extraction of dirt grayscale distribution features is achieved by at least one convolutional layer circuit, which is used to detect the distribution of dirt or deposits on the bushing surface; The number of convolutional layer circuits used to extract the correlation features between edges and textures is greater than the number of convolutional layer circuits used to extract individual axis color features, main edge features, and texture features. The extracted features, including bushing color, main edge, texture, dirt grayscale distribution, and the correlation between edge and texture, are fused in a multi-level spatial feature representation to form an input feature sequence for input into the bidirectional long short-term memory network.

5. The deep learning-based quality inspection method for heat treatment cross-shaped bushings according to claim 4, characterized in that, The object color feature circuit consists of two convolutional layers, each with a kernel size of 3×3 and a stride of 1, followed by a 2×2 max pooling layer. Main edge feature line: includes three convolutional layers, with kernel sizes of 3×3, 5×5, and 3×3 for each layer, stride of 1, and a 2×2 max pooling layer at the end; Texture feature circuitry: It consists of four convolutional layers with kernel sizes of 3×3 and strides of 1. Every two convolutional layers are followed by a 2×2 max pooling layer. The line for the grayscale distribution characteristics of dirt includes two convolutional layers with a kernel size of 5×5 and a stride of 1, followed by a 2×2 max pooling layer. Edge and texture association feature circuit: includes five convolutional layers, with convolutional kernel sizes of 3×3 and stride of 1, followed by a 2×2 average pooling layer after every two convolutional layers; Each feature extraction circuit processes the input features layer by layer through convolutional and pooling layers and outputs the results, which are then fused in a multi-level spatial feature representation to form the input feature sequence for inputting into the bidirectional long short-term memory network.

6. The deep learning-based quality inspection method for heat treatment cross-shaped bushings according to claim 5, characterized in that, The process of obtaining enhanced temporal feature sequences in at least two layers of bidirectional long short-term memory networks includes: The first layer of the bidirectional long short-term memory network encodes the forward and backward dependency information of the input feature sequence formed by fusing the output features of multiple layers of the convolutional neural network, and outputs the initial temporal feature sequence. The second-layer bidirectional long short-term memory network employs residual connections, adding the initial temporal feature sequence output from the first layer to the input feature sequence of the first layer element by element as the input feature sequence of the second layer, and modeling its forward and backward dependencies to form an enhanced temporal feature sequence. The initial temporal feature sequence consists of multiple time step features arranged in sequence. Each time step feature corresponds to a local region feature vector formed by the fusion of multiple feature extraction lines after the multi-layer output feature map of the convolutional neural network is fused in the spatial dimension.

7. The deep learning-based quality inspection method for heat treatment cross-shaped bushings according to claim 6, characterized in that, The process of generating weighted temporal feature representations by setting a Bahdanau attention-based temporal feature weighting mechanism at the output of the last layer in the at least two-layer bidirectional long short-term memory network includes: For the local region feature vector at each time step, the attention score is calculated based on the similarity between the feature vector and the global structural feature vector formed by the aggregation of the input feature sequence output by the convolutional neural network in the spatial dimension. The calculated attention scores are normalized and used as weights in the local region feature vectors at the corresponding time steps. The feature vectors at all time steps are then summed in a weighted manner to obtain a weighted temporal feature representation.

8. The deep learning-based quality inspection method for heat treatment cross-shaped bushings according to claim 7, characterized in that, The training dataset of bushing training images includes the following type labels: a first type label for identifying bushings as qualified, a second type label for identifying bushings as rusted, and a third type label for identifying bushings as dirty. The recognition model is trained using a training dataset, and the training method includes: The parameters of the recognition model are iteratively updated using an optimization algorithm with a learning rate of 0.001; In each training round, the function value of the pre-defined loss function for the training dataset is calculated; If the training loss function converges in several consecutive training rounds, the recognition model is determined to be a well-trained recognition model and can be used for feature extraction and defect recognition of subsequent sleeve images.

9. The deep learning-based quality inspection method for heat treatment cross-shaped bushings according to claim 7, characterized in that, The method further includes: The image of the bushing to be identified is processed to obtain the coordinates of the abnormal region in the image; the processing includes: Gaussian filtering is applied to the image of the bushing to be identified to remove noise, and adaptive histogram equalization is used to enhance edge contrast, resulting in the denoised and enhanced image. The Canny edge detection algorithm was used to extract the edge contour of the bushing body from the denoised and enhanced image; Protruding structures in the edge contour that deviate from the main edge curve and meet the preset deviation conditions are identified as abnormal regions. The main edge curve is a continuous curve obtained by locally smoothing and fitting the bushing edge profile in the horizontal or vertical direction. The deviation condition is that the length of the protrusion structure is greater than or equal to 5 pixels, the width is less than or equal to 2 pixels, and the angle between it and the main edge curve is greater than 30°. For each anomalous region, perform connectivity analysis to obtain its two-dimensional coordinate range and record it as a set of anomalous region coordinates.

10. The deep learning-based quality inspection method for heat treatment cross-shaped bushings according to claim 9, characterized in that, Statistical analysis is performed on the abnormal regions in the image of the bushing to be identified to obtain the number of burrs, burr density, burr length variation coefficient, and main edge regularity of the image of the bushing to be identified. The number of burrs is: the total number of protrusions in the bushing image to be identified that deviate from the main edge curve and meet the preset deviation conditions. The burr density is calculated by dividing the number of burrs by the total length of the main edge curve, resulting in the burr density per unit pixel. The coefficient of variation for burr length is the ratio of the standard deviation to the mean of all burr lengths. The principal edge regularity is the degree of fit between the principal edge curve of the image to be identified and the minimum circumscribed ellipse.

Citation Information

Patent Citations

  • Shaft sleeve part surface defect on-line detection method based on compressed sensing

    CN104063873A

  • Traffic sign detection method and device based on multi-feature fusion and storage medium

    CN116052129A

  • Industrial automatic quality detection device based on image recognition

    CN119006394A

  • Image classification method and system based on space attention and sequence modeling

    CN120689674A

  • Garbage classification method and system based on bidirectional long-short-term memory network and convolutional neural network

    CN120808033A