A surface defect identification method and system for an automobile gearbox housing

By employing a zero-shot anomaly detection model based on cross-modal contrastive learning and anomaly perception calibration, the inconsistencies of manual inspection and the insufficient generalization ability of existing machine vision methods in the identification of surface defects in gearbox housings are addressed, achieving efficient and accurate surface defect identification.

CN122175911APending Publication Date: 2026-06-09ANHUI XISU MACHINERY TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANHUI XISU MACHINERY TECHNOLOGY CO LTD
Filing Date
2026-03-05
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing technologies rely on manual inspection for identifying defects on the surface of automotive transmission housings, which suffers from strong subjectivity, inconsistent results, and poor accuracy. Furthermore, existing machine vision methods have limited generalization capabilities in scenarios with data noise or distribution offset.

Method used

A cross-modal contrastive learning method based on a large-scale pre-trained visual encoder and text encoder is adopted, combined with anomaly perception calibration, to build a zero-shot anomaly detection model. Through cross-modal contrastive learning and anomaly perception calibration, real-time defect identification of the gearbox housing surface is achieved, reducing the dependence on a large number of normal samples.

Benefits of technology

It improves the accuracy and efficiency of identifying surface defects in gearbox housings, demonstrates good generalization ability on unknown defect types, reduces the risk of missed detections, and improves the consistency and accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122175911A_ABST
    Figure CN122175911A_ABST
Patent Text Reader

Abstract

The application discloses a surface defect identification method and system of an automobile gearbox shell, relates to the related field of industrial product quality detection technology, and acquires the surface image of the automobile gearbox shell in real time, and carries out pretreatment, locates and extracts the region to be detected through adaptive background segmentation, highlights the contour boundary of the gearbox shell, improves the visual features of the surface image through multi-scale detail enhancement and light suppression method, and reduces the light interference of the metal surface; a defect identification model based on zero sample anomaly detection is built, the anomaly recognition ability of a large model is used, a pre-training defect identification model is acquired through cross-modal contrast learning of images and texts; the pretreated gearbox shell surface image is input into the pre-training model, an abnormal distribution heat map of the gearbox shell surface is output in real time, and the defect type and position are identified. The application solves the problem that the existing method excessively depends on samples and has high model training cost, improves the model generalization, and improves the identification precision and efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of industrial product quality inspection technology, and in particular to a method and system for identifying surface defects in automotive gearbox housings. Background Technology

[0002] In the casting process of automotive transmission housings, the identification of surface defects of the transmission housing refers to the automated or semi-automated inspection and analysis of the surface of the transmission housing using visual inspection or human observation to determine and locate whether there are any appearance defects on its surface that do not meet quality standards.

[0003] Strict surface defect identification of automotive transmission housings can ensure product performance. Surface defects may be external manifestations of deeper internal quality problems, and timely identification can avoid potential safety risks. Quality control of automotive transmission housings through surface defect identification can effectively prevent unqualified products from entering the market, reduce after-sales problems, and protect the company's reputation.

[0004] Traditional methods rely on manual visual inspection or manual measurement with contact measuring tools. This approach is highly subjective, has inconsistent standards, and seriously affects the consistency and accuracy of the test results. Manual inspection is slow and carries the risk of missed detections. Under strong interference from the metal surface of the gearbox, the inspection accuracy will drop significantly.

[0005] Existing methods incorporate machine vision and anomaly detection principles, using neural network-based visual detection models to analyze and process surface images of automotive gearbox housings, automatically outputting the identification results of surface defects. However, existing anomaly detection methods rely on sufficient and clean normal data, and their generalization ability will be limited in scenarios where the data contains noise or distribution shifts. Summary of the Invention

[0006] To address the technical problems of the prior art, this application provides a method and system for identifying surface defects in automotive gearbox housings. It establishes a defect identification model based on a large-scale pre-trained visual encoder and text encoder, and performs real-time defect identification on the gearbox housing surface through cross-modal contrastive learning and anomaly perception calibration. This solves the problem of existing defect identification models relying on a large number of normal samples, enabling the model to exhibit good generalization ability on unknown defect types and improving identification accuracy and efficiency.

[0007] This application provides a method for identifying surface defects in an automotive transmission housing, including:

