A bearing sleeve surface roughness fusion dataset construction and image and parameter double branch fusion detection method
By constructing a bearing sleeve surface roughness fusion dataset and adopting an image-parameter dual-branch fusion detection method, the stability problem of bearing sleeve surface texture detection was solved, and effective modeling and interaction between local texture and global statistical information were realized, thereby improving the accuracy and stability of detection.
Patent Information
- Application Number
- CN202611482560.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-22
- Publication Date
- 2026-11-27
AI Technical Summary
Existing technologies struggle to effectively capture and process the surface texture of bearing sleeves, especially when dealing with complex curved surfaces and varying viewing angles. The complementary relationship between image features and parametric features is not fully utilized, resulting in insufficient accuracy and stability in roughness detection.
A bearing sleeve surface roughness fusion dataset was constructed, and an image-parameter dual-branch fusion detection method was adopted. Features were extracted through convolutional neural networks and visual Transformer networks. Combined with a bidirectional cross-fusion module and an attention recalibration module, complementary modeling and interaction of local texture and global statistical information were achieved.
It improves the accuracy and stability of bearing sleeve surface roughness level prediction, reduces feature redundancy, enhances adaptability to changes in imaging angle and surface structure, and improves the discrimination stability and probability output calibration performance of the detection.
Smart Images

