A gear defect recognition method and system based on deep learning
By using multispectral data processing and deep learning networks, the problem of misjudgment and missed detection of oil stains in gear grinding burn identification was solved, and high-precision gear defect detection was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- YUANCHUANGLI (TIANJIN) TECH DEV CO LTD
- Filing Date
- 2026-05-09
- Publication Date
- 2026-06-05
AI Technical Summary
In existing technologies, it is difficult to distinguish between oil stains and grinding burns in gear grinding defect identification, leading to misjudgment and missed detection. There is a lack of in-depth mining of multi-band spectral information and refined feature processing.
By acquiring multispectral reflectance image data, asymmetric absorption offset values and absorption contrast values are extracted pixel by pixel. Adaptive confidence-guided filtering and curvature enhancement processing are performed. Combined with a pre-trained gear defect recognition network, dynamic convolution and attention bias are applied to generate gear defect maps and perform eccentricity screening and evaluation.
It effectively filters out interfering information, enhances the real characteristics of grinding burns, improves the accuracy and reliability of defect identification, reduces false positives and missed detections, and lowers the cost of sample acquisition and labeling.
Smart Images

Figure CN122156205A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of optical inspection technology for gear defects, specifically to a gear defect identification method and system based on deep learning. Background Technology
[0002] As a core component of mechanical transmission systems, the quality of gear tooth surfaces directly affects the service life and operational reliability of the entire machine. During gear grinding, improper grinding parameters, such as excessive feed rate or insufficient cooling, can easily cause grinding tempering burns on the tooth surface. These burns reduce the hardness of the tooth surface and introduce residual tensile stress, making it easy for fatigue cracks to develop under subsequent alternating loads, leading to premature gear failure. Therefore, non-contact, high-precision detection of tooth surface burns after gear finishing is a crucial step in ensuring gear quality.
[0003] The limitations of existing technologies include at least the following problems: Existing technologies for identifying gear grinding burn defects lack in-depth mining and refined feature processing of multi-band spectral information. They directly use raw imaging data to input into the model for judgment. In this mode, interference information such as tooth surface reflection, processing texture, and ambient light fluctuations will directly participate in feature analysis, causing weak abnormal characterization information to be completely covered by the complex background. In particular, grinding burns, oil stains, and carbon black have highly overlapping grayscale and color features in the visible light band. Existing technologies cannot independently complete interference filtering and effective feature enhancement, which easily leads to difficulty in distinguishing normal process textures from subtle abnormal areas, resulting in identification result deviations. A large number of qualified gears with only surface oil stains are misjudged as unqualified products, while genuinely burned gears are missed because their color is covered by stains. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a gear defect identification method and system based on deep learning, which solves the problems of existing technologies lacking multi-band spectral information, easily confusing burns with oil stains, and leading to misjudgments and missed detections.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a deep learning-based gear defect recognition method, comprising the following steps: acquiring multispectral reflectance image data of the gear to be identified, which is the reflectance value of each pixel in the multispectral reflectance image in multiple bands; extracting asymmetric absorption offset value and absorption contrast value pixel by pixel from the multispectral reflectance image data, and performing adaptive confidence-guided filtering and curvature enhancement processing guided by a preset band to generate an enhanced spectral feature map; performing dynamic convolution and attention bias on the enhanced spectral feature map based on a pre-trained gear defect recognition network to output a gear defect map; performing eccentric screening and evaluation processing on the gear defect map to generate a gear defect evaluation value, and performing defect recognition processing on the gear to be identified.
[0006] Furthermore, the specific steps for extracting the asymmetric absorption offset value and absorption contrast value pixel by pixel are as follows: read the reflectance value of each pixel in multiple bands; perform differential comparison processing on the reflectance value to obtain the asymmetric absorption offset value of the corresponding pixel; and perform absorption equalization processing on the reflectance value to obtain the absorption contrast value of the corresponding pixel.
[0007] Furthermore, the specific steps of the adaptive confidence-guided filtering are as follows: A spectral guide map is constructed using the reflectance value of each pixel in a preset band; a square window of a preset size is taken centered on each pixel, and the asymmetric offset neighborhood variability within the corresponding square window is statistically analyzed, along with the reflection fluctuation value of the spectral guide map within the same square window; fluctuation suppression modulation is applied to the asymmetric offset neighborhood variability and reflection fluctuation value to generate the local confidence of each pixel, and an adaptive smoothing intensity is constructed; a guided filtering algorithm is used, with the spectral guide map and adaptive smoothing intensity as parameters, to filter the asymmetric absorption offset value, outputting the filtered asymmetric absorption offset value for each pixel; and based on the spectral guide map, contrast fluctuation guided filtering is applied to the absorption contrast value to generate the filtered absorption contrast value for each pixel.
[0008] Furthermore, the specific steps of curvature enhancement are as follows: based on the reflectance values of each pixel in multiple bands, a quadratic curve is fitted, and the local spectral curvature is extracted; hyperbolic tangent enhancement modulation is applied to the local spectral curvature to generate a curvature enhancement factor; based on the curvature enhancement factor, the curvature of the filtered asymmetric absorption offset value is corrected to generate an enhanced asymmetric absorption offset value, and combined with the filtered absorption contrast value, an enhanced spectral feature map is constructed.
[0009] Further, the specific steps for outputting the gear defect map are as follows: The enhanced spectral feature map is input into an asymmetric offset modulation convolutional layer for dynamic convolution processing to extract the initial offset modulation feature map; the initial offset modulation feature map is then passed sequentially through alternating stacks of downsampling compression layers and asymmetric offset modulation convolutional layers to progressively reduce resolution and extract deep features, generating a deep compressed feature map; the deep compressed feature map is input into a contrast bias attention layer, and after absorption contrast bias recalibration, a bias recalibrated feature map is obtained; the bias recalibrated feature map is then passed sequentially through alternating stacks of resolution restoration layers and contrast bias attention layers to progressively restore resolution, and then stitched together by a cross-scale feature fusion layer to obtain a cross-scale fusion feature map; the cross-scale fusion feature map is then mapped to the gear defect map via the output layer.
[0010] Further, the specific steps for extracting the initial offset modulation feature map are as follows: For each pixel, the statistical value of the asymmetric absorption offset value in the enhanced spectral feature map within a preset local neighborhood is taken as the modulation factor; multiple basic convolution kernels are preset, each corresponding to an asymmetric absorption offset value interval; the membership degree of the modulation factor to each interval is calculated using the Gaussian radial basis function, and the basic convolution kernels are softly combined according to the membership degree to generate the current convolution kernel; the current convolution kernel is used to perform a convolution operation on the enhanced spectral feature map to output the initial offset modulation feature map.
[0011] Further, the specific steps to obtain the bias recalibrated feature map are as follows: Take the global mean of all pixels in the enhanced spectral feature map to obtain the global absorption contrast statistic; After global average pooling, the deep compressed feature map is processed by fully connected mapping to output the original attention weights; The global absorption contrast statistic is linearly transformed and used as a bias term, which is then fused with the original attention weights to obtain the final channel attention weights; The deep compressed feature map is recalibrated based on the final channel attention weights to output the bias recalibrated feature map.
[0012] Furthermore, the pre-training steps for the gear defect recognition network are as follows: A predefined empty feature map template is determined; control points of a Bézier curve are randomly generated, and a closed contour is constructed through interpolation; the internal region of the closed contour is filled in the empty feature map template; Gaussian noise is added to the filled empty feature map templates to construct synthetic enhanced spectral feature maps, which form a synthetic training set; the synthetic training set is used to perform synthetic prior training on the gear defect recognition network, and the total loss function of the synthetic prior training is jointly optimized by binary classification cross-entropy loss and spectral prior constraint loss; real gear samples are collected to construct a real training set, and the gear defect recognition network after synthetic prior training is subjected to experimental fine-tuning training to obtain a fully trained gear defect recognition network.
[0013] Further, the specific steps for generating gear defect evaluation values are as follows: Adaptive threshold segmentation is performed on the gear defect map to obtain a binary gear defect map; morphological operations are performed on the binary gear defect map based on preset structuring elements, and connected component analysis is performed in conjunction with the morphological operation results to extract the attribute set of each connected component, including defect area, defect eccentricity, spindle direction, and gear defect probability; connected components corresponding to attribute sets that meet preset screening conditions are taken as defect regions; the attribute sets of defect regions are comprehensively processed to obtain the gear defect evaluation value.
[0014] A deep learning-based gear defect recognition system includes: a spectral data acquisition unit for acquiring multispectral reflectance image data of the gear to be identified, which represents the reflectance values of each pixel in the multispectral reflectance image across multiple bands; a spectral feature extraction and enhancement unit for extracting asymmetric absorption offset values and absorption contrast values pixel-by-pixel from the multispectral reflectance image data, and performing adaptive confidence-guided filtering and curvature enhancement processing guided by preset bands to generate an enhanced spectral feature map; a dynamic convolutional attention learning unit for performing dynamic convolution and attention bias on the enhanced spectral feature map based on a pre-trained gear defect recognition network to output a gear defect map; and a defect evaluation and recognition unit for performing eccentric screening and evaluation processing on the gear defect map, generating a gear defect evaluation value, and performing defect recognition processing on the gear to be identified.
[0015] The present invention has the following beneficial effects: (1) This deep learning-based gear defect recognition method collects multi-band reflectance image data of gears, extracts two types of exclusive features, namely asymmetric absorption offset value and absorption contrast value, pixel by pixel, and then completes adaptive confidence-guided filtering processing with spectral guidance map. Simultaneously, it combines multi-band reflectance to fit the local spectral curvature and performs directional curvature enhancement reconstruction to obtain enhanced spectral feature map. This allows for layered filtering of interferences such as strong light reflection on the tooth surface and regular grinding marks commonly seen in the workshop. Normal oil stains and surface carbon black stains will not be marked as real grinding burns, nor will the real hidden burn areas be missed due to the stains covering the surface microstructure changes. In this way, only the effective features that are truly related to burns are enhanced, ensuring that the enhanced spectral feature map sent to the network has undergone sufficient interference suppression and effective enhancement, reducing the possibility of detection errors from the source, thereby improving the accuracy of defect recognition.
[0016] (2) The deep learning-based gear defect recognition method uses asymmetric absorption offset value as the modulation factor in the asymmetric offset modulation convolutional layer, calculates the membership degree through Gaussian radial basis function, softly combines multiple basic convolutional kernels, dynamically generates convolutional kernels for each pixel position, so that the convolutional kernel response adaptively matches the local defect intensity, enhances feature extraction in burn areas, and suppresses response in oil stain areas. Meanwhile, the contrast bias attention layer incorporates channel attention weights with the global mean of the absorbed contrast value as the bias term, so that the network adjusts the channel importance according to the average absorbed contrast of the tooth surface, thereby improving the detection rate of small burns and reducing false activation of interference areas such as oil stains and carbon black.
[0017] (3) The deep learning-based gear defect recognition method generates an empty feature map template, randomly generates Bézier curve control points to construct a closed contour, and then fills the asymmetric absorption offset value channel and absorption contrast value channel with random numbers that conform to the measured statistical range, and adds Gaussian noise to synthesize an enhanced spectral feature map. At the same time, a spectral prior constraint term is added to the pre-training loss function, so that the network obeys the physical law of multispectral absorption asymmetry while learning features, avoiding simply fitting noise or overfitting to the shape of synthetic data. In practice, only a small number of real gear samples need to be collected for actual measurement and fine-tuning training to obtain high-precision segmentation results, thereby avoiding the pain points of difficulty in obtaining real burn samples and high pixel-level annotation costs in industrial scenarios, and improving the reliability of network defect recognition.
[0018] (4) The deep learning-based gear defect recognition system acquires multi-band pixel-level reflectivity image information of the gear to be identified through the spectral data acquisition unit. The spectral feature extraction and enhancement unit simultaneously analyzes key spectral parameters pixel by pixel. With adaptive filtering and curvature correction, it completes clutter removal and effective defect feature enhancement, generating a high-purity standardized enhanced spectral feature map. The dynamic convolutional attention learning unit completes adaptive feature and deep semantic reasoning through a deep learning network, and quickly outputs a gear defect map with accurate pixel coordinate alignment. The defect assessment and recognition unit works together to complete adaptive threshold segmentation, morphological optimization screening and multi-connected component parameter calculation, intelligently generating objective defect assessment scores and simultaneously outputting graded judgment results, thereby effectively avoiding false detection and missed detection caused by oil stain reflection and processing texture, and thus improving the reliability of defect recognition.
[0019] Of course, any product implementing this invention does not necessarily need to achieve all of the above advantages at the same time. Attached Figure Description
[0020] Figure 1 This is a flowchart of a gear defect identification method based on deep learning according to the present invention.
[0021] Figure 2 This is a flowchart illustrating the specific steps involved in generating gear defect evaluation values in a deep learning-based gear defect identification method according to the present invention.
[0022] Figure 3 This is a block diagram of a gear defect recognition system based on deep learning according to the present invention. Detailed Implementation
[0023] Please see Figure 1This invention provides a technical solution: a deep learning-based gear defect identification method, comprising the following steps: acquiring multispectral reflectance image data of the gear to be identified (e.g., a carburized and quenched gear), which includes the two-dimensional coordinates of each pixel in the multispectral reflectance image and the reflectance values of each pixel in multiple bands (e.g., three bands, which can be low-band, mid-band, and high-band, with the low-band being the 1.20μm shortwave infrared band, the mid-band being the 1.72μm shortwave infrared band, and the high-band being the 2.00μm shortwave infrared band); extracting asymmetric absorption offset values and absorption contrast values pixel by pixel from the multispectral reflectance image data, and performing adaptive confidence-guided filtering and curvature enhancement processing guided by a preset band to generate an enhanced spectral feature map of the gear to be identified; and performing dynamic convolution and attention bias on the enhanced spectral feature map based on a pre-trained gear defect identification network to output the gear defect map of the gear to be identified. The gear defect image is subjected to eccentric screening and evaluation processing to generate gear defect evaluation values. Defect identification processing is then performed on the gear to be identified, specifically as follows: Determine whether the gear defect assessment value is higher than the preset gear defect assessment threshold; If the defect exceeds the preset gear defect assessment threshold, the gear to be identified is unqualified. If the defect rate is not higher than the preset gear defect assessment threshold, the gear to be identified is qualified. The preset steps for the gear defect assessment threshold are as follows: Collect multiple gear samples with known quality conditions, including samples that have passed destructive testing or long-term service verification and non-conforming samples that have been confirmed to have burns that affect service life. Calculate the gear defect assessment value for each sample according to the steps described above. Statistically combine the assessment values of all qualified samples and take the 95th percentile as the upper limit of acceptable quality. Statistically combine the assessment values of all non-conforming samples and take the 5th percentile as the lower limit of unacceptable quality. If there is a significant gap between the upper limit of acceptable and the lower limit of unacceptable, the threshold is set to the midpoint between the upper limit of acceptable and the lower limit of unacceptable. If the two overlap, the value that minimizes the false judgment rate (the sum of judging acceptable as unacceptable and judging unacceptable as acceptable) is selected as the threshold.
[0024] Specifically, the steps for extracting the asymmetric absorption offset value and absorption contrast value pixel by pixel are as follows: Read the reflectance values of each pixel in multiple bands, that is, read the reflectance values of the same pixel in three bands, and record them as follows: (Reflectivity at 1.20 μm) (Reflectivity at 1.72 μm) (Reflectivity at 2.00 μm); By performing differential comparison processing on the reflectance values, the asymmetric absorption offset value of the corresponding pixel is obtained, specifically as follows: By calculating the asymmetry of reflectivity differences between adjacent bands, the asymmetric absorption offset value (SAAC) is obtained to capture the differences in infrared spectral absorption characteristics of different materials (normal matrix and burn defects) on gear tooth surfaces. This is used to distinguish the characteristics of hidden grinding burns from normal machining textures. The calculation formula is as follows: ; SAAC represents the asymmetric absorption offset value of the current pixel, ranging from -1 to 1. A positive SAAC value indicates that the spectral absorption characteristics of the region corresponding to the pixel are consistent with the spectral characteristics of gear grinding burn defects. The larger the SAAC value, the higher the probability of a defect. The local constant is 1 × 10⁻⁶. -8 Its function is to prevent the denominator from being 0; The reflectance values are then subjected to absorption equalization processing to obtain the absorption contrast values of the corresponding pixels, specifically as follows: The absorption contrast ratio is calculated using the three-band reflectance ratio, and the formula is as follows: ; Ratio is the absorption contrast value of the current pixel. When this value is large, it indicates that the absorption characteristics of the area corresponding to the pixel are consistent with the characteristics of grinding burn defects.
[0025] The specific steps of adaptive confidence-guided filtering are as follows: A spectral guide map is constructed using the reflectance value of each pixel in a preset wavelength band. Specifically, the preset wavelength band is selected as the mid-band of 1.72μm, where the reflectance is... It is the most stable in characterizing changes in gear tooth surface profile and material, and is relatively less affected by metallic specular highlights, effectively preserving the edge structure and weak defect features of the tooth surface. The reflectance values of all pixels in the mid-band For each pixel value, a two-dimensional spectral guide map G is constructed. The size of the guide map G is consistent with the size of the acquired multispectral reflectance image. The coordinates (x, y) of each pixel point correspond to the pixel value G(x, y) at coordinates (x, y) in the guide map G. (x, y); And taking each pixel as the center, a square window of a preset size is taken, and the variability of the asymmetric offset neighborhood within the corresponding square window is calculated. At the same time, the reflection fluctuation value of the spectral guide map within the same square window is calculated. Specifically: The preset square window size can be 3×3. Centered on the current pixel (x, y), all pixels within the window are selected as neighboring pixels. Calculate the coefficient of variation of the asymmetric absorption offset value (SAAC) of all pixels in the neighborhood, and use it as the asymmetric offset neighborhood variability. The coefficient of variation reflects the dispersion of SAAC values within the neighborhood, and the calculation formula is as follows: ; in, The standard deviation of the SAAC values within the neighborhood. The mean of the SAAC values in the neighborhood. The larger the value, the greater the dispersion of the SAAC value in the neighborhood, which may indicate the boundary between the defective and normal regions. The smaller the value, the more uniform the SAAC value is in the neighborhood, which may be a pure normal area or a pure defect area. Simultaneously, within the same 3×3 square window, the reflection fluctuation values of corresponding pixels in the spectral guidance map G are statistically analyzed. This value reflects the degree of drastic change in reflectivity within the neighborhood, and the calculation formula is as follows: ; in, The maximum pixel value (maximum reflectance) of the spectral guide map G within the 3×3 window. This represents the minimum pixel value (minimum reflectance) of the spectral guide map G within the window. The larger the value, the more drastic the change in reflectivity in the area, and the greater the possibility of metallic highlights or noise interference; conversely, the smaller the value, the more stable the reflectivity in the area, and the less interference. The asymmetric offset neighborhood variability and reflection fluctuation value are subjected to fluctuation suppression modulation to generate the local confidence of each pixel, and an adaptive smoothing intensity is constructed, specifically as follows: Local confidence C(x, y) is used to characterize the reliability of the SAAC value of the current pixel, combined with and Modulation is performed; when the SAAC value dispersion within the neighborhood is small and the reflection fluctuation is small, it indicates that the SAAC value of that pixel has high reliability and high confidence; conversely, it indicates low confidence. The calculation formula is as follows: ; in, These are modulation coefficients, all empirical values, whose function is to balance... and Impact on confidence level: The closer C(x,y) is to 1, the more reliable the SAAC value of the current pixel is, and the more necessary it is to retain its original value; the closer C(x,y) is to 0, the more the SAAC value of the current pixel is affected by interference, and the more necessary it is to perform smoothing processing. in, The steps to obtain it are as follows: Multiple gear tooth surface samples were selected, covering areas with different degrees of burns, oil stains, and different processing texture intensities. The coefficient of variation of the SAAC value in the neighborhood of each pixel was calculated according to the above steps and denoted as the first fluctuation amount. At the same time, the difference between the maximum and minimum values of the guide map reflectivity in the same neighborhood was calculated and denoted as the second fluctuation amount. All pixels in all samples are automatically divided into two categories according to the following rules: the first category is boundary pixels, which are determined by either a first fluctuation value greater than the median of the first fluctuation values of all pixels, or a second fluctuation value greater than the median of the second fluctuation values of all pixels; the second category is flat pixels, which are determined by either a first fluctuation value or a second fluctuation value less than their respective medians. set up Candidate values are 0.1, 0.3, 0.5, 0.7, and 0.9. The candidate values are 0.2, 0.5, 0.8, 1.1, and 1.4. For each set of candidate values, the confidence score is calculated for each pixel, i.e., the negative confidence score is calculated first. Multiply by the first fluctuation and then subtract Multiply by the value of the second fluctuation, then take an exponential function with the natural constant as the base of that value to obtain the confidence score. Calculate the average confidence score for all boundary pixels and the average confidence score for all flat pixels, then calculate the separation score. The separation score equals the average confidence score of flat pixels minus the average confidence score of boundary pixels, and then divides by the sum of the two average confidence scores. Select the candidate values that maximize the separation score as... and The final value; Based on the local confidence C(x, y) of each pixel at (x, y), a corresponding adaptive smoothing intensity S(x, y) is constructed. The smoothing intensity is used to dynamically adjust the smoothing degree of the guided filter, achieving strong smoothing in the interference area and weak smoothing in the defect area, thus avoiding blurring of defect features during the filtering process. The calculation formula is as follows: ; in, The preset basic smoothing strength is set to 0.2 in this embodiment. The minimum smoothing intensity is set to 0.05, ensuring that the smoothing intensity is neither too small to suppress noise nor too large to blur defects. When C(x,y) is small and S(x,y) is large, strong smoothing is applied to the pixel to suppress interference. When C(x,y) is large and S(x,y) is small, the original features of the pixel are preserved. in, Preset steps: Collect several (e.g., 50) representative multispectral reflectance images of gear tooth surfaces. These images should cover normal areas, burn defect areas, and interfering areas such as oil stains and carbon black. For each image, extract its asymmetric absorption offset value and spectral guide map according to the above steps, and extract the pixels in the flat area of the image (i.e., the local standard deviation of the asymmetric absorption offset value and the reflectance fluctuation value is less than the preset threshold, such as 0.05). Calculate the standard deviation of the asymmetric absorption offset value on these pixels and record it as the noise level of the image. Take the average noise level of all sample images to obtain the overall noise level estimate. In a candidate value set such as {0.05, 0.1, 0.15, 0.2, 0.25, 0.3}, the defect segmentation accuracy (e.g., IoU index) for each candidate value is calculated on a small validation set (e.g., 20 labeled gear images). The value that results in the highest accuracy is selected as the final value. ; A guided filtering algorithm is employed, using the spectral guide map and adaptive smoothing intensity as parameters, to filter the asymmetric absorption offset values, outputting the filtered asymmetric absorption offset value for each pixel. Specifically: The guided filtering algorithm, based on the structural information of the spectral guide map G, smooths the asymmetric absorption offset value SAAC while preserving edge features. Combined with the adaptive smoothing intensity S(x, y), it dynamically adjusts the filtering weights. The specific calculation formula is as follows: ; in, `x, y` represents the filtered asymmetric absorption offset value of the current pixel at (x, y) (i.e., the filtered asymmetric absorption offset value); `N` represents the number of pixels within the 3×3 square window; `win(x, y)` represents the 3×3 square window centered at (x, y); `(i, j)` represents the coordinates of any pixel within the window; `G(i, j)` represents the pixel value of pixel (i, j) within the window in the spectral guide map `G`; `SAAC(i, j)` represents the original asymmetric absorption offset value of pixel (i, j) within the window. Based on the spectral guide map, contrast fluctuation guided filtering is applied to the absorption contrast value to generate a filtered absorption contrast value for each pixel, specifically as follows: Using the same guided filtering framework as the asymmetric absorption offset value filtering described above, guided by the spectral guide map G, the neighborhood variation coefficient and reflection fluctuation value of the absorption contrast ratio are calculated respectively. The local confidence and adaptive smoothing intensity of each pixel are calculated in the same manner. Then, the guided filtering described above is performed to obtain the filtered absorption contrast value. Specifically, simply replace SAAC with Ratio in the steps, while keeping the other parameters (window size, modulation coefficient, smoothing intensity coefficient, etc.) unchanged.
[0026] The specific steps for curvature enhancement are as follows: Based on the reflectance values of each pixel in multiple spectral bands, a quadratic curve is fitted for the corresponding pixel, and the local spectral curvature of each pixel is extracted, specifically as follows: Three wavelengths are selected as independent variables λ, corresponding to the reflectivity of the pixel. As the dependent variable R(λ), a quadratic function curve is fitted using the least squares method. This quadratic curve can accurately characterize the reflectance variation trend of pixels in the infrared spectral range. The fitted quadratic function is as follows: ; Where R(λ) is the fitted value of reflectance at wavelength λ; λ is the infrared wavelength, and its values are respectively... =1.20μm =1.72μm, =2.00μm; a, b, and c are the fitting coefficients of the quadratic function, where a is the coefficient of the quadratic term, b is the coefficient of the linear term, and c is the constant term. These coefficients are obtained using the least squares method. The solution process is as follows: Construct the objective function...
[0027] Let be the number of wavelengths. Take the partial derivatives with respect to a, b, and c, and set the partial derivatives to 0. Solve the system of equations to obtain the optimal solutions for a, b, and c. For the first One infrared band wavelength; The local spectral curvature (Curv) is used to characterize the degree of curvature of the spectral curve, reflecting the drastic change in reflectance with wavelength. The spectral curve of the burn defect region is steeper and the absolute value of the curvature is larger. It is calculated using the second derivative of a quadratic function, as shown in the following formula: ; Where Curv is the local spectral curvature of the current pixel. When Curv is positive, the spectral curve bends upward, which corresponds to a higher probability of burn defect areas. When Curv is negative, the spectral curve bends downward, which corresponds to a higher probability of interference areas such as oil stains. When Curv is close to 0, the spectral curve tends to be flat, which corresponds to normal gear base areas. Hyperbolic tangent enhancement modulation is applied to the local spectral curvature to generate a curvature enhancement factor for each pixel, specifically as follows: Curvature enhancement factor Its function is to modulate the asymmetric absorption offset value of the filter, amplify the characteristic differences between the defective region and the normal region, and suppress noise amplification caused by excessive enhancement. The hyperbolic tangent function is used for nonlinear enhancement, and the calculation formula is as follows: ; in, α is the curvature enhancement factor, and β is the enhancement coefficient. α controls the enhancement amplitude, and β controls the degree of influence of curvature on the enhancement factor. The steps for obtaining α and β are as follows: Read the multispectral reflectance image samples of the gear tooth surface, calculate their enhanced spectral feature map according to the above steps, and manually mark the real pixel position of the burn defect, which is divided into training set (40 images) and validation set (10 images). Set the candidate value set of α to {0.2, 0.3, 0.4, 0.5, 0.6} and the candidate value set of β to {0.2, 0.4, 0.6, 0.8, 1.0}. Iterate through all (α, β) combinations. For each set of parameters, calculate the curvature enhancement factor of each pixel according to the above formula. Multiply the factor by the filtered asymmetric absorption offset value to obtain the enhanced asymmetric absorption offset value. For each set of parameters, the mean and variance of the enhanced asymmetric absorption offset values in the burn area and the oily area are calculated separately. The evaluation index is calculated as follows: the square of the difference between the mean value of the burn area and the mean value of the oily area, divided by the sum of the variances of the two areas. This index reflects the separability of the two types of features after enhancement. The larger the index value, the more obvious the difference between the characteristics of burns and oily areas. Iterate through all candidate parameter combinations, calculate the corresponding evaluation index for each group, and select the group (α, β) that maximizes the index value as the final value. Based on the curvature enhancement factor, the curvature of the filtered asymmetric absorption offset value is corrected to generate an enhanced asymmetric absorption offset value for each pixel. This is then combined with the filtered absorption contrast value to construct an enhanced spectral feature map, specifically as follows: The curvature enhancement factor Q and the filter asymmetric absorption offset value are used. Perform pixel-level multiplication to obtain the enhanced asymmetric absorption offset value. This achieves precise enhancement of defect features, and the calculation formula is as follows: ; in, The enhanced asymmetric absorption offset value at (x, y) of the current pixel point significantly enhances its defect features while suppressing the features of normal and interference regions. The curvature enhancement factor for the current pixel (x, y); The enhanced spectral feature map F is a dual-channel feature map, with dimensions identical to those of the acquired multispectral reflectance image and spectral guide map. Its two channels are the enhanced asymmetric absorption offset channel and the filtered absorption contrast value channel, respectively. The channel stitching method is as follows: ; Where F(x, y) is the feature vector of the enhanced spectral feature map at the pixel (x, y); This is the enhanced asymmetric absorption offset value for this pixel, used as the first channel, mainly to characterize the difference in spectral absorption asymmetry between the defect and normal regions; This is the filtered absorption contrast value of the pixel, which serves as the second channel and is mainly used to characterize the difference in spectral absorption contrast between defective and normal areas.
[0028] In this implementation scheme, multi-band infrared reflectance data is used to mine the spectral response patterns of the gear surface, capturing the microscopic absorption differences between the gear substrate and the grinding burn area. This effectively distinguishes between hidden burns and interference from machining textures, oil stains, carbon black, etc., and calculates exclusive spectral parameters differently. Combined with neighborhood statistics and adaptive fluctuation suppression, it dynamically adapts to gear surface reflection and ambient light disturbances, filtering out noise interference while preserving the edges of weak defects. Furthermore, it combines spectral curve fitting and curvature adaptive modulation to enhance the true defect features and weaken the influence of background information, outputting a dual-channel enhanced feature map with higher discrimination, thereby improving the stability and reliability of gear defect detection from the source.
[0029] Specifically, the gear defect recognition network includes several asymmetric offset modulation convolutional layers, contrast bias attention layers, downsampling compression layers, resolution restoration layers, cross-scale feature fusion layers, and an output layer. The specific steps for outputting the gear defect map are as follows: The enhanced spectral feature map is input into the first asymmetric offset modulation convolutional layer for dynamic convolution processing to extract the initial offset modulation feature map. The initial offset modulation feature map is sequentially passed through alternating stacks of downsampling compression layers and asymmetric offset modulation convolutional layers to progressively reduce resolution and extract deep features, generating a deep compressed feature map (i.e., the output of the last asymmetric offset modulation convolutional layer is denoted as the deep compressed feature map). Specifically: The downsampling compression layer can use a 3×3 convolutional kernel with a stride of 2. The number of output channels of each downsampling compression layer is twice that of the previous layer, which is used to reduce the feature map resolution, expand the receptive field, and reduce the amount of computation. Asymmetric offset modulation convolutional layers and downsampling compression layers are stacked alternately, with up to 4 groups (stacked in the following order: asymmetric offset modulation convolutional layer, downsampling compression layer, asymmetric offset modulation convolutional layer, downsampling compression layer, ..., for a total of 4 downsampling operations, ultimately yielding a deep compressed feature map). Let the size of the enhanced spectral feature map F be H×W×2 (H is the image height, W is the image width, and 2 is the number of channels). After processing by the first asymmetric offset modulation convolutional layer, the initial offset modulation feature map is output. After four downsampling operations, the final deep compressed feature map is obtained. (It contains high-level semantic information about tooth surface defects, which can effectively distinguish between minor defects and interference), and its specific expression is as follows: ; in, This represents the convolution operation of an asymmetric offset modulation convolutional layer, the core of which is to dynamically adjust the convolution kernel based on the asymmetric absorption offset value of the enhanced spectral feature map. The downsampling operation of the downsampling compression layer is implemented using a 3×3 convolution with a stride of 2. This stacked structure can extract deep features step by step, while retaining the detailed features of defects through asymmetric offset modulation of the convolutional layer. In the deep compressed feature map here, the pixel value in the channel represents the intensity of the feature corresponding to that position. The deep compressed feature map is input into the contrast bias attention layer, and after absorption contrast bias recalibration, the bias recalibrated feature map is obtained. The bias recalibrated feature map is sequentially passed through alternating stacks of resolution restoration layers and contrast bias attention layers to restore resolution level by level. The feature map output from each resolution restoration layer is then concatenated with the feature map output from the corresponding scale downsampling compression layer via a cross-scale feature fusion layer to obtain a cross-scale fused feature map, specifically as follows: The resolution restoration layer uses transposed convolution operation, with a kernel size of 3×3 and a stride of 2. The number of output channels of each resolution restoration layer is half that of the previous layer, which is used to gradually restore the resolution of the feature map, corresponding to the resolution change of the downsampling compression layer. The contrast bias attention layer and the resolution restoration layer are stacked alternately, and up to 4 groups can be set, which is consistent with the number of stackings in the downsampling stage; The cross-scale feature fusion layer uses channel stitching to stitch the feature map output by the resolution restoration layer with the feature map output by the asymmetric offset modulation convolutional layer at the corresponding scale in the downsampling stage, thereby achieving the fusion of deep semantic features and shallow detail features and avoiding feature loss during the resolution restoration process. Let the bias recalibration feature map be After the first resolution restoration layer processing, and then after the contrast bias attention layer processing, the result is... ;Will The feature map output from the third asymmetric offset modulation convolutional layer in the downsampling stage is concatenated with the feature map output from the third asymmetric offset modulation convolutional layer through a cross-scale feature fusion layer to obtain a fused feature map. ; Following this process, after four iterations of resolution restoration, attention bias, and cross-scale fusion, the final cross-scale fused feature map is obtained. (It integrates deep semantic features and shallow detail features, achieving a balance between defect recognition accuracy and localization accuracy), and its size is consistent with the enhanced spectral feature map F, with the specific expression as follows: ; in, This represents the channel splicing operation of the cross-scale feature fusion layer; This indicates the attention bias operation of the contrast bias attention layer; This represents the transpose convolution operation of the resolution restoration layer. The skip feature map is the output of the asymmetric offset modulation convolutional layer at the corresponding scale of the downsampling stage, which is used to provide shallow detail features; The cross-scale fusion feature map here specifically includes: a fusion feature matrix with multiple channels and the same size as the original image. Each channel fuses deep semantic features and shallow detail features at the corresponding location, which can accurately depict the location and shape of defects. The cross-scale fused feature map is mapped to a gear defect map through the output layer, specifically as follows: The output layer uses a 1×1 convolutional kernel to map multiple channels of the cross-scale fused feature map into a single channel, outputting a pixel-level defect probability map, i.e., the gear defect map P. The size of the gear defect map P is exactly the same as the size of the enhanced spectral feature map F and the original multispectral reflectance image. The value of each pixel represents the probability that the location belongs to a gear grinding burn defect, as shown in the following expression: ; Wherein, P(x,y) is the defect probability value of the gear defect image P at pixel (x,y), and the value range is [0,1]. The closer P(x,y) is to 1, the greater the possibility that the area corresponding to the pixel is a grinding burn defect. Use the Sigmoid activation function; This represents a 1×1 convolution operation in the output layer, used to map the fused features of multiple output channels to probability values of a single channel. This is the feature vector of the cross-scale fused feature map at pixel (x, y).
[0030] The specific steps for extracting the initial offset modulation feature map are as follows: For each pixel, the statistical value of the asymmetric absorption offset channel in the enhanced spectral feature map within a preset local neighborhood is taken as the modulation factor, specifically: The size of the local neighborhood can be 3×3. The first channel of the enhanced spectral feature map F is the enhanced asymmetric absorption offset value channel. Taking the current pixel (x, y) as the center, all pixels in the 3×3 local neighborhood are selected, and the arithmetic mean of the enhanced asymmetric absorption offset values of all pixels in the neighborhood is calculated as the modulation factor M(x, y). This modulation factor can reflect the intensity of the defect features in the local area. Multiple basic convolutional kernels are preset, and each basic convolutional kernel corresponds to an asymmetric absorption offset value range. Specifically, 6 basic convolutional kernels can be preset, each corresponding to 6 ranges of enhanced asymmetric absorption offset values (the range of enhanced asymmetric absorption offset values is evenly divided into 6 ranges). Each interval corresponds to one basic convolutional kernel. k is the number of basic convolutional kernels, k=1, 2, ..., 6. Each basic convolutional kernel has a size of 3×3, 2 input channels (consistent with the number of channels in the enhanced spectral feature map), and 16 output channels (which can be adjusted according to the network depth; in this embodiment, the first layer has 16 output channels, and subsequent layers double the number). The weights of the convolutional kernels are determined through pre-training to adapt to different intensities of defect features and interference features (such as...). Adaptable to areas with oil stains. (Adapt to areas with strong defects). The membership degree of the modulation factor to each interval is calculated using the Gaussian radial basis function. Based on the membership degree, the basic convolutional kernels are softly combined to generate the current convolutional kernel, specifically as follows: The Gaussian radial basis function (RBF) is used to calculate the membership degree of the modulation factor M(x, y) within each asymmetric absorption offset interval. The membership degree characterizes the degree of matching between the defect feature intensity of the current pixel and each basic convolution kernel. The calculation formula is as follows: ; in, This represents the membership degree of the current modulation factor to the interval corresponding to the k-th basic convolutional kernel. The value range is (0, 1]. The larger the value, the better the fit between the defect feature intensity of the current pixel and the k-th basic convolutional kernel. The center value of the k-th asymmetric absorption offset value interval; Let $\frac{k}{k}$ be the standard deviation of the $k$-th interval. The six membership degrees are normalized to ensure that the sum of the membership degrees is 1. The normalization formula is as follows: ; in, The normalized membership degree; Based on the normalized membership degrees, the six basic convolutional kernels are softly combined to generate the dynamic convolutional kernel D(x, y) corresponding to the current pixel, ensuring that the convolutional kernel can adaptively match the defect feature intensity of the current pixel. The specific expression is as follows: ; Where D(x, y) is the dynamic convolution kernel corresponding to the current pixel at (x, y). The current convolution kernel is the k-th basic convolution kernel. A convolution operation is performed on the enhanced spectral feature map using the current kernel, outputting an initial offset modulation feature map, specifically: A dynamic convolution kernel D(x, y) is used to perform pixel-by-pixel convolution on the enhanced spectral feature map F. During the convolution process, each pixel corresponds to a different dynamic convolution kernel to ensure that the convolution operation can adapt to the defect feature intensity of that pixel. The convolution calculation formula is as follows: ; in, Initial offset modulation feature map The feature value at pixel (x, y) reflects the initial defect features at that location; D(x, y, i, j) is the weight value of the dynamic convolution kernel corresponding to the current pixel (x, y) at position (u, v) (u, v∈{-1, 0, 1}, corresponding to the 9 positions of the 3×3 convolution kernel); F(x+u, y+v) is the feature vector (two-dimensional vector containing the values of two channels) of the enhanced spectral feature map F at pixel (x+i, y+j).
[0031] The specific steps to obtain the bias recalibration feature map are as follows: The global mean of the absorption contrast value channel in the enhanced spectral feature map is taken to obtain the global absorption contrast statistic, which is as follows: The second channel of the enhanced spectral feature map F is the absorption contrast value channel, representing the global absorption contrast statistics. Used to characterize the average absorption contrast level across the entire tooth surface; The deep compressed feature map is then subjected to global average pooling, followed by fully connected mapping to output the original attention weights, specifically: Global average pooling (GAP) is used to compress feature maps in deep layers. Dimensionality reduction is performed to preserve global information of deep features and avoid overfitting. The calculation formula for global average pooling is as follows: ; Where Gap is the feature vector after global average pooling, and its dimension is the same as the number of channels in the deep compressed feature map; H / 16 and W / 16 are the height and width of the deep compressed feature map; (x, y) is the feature vector of the deep compressed feature map at the pixel (x, y); The feature vector gap after global average pooling is input into the fully connected layer for dimension mapping, and the original attention weights are output. This weight is used to initially distinguish the importance of deep feature channels, and the calculation formula is as follows: ; in, These are the original attention weights, with the same dimensionality as the number of channels in the deep compressed feature map. Each value corresponds to a deep compressed feature. Figure 1 The weight of each channel; This is the weight matrix for a fully connected mapping. For bias terms in fully connected mappings; The global absorption contrast statistic is linearly transformed and used as a bias term, which is then fused with the original attention weights. This fusion is followed by activation using the Sigmoid function to obtain the final channel attention weights, which are as follows: Global absorption contrast statistics Perform a linear transformation to make its dimensions the same as the original attention weights. Consistent, as the attention bias term B, the linear transformation formula is as follows: ; Where B is the attention bias term, with a dimension of 1×1024; These are the linear transformation coefficients, with a value of 0.3; This is the linear transformation bias term, with a value of 0.5; The attention bias term B is fused with the original attention weights, and then activated by the Sigmoid function to obtain the final channel attention weights. This weight can adaptively adjust the importance of each channel in the deep compressed feature map, strengthen the weight of defective feature channels, and suppress the weight of interfering feature channels. The calculation formula is as follows: ; in, The final channel attention weights have values ranging from [0, 1], with each value corresponding to a deep compressed feature. Figure 1 The final weight of each channel; the larger the value, the more important the defect feature of that channel. Based on the final channel attention weights, each channel of the deep compressed feature map is recalibrated, and a bias recalibrated feature map is output, specifically as follows: Using final channel attention weights Deep compressed feature map Channel-level recalibration is performed, which involves multiplying the feature map of each channel by the corresponding attention weight at the pixel level. This enhances the features of important channels and suppresses the features of unimportant channels. The calculation formula is as follows: ; in, For bias recalibration feature map The feature vector of the middle pixel at (x, y); represents the feature vector at pixel (x, y) of the deep compressed feature map; ⊙ represents pixel-level multiplication (channel-to-channel multiplication), and the size of the bias recalibrated feature map is related to the deep compressed feature map. Figure 1 To.
[0032] The pre-training steps for the gear defect recognition network are as follows: Generate an empty feature map template of a preset size. This template contains two channels: asymmetric absorption offset value and absorption contrast value. The initial values of both are zero. Specifically: The size of the preset empty feature map template T is consistent with the size of the actual acquired enhanced spectral feature map. The two channels of the empty feature map template correspond to the asymmetric absorption offset value channel (first channel) and the absorption contrast value channel (second channel), respectively. The initial value of all pixels in the template is 0, that is, T(x, y, 1) = 0, T(x, y, 2) = 0 (x∈[1, H], y∈[1, W]), where T(x, y, 1) represents the value of the first channel of the template at pixel (x, y), and T(x, y, 2) represents the value of the second channel. Control points of Bézier curves are randomly generated, and closed contours in the form of strips, arcs, and patches are constructed through interpolation to serve as the boundaries of the simulated defect region. Specifically: Bézier curves are used to construct the boundaries of simulated defect regions, accurately simulating typical morphologies of gear grinding burn defects (strip-shaped and arc-shaped, corresponding to linear burns during gear grinding; patch-shaped, corresponding to localized severe burns). Each simulated defect region corresponds to a set of Bézier curve control points, the number of which is determined by the defect morphology: strip-shaped and arc-shaped defects are selected with 4 control points (forming a quadratic Bézier curve), while patch-shaped defects can be selected with 6 control points (forming a cubic Bézier curve). The coordinates of the control points are randomly generated within the range of the empty feature map template to ensure that the defect area is located within the template and that the defect size conforms to the actual size range of gear grinding burns (e.g., strip-shaped defects have a length of 5~20 pixels and a width of 1~3 pixels; arc-shaped defects have a radius of 10~30 pixels and a width of 1~3 pixels; patch-shaped defects have an area of 20~100 pixels²). The de Castelli algorithm is used to interpolate the control points and generate a smooth closed contour C, which serves as the boundary of the simulated defect region. The specific expression is as follows (taking a quadratic Bézier curve as an example): ; Where C(t) is the coordinate point of the Bézier curve at parameter t, which constitutes the boundary of the simulated defect area; t is the interpolation parameter, which takes values in the range of [0, 1]. When t changes from 0 to 1, C(t) forms a complete closed contour. To supplement the three control points of the quadratic Bézier curve (for strip-shaped and arc-shaped defects), a fourth control point is needed. The closed contour (forming a cubic Bézier curve) has coordinates (x, y) and a range of values of [1, H] × [1, W]. This closed contour can accurately simulate the shape of real burn defects and ensure the authenticity of the synthetic sample. The closed contour C here specifically includes: a series of continuous coordinate points (x, y) forming a smooth closed curve, which is used to divide the boundary between the simulated defect area and the normal area. The internal region of the closed contour is filled in the empty feature map template using the asymmetric absorption offset value channel and the absorption contrast value channel, specifically as follows: A region-filling algorithm, such as flood fill, is used to divide the area inside the closed contour C into target regions. Based on four preset region types (burn, oil stain, carbon black, and normal), numerical filling is performed on two channels of the empty feature map template T. The filling rules conform to the spectral characteristics of each region on the real gear tooth surface, ensuring the physical rationality of the synthesized sample. For example: Burned area (target defect area): The asymmetric absorption offset value channel is filled with random positive numbers between 0.4 and 0.7, and the absorption contrast value channel is filled with random positive numbers (larger values) between 1.2 and 1.6. Oil pollution interference area: the asymmetric absorption offset value channel is filled with random negative numbers between -0.7 and -0.4, and the absorption contrast value channel is filled with random numbers (smaller values) between 0.4 and 0.8. Carbon black interference region: the asymmetric absorption offset value channel is filled with random numbers between -0.1 and 0.1, and the absorption contrast value channel is filled with random numbers between 0.0 and 0.2 (very small values). Normal region: Asymmetric absorption offset value channel is filled with random numbers between -0.05 and 0.05, and absorption contrast value channel is filled with random numbers between 0.9 and 1.1 (close to 1). Gaussian noise is added to each of the two channels of the filled empty feature map template. The two channels are stacked to form a synthetic enhanced spectral feature map. Pixel-level binary labels are automatically generated based on the category of the region inside the closed contour: the burned area is labeled 1, and the other areas are labeled 0. These labels are paired with the synthetic enhanced spectral feature map to form a synthetic training set, specifically: Add Gaussian noise to each of the two channels after filling. The noise standard deviation Take 5% to 10% of the fill range. For example, for the asymmetric absorption offset channel in a burn area, the fill range amplitude is 0.7 − 0.4 = 0.3, therefore take... =0.015~0.03, stack the two channels after adding noise into a two-channel image, that is, synthesize an enhanced spectral feature map; Repeat the above steps (randomly generate control points, construct closed contours, and fill regions) to generate a predetermined number (no less than 1000) of synthetic enhanced spectral feature maps, forming the basic sample set for network pre-training. Simultaneously, label each synthetic enhanced spectral feature map with a corresponding pixel-level defect image, the label image size being the same as the synthetic feature map size. Figure 1Defective areas (burned areas) are labeled as 1, and non-defective areas (oil stains, carbon black, normal areas) are labeled as 0. This is used for supervised learning in network training, and the weights of each layer of the gear defect recognition network are initialized: the weights of the convolutional layer and the fully connected layer are uniformly initialized using Xavier, and the bias term is initialized to 0. The gear defect recognition network was trained using a synthetic training set. The total loss function of the synthetic prior training was jointly optimized by binary cross-entropy loss and spectral prior constraint loss. The spectral prior constraint loss was calculated as follows: for each pixel, if the asymmetric absorption offset value was positive and the burn probability output by the network was less than 0.5, or if the asymmetric absorption offset value was negative and the burn probability output by the network was greater than 0.5, a penalty term was added. (It should be noted that the spectral prior constraint loss is mainly supervised based on the physical sign of the asymmetric absorption offset value, while the absorption contrast ratio indirectly participates in the constraint through the subsequent attention bias mechanism; the two work together.) For each pixel of each synthetic sample (i.e., the synthetic enhanced spectral feature map) in the synthetic training set, if the asymmetric absorption offset value is positive and the burn probability output by the network is less than 0.5, or if the asymmetric absorption offset value is negative and the burn probability output by the network is greater than 0.5, a penalty term is accumulated, specifically as follows: The network forward inference outputs a pixel-by-pixel burn prediction probability map, synchronously retrieving the original asymmetric absorption offset values from the input layer; pixel-by-pixel logical mechanism constraints are used for decision-making, constructing a differentiable spectral prior constraint penalty loss function. The formula for calculating the spectral prior constraint loss is as follows: ; in: The loss is a penalty for prior constraints on single-pixel spectral data. To synthesize and enhance the asymmetric absorption shift value in the spectral feature map; The network outputs pixel-level burn prediction probability, with a value ranging from 0 to 1; To balance the penalty weighting coefficients, a unified preset is used. , If the prediction of the positive defect physical region is too low and the prediction of the negative background region is too high, a penalty will be automatically applied. The total spectral prior constraint loss is obtained by summing the values pixel by pixel across the entire domain. This loss is then combined with the standard pixel-level binary classification cross-entropy semantic loss and weighted to construct a global joint total loss function. : ; in, For pixel-by-pixel binary classification, cross-entropy loss, These are the weighting coefficients for spectral prior constraints. This represents the total number of pixels in the feature map. The gear defect recognition network was trained using the above-mentioned synthetic training set. The optimizer was Adam, the initial learning rate was set to 0.001, the batch size was set to 16, and a total of 100 epochs were trained. Iterative optimization was carried out through end-to-end backpropagation to force the network to obey the physical law of multispectral absorption asymmetry while learning visual morphology, thereby preventing the network from overfitting to light and shadow artifacts and improving the generalization ability of hidden burns. A small number of real gear samples were collected, and after multispectral reflectance image acquisition, feature extraction, and enhancement processing, real enhanced spectral feature maps were obtained. Experts then performed pixel-level annotation of the burn areas to construct a real training set, specifically as follows: Select a small number (e.g., 50) of carburized and quenched gear samples. These samples should include different degrees of burns, oil stains, carbon black, and normal areas. Process each sample in the order described above to obtain the true enhanced spectral feature map of each sample. The burn area of each sample is determined by non-destructive testing experts using acid etching or Barkhausen method. Then, pixel-level binary labels are generated at the spatial location corresponding to the real enhanced spectral feature map, where the burn area is marked as 1 and the other areas are marked as 0. All labeled real samples and their labels are paired to form a real training set; The gear defect recognition network trained with synthetic priors was subjected to experimental fine-tuning training using a real training set. During experimental fine-tuning training, a lower learning rate than that used in the synthetic prior training stage was employed, and the spectral prior constraint loss term was retained. This resulted in a fully trained gear defect recognition network, specifically: The network parameters obtained in the synthetic prior training phase are loaded, and the network is trained again using the real training set. The loss function remains in the same form as in the synthetic prior training phase, the learning rate is reduced to 0.0001, and the training is performed for 20 epochs. Finally, a fully trained gear defect recognition network is obtained, which can perform high-precision pixel-level segmentation of gear tooth surface burn defects.
[0033] In this implementation scheme, the gear defect recognition network adopts a multi-level encoding and decoding and cross-scale fusion design to simultaneously capture shallow details and deep semantic information. It also uses spectral offset data to generate dynamic convolutional kernels in real time and adaptively matches the real morphology of burns to complete feature extraction. Furthermore, it introduces a contrast-biased attention mechanism and combines it with a global spectral absorption benchmark to recalibrate channel weights, thereby strengthening defect features and accurately locating hidden burn areas. During the training phase, it constructs synthetic samples that fit the spectral rules in batches through simulated contours and completes prior learning by combining spectral prior constraints with joint loss. Then, it is fine-tuned and adapted with a small number of real samples. Therefore, it can be quickly deployed without a large amount of manual annotation, which steadily improves the accuracy of burn localization and reduces recognition deviations under complex on-site working conditions.
[0034] Specifically, such as Figure 2As shown, the specific steps for generating gear defect evaluation values are as follows: Adaptive threshold segmentation is performed on the gear defect image to obtain a binary image of the gear defect, as follows: The defect probability values of all pixels in the gear defect image are traversed, and the global threshold is calculated using the Otsu adaptive segmentation algorithm. And generate the initial binary image Z according to the following formula:
[0035] in, The first value is the binarized value of the pixel at (x, y) in the initial binary image; the second value is the value that does not meet the above conditions. Other situations; Morphological operations are performed on the binary image of gear defects based on preset structuring elements. Connectivity analysis is then performed based on the morphological operation results to extract the attribute set of each connected component, including defect area, defect eccentricity, spindle direction, and gear defect probability. Specifically: An elliptical structuring element is used to perform an opening operation (erosion followed by dilation) on Z. In this embodiment, the size of the elliptical structuring element is 5×3 pixels (5 pixels on the major axis and 3 pixels on the minor axis), and its direction is parallel to the gear tooth direction. The opening operation can remove isolated noise points. The result of the opening operation is closed using a linear structuring element (dilation followed by erosion). The linear structuring element is 7 pixels long and 1 pixel wide, and its direction is consistent with the gear tooth direction. The closing operation is used to connect the broken strip or arc-shaped burn areas. The length of the linear structuring element should be greater than the common fracture interval in the burn area (usually 3 to 5 pixels). The morphologically processed binary graph is labeled with connected components (e.g., eight-neighbor global connected components) to obtain several connected components. Defect area, defect eccentricity, spindle direction, and gear defect probability are then extracted. Defect area: The number of pixels contained within this connected region; Defect eccentricity: Fit an ellipse to the connected region and take the ratio of the major axis to the minor axis of the ellipse. Its value is between [0, 1]. The closer it is to 1, the more slender the shape is. Principal axis direction: The angle between the major axis of the fitted ellipse and the horizontal direction, with a value range of 0°-180°; Gear defect probability: The mean defect probability of all pixels in the connected domain; The connected components corresponding to the attribute set that meet the preset filtering conditions are taken as defective regions, specifically: The attribute set of connected components is filtered according to the following preset conditions. Only connected components that meet all the conditions are judged as defective regions: The defect eccentricity is greater than the first preset threshold (range 0.6~0.8, preferably 0.7 in this embodiment); this condition can exclude oil stains with high roundness, and the defect area is greater than the second preset threshold (range 5~20 pixels, preferably 10 pixels in this embodiment). Isolated points below this threshold are considered noise. The angle between the spindle direction and the gear tooth direction (a preset reference direction, which is the direction angle of the gear tooth line, for example, the tooth line of a spur gear is parallel to the projection of the gear axis onto the tooth surface, and can be set to the horizontal direction, i.e. 0°) is less than the third preset threshold (the value range is 15°~45°, and 30° is preferred in this embodiment). This condition is used to eliminate noise with messy directions. Connected regions that meet the above conditions are considered defective regions. The attribute set of the defect area is comprehensively processed to obtain the gear defect evaluation value, which is as follows: Calculate the sum of the defect areas of all defect regions and compare it with the total area of the gear defect map (i.e., the sum of the total pixels) to obtain the defect percentage value. The average defect probability is obtained by averaging the gear defect probabilities of all defective regions. The average deviation of the principal axis direction is obtained by averaging the angles between the principal axis direction of all defective areas and the preset reference direction. The defect percentage, average defect probability, and average spindle direction deviation are normalized, and then weighted according to the normalization results to obtain the gear defect assessment value. ,Right now: ; in, This represents the defect percentage after normalization. The normalized average defect probability. This represents the normalized average principal axis direction deviation. The weighting coefficients for the normalized defect percentage, average defect probability, and average principal axis deviation are, in order. The steps to obtain it are as follows: Obtain each carburized and quenched gear sample from the real training set, and following the steps described above, extract the normalized defect percentage, average defect probability, and average spindle direction deviation for each carburized and quenched gear sample. Extract the mean of these indicators for all carburized and quenched gear samples, and sum them to obtain the defect sum value. Ratio the mean of these indicators to the defect sum value, and use the resulting values as the basis for the calculation. .
[0036] In this implementation scheme, an adaptive algorithm is used to autonomously divide the effective defect area, adapting to different differences in brightness and darkness on the tooth surface and imaging changes. By optimizing the binary image through morphological operations, scattered noise interference is removed, the true defect texture of the fracture is connected, and the overall target outline is regularized. Then, by combining multiple regional features to carry out connected component screening, irrelevant stains, scattered noise and other invalid targets are filtered from the perspective of morphological scale and direction, and the effective area that fits the true burn characteristics is accurately retained. Furthermore, multiple types of key regional information are integrated to carry out unified weighted calculation, and the evaluation score is output in an integrated manner based on the dimensions of defect distribution, confidence level and extension direction. This can objectively reflect the overall integrity of the gear tooth surface and effectively improve the accuracy of gear defect identification.
[0037] Please see Figure 3 The present invention provides a technical solution: a gear defect identification system based on deep learning, comprising: a spectral data acquisition unit, used to acquire multispectral reflectance image data of the gear to be identified, which is the reflectance value of each pixel in the multispectral reflectance image in multiple bands; The spectral feature extraction and enhancement unit extracts asymmetric absorption offset and absorption contrast values pixel by pixel from multispectral reflectance image data, and performs adaptive confidence-guided filtering and curvature enhancement processing guided by preset bands to generate an enhanced spectral feature map. The dynamic convolutional attention learning unit performs dynamic convolution and attention bias on the enhanced spectral feature map based on a pre-trained gear defect recognition network to output a gear defect map. The defect evaluation and recognition unit performs eccentric screening and evaluation processing on the gear defect map, generates a gear defect evaluation value, and performs defect recognition processing on the gear to be identified.
[0038] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0039] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A gear defect identification method based on deep learning, characterized in that, Includes the following steps: Collect multispectral reflectance image data of the gear to be identified, which is the reflectance value of each pixel in the multispectral reflectance image in multiple bands; For multispectral reflectance image data, asymmetric absorption offset value and absorption contrast value are extracted pixel by pixel, and adaptive confidence-guided filtering and curvature enhancement processing are performed with preset bands to generate enhanced spectral feature maps. Based on a pre-trained gear defect recognition network, dynamic convolution and attention bias are applied to the enhanced spectral feature map to output a gear defect map. The gear defect image is subjected to eccentric screening and evaluation processing to generate gear defect evaluation values, and the defect identification processing is performed on the gear to be identified.
2. The gear defect identification method based on deep learning according to claim 1, characterized in that, The specific steps for extracting the asymmetric absorption offset value and absorption contrast value pixel by pixel are as follows: Read the reflectance values of each pixel in multiple wavelength bands; Differential comparison processing is performed on the reflectivity values to obtain the asymmetric absorption offset values of the corresponding pixels; The reflectance values are then subjected to absorption equalization processing to obtain the absorption contrast values of the corresponding pixels.
3. The gear defect identification method based on deep learning according to claim 2, characterized in that, The specific steps of adaptive confidence-guided filtering are as follows: A spectral guide map is constructed using the reflectance value of each pixel in a preset band. And take a square window of a preset size as the center of each pixel, and count the asymmetric offset neighborhood variability within the corresponding square window. At the same time, count the reflection fluctuation value of the spectral guide map within the same square window. The asymmetric offset neighborhood variability and reflection fluctuation value are subjected to fluctuation suppression modulation to generate the local confidence of each pixel and construct the adaptive smoothing intensity. A guided filtering algorithm is used to filter the asymmetric absorption offset value with the spectral guide map and adaptive smoothing intensity as parameters, and the filtered asymmetric absorption offset value of each pixel is output. Based on the spectral guide map, the absorption contrast value is subjected to contrast fluctuation guided filtering to generate the filtered absorption contrast value for each pixel.
4. The gear defect identification method based on deep learning according to claim 3, characterized in that, The specific steps for curvature enhancement are as follows: Based on the reflectance values of each pixel in multiple bands, a quadratic curve is fitted, and the local spectral curvature is extracted. Hyperbolic tangent enhancement modulation is applied to the local spectral curvature to generate a curvature enhancement factor; Based on the curvature enhancement factor, the curvature of the filtered asymmetric absorption offset value is corrected to generate an enhanced asymmetric absorption offset value. Combined with the filtered absorption contrast value, an enhanced spectral feature map is constructed.
5. The gear defect identification method based on deep learning according to claim 1, characterized in that, The specific steps for generating a gear defect diagram are as follows: The enhanced spectral feature map is input into the asymmetric offset modulation convolutional layer for dynamic convolution processing to extract the initial offset modulation feature map. The initial offset modulation feature map is sequentially passed through downsampling compression layers and asymmetric offset modulation convolutional layers to progressively reduce the resolution and extract deep features, thereby generating a deep compressed feature map. The deep compressed feature map is input into the contrast bias attention layer, and after absorption contrast bias recalibration, the bias recalibrated feature map is obtained. The bias recalibrated feature map is sequentially passed through an alternating stack of resolution restoration layers and contrast bias attention layers to restore resolution step by step, and then stitched together by a cross-scale feature fusion layer to obtain a cross-scale fused feature map. The cross-scale fused feature map is mapped to a gear defect map through the output layer.
6. The gear defect identification method based on deep learning according to claim 5, characterized in that, The specific steps for extracting the initial offset modulation feature map are as follows: For each pixel, the statistical value of the asymmetric absorption offset value in the enhanced spectral feature map within a preset local neighborhood is taken as the modulation factor. Multiple basic convolutional kernels are preset, and each basic convolutional kernel corresponds to an asymmetric absorption offset value range; The membership degree of the modulation factor to each interval is calculated using the Gaussian radial basis function. Based on the membership degree, the basic convolution kernels are softly combined to generate the current convolution kernel. Perform a convolution operation on the enhanced spectral feature map using the current convolution kernel, and output the initial offset modulation feature map.
7. The gear defect identification method based on deep learning according to claim 5, characterized in that, The specific steps to obtain the bias recalibration feature map are as follows: The global mean of the absorption contrast value of all pixels in the enhanced spectral feature map is taken to obtain the global absorption contrast statistic. The deep compressed feature map is then subjected to global average pooling and then fully connected mapping to output the original attention weights. The global absorption contrast statistic is linearly transformed and used as a bias term, which is then fused with the original attention weights to obtain the final channel attention weights. The deep compressed feature map is recalibrated based on the final channel attention weights, and the bias recalibrated feature map is output.
8. The gear defect identification method based on deep learning according to claim 5, characterized in that, The pre-training steps for the gear defect recognition network are as follows: Determine the empty feature map template of the preset size; Randomly generate control points for the Bézier curve and construct a closed contour through interpolation; Fill the internal region of the closed contour in the empty feature map template; Gaussian noise was added to the filled empty feature map templates to construct synthetic enhanced spectral feature maps and form a synthetic training set; The gear defect recognition network is trained using a synthetic training set. The total loss function of the synthetic prior training is jointly optimized by the binary cross-entropy loss and the spectral prior constraint loss. Real gear samples were collected to construct a real training set, and the gear defect recognition network trained by prior measurements was subjected to experimental fine-tuning training to obtain a fully trained gear defect recognition network.
9. The gear defect identification method based on deep learning according to claim 1, characterized in that, The specific steps for generating gear defect assessment values are as follows: Adaptive threshold segmentation is applied to the gear defect image to obtain a binary image of the gear defect; Morphological operations are performed on the binary image of gear defects based on the preset structuring elements, and connected component analysis is performed in combination with the morphological operation results to extract the attribute set of each connected component, including defect area, defect eccentricity, spindle direction and gear defect probability. Connected components corresponding to attribute sets that meet preset filtering conditions are considered defective regions. The attribute set of the defect area is comprehensively processed to obtain the gear defect evaluation value.
10. A gear defect identification system based on deep learning, employing the gear defect identification method based on deep learning according to any one of claims 1-9, characterized in that, include: The spectral data acquisition unit is used to acquire multispectral reflectance image data of the gear to be identified, which is the reflectance value of each pixel in the multispectral reflectance image in multiple bands; The spectral feature extraction and enhancement unit is used to extract asymmetric absorption offset values and absorption contrast values pixel by pixel from multispectral reflectance image data, and perform adaptive confidence-guided filtering and curvature enhancement processing guided by preset bands to generate enhanced spectral feature maps. The dynamic convolutional attention learning unit is used to perform dynamic convolution and attention bias on the enhanced spectral feature map based on the pre-trained gear defect recognition network, and output the gear defect map. The defect assessment and identification unit is used to perform eccentric screening and assessment processing on the gear defect diagram, generate gear defect assessment values, and perform defect identification processing on the gear to be identified.