[0008] Step S10: During the casting process of the automotive gearbox housing, real-time images of the gearbox housing surface are acquired. Step S20: Preprocess the image of the gearbox housing surface, locate and extract specific areas to be detected on the surface of the gearbox housing through adaptive background segmentation, and improve the visual features of the image by using multi-scale detail enhancement and reflection suppression methods to reduce the reflection interference of the metal surface of the gearbox housing. Step S30: Build a defect recognition model based on zero-shot anomaly detection. Take the surface defects of the gearbox housing as the anomaly condition, utilize the anomaly recognition capability of the large model, apply visual and text encoders through cross-modal contrastive learning, combine the anomaly perception calibration module, classify and locate the surface defects of the gearbox housing, and generalize to unknown defect types to obtain a pre-trained defect recognition model. Step S40: Input the preprocessed image of the gearbox housing surface into the pre-trained defect recognition model, and output the abnormal distribution heat map of the gearbox housing surface in real time to determine the defect type and location.

[0009] Furthermore, zero-shot anomaly detection can directly identify and locate anomalous regions in an image without using any training samples from the target scene. The core of this method lies in utilizing the prior knowledge learned by the model on a large amount of general data and transferring it to specific anomaly detection tasks. The main ideas include the following: Leveraging the generalization capabilities of pre-trained models, and based on a large-scale pre-trained model on a massive dataset, this method utilizes the rich visual concepts and semantic features learned by the model to achieve cross-domain anomaly detection. By defining the semantic concepts of normal and abnormal through text prompts, the method guides the model to understand abnormal states under specific categories. Furthermore, it compares the similarity between the features of the image to be detected and the text features representing normal and abnormal states, and identifies regions that match the two modalities more closely as abnormal regions.

[0010] Furthermore, the problem definition of zero-shot anomaly detection can be described as follows: Given test samples ,in Represents a matrix, and These represent the height and width of the sample image, respectively; the goal of zero-shot anomaly detection is to generate pixel-level anomaly heatmaps. Build the model and use the auxiliary dataset. Training was conducted on [the platform]. , This represents the total number of samples in the dataset, which includes both normal and abnormal samples. and its corresponding real annotation mask The trained model will be tested on a disjoint test dataset. An evaluation will be conducted on the above. This represents the total number of samples in the test dataset, which contains unknown images from different benchmarks and domains. To ensure a zero-sample setting, the auxiliary and test datasets meet a non-overlapping condition.

[0011] This application also provides a surface defect identification system for automotive transmission housings, including: Transmission housing image acquisition module: Acquires real-time images of the transmission housing surface during the casting process of the automotive transmission housing; The gearbox housing image preprocessing module is used to preprocess the surface image of the gearbox housing. It locates and extracts specific areas to be detected on the surface of the gearbox housing through adaptive background segmentation, and improves the visual features of the image by using multi-scale detail enhancement and reflection suppression methods to reduce reflection interference on the metal surface of the gearbox housing. Zero-shot defect recognition model training module: used to build a defect recognition model based on zero-shot anomaly detection. Taking the surface defects of the gearbox housing as the anomaly condition, it utilizes the anomaly recognition capability of a large model, through cross-modal contrastive learning, applies visual and text encoders, and combines anomaly perception calibration module to classify and locate the surface defects of the gearbox housing, and generalizes to unknown defect types to obtain a pre-trained defect recognition model. Online defect identification module for gearbox housing: It is used to input the pre-processed surface image of the gearbox housing into the pre-trained defect identification model, and output the abnormal distribution heat map of the gearbox housing surface in real time to determine the defect type and location.

[0012] This application also proposes a surface defect identification device for an automotive transmission housing. The device includes a memory, a processor, and a program such as an automotive transmission housing surface defect identification algorithm stored in the memory and executable on the processor. The automotive transmission housing surface defect identification algorithm and other programs are steps for implementing the surface defect identification method for an automotive transmission housing as described above.

[0013] This application also provides a computer program product, which includes a program such as a surface defect identification algorithm for an automotive transmission housing. When the program such as the surface defect identification algorithm for an automotive transmission housing is executed by a processor, it implements the surface defect identification method for an automotive transmission housing as described above.