Figure CN123181979A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for constructing a bearing sleeve surface roughness fusion dataset and a dual-branch fusion detection method combining images and parameters. Background Technology
[0002] With the development of precision manufacturing and intelligent industrial inspection technologies, the requirements for surface roughness inspection of sleeve-type parts are constantly increasing in terms of inspection efficiency and result stability. Bearing sleeves are characterized by deep, closed holes, limited inner wall space, and complex curved surface structures, making the acquisition and characterization of their surface textures quite challenging. Traditional contact measurement methods are inefficient and difficult to apply to the inner surface of bearing sleeves. While non-contact machine vision methods based on industrial cameras can acquire surface textures and combine them with learning models to achieve roughness inspection, the direction, scale, and grayscale distribution of the texture are easily shifted due to the influence of imaging angle, curved surface structure, and lighting conditions, affecting the stability of roughness characterization.
[0003] Existing machine vision-based surface roughness detection methods mainly fall into two categories: parametric feature modeling and image feature modeling. Regarding parametric feature modeling, Li Siyi et al.'s 2024 paper, "A multifeature fusion model for surface roughness measurement of cold-rolled strip steel based on laser speckle," extracted gray-level co-occurrence matrix (GLCM) parameters from speckle images for steel surface roughness prediction, verifying the characterization role of statistics such as contrast, energy, entropy, and homogeneity. Chen Zixin et al.'s 2013 paper, "Application of gray level co-occurrence matrix method in characterization of cylindrical grinding surface roughness," studied the differences between GLCM features and Ra values at different scales and orientations. Ganesha Prasad et al.'s 2024 paper, "A study of dimensionality reduction in GLCM feature-based classification of machined surface," further investigated the differences between GLCM features and Ra values at different scales and orientations. The "images" patent proposed a method for GLCM feature dimensionality reduction and discriminative feature selection; the published patent CN114627048A proposed a workpiece roughness measurement method based on a mobile terminal. This method acquires workpiece surface images through a mobile terminal, extracts GLCM texture features after focusing region extraction and image enhancement, and inputs the extracted features into a convolutional neural network to achieve roughness level recognition. These methods verify the feasibility of combining GLCM statistical features with neural networks for roughness detection. However, most methods treat GLCM features as single parameter inputs, focusing on the selection, combination, or dimensionality reduction of statistical quantities. They give less consideration to the complementary relationship and interactive fusion between local texture image features and global GLCM statistical features, and the utilization of pixel distance, statistical direction, and structural correlations and contribution differences between statistical quantities remains limited.
[0004] In image feature modeling, Sun Hao et al.'s 2024 paper, "Surface roughness classification using light scattering matrix and deep learning," used the ResNet50 residual network to classify the roughness of workpiece speckle images, verifying the residual network's ability to represent local texture and edge information. However, the stability of feature representation remains insufficient when acquisition conditions and sample distribution change. Leonardo Scabini et al.'s 2025 review of texture analysis, "A comparative survey of vision transformers for feature extraction in texture analysis," shows that the Vision Transformer (ViT) can establish global associations between image features through tokens and self-attention mechanisms. Such methods can autonomously extract texture, edge, and shape features, but for complex curved surfaces of bearing sleeves and texture direction, scale, and gray-level distribution shifts caused by changes in viewing angle, relying solely on image feature modeling still falls short in utilizing multi-scale, multi-directional gray-level statistical relationships.
[0005] To balance local texture information with global statistical information, existing research has begun to adopt multi-feature fusion methods. The 2023 paper by Yang Yue et al., "Workpiece Surface Roughness Detection Based on Improved GLCM and Tamura Features," uses a method that fuses improved GLCM and Tamura features to achieve complementarity between statistical and visual texture information. The 2026 paper by Dong Liangzhen et al., "Surface Roughness Detection Method Fusion of Dual-Channel Features," uses multi-kernel Gabor convolution and Transformer to extract local and global image features respectively, followed by splicing and fusion. The 2024 paper by Eyeb Mengiste et al., "Transfer-learning and texture features for recognition of the conditions of construction materials with small data sets," concatenates Inception V3 image features with GLCM features for material state recognition. Public patent CN121544610A proposes inputting parametric features and image grayscale features into an enhanced neural network and using a multi-head self-attention mechanism for feature fusion to achieve surface roughness prediction in machining. The methods described above validate the complementarity between different representations, but the utilization of the internal structural relationships of texture parameters remains insufficient. Image features and parametric features mainly interact during the fusion stage, while cross-representation information interaction during feature extraction remains limited. Furthermore, image features and parametric features differ in data format, scale, and semantics, making simple concatenation or direct splicing prone to feature redundancy or insufficient utilization of complementary information. In addition, the texture differences between adjacent roughness levels are small, making it difficult to adaptively adjust the class score distribution based on different sample features using a fixed-temperature Softmax mapping, which can easily lead to confusion of classification boundaries between adjacent levels.
[0006] Therefore, there is an urgent need to provide a method for constructing a fusion dataset of bearing sleeve surface roughness and a dual-branch fusion detection method of image and parameters, so as to achieve stable acquisition and processing of the texture of the inner and outer surfaces of the bearing sleeve, establish the correspondence between texture images, gray-level statistical parameters and roughness level labels, and effectively model, interact and fuse local texture features and global gray-level statistical features while retaining GLCM pixel distance, statistical direction and statistical structure information, and adaptively adjust the category response of different samples, thereby improving the accuracy and stability of bearing sleeve surface roughness level prediction. Summary of the Invention
[0007] This invention provides a method for constructing a bearing sleeve surface roughness fusion dataset and a dual-branch fusion detection method for images and parameters in order to solve the problems existing in the prior art.
[0008] The technical solutions adopted in this invention are as follows:
[0009] A method for constructing a fusion dataset of bearing sleeve surface roughness and for image and parameter dual-branch fusion detection, including a fusion dataset construction stage and an image and parameter dual-branch fusion detection stage;
[0010] The fusion dataset construction phase includes:
[0011] Texture images of the inner surface of the bearing sleeve, the outer surface of the bearing sleeve, and the standard roughness sample block were obtained respectively, and the roughness level label corresponding to each texture image was determined.
[0012] The collected texture images are preprocessed, and the preprocessed texture images are segmented without overlap and augmented with data. The training set, validation set and test set are divided with the physical specimen as the smallest dividing unit to construct the texture image dataset.
[0013] For each texture image in the texture image dataset, the gray-level co-occurrence matrix is calculated under multiple pixel distances and multiple statistical directions. Multiple types of texture statistics are extracted from the gray-level co-occurrence matrix to form a parameter vector corresponding to the sample number of the texture image, and a parameter dataset is constructed.
[0014] By associating texture images, parameter vectors, and roughness level labels one by one according to sample numbers, a fused dataset is constructed.
[0015] The image and parameter dual-branch fusion detection stage includes:
[0016] An image-parameter dual-branch fusion detection network is constructed, which includes an image branch, a parameter branch, a bidirectional cross-fusion module, an attention recalibration module, and a classification layer.
[0017] Texture images and parameter vectors with the same sample number in the fused dataset are input into the image branch and parameter branch, respectively. The image branch uses a convolutional neural network as the backbone to extract features from the texture images to obtain image features. The parameter branch uses a visual Transformer network as the backbone. Based on the correspondence between pixel distance, statistical direction and texture statistics of each dimension of the parameter vector, the parameter vector is organized into multiple structured feature units. After weighting each structured feature unit, the global statistical relationship between different structured feature units is established through the visual Transformer encoder to obtain parameter features.
[0018] The bidirectional cross-fusion module includes an intermediate feature interaction module and a high-level feature fusion module. The intermediate feature interaction module uses the image features output from the intermediate layer of the image branch as keys and values, and the parameter features output from the intermediate layer of the parameter branch as queries. It aggregates the information of the image features through cross attention to update the parameter features, and generates gating weights from the updated parameter features to modulate the image features element by element. The interacting image features and parameter features continue to be extracted along their respective branches. The high-level output features of the two branches are again interacted with by the intermediate feature interaction module. The high-level feature fusion module then aligns the dimensions of the interacting image features and parameter features and concatenates them to obtain the fused features.
[0019] The attention recalibration module performs channel attention recalibration and spatial attention recalibration on the fused features;
[0020] The classification layer maps the recalibrated fusion features to category scores for various roughness levels, generates dynamic temperatures related to the samples based on the fusion features, scales the category scores of the same sample using the same dynamic temperature, and outputs the probabilities of various roughness levels through the Softmax function.
[0021] The image-parameter dual-branch fusion detection network was trained under supervision using a fusion dataset to obtain a trained detection model.
[0022] Following the same preprocessing and parameter vector extraction methods as in the fusion dataset construction phase, the corresponding texture images and parameter vectors of the bearing sleeve under test are obtained. These are then input into the image branch and parameter branch of the trained detection model, respectively, and the surface roughness level of the bearing sleeve under test and the probability of each roughness level are output.
[0023] Furthermore, in the fusion dataset construction phase,
[0024] When acquiring the texture image of the inner surface of the bearing sleeve, a camera is used in conjunction with an endoscope for imaging, and a ring light source illuminates the inner surface of the bearing sleeve through the through hole of the perforated base supporting the bearing sleeve.
[0025] When acquiring texture images of the outer surface of the bearing sleeve and the standard roughness sample block, a camera is used in conjunction with a telecentric lens for imaging. Strip light sources are symmetrically arranged on both sides of the object being measured, and the illumination directions of the strip light sources on both sides are at a 45° angle to the surface of the object being measured.
[0026] Furthermore, for the acquired annular texture image of the inner surface of the bearing sleeve, Hough circle detection is first used to determine the center, inner radius and outer radius of the annular texture image. With the center as the origin of polar coordinates, the annular texture image is expanded into a rectangular texture image through inverse coordinate mapping. The mapping coordinates are sampled from the nearest neighbor pixels and constrained within the effective pixel range.
[0027] The preprocessing of all texture images includes target region extraction, grayscale conversion, and noise suppression: adaptive binarization and Canny edge detection are used to extract texture boundaries and the target region is cropped according to the maximum bounding rectangle; weighted grayscale conversion is performed and constructed into a three-channel form; median filtering is performed using 3×3, 5×5, and 7×7 neighborhood windows in sequence. When the difference between the center pixel and the neighborhood median exceeds the adaptive threshold, the center pixel is replaced with the corresponding neighborhood median; the adaptive threshold is set according to the standard deviation of the pixel grayscale values in the corresponding neighborhood window.
[0028] Furthermore, when extracting the gray-level co-occurrence matrix parameters, the number of gray levels is set to 256, the pixel distance includes 1 pixel, 2 pixels, 3 pixels and 4 pixels, the statistical directions include 0°, 22.5°, 45°, 67.5°, 90°, 112.5°, 135° and 157.5°, a total of eight directions, and the texture statistics include contrast, correlation, energy, homogeneity, dissimilarity, second moment of angle, two-dimensional entropy and differential entropy, a total of eight categories; the four pixel distances, eight statistical directions and eight categories of texture statistics together form a 256-dimensional parameter vector.
[0029] Furthermore, the image branch uses a 50-layer deep residual network ResNet50 as its backbone, and extracts image features through a four-stage residual bottleneck structure consisting of 7×7 convolution, batch normalization, 3×3 max pooling, and so on. After the output of the second residual bottleneck structure, a convolutional block attention module is set to recalibrate the channel response and spatial response.
[0030] Furthermore, when extracting parameter features through parameter branches, the parameter vector is organized into multiple structured feature units based on the correspondence between pixel distance, statistical direction, and texture statistics.
[0031] The eight statistical directions are reorganized into four direction groups: {0°, 90°}, {22.5°, 157.5°}, {45°, 135°}, and {67.5°, 112.5°}. Each direction group is combined with four pixel distances. The eight texture statistics corresponding to the same pixel distance and the two directions in the same direction group form a 16-dimensional structured feature unit, resulting in a total of 16 structured feature units.
[0032] Prediction function with trainable weights Based on the complete parameter vector The responses of each structured feature unit are generated, and the gating weights of the i-th structured feature unit are obtained by activating them with the Sigmoid function. ,in For the Sigmoid function; introduce a lower gate limit. Adjust the lower limit of the gating weight. ;
[0033] The lower bound adjusted gating weights are applied to the i-th structured feature unit. Weighting is performed to obtain the weighted structured feature units. The weighted structured feature units are then embedded, mapped, and encoded at location, and a global statistical relationship is established using a visual Transformer encoder.
[0034] Furthermore, the bidirectional cross-fusion module includes an intermediate feature interaction module and a high-level feature fusion module. The intermediate feature interaction module first expands the image features into a sequence and projects the image features and parameter features into a unified embedding space. It constructs a query with the projected parameter features and constructs keys and values with the projected image features. It then aggregates image information through cross-attention to update the parameter features. The updated parameter features are then compressed by feature units and gating weights are generated by the Sigmoid function to modulate the image features element by element. The interacting image features and parameter features continue to extract high-level features along their respective branches. The high-level features of the two branches exchange information again through the intermediate feature interaction module, and then the high-level feature fusion module performs dimensional alignment and splicing to obtain the fused features.
[0035] Furthermore, when recalibrating the fused features with channel attention, the fused features are divided into image features and parameter features according to their source. Global pooling, nonlinear mapping and Sigmoid function activation are performed on them respectively to obtain image channel weights and parameter channel weights. The two types of channel weights are then concatenated into the overall channel weights.
[0036] When spatial attention recalibrates the fused features, the parameter features are mapped to a guide map that matches the spatial resolution of the image features. The guide map, the average pooling response and the max pooling response of the image features are concatenated and then activated by convolution and the Sigmoid function to generate spatial attention weights.
[0037] Furthermore, when generating the dynamic temperature related to the sample, a trainable mapping consisting of layer normalization, first linear mapping, first batch normalization, modified linear unit activation, second linear mapping, sigmoid function activation, third linear mapping, second batch normalization, modified linear unit activation, fourth linear mapping and sigmoid function activation is used to generate a sample uncertainty estimate U with a value range of 0 to 1 based on the fusion features.
[0038] According to the lower limit of temperature Upper temperature limit And can learn global base temperature Constructing a dynamic temperature function This makes the dynamic temperature and the sample uncertainty estimate have an inverse adjustment relationship. Clip is a numerical constraint operation that constrains the dynamic temperature between the lower limit and the upper limit of the temperature.
[0039] Scoring of each category for the same sample using the same dynamic temperature. Scaling is performed to obtain the recalibrated category scores. .
[0040] Furthermore, when training the detection network, the cross-entropy loss function is used, and the roughness level label is used as the supervision signal for supervised training. The detection network is trained from the initial parameters, without using external pre-trained weights, and the completed detection model is determined based on the validation results of the validation set.
[0041] The present invention has the following beneficial effects:
[0042] (1) This invention sets up suitable imaging and illumination methods for the inner surface, outer surface and standard roughness sample of the bearing sleeve: the inner surface is imaged using an endoscope, and a ring light source illuminates the inner surface of the bearing sleeve from the bottom through the through hole of the perforated base; the outer surface and standard roughness sample are imaged using a telecentric lens, and symmetrically arranged strip light sources provide 45° illumination on both sides, which alleviates the difficulty of texture acquisition caused by the closed deep hole and limited inner wall space of the bearing sleeve. Furthermore, this invention divides the training set, validation set and test set with the physical specimen as the smallest dividing unit, and associates the texture image, parameter vector and roughness level label one by one according to the sample number to construct a fusion dataset; wherein, the texture image represents local texture and spatial morphology information, and the gray-level co-occurrence matrix parameter represents gray-level statistical information under multi-pixel distance and multi-statistical direction conditions, so that the two branches obtain paired inputs with consistent sources and complementary representations, and are less affected by texture shift caused by imaging angle, curved surface structure and illumination conditions, providing a reliable data foundation for subsequent feature extraction, interaction and fusion.
[0043] (2) The parameter branch of this invention organizes the parameter vector into multiple structured feature units based on the correspondence between the pixel distance, statistical direction and texture statistics of each dimension parameter in the parameter vector. It uses a trainable weight prediction function to generate the gating weight of each structured feature unit based on the complete parameter vector, weights each structured feature unit and introduces a lower limit of gating to avoid a certain set of information being completely suppressed due to the small gating response. This enables the parameter branch to realize global modeling of multi-scale and multi-directional gray-scale statistical information on the basis of preserving the structural correlation of the gray-scale co-occurrence matrix, and makes up for the shortcomings of existing parameter modeling in not making full use of the structural correlation and contribution difference between pixel distance, statistical direction and statistics.
[0044] (3) This invention sets up a bidirectional cross-fusion module. The intermediate feature interaction module updates the parameter features during feature extraction by using parameter features as queries and image features as keys and values. The updated parameter features generate gating weights to modulate the image features element by element, realizing bidirectional information interaction between image features and parameter features. The gray-level statistical information of parameter branch modeling is injected into the image branch during feature extraction, making up for the problem of insufficient utilization of multi-scale and multi-directional gray-level statistical relationships in image feature modeling. The high-level feature fusion module performs dimensional alignment and splicing of the high-level features of the two branches. The fused features are then recalibrated by channel attention and spatial attention to enhance the effective features related to roughness and suppress redundant and interference information. Compared with the existing technology that performs single interaction or direct splicing in the fusion stage, this invention reduces fusion redundancy and realizes the synergistic utilization of local texture information and global statistical information throughout the feature extraction process.
[0045] (4) The image branch of this invention introduces a convolutional block attention module in the shallow feature extraction stage of the residual network ResNet50 to enhance the channel and spatial texture response related to roughness; the classification layer generates dynamic temperature related to the sample based on the fusion features, and uses the same dynamic temperature to scale the scores of each category of the same sample, and outputs the probability of each roughness level through the Softmax function, so that the adjustment of the category score is adapted to the sample uncertainty: when the uncertainty is high, the relative difference between category scores is enhanced, and when the uncertainty is low, the category response is smoothed, thereby reducing the boundary confusion between adjacent roughness levels and improving the accuracy of roughness level prediction, discrimination stability and calibration performance of probability output. Attached Figure Description
[0046] Figure 1 This is a schematic diagram of the overall framework of the image-parameter dual-branch fusion detection network of the present invention;
[0047] Figure 2 This is a schematic diagram illustrating the principle of the dynamic temperature enhancement module of the present invention;
[0048] Figure 3 This is a schematic diagram of the structured feature unit division of the gray-level co-occurrence matrix parameters of the present invention;
[0049] Figure 4 This is a schematic diagram of the channel and spatial attention recalibration mechanism for the fusion features of this invention;
[0050] Figure 5 This is a schematic diagram of the bidirectional cross-fusion module of the present invention;
[0051] Figure 6 This is a schematic diagram of the bearing sleeve surface texture image acquisition platform of the present invention;
[0052] Figure 7This is a schematic diagram of the image acquisition platform of the present invention, wherein:
[0053] (a) is the bearing sleeve acquisition platform, and (b) is the standard roughness sample acquisition platform;
[0054] Figure 8 This is a schematic diagram of the original image of the annular texture on the inner surface of the bearing sleeve of the present invention;
[0055] Figure 9 This is a schematic diagram of the rectangular texture image after the annular texture on the inner surface of the bearing sleeve of the present invention has been unfolded.
[0056] Figure 10 This is a schematic diagram of the texture image preprocessing process of the present invention;
[0057] Figure 11 This is a schematic diagram of the texture images of the six types of standard roughness samples of the present invention, wherein:
[0058] (a) corresponds to Ra 0.05 μm, (b) corresponds to Ra 0.1 μm, (c) corresponds to Ra 0.2 μm, (d) corresponds to Ra 0.4 μm, (e) corresponds to Ra 0.8 μm, and (f) corresponds to Ra 1.6 μm.
[0059] Figure 12 This is a schematic diagram of the texture images of the surfaces of four types of bearing sleeves according to the present invention, wherein:
[0060] (a) corresponds to Ra0.1μm, (b) corresponds to Ra0.2μm, (c) corresponds to Ra0.4μm, and (d) corresponds to Ra0.8μm;
[0061] Figure 13 This is a schematic diagram comparing the prediction results of bearing sleeve surface roughness levels using different detection models of the present invention, wherein:
[0062] (a) is the ResNet50 baseline model, (b) is the improved image branch model, (c) is the dual-branch fusion model of this invention, (d) is the CNN-Transformer model, (e) is the DBFF-Net model, and (f) is the GLCM-DNN model. Detailed Implementation
[0063] The invention will now be further described with reference to the accompanying drawings.
[0064] like Figure 6 As shown, the image acquisition platform in this embodiment includes a camera 1, an endoscope 2, a strip light source 3, a light source bracket 4, a telecentric lens 6, a camera tripod 7, a base with holes 8, a ring light source 9, a rotating platform 10, and a three-axis moving platform 11. The bearing sleeve 5 is the workpiece to be acquired.
[0065] Camera 1 is a Hikvision MV-CS200-10UC 20-megapixel industrial camera, which, together with endoscope 2 and telecentric lens 6, forms imaging pathways for the inner and outer surfaces. In this embodiment, the dimensions of the bearing sleeves acquired range from 25mm×38mm×57mm to 12mm×16mm×20mm. Endoscopic and lateral telecentric imaging modes are set according to the imaging positions of the inner and outer surfaces, respectively. The relative positions are adjusted by a motion platform, and bottom ring illumination and bilateral strip illumination meet the acquisition requirements of the inner and outer walls, respectively.
[0066] When acquiring the inner surface image, the bearing sleeve 5 is placed on the perforated base 8, aligning the inner hole with the through hole of the base. The perforated base 8 is positioned on the rotating platform 10, and the ring light source 9 is located below the perforated base 8, providing supplemental lighting to the inner wall through the through hole. The relative position of the imaging device and the bearing sleeve 5 is adjusted using the three-axis moving platform 11, aligning the endoscope 2 with the inner hole and cooperating with the camera 1 to acquire the ring-shaped texture of the inner surface. The endoscope 2 is a PRHI230-82 model, suitable for inner hole diameters of 5–120 mm and imaging depths of 4–120 mm, meeting the requirements for inner wall acquisition. The acquired ring-shaped image is then reconstructed and unfolded before entering the preprocessing stage.
[0067] When acquiring images of the outer surface, the lateral camera 1 is supported by a camera tripod 7 and works in conjunction with the telecentric lens 6 to image the outer surface of the bearing sleeve 5. A strip light source 3 is positioned on both sides of the workpiece via a light source bracket 4, providing 45° illumination from both sides. The rotating platform 10 drives the bearing sleeve 5 to rotate in 15° increments, sequentially acquiring texture images at different circumferential positions. The positions of the light source bracket 4 and the imaging device are adjusted so that the texture area to be acquired enters the field of view and receives appropriate illumination. Images obtained from different positions on the same bearing sleeve 5 retain the same physical specimen affiliation for subsequent data subset partitioning.
[0068] When acquiring the texture image of the standard roughness sample block, the lens of the upper camera 1 is replaced with a telecentric lens 6. The relative position of the imaging device and the sample block is adjusted by the three-axis moving platform 11 so that the area to be acquired is within the imaging field of view and the focus is completed. The standard roughness sample block is 23mm×20mm in size and covers surfaces machined by grinding, surface grinding, external grinding and surface milling.
[0069] The telecentric lens 6 is a Wollaston M150-04XMPM type telecentric lens with a working field of view of 36.0mm×27.0mm to meet the requirements of sample block texture imaging; the strip light source 3 is arranged on both sides of the sample block through the light source bracket 4, using dual-sided 45° illumination to improve the surface brightness and texture grayscale contrast of the sample block, and to obtain the benchmark sample image used for the construction of the fusion dataset. Figure 7 The image shows the physical platform for collecting bearing sleeves and standard sample blocks. Figure 7 (a) shows the bearing sleeve acquisition platform. Figure 7 (b) is the standard sample collection platform.
[0070] The measurement and evaluation of surface roughness grades shall be carried out in accordance with GB / T3505-2009 and GB / T10610-2009, using a Mitutoyo SJ-210 roughness tester, with a sampling length of 0.8 mm and an evaluation length of 4.0 mm.
[0071] Measurements are taken at multiple locations on the workpiece, with at least three repeated measurements at each location. If the results of all repeated measurements are within the allowable range for the corresponding Ra grade, the roughness grade is confirmed in conjunction with the company's factory quality inspection results. Measurement and evaluation results are used to establish training and evaluation labels, while image acquisition provides input for network detection; the two correspond at the sample level.
[0072] like Figure 8 The image shown is of the inner surface of the bearing sleeve, with a ring-shaped texture. First, the target ring region and its center are obtained using Hough circle detection. Then, the ring region is unfolded circumferentially into a rectangular image with the center (a, b) as the origin of the polar coordinates. To avoid pixel holes caused by forward mapping, inverse coordinate mapping is used, determining the corresponding polar radius and polar angle based on the pixel position in the unfolded image.
[0073] , ,
[0074] Then, based on the angle and radial position, calculate the corresponding coordinates in the original image, and map the polar coordinates to the Cartesian coordinate system of the original image: , ,
[0075] in, Here are the coordinates of the unfolded diagram, where W and H are the width and height of the unfolded diagram, respectively. and These are the inner and outer radii of the annular region, respectively. These are the mapped coordinates.
[0076] The final mapped coordinates are sampled using nearest neighbor pixels with rounding, and the sampling position is limited to the effective pixel range of the original image by boundary cropping. The circular unfolding effect is as follows: Figure 9 As shown in the figure. This yields a rectangular inner surface texture image for subsequent preprocessing and feature extraction.
[0077] like Figure 10As shown, the texture image obtained through the aforementioned steps is subjected to target region extraction, grayscale conversion, and noise suppression. First, adaptive binarization and Canny edge detection are used to extract image boundaries, and the target region is cropped according to the maximum bounding rectangle to reduce the influence of invalid background on texture feature extraction. Subsequently, weighted grayscale conversion is performed based on the ITU-R BT.601 standard, where the weighting coefficients for the red, green, and blue channels are 0.299, 0.587, and 0.114, respectively, and the grayscale image is constructed in a three-channel format to adapt to the input requirements of the image branch.
[0078] To suppress impulse noise generated by sensor anomalies during image acquisition, a variable window optimized median filter is employed. The filter sequentially uses 3×3, 5×5, and 7×7 neighborhood windows to detect abnormal pixels. When the difference between the center pixel and the neighborhood median exceeds an adaptive threshold, the center pixel is replaced with the corresponding neighborhood median. Pixels that do not meet the anomaly detection criteria retain their original values. This approach suppresses abnormal noise while minimizing the impact on effective texture details. The adaptive threshold is set based on the standard deviation of the pixel grayscale values within the corresponding neighborhood window.
[0079] This embodiment constructs a roughness texture image dataset, with samples sourced from two parts: bearing sleeves and standard roughness samples. A total of 30 bearing sleeves and 34 standard roughness samples, comprising 64 physical specimens, were used. 10-20 original images were acquired for each bearing sleeve, and 5 original images were acquired for each standard sample. Each original image was segmented into 512×512 pixels without overlap, yielding approximately 10-20 sub-images. Data enhancement was performed through flipping, rotation, contrast adjustment, and brightness adjustment, ultimately resulting in 10,756 texture images.
[0080] like Figure 11 As shown, the standard roughness sample blocks cover six roughness levels Ra: 0.05, 0.1, 0.2, 0.4, 0.8, and 1.6 μm; Figure 12 As shown, the bearing sleeve samples cover four roughness levels Ra: 0.1, 0.2, 0.4, and 0.8 μm. Bearing sleeves with Ra values of 0.1 μm and 0.2 μm correspond to ultra-fine ground surfaces, while those with Ra values of 0.4 μm and 0.8 μm correspond to finely ground surfaces. Since actual bearing sleeves primarily cover the roughness level range of Ra 0.1 to Ra 0.8, standard sample blocks are used to supplement two boundary levels: Ra 0.05 μm and Ra 1.6 μm. This expands the classification boundaries of the dataset and, together with the bearing sleeve samples, constitutes a six-level roughness texture image dataset.
[0081] The texture image dataset was divided into a training set, a validation set, and a test set, with an image ratio of approximately 8:1:1. Physical specimens were used as the smallest unit of division, and the three subsets contained 44, 10, and 10 physical specimens, respectively. All original images, segmented sub-images, and enhanced images generated from the same physical specimen were assigned to the same subset to maintain consistency in the attribution of samples from the same source.
[0082] Based on the texture image dataset, the gray-level co-occurrence matrix (GLCM) algorithm is used to extract GLCM parameters. Pixel distances and statistical directions are set according to the scale and directional characteristics of the texture to construct parameter data corresponding to each texture image. The number of gray levels is set to 256, and the pixel spacing is set to d=1, 2, 3, and 4. d=1 and 2 reflect fine-grained, local texture structure, while d=3 and 4 reflect the large-scale gray-level variation trend, thus obtaining texture statistical information at different scales. The statistical directions are set to 0°, 22.5°, 45°, 67.5°, 90°, 112.5°, 135°, and 157.5° to characterize the texture distribution features in different directions.
[0083] For any combination of pixel distance and statistical direction, count the pixel grayscale value pairs with the aforementioned spatial relationship and construct the corresponding grayscale co-occurrence matrix. Let the number of times a pixel with grayscale value i and a pixel with grayscale value j co-occur is denoted as . The normalized gray-level co-occurrence probability is expressed as:
[0084] ,
[0085] in, This represents the number of times pixel pairs with gray values i and j co-occur at a given pixel distance and statistical direction. The grayscale level is denoted by .
[0086] For each set of pixel distances and statistical directions, eight types of texture statistics are extracted from the gray-level co-occurrence matrix.
[0087] The first category is contrast, and its calculation expression is: It is used to reflect the intensity of local grayscale changes.
[0088] The second category is correlation, and its calculation expression is: This is used to measure the degree of linear correlation between the gray levels of adjacent pixels. , These represent the mean gray levels in the row and column directions of the gray-level co-occurrence matrix, respectively. , These are the gray-level standard deviations in the row and column directions of the gray-level co-occurrence matrix, respectively, used to measure the degree of linear correlation between the gray levels of adjacent pixels.
[0089] The third category is energy, and its calculation formula is: It is used to reflect the uniformity of the texture.
[0090] The fourth category is homogeneity, and its calculation expression is: It is used to assign higher weights to pixel pairs with small grayscale changes.
[0091] The fifth category is dissimilarity, and its calculation expression is: It is used to measure the fineness of the texture.
[0092] The sixth type is the Angular Second Moment (ASM), whose calculation expression is: It is used to measure the regularity of texture.
[0093] The seventh category is two-dimensional entropy, whose calculation expression is: It is used to reflect the uncertainty of grayscale distribution.
[0094] The eighth category is Differential Entropy (DE), whose calculation expression is: , used to characterize the complexity of grayscale difference distribution.
[0095] A 256-dimensional gray-level co-occurrence matrix parameter vector is formed by 4 pixel distances, 8 statistical directions, and 8 types of texture statistics. A correspondence is established according to the sample number consistent with the texture image to form a gray-level co-occurrence matrix parameter dataset.
[0096] Each texture image is associated with its corresponding 256-dimensional gray-level co-occurrence matrix parameter vector according to its sample number, and assigned a corresponding roughness level label to form a fused dataset. The texture image is used to represent the local texture spatial distribution, and the gray-level co-occurrence matrix parameters are used to describe the gray-level statistical relationships of the same image under multiple distance and direction conditions. Both types of data share the same sample number and level label.
[0097] When constructing the fused dataset, the gray-level co-occurrence matrix parameter record inherits the physical specimen affiliation and training set, validation set, or test set affiliation of the corresponding texture image. During training, validation, and testing, the texture image, gray-level co-occurrence matrix parameter vector, and roughness level label are read synchronously according to the sample number, and the texture image and parameter vector are respectively input into the corresponding branch, so that the features of the two branches always originate from the same texture sample, and the roughness level label is used for supervised learning.
[0098] Overall network such as Figure 1As shown, the system consists of an image branch, a parameter branch, a bidirectional cross-fusion module, and a classification layer. The image branch takes the texture image as input to extract local texture and shape features; the parameter branch takes the gray-level co-occurrence matrix parameter vector as input to model multi-scale, multi-directional gray-level statistical relationships. During feature extraction, the two branches exchange intermediate information through the bidirectional cross-fusion module and complete feature fusion at a higher level. The fused features are then processed by an attention recalibration module, a multilayer perceptron, and a dynamic temperature enhancement module to classify the roughness level.
[0099] The image branch uses a 50-layer deep residual network, ResNet50, as its backbone. It extracts local texture and morphological features of the bearing sleeve surface through convolution and residual structures at each level. After the shallow feature extraction stage (after the output of the second residual bottleneck structure), a convolutional block attention module is introduced to enhance the texture response related to roughness from both channel and spatial dimensions. The attention-enhanced image features continue to be extracted along the residual network and participate in cross-branch feature interaction at designated intermediate layers. The interacting features are then further processed by subsequent residual layers to extract higher-level image features.
[0100] like Figure 1 As shown, the image branch sequentially undergoes 7×7 convolution, batch normalization, and 3×3 max pooling, and extracts texture features step by step through a four-stage residual bottleneck structure. Shallow features are recalibrated by the convolutional block attention module and participate in intermediate cross-branch interactions. The interaction results continue to propagate along subsequent residual stages to extract high-level image features. Finally, these features are fused with the high-level features of the parameter branch through a bidirectional cross-fusion module for roughness level classification.
[0101] The parameter branch, with the visual Transformer network as its backbone, performs global statistical relationship modeling on the 256-dimensional gray-level co-occurrence matrix parameters corresponding to the texture image. Since each dimension of the gray-level co-occurrence matrix parameter corresponds to different pixel distances, orientations, and statistics, the parameter branch organizes the gray-level co-occurrence matrix parameters into structured feature units within the network based on their structural relationships. Specifically, such as... Figure 3 As shown, the eight directions are organized into four direction groups: {0°, 90°}, {22.5°, 157.5°}, {45°, 135°}, and {67.5°, 112.5°}. Each direction group is combined with pixel distances 1, 2, 3, and 4, respectively. For the same distance and direction group, the eight statistical measures corresponding to the two directions are combined into a 16-dimensional structured feature unit, resulting in a total of 16 structured feature units, which retain the complete 256-dimensional gray-level co-occurrence matrix statistical information.
[0102] Within the parameter branch, an adaptive weight gating is applied to the structured feature units, weighting each group of structured feature units sequentially. Let the input gray-level co-occurrence matrix parameter vector be X. After structured grouping, the feature unit set is obtained, expressed as:
[0103] The weight prediction function f generates the response corresponding to each feature unit based on the complete input X, obtains the gate weight of the i-th group through the Sigmoid activation function, and then applies the weight to that feature unit: .
[0104] To prevent a set of information from being completely suppressed due to an excessively small gating response, a lower gating limit ε is introduced. The weights are then adjusted for this lower limit before being used for weighting.
[0105] ,
[0106] The weighted set of feature units is:
[0107] ,
[0108] in, Let T be the input vector and T be the set of feature units. For the i-th feature unit, For the i-th weighted feature unit, Let f be the corresponding weight, σ be the weight prediction function, σ be the sigmoid function, and ε be the lower threshold. This is the weighted set of feature units.
[0109] After weighting and embedding mapping, the structured feature units, together with the positional encoding and classification labels, constitute the sequence input of the Transformer encoder. Global statistical correlations between different feature units are established through multi-head self-attention and a feedforward network. The encoded classification label features are further processed by the subsequent Transformer encoder to extract high-level parameter representations, and feature mapping is completed through a multilayer perceptron. The intermediate and high-level features of the parameter branches are respectively connected to the subsequent bidirectional cross-fusion module, interacting and fusing with the corresponding features of the image branches.
[0110] Bidirectional cross-fusion module such as Figure 5 As shown, it includes an intermediate feature interaction module and a high-level feature fusion module. The intermediate feature interaction module realizes bidirectional information interaction between image features and parametric features during the dual-branch feature extraction process, while the high-level feature fusion module fuses the high-level features of the two branches to form a joint feature representation for subsequent classification.
[0111] The intermediate feature interaction module first unfolds the convolutional features of the image branch into a sequence, and then projects the image features and parametric features separately, so that the two types of features are mapped to a unified embedding space, represented as:
[0112] ,
[0113] in, For convolutional features, It is a GLCM sequence. To unify the image features of the embedding space, To unify the parameter characteristics of the embedding space, For convolution projection function, This is the GLCM projection function.
[0114] In the information interaction process from image features to parameter branches, a query is constructed using the projected parameter features, and keys and values are constructed using the projected image features. Cross-attention weights are calculated based on the correlation between the query and the keys, and the image value features are weighted and aggregated to obtain the updated parameter features, represented as follows:
[0115] ,
[0116] in, For the parameter features after interaction, To query the projection matrix, The key projection matrix, Let be the value projection matrix, and d be the attention embedding dimension.
[0117] During the information exchange process from parameter features to the image branch, weights are generated using the updated parameter features through a gating function, and the image features are modulated element by element, as shown below:
[0118] ,
[0119] in, For the interactive image features, For the characteristic compression function, It is a Sigmoid-gated function. This is an element-wise multiplication. The gated input is the parameter features of the aggregated image information, thereby forming a two-way interactive process of supplementing the image feature with parameter representation and remodulating the image response with the updated parameter features.
[0120] After the bi-branch features have undergone information exchange through the intermediate feature interaction module, the high-level feature fusion module continues to perform dimensional alignment using convolutional projection and parametric projection functions. The high-level feature fusion module maps the image features and parametric features after high-level information exchange to feature representations with consistent spatial resolution, and then concatenates them along the channel dimension to form a fused feature, represented as:
[0121] ,
[0122] in, To fuse features, Concat() is the feature concatenation function.
[0123] The fused features contain both texture and shape information extracted from image branches and grayscale statistical information from parametric branch modeling, and serve as inputs to the subsequent attention recalibration module and classification layer.
[0124] like Figure 4 As shown, the attention recalibration module includes a channel attention submodule and a spatial attention submodule. Since image features and gray-level co-occurrence matrix parameter features differ in semantics, scale, and channel structure, an adaptation for both types of features is adopted at the fusion output location: the channel attention submodule establishes channel weights for the image and parameters respectively, while the spatial attention submodule uses parameter information to guide the spatial response.
[0125] The channel attention submodule first divides the fused features into image features and parametric features according to their source, and then performs global pooling, non-linear mapping, and sigmoid activation on them respectively to obtain the channel weights within the branch:
[0126]
[0127]
[0128] Furthermore, the two sets of channel weights are concatenated to form channel weights used for feature recalibration:
[0129] ,
[0130] in, For image features, For parameter features, Image channel weights, For parameter channel weights, For the Sigmoid function, For global pooling, This represents the overall channel weight.
[0131] The spatial attention submodule, based on the extracted spatial response, maps the parametric features to a spatial guidance map, and concatenates it with the pooling result before generating spatial attention weights through convolution and the sigmoid function.
[0132] ,
[0133] in, It maps GLCM into a guide map that matches the spatial resolution. For average pooling, For max pooling, This is a Conv convolutional layer. Compared to spatial weights being formed solely from image responses, this step incorporates grayscale statistics into the spatial attention calculation, ensuring that the fused region response is influenced by both texture and parametric information.
[0134] The channel attention submodule and the spatial attention submodule perform channel recalibration and spatial recalibration on the fused features, respectively. The channel attention submodule adaptively adjusts the channel contribution of features from different sources, while the spatial attention submodule uses parametric features to guide the spatial response, thereby enhancing the effective features related to roughness and suppressing redundant and interfering information, thus improving the classification layer's ability to discriminate the fused features.
[0135] Because the texture differences between adjacent roughness levels are small, using a fixed-temperature Softmax mapping makes it difficult to adaptively adjust the class score distribution according to different sample features, easily leading to confusion of classification boundaries between adjacent levels. Figure 2 As shown, in the single-branch model of the image branch, a dynamic temperature enhancement module is used to perform sample adaptive temperature adjustment on the category score; in the complete dual-branch fusion network, the same dynamic temperature adjustment mechanism is used to generate the dynamic temperature parameter corresponding to the current sample according to the fusion features, and to perform temperature scaling on the original category score output by the multilayer perceptron.
[0136] The core idea of the dynamic temperature enhancement module is to generate an adaptive temperature parameter T based on the uncertainty model of texture samples, and then use this temperature to scale the category scores, thereby adjusting the concentration of probability distributions among different samples and reducing boundary confusion between adjacent roughness levels. To obtain the temperature parameter T, a lightweight uncertainty assessment network is constructed to generate sample uncertainty estimates U based on fused features.
[0137] ,
[0138] Where U is the sample uncertainty estimate, and u(·) is a lightweight uncertainty assessment network. , These are the feature vectors output by the network. LN is layer normalization, BN is batch normalization, σ is the sigmoid function, and φ is the modified linear unit activation function. The weights are linearly mapped and automatically updated by backpropagation of the classification loss, and can be expressed as: , where η is the learning rate, λ is the training loss, and t is the number of iterations.
[0139] After obtaining the U value, a dynamic temperature function is further constructed, and upper and lower limits are used to avoid the probability distribution from being overly smooth or sharp:
[0140] ,
[0141] in, The lower limit of temperature, This is the upper limit of temperature. To learn the global baseline temperature, `clip` is used as a numerical constraint operation. Dynamic temperature exhibits an inverse relationship with sample uncertainty: when uncertainty is high, a lower temperature parameter is used to enhance the relative differences between Logits; when uncertainty is low, the temperature parameter is increased to smooth the class response and avoid excessive concentration of probability distribution.
[0142] Dynamic temperature is used to dynamically recalibrate the scores of each category, thereby achieving dynamic adjustment of the category scores:
[0143] ,
[0144] in, Logits represents the original classification score of the i-th class. This represents the recalibrated Logits.
[0145] Finally, class probabilities are obtained through Softmax, and the common maximum term is subtracted during calculation to improve the numerical stability of exponentiation.
[0146] ,
[0147] in, For the first The predicted probability of each class, where N is the number of roughness classes.
[0148] The scores for each category of the same sample are scaled using the same positive dynamic temperature, and the category probability for each roughness level is obtained through Softmax. This embodiment sets six discrete roughness levels, using the level corresponding to the highest category probability as the prediction result and outputting the corresponding category probability. During training, supervised learning is performed using roughness level labels from the fused dataset, with cross-entropy as the loss function, and the trainable parameters of the detection network are jointly updated through backpropagation. Each model is trained from the initial parameters without using external pre-trained weights, and the completed detection model is determined based on the validation results for subsequent testing and prediction of the surface roughness level of the bearing sleeve under test.
[0149] For the inner surface texture image of the bearing sleeve, it is first unfolded according to the aforementioned annular unfolding steps. The outer surface image and the unfolded inner surface image are processed according to the aforementioned preprocessing steps, and the corresponding gray-level co-occurrence matrix parameters are extracted according to the aforementioned gray-level co-occurrence matrix parameter extraction steps. The obtained texture image and parameter vector are input into the image branch and parameter branch, respectively. After dual-branch feature extraction, feature interaction, high-level fusion, and classification processing, the roughness level and corresponding category probability of the bearing sleeve under test are obtained. For samples with known roughness levels, the predicted results can be compared with the true levels to evaluate the prediction accuracy and result stability of the method.
[0150] To verify the effectiveness of the method of this invention, dynamic temperature regulation strategy verification, single-branch and double-branch ablation experiments, random seed replication experiments, model comparison experiments, and bearing sleeve roughness level prediction were carried out sequentially. Unless otherwise specified, all experiments used the same data partitioning, image preprocessing, and training configuration; the image branch used a texture image dataset, and the parameter branch used a gray-level co-occurrence matrix parameter dataset.
[0151] The experiment used an Intel Core i5-12600KF processor, an NVIDIA GeForce RTX5060 graphics card, 32GB of memory, and a Windows 11 system. The software environment consisted of Python 3.11 and CUDA 12.7.
[0152] The training parameters are shown in Table 1. Each model is trained from the initial parameters without using external pre-trained weights. The basic experiment uses a random seed of 46, and the repeated experiments use three random seeds: 46, 2026, and 3407. The optimal model weights are determined based on the accuracy of the validation set for each training iteration.
[0153] Table 1. Detection Network Training Parameter Settings
[0154] parameter set up parameter set up Number of training rounds 150 Batch size 16 Initial learning rate 0.0001 Optimizer Adam Learning rate decay coefficient 0.5 Patience parameter 15 Activation function ReLU Benchmark random seed 46 Repeated Experiment Random Seed 46、2026、3407 Temperature constraint range 0.2~5.0
[0155] The classification performance evaluation metrics include accuracy, cross-entropy loss, mean precision, and macro-mean F1 score. Validation set accuracy and loss are denoted as Val_Acc and Val_loss, respectively, while test set accuracy is denoted as Test_Acc. The training-test accuracy gap is denoted as Gap. Acc This is used to help represent the performance difference between the training and test sets. Loss and Gap Acc Smaller values are better, and larger values for Acc, mAP, and F1 are also better. The probability output calibration evaluation metrics are evaluated using expected calibration error, negative log-likelihood, and Brill score. The smaller these three metrics are, the better the consistency between the model's probability output and the true label.
[0156] To verify the effect of the dynamic temperature enhancement module on the probability output, the optimal model weights for the image branch were loaded, and inference was performed on the test set using no temperature adjustment at T=1, fixed temperatures at T=0.5 and T=2, and dynamic temperature. Based on the main variation range of dynamic temperature during training (0.4943–3.3754), the dynamic temperature constraint range was set to 0.2–5.0. The results are shown in Table 2.
[0157] Table 2 Probabilistic calibration performance of different temperature control strategies
[0158] Temperature strategy ECE / % NLL Brier T=1 (No temperature control) 5.56 0.40 0.20 T=0.5 (fixed temperature) 9.71 0.64 0.23 T=2 (fixed temperature) 5.87 0.39 0.20 <![CDATA[T min =0.2, T max =5.0 (Dynamic Temperature) 3.10 0.37 0.20
[0159] Table 2 shows that the ECE of the dynamic temperature strategy is 3.10%, a decrease of 2.46 percentage points from 5.56% at T=1; the NLL decreases from 0.40 to 0.37, and the Brier is 0.20, consistent with T=1 and T=2. The results indicate that, while maintaining consistent model weights, dynamic temperature primarily improves the probabilistic calibration performance reflected by ECE and NLL.
[0160] First, the effects of the image branch convolutional block attention module, the parameter branch adaptive weight gating, and the dynamic temperature enhancement module were verified on single-branch models of both the image branch and parameter branch. Then, using the basic image-parameter fusion model as a baseline, a bidirectional cross-fusion module, a fusion-end attention recalibration module, and a dynamic temperature enhancement module were gradually introduced. The results of the single-branch experiments are shown in Table 3, and the results of the two-branch fusion experiments are shown in Table 4. In the single-branch model, the dynamic temperature enhancement module is set at the corresponding classification end; specifically, the dynamic temperature enhancement module in the parameter branch is used to verify its effectiveness in adjusting parametric features as fusion input. In the complete two-branch model, the dynamic temperature enhancement module is set at the fusion classification end. For ease of description, CBAM represents the convolutional block attention module, DTEM represents the dynamic temperature enhancement module, GW represents the adaptive weight gating module, and CFM represents the bidirectional cross-fusion module. CBAM is set in the shallow feature extraction stage of the image branch in the single-branch model and in the fusion classification stage in the two-branch fusion model. CD-ResNet50 represents the image branch model with CBAM and DTEM, GW-ViT represents the parametric branch model with GW, ResNet50-GLCM represents the basic fusion model formed by directly concatenating the image branch and the parametric branch, and ResNet50-GLCM-CCD represents the complete fusion model formed by introducing CFM, CBAM, and DTEM on the basic fusion model.
[0161] Table 3 Ablation experiments using the single-branch model
[0162] Model Val_Acc / % Val_loss mAP / % F1 / % <![CDATA[Gap Acc / %]]> ResNet50 86.08 0.3957 95.13 88.58 14.50 ResNet50+CBAM 88.55 0.3625 96.69 90.53 11.30 ResNet50+DTEM 89.59 0.3364 96.96 91.61 11.96 ResNet50 + CBAM + DTEM 89.80 0.3529 96.81 91.40 9.60 ViT 82.61 0.4921 92.18 84.46 3.95 ViT+GW 83.78 0.5413 92.83 86.07 6.43 ViT+DTEM 83.95 0.4826 93.16 84.40 5.78 ViT+GW+DTEM 84.36 0.4771 93.25 85.77 4.39
[0163] Table 3 shows that the Val_Acc of the image branch ResNet50 is 86.08%, which increases to 88.55% and 89.59% after introducing CBAM and DTEM respectively, and reaches 89.80% after introducing both. The Val_Acc of the parameter branch ViT is 82.61%, which increases to 83.78% after introducing GW, and reaches 84.36% after using GW and DTEM. Combined with Val_loss, mAP and F1, it can be seen that the overall performance of the improved two branches is better than the corresponding baseline models, indicating that the branch improvement can improve the roughness level classification performance.
[0164] Table 4 Ablation Experiments of the Dual-Branch Fusion Model
[0165] Model Val_Acc / % Val_loss mAP / % F1 / % <![CDATA[Gap Acc / %]]> ResNet50-GLCM 90.93 0.2702 97.91 92.11 8.56 +CFM 92.52 0.2243 98.30 93.98 7.85 +CBAM 93.65 0.2200 98.70 94.69 5.25 +DTEM 93.94 0.1786 98.71 94.97 4.00 +CFM+DTEM 94.15 0.1657 98.88 95.05 1.80 +CBAM+DTEM 93.77 0.1730 98.95 94.74 1.28 +CFM+CBAM 92.77 0.2160 98.52 93.72 4.16 +CFM+CBAM+DTEM 95.11 0.1473 99.12 95.69 3.10
[0166] In Table 4, ResNet50-GLCM is the basic image-parameter stitching model with image and parameter branches, and its Val_Acc is 90.93%. By simultaneously introducing CFM, the fusion end CBAM, and DTEM, the Val_Acc of the complete fusion model reaches 95.11%, an improvement of 4.18 percentage points compared to the basic fusion model; Val_loss decreases from 0.2702 to 0.1473, mAP reaches 99.12%, F1 increases from 92.11% to 95.69%, and Gap... Acc The percentage decreased from 8.56% to 3.10%. The results show that the image and parameter dual-branch fusion detection method has good comprehensive classification performance on the constructed fusion dataset.
[0167] To maintain consistency in data partitioning, preprocessing procedures, and training parameters, the models were independently trained using three random seeds of 46, 2026, and 3407, respectively. The optimal model weights determined by the validation set during each training iteration were loaded and evaluated on the test set. The results are expressed as mean ± standard deviation, as shown in Table 5.
[0168] Table 5 Results of repeated experiments with random seeds for different models
[0169] Model Test_Acc / % mAP / % F1 / % ResNet50 86.09±1.14 94.99±1.00 88.26±0.82 CD-ResNet50 (image branch that introduces convolutional block attention module and dynamic temperature enhancement module) 88.74±1.35 96.24±0.64 90.57±1.12 ViT 81.26±0.95 91.72±0.29 82.69±0.65 GW-ViT (introducing an adaptive weight-gated parametric branch) 83.33±0.28 93.12±0.19 85.04±0.23 ResNet50-GLCM 90.60±0.85 97.53±0.64 91.67±0.67 ResNet50-GLCM-CCD (the fusion model described in this invention) 93.67±0.77 98.73±0.33 94.38±1.01
[0170] The test_Acc of the fusion model of this invention is 93.67%±0.77%, mAP is 98.73%±0.33%, and F1 is 94.38%±1.01%, all of which are higher than the single-branch model and the basic fusion model ResNet50-GLCM listed in Table 5. The results show that the proposed dual-branch fusion detection method maintains good classification performance and result stability under different random initialization conditions.
[0171] To further verify the performance of the dual-branch fusion detection method of this invention, different feature fusion models were selected for comparison under a unified data partitioning and training configuration. The results are shown in Table 6. GLCM-Tamura, dual-channel fusion CNN, CNN-Transformer, DBFF-Net, and GLCM-DNN were selected for comparison with the fusion model of this invention, including dual-parameter, dual-image, and parameter-image fusion models, covering methods such as stitching, interaction, and adaptive feature fusion.
[0172] Table 6 Performance Comparison of Fusion Models
[0173] Model Val_Acc / % Val_loss mAP / % F1 / % <![CDATA[Gap Acc / %]]> Parameter quantity / M GLCM-Tamura 79.46 0.5679 89.36 80.58 1.09 0.537 Dual-channel fusion CNN 80.35 - 88.63 81.30 - 49.38 CNN-Transformer 90.55 0.4273 97.18 91.79 10.59 69 DBFF-Net 92.47 0.2322 98.14 93.51 6.63 34.81 GLCM-DNN 90.93 0.3114 96.19 91.38 9.28 24.96 This invention's fusion model 95.11 0.1473 99.12 95.69 3.10 27.63
[0174] As shown in Table 6, the fusion model of this invention outperforms the fusion comparison models listed in the table in terms of Val_Acc, Val_loss, mAP, and F1, with a parameter count of 27.63M. Compared with dual-channel fusion CNN, CNN-Transformer, and DBFF-Net, the model of this invention improves classification performance while having a lower parameter count; compared with GLCM-Tamura and GLCM-DNN, although the parameter count is increased, the classification performance is better, demonstrating superior overall performance.
[0175] To verify the predictive ability of the method of this invention on the roughness level of actual bearing sleeve samples, bearing sleeve texture images from independent physical specimens were selected for prediction. The samples covered four roughness levels: Ra0.1, Ra0.2, Ra0.4, and Ra0.8, and the prediction was completed according to the aforementioned processing and prediction process. Comparisons were made using ResNet50, CD-ResNet50, the fusion model of this invention, as well as CNN-Transformer, DBFF-Net, and GLCM-DNN. The prediction results are as follows: Figure 13 As shown in the figure. The green and red boxes represent correctly predicted and incorrectly predicted samples, respectively, and are labeled with the true label T, predicted label P, prediction confidence PC, and true class confidence TC. Figure 13 As can be seen, compared with the listed comparison methods, the method described above has a better ability to predict the roughness level of bearing sleeve texture samples.
[0176] The above description is only a preferred embodiment of the present invention. It should be noted that those skilled in the art can make several improvements without departing from the principle of the present invention, and these improvements should also be considered within the scope of protection of the present invention.
Claims
1. A method for constructing a bearing sleeve surface roughness fusion dataset and performing image and parameter dual-branch fusion detection, characterized in that: This includes the fusion dataset construction phase and the image and parameter dual-branch fusion detection phase; The fusion dataset construction phase includes: Texture images of the inner surface of the bearing sleeve, the outer surface of the bearing sleeve, and the standard roughness sample block were obtained respectively, and the roughness level label corresponding to each texture image was determined. The collected texture images are preprocessed, and the preprocessed texture images are segmented without overlap and augmented with data. The training set, validation set and test set are divided with the physical specimen as the smallest dividing unit to construct the texture image dataset. For each texture image in the texture image dataset, the gray-level co-occurrence matrix is calculated under multiple pixel distances and multiple statistical directions. Multiple types of texture statistics are extracted from the gray-level co-occurrence matrix to form a parameter vector corresponding to the sample number of the texture image, and a parameter dataset is constructed. By associating texture images, parameter vectors, and roughness level labels one by one according to sample numbers, a fused dataset is constructed. The image and parameter dual-branch fusion detection stage includes: An image-parameter dual-branch fusion detection network is constructed, which includes an image branch, a parameter branch, a bidirectional cross-fusion module, an attention recalibration module, and a classification layer. Texture images and parameter vectors with the same sample number in the fused dataset are input into the image branch and parameter branch, respectively. The image branch uses a convolutional neural network as the backbone to extract features from the texture images to obtain image features. The parameter branch uses a visual Transformer network as the backbone. Based on the correspondence between pixel distance, statistical direction and texture statistics of each dimension of the parameter vector, the parameter vector is organized into multiple structured feature units. After weighting each structured feature unit, the global statistical relationship between different structured feature units is established through the visual Transformer encoder to obtain parameter features. The bidirectional cross-fusion module includes an intermediate feature interaction module and a high-level feature fusion module. The intermediate feature interaction module uses the image features output from the intermediate layer of the image branch as keys and values, and the parameter features output from the intermediate layer of the parameter branch as queries. It aggregates the information of the image features through cross attention to update the parameter features, and generates gating weights from the updated parameter features to modulate the image features element by element. The interacting image features and parameter features continue to be extracted along their respective branches. The high-level output features of the two branches are again interacted with by the intermediate feature interaction module. The high-level feature fusion module then aligns the dimensions of the interacting image features and parameter features and concatenates them to obtain the fused features. The attention recalibration module performs channel attention recalibration and spatial attention recalibration on the fused features; The classification layer maps the recalibrated fusion features to category scores for various roughness levels, generates dynamic temperatures related to the samples based on the fusion features, scales the category scores of the same sample using the same dynamic temperature, and outputs the probabilities of various roughness levels through the Softmax function. The image-parameter dual-branch fusion detection network was trained under supervision using a fusion dataset to obtain a trained detection model. Following the same preprocessing and parameter vector extraction methods as in the fusion dataset construction phase, the corresponding texture images and parameter vectors of the bearing sleeve under test are obtained. These are then input into the image branch and parameter branch of the trained detection model, respectively, and the surface roughness level of the bearing sleeve under test and the probability of each roughness level are output.
2. The bearing sleeve surface roughness fusion dataset construction and image and parameter dual-branch fusion detection method as described in claim 1, characterized in that: During the construction phase of the fusion dataset, when acquiring the texture image of the inner surface of the bearing sleeve, a camera is used in conjunction with an endoscope for imaging, and a ring light source illuminates the inner surface of the bearing sleeve through the through hole of the perforated base supporting the bearing sleeve. When acquiring texture images of the outer surface of the bearing sleeve and the standard roughness sample block, a camera is used in conjunction with a telecentric lens for imaging. Strip light sources are symmetrically arranged on both sides of the object being measured, and the illumination directions of the strip light sources on both sides are at a 45° angle to the surface of the object being measured.
3. The bearing sleeve surface roughness fusion dataset construction and image and parameter dual-branch fusion detection method as described in claim 1, characterized in that: For the collected annular texture image of the inner surface of the bearing sleeve, Hough circle detection is first used to determine the center, inner radius and outer radius of the annular texture image. With the center as the origin of polar coordinates, the annular texture image is expanded into a rectangular texture image through inverse coordinate mapping. The mapping coordinates are sampled from the nearest neighbor pixels and constrained to the effective pixel range. The preprocessing of all texture images includes target region extraction, grayscale conversion, and noise suppression: adaptive binarization and Canny edge detection are used to extract texture boundaries and the target region is cropped according to the maximum bounding rectangle; weighted grayscale conversion is performed and constructed into a three-channel form; Median filtering is performed using 3×3, 5×5, and 7×7 neighborhood windows in sequence. When the difference between the center pixel and the neighborhood median exceeds an adaptive threshold, the center pixel is replaced with the corresponding neighborhood median. The adaptive threshold is set according to the standard deviation of the pixel grayscale values within the corresponding neighborhood window.
4. The bearing sleeve surface roughness fusion dataset construction and image and parameter dual-branch fusion detection method as described in claim 1, characterized in that: When extracting the gray-level co-occurrence matrix parameters, the number of gray levels is set to 256, the pixel distance includes 1 pixel, 2 pixels, 3 pixels and 4 pixels, the statistical directions include 0°, 22.5°, 45°, 67.5°, 90°, 112.5°, 135° and 157.5°, a total of eight directions, and the texture statistics include contrast, correlation, energy, homogeneity, dissimilarity, second moment of angle, two-dimensional entropy and differential entropy, a total of eight categories; the 256-dimensional parameter vector is formed by the four pixel distances, the eight statistical directions and the eight categories of texture statistics.
5. The bearing sleeve surface roughness fusion dataset construction and image and parameter dual-branch fusion detection method as described in claim 1, characterized in that: The image branch uses a 50-layer deep residual network ResNet50 as its backbone, and extracts image features through a four-stage residual bottleneck structure consisting of 7×7 convolution, batch normalization, 3×3 max pooling, and so on. After the output of the second residual bottleneck structure, a convolutional block attention module is set to recalibrate the channel response and spatial response.
6. The bearing sleeve surface roughness fusion dataset construction and image and parameter dual-branch fusion detection method as described in claim 4, characterized in that: When extracting parameter features using the parameter branch, the parameter vector is organized into multiple structured feature units based on the correspondence between pixel distance, statistical direction, and texture statistics. The eight statistical directions are reorganized into four direction groups: {0°, 90°}, {22.5°, 157.5°}, {45°, 135°}, and {67.5°, 112.5°}. Each direction group is combined with four pixel distances. The eight texture statistics corresponding to the same pixel distance and the two directions in the same direction group form a 16-dimensional structured feature unit, resulting in a total of 16 structured feature units. Prediction function with trainable weights Based on the complete parameter vector The responses of each structured feature unit are generated, and the gating weights of the i-th structured feature unit are obtained by activating them with the Sigmoid function. ,in For the Sigmoid function; introduce a lower gate limit. Adjust the lower limit of the gating weight. ; The lower bound adjusted gating weights are used for the i-th structured feature unit. Weighting is performed to obtain the weighted structured feature units. The weighted structured feature units are then embedded, mapped, and encoded at location, and a global statistical relationship is established using a visual Transformer encoder.
7. The bearing sleeve surface roughness fusion dataset construction and image and parameter dual-branch fusion detection method as described in claim 1, characterized in that: The bidirectional cross-fusion module includes an intermediate feature interaction module and a high-level feature fusion module. The intermediate feature interaction module first expands the image features into a sequence and projects the image features and parameter features into a unified embedding space. It constructs a query with the projected parameter features and constructs keys and values with the projected image features. It aggregates image information through cross attention to update the parameter features. The updated parameter features are then compressed by feature units and gating weights are generated by the Sigmoid function to modulate the image features element by element. The interacting image features and parameter features continue to extract high-level features along their respective branches. The high-level features of the two branches exchange information again through the intermediate feature interaction module, and then the high-level feature fusion module performs dimensional alignment and splicing to obtain the fused features.
8. The bearing sleeve surface roughness fusion dataset construction and image and parameter dual-branch fusion detection method as described in claim 1, characterized in that: When performing channel attention recalibration on the fused features, the fused features are divided into image features and parameter features according to their source. Global pooling, non-linear mapping and sigmoid function activation are performed on them respectively to obtain image channel weights and parameter channel weights. The two types of channel weights are then concatenated into the overall channel weights. When spatial attention recalibrates the fused features, the parameter features are mapped to a guide map that matches the spatial resolution of the image features. The guide map, the average pooling response and the max pooling response of the image features are concatenated and then activated by convolution and the Sigmoid function to generate spatial attention weights.
9. The bearing sleeve surface roughness fusion dataset construction and image and parameter dual-branch fusion detection method as described in claim 1, characterized in that: When generating the dynamic temperature related to the sample, a trainable mapping consisting of layer normalization, first linear mapping, first batch normalization, modified linear unit activation, second linear mapping, sigmoid function activation, third linear mapping, second batch normalization, modified linear unit activation, fourth linear mapping and sigmoid function activation is used to generate a sample uncertainty estimate U with a value range of 0 to 1 based on the fusion features. According to the lower limit of temperature Upper temperature limit And can learn global base temperature Constructing a dynamic temperature function This makes the dynamic temperature and the sample uncertainty estimate have an inverse adjustment relationship. Clip is a numerical constraint operation that constrains the dynamic temperature between the lower limit and the upper limit of the temperature. Scoring of each category for the same sample using the same dynamic temperature. Scaling is performed to obtain the recalibrated category scores. .
10. The bearing sleeve surface roughness fusion dataset construction and image and parameter dual-branch fusion detection method as described in claim 1, characterized in that: When training the detection network, the cross-entropy loss function is used, and the roughness level label is used as the supervision signal for supervised training. The detection network is trained from the initial parameters without the use of external pre-trained weights, and the completed detection model is determined based on the validation results of the validation set.
Citation Information
Patent Citations
Workpiece roughness measuring method and device based on mobile terminal, terminal and medium
CN114627048A
Anti-interference detection method and system for machining surface roughness in complex environment
CN121544610A