[0014] The present invention discloses the following technical effects: This invention provides a method for identifying surface defects in automotive transmission housings. Based on zero-shot anomaly detection, it applies a large-model vision and text encoder to process transmission housing surface images in real time, achieving accurate surface defect identification. This invention applies zero-shot anomaly detection to transmission housing surface defect detection, omitting the step of collecting a large number of normal and abnormal image samples in existing visual inspection methods. In the casting and production process of automotive transmission housings, the types of surface defects are diverse, making it difficult to collect image samples for model training and cover all operating conditions. The defect identification model applied in this invention consists of a pre-trained large-model vision and text encoder, possessing strong generalization capabilities. It can quickly and accurately transfer the learned visual and textual features to the field of automotive transmission housing detection. Based on cross-modal comparative learning of images and text, and utilizing the generative interaction between modalities, it further aligns visual and textual features in the semantic space through anomaly perception calibration, accurately locating abnormal regions and improving the accuracy and efficiency of identifying surface defects in automotive transmission housings. Attached Figure Description

[0015] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings of the embodiments of the present invention will be briefly described below. Flowcharts are used in this application to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed precisely in sequence. Instead, various steps can be processed in reverse order or simultaneously as needed. Furthermore, other operations can be added to these processes, or one or more steps can be removed from these processes.

[0016] Figure 1 This is a flowchart illustrating a method for identifying surface defects in an automotive transmission housing, as provided in an embodiment of this application.

[0017] Figure 2 A detailed structural diagram of the defect identification model provided in the embodiments of this application.

[0018] Figure 3 This is a schematic diagram of the structure of a surface defect identification system for an automotive transmission housing provided in an embodiment of this application. Detailed Implementation

[0019] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below.

[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description of this application will be provided in conjunction with the accompanying drawings. The described embodiments should not be considered as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] In the following description, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those explicitly listed, but may include other steps or modules not explicitly listed or inherent to such processes, methods, products, or devices. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only.

[0022] Example 1: This application provides a method for identifying surface defects in an automotive gearbox housing, such as... Figure 1 As shown, the method includes: Step S10: During the casting process of the automotive gearbox housing, real-time images of the gearbox housing surface are acquired.

[0023] In this embodiment, the detection target is defined before image acquisition, including the type of automotive transmission to be inspected, the inspection range of the transmission housing, the type of defect, and the operating speed of the conveyor belt; the image acquisition hardware system is then built based on the detection target. To avoid the jelly effect that occurs when photographing the high-speed moving gearbox housing on the conveyor belt during the casting process, select an industrial color camera with a global shutter. Set the camera resolution according to the test range, and ensure the camera frame rate is higher than the running speed of the casting conveyor belt. Fix the camera on the bracket with the lens facing the surface of the gearbox housing to be inspected, keeping it vertical. Install a trigger sensor. When the gearbox housing passes the sensor, the sensor sends a signal to trigger the camera to take a picture, achieving real-time synchronous data acquisition.

[0024] The detailed steps for acquiring images of the surface of an automotive transmission housing are as follows: During the casting process, the automotive gearbox housing moves along the conveyor belt and enters the inspection station, blocking the trigger sensor. The sensor immediately sends a trigger signal to the camera's image acquisition card. After receiving the signal, the acquisition card controls the light source to turn on momentarily before the camera exposure. The camera performs one exposure to capture the surface image of the gearbox housing. After the exposure, the light source is turned off. The captured image data is transmitted to the industrial control computer's memory for subsequent image preprocessing and surface defect identification.

[0025] Step S20: Preprocess the image of the gearbox housing surface, locate and extract specific areas to be detected on the surface of the gearbox housing through adaptive background segmentation, and improve the visual features of the image by using multi-scale detail enhancement and reflection suppression methods to reduce the reflection interference of the metal surface of the gearbox housing.

[0026] In this embodiment, the complete outline of the automotive transmission housing is extracted from an image of the transmission housing surface containing a complex background and uneven lighting. First, a frequency-domain-based Fourier saliency detection method is used to highlight the main region of the transmission housing in the image, generating a preliminary saliency map. Read the RGB image of the surface of the car transmission housing, convert it to LAB color channel, make full use of the color information in the transmission housing image, and extract the luminance channel L and color channels A and B of the image; To simulate the visual system's processing of color opposition mechanisms, four channel features are constructed: brightness channel features, red-green opposition channel features, yellow-blue opposition channel features, and hue direction features. The hue direction is obtained by calculating the arctangent functions of color channel A and color channel B. Perform a two-dimensional fast Fourier transform independently on each channel feature to obtain the amplitude spectrum and phase spectrum; The logarithm of the amplitude spectrum is taken, and the logarithmic amplitude spectrum is convolved and smoothed using a mean filter to obtain redundant information of the image. The original logarithmic amplitude spectrum and the smoothed convolved amplitude spectrum are subtracted to obtain the spectral residual, which represents the significant part of each channel feature that is different from the surrounding frequencies. The spectral residuals are combined with the original phase spectrum, and an inverse Fourier transform is performed to obtain a saliency map of the channel features. The saliency maps of the four channels are linearly fused, and each channel is assigned an empirical weight based on the importance of the color channel for defect identification, which is then dynamically adjusted in actual operation. Thresholding is performed on the fused saliency map to obtain a preliminary binary mask. Morphological closing operation is then used to fill the internal holes, thus repairing the black holes on the surface of the gearbox housing caused by reflection and color similarity in the preliminary mask.

[0027] The repaired initial binary mask is Gaussian blurred to smooth the jagged edges and small burrs on the mask edges, making the edge gradient change gentle. Then, the Canny edge detector is applied. By calculating the gradient and direction of the image, and through non-maximum suppression and double threshold detection, the complete edge contour of the gearbox housing is extracted. A high-quality binary mask is generated based on the contour features. This mask is then ANDed with the original color image. The region of interest image of the gearbox housing is cropped according to the preset detection area.

[0028] The region of interest image of the area to be detected on the surface of the gearbox housing is downsampled to generate an image with a resolution equal to the original. Figure 1The bottom layer image of / 4 is used to represent the macroscopic structure of the image; Adaptive histogram equalization is applied to the underlying image to limit contrast in order to suppress the reflection effect on the image surface, and the underlying image after the reflection is suppressed is upsampled back to the original image size; Subtracting the upsampled image from the original image yields a detail layer image of the region of interest (ROI) of the gearbox housing, which contains texture and defect information of the gearbox housing. Contrast-limited adaptive histogram equalization is applied to the detail layer image to highlight the visual features of defects in the gearbox housing. The bottom layer image after reflection suppression and the enhanced detail layer image are fused with certain weights to obtain a fully preprocessed image of the gearbox housing surface, which is used for surface defect identification.

[0029] Step S30: Build a defect recognition model based on zero-shot anomaly detection. Take the surface defects of the gearbox housing as the anomaly condition, utilize the anomaly recognition capability of the large model, apply visual and text encoders through cross-modal comparative learning, combine the anomaly perception calibration module, classify and locate the surface defects of the gearbox housing, and generalize to unknown defect types to obtain a pre-trained defect recognition model.

[0030] In this embodiment, the detailed structure of the defect identification model is as follows: Figure 2 As shown: The model consists of an image branch and a text branch. The image branch uses a pre-trained DINO visual encoder to extract image block tokens and corresponding defect category tokens from the surface image of the gearbox housing. The image block tokens and category tokens are then optimized collaboratively by the adapter and the anomaly perception calibration module. The anomaly perception calibration module, under mask supervision, displays guided category tokens that focus on image patch regions with anomalies, redirecting global attention from general objects favored in the pre-training of large models to anomalous regions on the surface of the gearbox housing. The text branch uses a pre-trained CLIP text encoder to encode normal and abnormal cue words about the surface of the gearbox housing. The adapter is optimized to align with the visual features of the automotive gearbox housing. Finally, by comparing image block tokens and cue word embeddings to generate pixel-level anomaly heatmaps, the surface defects of the gearbox housing are classified and located.

[0031] The pre-trained DINO visual encoder is a DINOv3 backbone network trained on a large number of image datasets covering various application scenarios. It has powerful visual feature extraction capabilities and contains 24 Transformer layers. In this embodiment, it is divided into four stages to extract image patch embeddings from layers 6, 12, 18 and 24 respectively. The pre-trained CLIP text encoder adopts the CLIP model structure and is pre-trained on large-scale image and text data pairs through contrastive learning, introducing natural language supervision signals into visual representation learning. The visual-language models DINOv3 and CLIP, pre-trained on large-scale industrial scene images, mainly capture high-level semantic information and are not suitable for anomaly detection. Directly applying pre-trained features can lead to weak separability. Image patches covering anomalous defects may be highly similar to normal regions, and the text embedding is not explicitly aligned with the anomalous semantics. Therefore, the defect recognition model introduces adapters in both the image and text branches. Each adapter is implemented using a bottleneck-structured multilayer perceptron with two linear layers and a LeakyReLU activation function. For the adapted visual image patch, the text embedding is aligned with the text embedding. Calculate similarity :

[0032] in, Indicates the first A visual image block, This indicates the transpose operation. Represent the L2 norm; further calculate the normal or abnormal probability. : , This represents the softmax function executed along the defect category dimension; at the image patch level, the anomaly probability is reconstructed into a coarse-grained heatmap and restored to the original image resolution through bilinear upsampling, generating a pixel-level anomaly detection map; Category tokens are used to aggregate global contextual information, favoring target objects in common industrial scenarios. However, they are unfamiliar with the visual features of automotive gearbox housings, causing the model to confuse anomalous regions with salient object regions and exhibit poor perception of subtle details. Therefore, the model introduces a mask-guided training objective through an anomaly perception calibration module. This guides the interaction between category tokens and image patch tokens to focus more on anomalous regions. For each image patch, the interaction with the calibrated category tokens... Calculate similarity:

[0033] in, Indicates the first A visual image block Similarity to category tokens, similarity distribution By focusing loss and Dice loss and real anomaly mask Optimize and reduce anomaly detection calibration loss. Represented as:

[0034] in, and These represent focus loss and Dice loss, respectively.

[0035] When training the defect recognition model, a cross-dataset evaluation strategy was adopted. Official benchmark datasets for anomaly detection in industrial scenarios, VisA and MVTec AD, were downloaded from the internet. The model was trained using the VisA dataset and tested on the MVTec AD dataset. The learning capabilities of the DINOv3 and CLIP models were utilized to extract visual features from defect image data in industrial scenarios and generalize them to the automotive gearbox housing domain. The model's total loss function... Represented as cross-modal contrast loss With anomaly perception calibration loss Weighted sum:

[0036] in, This represents the cross-modal anomaly detection map output by the model. and These are the balancing weighting coefficients.

[0037] Step S40: Input the preprocessed image of the gearbox housing surface into the pre-trained defect recognition model, and output the abnormal distribution heat map of the gearbox housing surface in real time to determine the defect type and location.

[0038] Example 2: The surface defect identification system for an automotive transmission housing provided in this embodiment of the invention can execute the surface defect identification method for an automotive transmission housing provided in any embodiment of the invention, and has the corresponding functional modules for executing the method, such as... Figure 3 As shown, it includes the following modules: Transmission housing image acquisition module: Acquires real-time images of the transmission housing surface during the casting process of the automotive transmission housing; The gearbox housing image preprocessing module is used to preprocess the surface image of the gearbox housing. It locates and extracts specific areas to be detected on the surface of the gearbox housing through adaptive background segmentation, and improves the visual features of the image by using multi-scale detail enhancement and reflection suppression methods to reduce reflection interference on the metal surface of the gearbox housing. Zero-shot defect recognition model training module: used to build a defect recognition model based on zero-shot anomaly detection. Taking the surface defects of the gearbox housing as the anomaly condition, it utilizes the anomaly recognition capability of a large model, through cross-modal contrastive learning, applies visual and text encoders, and combines anomaly perception calibration module to classify and locate the surface defects of the gearbox housing, and generalizes to unknown defect types to obtain a pre-trained defect recognition model. Online defect identification module for gearbox housing: It is used to input the pre-processed surface image of the gearbox housing into the pre-trained defect identification model, and output the abnormal distribution heat map of the gearbox housing surface in real time to determine the defect type and location.

[0039] This application provides a surface defect recognition system for automotive transmission housings, employing the surface defect recognition method for automotive transmission housings described in Embodiment 1 above. This system addresses the technical problems of insufficient generalization ability and excessive reliance on a large number of normal samples in existing visual inspection models, thereby reducing model training costs. Compared to the prior art, the beneficial effects of the surface defect recognition system for automotive transmission housings provided in this application are the same as those of the surface defect recognition method for automotive transmission housings provided in the above embodiments. Furthermore, other technical features of the surface defect recognition system for automotive transmission housings are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0040] Although this application makes various references to certain modules in the system according to the embodiments of this application, any number of different modules can be used and run on user terminals and / or servers. The various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy distinction between each other and are not used to limit the scope of protection of this invention.

[0041] Example 3: This application provides a surface defect identification device for an automotive transmission housing. The surface defect identification device for an automotive transmission housing includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform a surface defect identification method for an automotive transmission housing as described in the above embodiment.

[0042] Example 4: This application provides a computer program product including a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication system, or installed from a storage system. When the computer program is executed by a processing system, it performs the functions defined in the method of Example 1 of this application.

[0043] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application. In some cases, the actions or steps described in this application can be performed in a different order than that shown in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results.

Claims

1. A method for identifying surface defects in an automotive transmission housing, characterized in that, The method includes: Step S10: During the casting process of the automotive gearbox housing, real-time images of the gearbox housing surface are acquired. Step S20: Preprocess the image of the gearbox housing surface, locate and extract specific areas to be detected on the surface of the gearbox housing through adaptive background segmentation, and improve the visual features of the image by using multi-scale detail enhancement and reflection suppression methods to reduce the reflection interference of the metal surface of the gearbox housing. Step S30: Build a defect recognition model based on zero-shot anomaly detection. Take the surface defects of the gearbox housing as the anomaly condition, utilize the anomaly recognition capability of the large model, apply visual and text encoders through cross-modal contrastive learning, combine the anomaly perception calibration module, classify and locate the surface defects of the gearbox housing, and generalize to unknown defect types to obtain a pre-trained defect recognition model. Step S40: Input the preprocessed image of the gearbox housing surface into the pre-trained defect recognition model, and output the abnormal distribution heat map of the gearbox housing surface in real time to determine the defect type and location.

2. The method for identifying surface defects in an automotive transmission housing as described in claim 1, characterized in that, In step S10, the steps for real-time synchronous acquisition of images of the automotive transmission housing surface are as follows: During the casting process, the automotive gearbox housing moves along the conveyor belt and enters the inspection station, blocking the trigger sensor. The sensor immediately sends a trigger signal to the camera's image acquisition card. After receiving the signal, the acquisition card controls the light source to turn on momentarily before the camera exposure. The camera performs one exposure to capture the surface image of the gearbox housing. After the exposure, the light source is turned off. The captured image data is transmitted to the industrial control computer's memory for subsequent image preprocessing and surface defect identification.

3. The method for identifying surface defects in an automotive transmission housing as described in claim 1, characterized in that, In step S20, the complete outline of the gearbox housing is extracted from the image of the gearbox housing surface, which contains a complex background and uneven lighting. A frequency domain-based Fourier saliency detection method is used to highlight the main region of the gearbox housing in the image, generating a preliminary saliency map. Read the RGB image of the car gearbox housing surface, convert it to LAB color channels, and extract the image's luminance channel L and color channels A and B; To simulate the visual system's processing of color opposition mechanisms, four channel features are constructed: brightness channel features, red-green opposition channel features, yellow-blue opposition channel features, and hue direction features. The hue direction is obtained by calculating the arctangent functions of color channel A and color channel B. Perform a two-dimensional fast Fourier transform independently on each channel feature to obtain the amplitude spectrum and phase spectrum; The logarithm of the amplitude spectrum is taken, and the logarithmic amplitude spectrum is smoothed by convolution using a mean filter to obtain redundant information of the image. The original logarithmic amplitude spectrum and the smoothed convolutional amplitude spectrum are subtracted to obtain the spectral residual. The spectral residuals are combined with the original phase spectrum, and an inverse Fourier transform is performed to obtain a saliency map of the channel features. The saliency maps of the four channels are linearly fused, and each channel is assigned an empirical weight based on the importance of the color channel for defect identification, which is then dynamically adjusted in actual operation. Thresholding is performed on the fused saliency map to obtain a preliminary binary mask. Morphological closing operation is then used to fill the internal holes, thus repairing the black holes on the surface of the gearbox housing caused by reflection and color similarity in the preliminary mask.

4. The method for identifying surface defects in an automotive transmission housing as described in claim 3, characterized in that, The repaired preliminary mask obtains the edge contour of the gearbox housing through edge detection, and determines the preset region to be detected based on the contour and detection requirements to obtain the region of interest image. Multi-scale detail enhancement and reflection suppression processing are then applied to the region of interest image, including: The region of interest image of the area to be detected on the surface of the gearbox housing is downsampled to generate a low-level image with a resolution of 1 / 4 of the original image, which is used to represent the macroscopic structure of the image; Adaptive histogram equalization is applied to the underlying image to limit contrast in order to suppress the reflection effect on the image surface, and the underlying image after the reflection is suppressed is upsampled back to the original image size; Subtracting the upsampled image from the original image yields a detail layer image of the region of interest (ROI) of the gearbox housing, which contains texture and defect information of the gearbox housing. Contrast-limited adaptive histogram equalization is applied to the detail layer image to highlight the visual features of defects in the gearbox housing. The bottom layer image after reflection suppression and the enhanced detail layer image are fused with certain weights to obtain a fully preprocessed image of the gearbox housing surface, which is used for surface defect identification.

5. The method for identifying surface defects in an automotive transmission housing as described in claim 1, characterized in that, In step S30, the defect recognition model consists of an image branch and a text branch. The image branch uses a pre-trained DINO visual encoder to extract image block tokens and corresponding defect category tokens from the surface image of the gearbox housing. The image block tokens and category tokens are then collaboratively optimized by the adapter and the anomaly perception calibration module. The anomaly perception calibration module, under mask supervision, displays guided category tokens that focus on image patch regions with anomalies, redirecting global attention from general objects favored in the pre-training of large models to anomalous regions on the surface of the gearbox housing. The text branch uses a pre-trained CLIP text encoder to encode normal and abnormal cue words about the surface of the gearbox housing. The adapter is optimized to align with the visual features of the automotive gearbox housing. Finally, by comparing the image block tokens and cue word embeddings to generate a pixel-level anomaly heatmap, the surface defects of the automotive gearbox housing are classified and located.

6. The method for identifying surface defects in an automotive transmission housing as described in claim 5, characterized in that, The pre-trained DINO visual encoder is a DINOv3 backbone network trained on a large number of natural images, from which image patch embeddings are extracted in four stages. The pre-trained CLIP text encoder adopts the CLIP model structure and is pre-trained on large-scale image-text data pairs through contrastive learning, introducing natural language supervision signals into visual representation learning.

7. The method for identifying surface defects in an automotive transmission housing as described in claim 5, characterized in that, The anomaly perception calibration module introduces a mask-guided training objective to guide the interaction between the category token and the image patch token, focusing on anomaly regions on the surface of the gearbox housing for each image patch. , with the calibrated category token Calculate similarity: in, Indicates the first A visual image block Similarity to category tokens, This indicates the transpose operation. L2 norm, similarity distribution By focusing loss and Dice loss and real anomaly mask Optimize and reduce anomaly detection calibration loss. Represented as: in, This represents the softmax function executed along the defect category dimension. and These represent focus loss and Dice loss, respectively.

8. A surface defect identification system for an automotive transmission housing, characterized in that, The system is used to implement the surface defect identification method for an automotive transmission housing according to any one of claims 1-7, the system comprising: Transmission housing image acquisition module: used to acquire images of the transmission housing surface in real time during the casting process of the automotive transmission housing; The gearbox housing image preprocessing module is used to preprocess the surface image of the gearbox housing. It locates and extracts specific areas to be detected on the surface of the gearbox housing through adaptive background segmentation, and improves the visual features of the image by using multi-scale detail enhancement and reflection suppression methods to reduce reflection interference on the metal surface of the gearbox housing. Zero-shot defect recognition model training module: used to build a defect recognition model based on zero-shot anomaly detection. Taking the surface defects of the gearbox housing as the anomaly condition, it utilizes the anomaly recognition capability of a large model, through cross-modal contrastive learning, applies visual and text encoders, and combines anomaly perception calibration module to classify and locate the surface defects of the gearbox housing, and generalizes to unknown defect types to obtain a pre-trained defect recognition model. Online defect identification module for gearbox housing: It is used to input the pre-processed surface image of the gearbox housing into the pre-trained defect identification model, and output the abnormal distribution heat map of the gearbox housing surface in real time to determine the defect type and location.

9. A surface defect identification device for an automotive transmission housing, characterized in that, The surface defect identification device for an automotive transmission housing includes: A memory, a processor, and a surface defect identification program for an automotive transmission housing stored in the memory and executable on the processor, wherein the surface defect identification program for an automotive transmission housing, when executed by the processor, implements a surface defect identification method for an automotive transmission housing as described in any one of claims 1 to 7.

10. A computer program product, characterized in that, The computer program product includes a surface defect identification program for an automotive transmission housing, which, when executed by a processor, implements a surface defect identification method for an automotive transmission housing as described in any one of claims 1 to 7.