Transformer training method for paint surface AI defect identification
By simultaneously acquiring RGB images and 3D point cloud data, and combining fluid dynamics and ray tracing models to generate multimodal training samples, and utilizing dynamic routing attention networks and prototype memory matrices for feature aggregation and knowledge fusion, the shortcomings of existing Transformers in structured representation and reliability assessment in paint surface defect identification are solved, achieving high-precision and high-reliability automated sorting.
Patent Information
- Application Number
- CN202511660671.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-02-10
AI Technical Summary
Existing Transformer-based methods for identifying defects on paint surfaces lack the ability to provide structured representation when dealing with complex defects, have weak generalization and memorization capabilities for rare defects, and lack multimodal data fusion and reliability assessment, making it difficult to support high-confidence automated sorting decisions.
A six-axis data acquisition robotic arm synchronously acquires RGB images and 3D point cloud data. Multimodal training samples are generated by combining fluid dynamics and ray tracing models. Feature aggregation and knowledge fusion are performed using a dynamic routing attention network and a prototype memory matrix. An uncertainty quantification module is integrated for decision feedback.
It significantly improves the accuracy and structural consistency of identifying complex defects, enhances the ability to remember and generalize rare defects, realizes deep semantic alignment and reliability assessment of multimodal data, and improves the confidence and practicality of automated sorting systems.
Smart Images

Figure CN121504856A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and more specifically to a Transformer training method for AI defect recognition of painted surfaces. Background Technology
[0002] In recent years, deep learning-based visual inspection technology has become the mainstream approach for detecting defects on painted surfaces in industry. Early research focused primarily on convolutional neural networks, leveraging their local perception capabilities to extract defect features. With breakthroughs in the Transformer architecture in computer vision, its powerful global context modeling advantages have begun to be applied to defect recognition tasks. By capturing long-distance dependencies through self-attention mechanisms, it significantly improves the ability to extract defect features in complex backgrounds, driving progress in this technological field.
[0003] However, existing Transformer-based defect identification methods still have significant limitations. Standard self-attention mechanisms struggle to effectively model the component-to-whole hierarchical structure of defects, lack accuracy in identifying complex defects, exhibit weak generalization ability for rare defect patterns in training data, and lack effective knowledge memory and reuse mechanisms. Multimodal data fusion methods are relatively simple, failing to fully explore the deep correlation between visual information and 3D morphological features. Furthermore, existing methods generally lack quantitative assessment of the reliability of identification results, making it difficult to support high-confidence automated sorting decisions. These shortcomings severely restrict the practical application of this technology in industrial precision inspection. Summary of the Invention
[0004] To overcome the aforementioned shortcomings of existing technologies, this invention provides a Transformer training method for AI defect recognition of paint surfaces. This addresses the problems of insufficient structural representation capabilities for complex defects, weak generalization and memorization capabilities for rare defects, and the inability to achieve highly reliable automatic sorting with integrated uncertainty assessment in existing paint surface defect recognition methods.
[0005] In a first aspect, the present invention provides a Transformer training method for AI defect recognition of painted surfaces, comprising the following steps: By using an industrial camera and a 3D line laser scanner at the end of a six-axis data acquisition robotic arm, RGB images and 3D point cloud data of painted workpieces are simultaneously acquired to form an original multimodal dataset. The original multimodal dataset is input into the fluid dynamics and ray tracing model to generate synthetic defect data, thereby outputting an expanded multimodal training sample set containing both real and synthetic samples; The multimodal training sample set is used to extract and serialize features from RGB images and point cloud data, and cross-modal semantic alignment is achieved by calculating contrastive learning loss, so as to output aligned feature sequences with a unified dimension. A dynamic routing attention network is used to aggregate feature sequences into high-level defect structure capsules that carry component-whole relationship information. Knowledge retrieval and fusion are performed by calculating the similarity between the prototype capsules stored in the prototype memory matrix and the high-level defect structure capsules, thereby outputting a comprehensive defect feature vector enhanced by knowledge. The comprehensive defect feature vector is used to perform defect classification, segmentation and detection tasks, and the uncertainty score of the identification results is calculated. Finally, the sorting robot arm is driven to perform sorting or re-inspection operations based on the classification results and uncertainty score.
[0006] As a preferred embodiment of the Transformer training method for AI defect recognition of paint surfaces described in this invention, the step of simultaneously acquiring RGB images and 3D point cloud data of the painted workpiece using an industrial camera at the end of a six-axis data acquisition robotic arm and a 3D line laser scanner to form an original multimodal dataset includes the following specific steps: The host computer control system plans a bow-shaped scanning path covering the entire surface of the workpiece for the six-axis data acquisition robot arm, ensuring that the end effector maintains a constant distance from the workpiece surface. During the movement of the robotic arm along the path, the programmable logic controller sends a synchronous trigger pulse to drive the industrial camera to perform global shutter exposure to capture RGB images, and at the same time drive the 3D line laser scanner to project laser stripes to collect point cloud data. Each set of RGB images and point cloud data collected is labeled with a unified timestamp and spatial coordinates, and then transmitted in real time to the data preprocessing server via gigabit industrial Ethernet. The preprocessing server performs pixel-level and point-level spatial registration of RGB images and point cloud data at the same time and location based on timestamps and spatial coordinates to generate the original multimodal dataset.
[0007] As a preferred embodiment of the Transformer training method for AI defect recognition of paint surfaces described in this invention, the steps of inputting the original multimodal dataset into a fluid dynamics and ray tracing model to generate synthetic defect data, thereby outputting an expanded multimodal training sample set containing both real and synthetic samples, are as follows: A batch of defect-free RGB images and point cloud data were randomly selected from the original multimodal dataset as the basis for simulation. The system calls upon a physics-based fluid dynamics simulation engine to simulate the dynamic process of paint bubbles or drips due to changes in viscosity and surface tension at a specified location on the substrate image, and simultaneously generates 3D point cloud data of the corresponding depressions or protrusions. Using a physically based ray tracing rendering engine, the base with simulated defects is rendered according to preset workshop lighting environment parameters, and RGB images with orange peel and color difference visual effects presented under different lighting angles are accurately generated. The simulated defect data is mixed with the real-collected data, and then normalized and standardized to form an expanded multimodal training sample set.
[0008] As a preferred embodiment of the Transformer training method for AI defect recognition of paint surfaces described in this invention, the steps include: extracting and serializing features from the multimodal training sample set using RGB images and point cloud data, and achieving cross-modal semantic alignment by calculating contrastive learning loss to output aligned feature sequences of a unified dimension. A pre-trained Vision Transformer model is used to segment RGB images into fixed-size image patches and linearly project them into image feature sequences. A lightweight PointNet network is used to convert 3D point cloud data into point cloud feature sequences composed of global and local features. Within a batch, the image feature sequence and point cloud feature sequence belonging to the same workpiece are used as positive sample pairs, and the feature sequences of other workpieces are used as negative sample pairs. In the shared projector network, the cosine similarity of all positive and negative sample pairs in the latent space is calculated, and optimization is performed based on the InfoNCE loss function to bring positive sample pairs closer and push negative sample pairs further apart. Once the contrastive learning loss converges, the output is an aligned feature sequence that achieves alignment in both feature dimension and semantics.
[0009] As a preferred embodiment of the Transformer training method for AI defect recognition of paint surfaces described in this invention, the specific steps of aggregating feature sequences into high-level defect structure capsules carrying component-to-whole relationship information using a dynamic routing attention network are as follows: Each feature vector in the aligned feature sequence is initialized as a primary capsule containing feature activation values and an instantiation parameter matrix; In the first layer of the dynamic routing attention network, each primary capsule predicts the existence of the next layer capsule by linearly transforming its instantiation parameters, thus generating a voting vector. Iterative calculations are performed through the routing protocol layer integrated in the network. In each iteration, the routing weights are dynamically updated based on the consistency between the votes of the lower-level capsules and the activation values of the higher-level capsules, thereby strengthening the voting of capsules belonging to the same defective structure. After three rounds of iteration, the bottom-level capsules were clustered into multiple high-level capsules. The activation values and instantiation parameters of these high-level capsules together constitute high-level defect structure capsules that carry component-to-whole relationship information.
[0010] As a preferred embodiment of the Transformer training method for AI defect recognition of paint surfaces described in this invention, the steps include: calculating the similarity between prototype capsules stored in a prototype memory matrix and high-level defect structure capsules for knowledge retrieval and fusion, thereby outputting a comprehensive defect feature vector enhanced with knowledge; the specific steps are as follows: During the training phase, a prototype memory matrix is constructed through sparse coding constraints to store prototype capsules of various typical defects from the training set. Calculate the cosine similarity between the currently input high-level defect structure capsule and each prototype capsule in the memory matrix; The Top-K sorting selection circuit retrieves the three prototype capsules most similar to the current input, and a weighting coefficient is calculated based on the similarity score. A learnable gated neural network is used to control the feature fusion of the three retrieved prototype capsules and the current input capsule with weighted coefficients. The output of the gated neural network is the knowledge-enhanced comprehensive defect feature vector.
[0011] As a preferred embodiment of the Transformer training method for AI defect recognition of paint surfaces described in this invention, the steps include: performing defect classification, segmentation, and detection tasks by integrating defect feature vectors, calculating the uncertainty score of the recognition results, and finally driving a sorting robot arm to perform sorting or re-inspection operations based on the classification results and uncertainty scores. The comprehensive defect feature vector is simultaneously input into a classification head composed of fully connected layers, a segmentation head composed of transposed convolutional layers, and a detection head composed of anchor point regression layers to obtain defect categories, pixel-level segmentation masks, and bounding box coordinates in parallel. Monte Carlo Dropout technology is integrated into the classification head, and Dropout is kept active during inference and fifty forward propagations are performed. The uncertainty score is calculated based on the variance of the fifty output probabilities. The programmable logic controller receives the classification results and uncertainty score. When the classification confidence is higher than the first threshold and the uncertainty score is lower than the second threshold, a sorting instruction is generated. The sorting instructions are sent to the three-axis sorting robot arm, which performs precise gripping and removes defective workpieces from the production line. For workpieces that do not meet the requirements, the conveyor belt is controlled to guide them to the manual re-inspection station.
[0012] Secondly, this invention provides a Transformer training system for AI defect recognition of painted surfaces, comprising, The synchronous acquisition module uses an industrial camera and a 3D line laser scanner at the end of a six-axis data acquisition robotic arm to simultaneously acquire RGB images and 3D point cloud data of painted workpieces to form an original multimodal dataset. The simulation enhancement module inputs the original multimodal dataset into the fluid dynamics and ray tracing model to generate synthetic defect data, thereby outputting an expanded multimodal training sample set containing both real and synthetic samples. The feature alignment module extracts and serializes features from the multimodal training sample set using RGB images and point cloud data, and achieves cross-modal semantic alignment by calculating the contrastive learning loss, so as to output an aligned feature sequence with a unified dimension. The structural aggregation module uses a dynamic routing attention network to aggregate feature sequences into high-level defect structure capsules that carry component-whole relationship information. The knowledge fusion module performs knowledge retrieval and fusion by calculating the similarity between the prototype capsules stored in the prototype memory matrix and the high-level defect structure capsules, thereby outputting a comprehensive defect feature vector enhanced by knowledge. The intelligent decision-making module performs defect classification, segmentation, and detection tasks based on the comprehensive defect feature vector, calculates the uncertainty score of the identification results, and finally drives the sorting robot arm to perform sorting or re-inspection operations based on the classification results and uncertainty score.
[0013] Thirdly, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, it implements any step of the Transformer training method for AI defect recognition of paint surfaces as described in the first aspect of the present invention.
[0014] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the Transformer training method for AI defect recognition of paint surfaces as described in the first aspect of the present invention.
[0015] The beneficial effects of this invention are as follows: By introducing a dynamic routing attention mechanism, a component-to-whole hierarchical structure relationship of defects is effectively established, significantly improving the recognition accuracy and structural consistency of defects with complex shapes; by constructing a trainable prototype memory matrix and designing a knowledge retrieval fusion mechanism, the model's ability to remember and generalize rare defect patterns in training data is enhanced, effectively alleviating the problem of data imbalance; cross-modal contrastive learning is used to achieve deep semantic alignment of visual features and three-dimensional morphological features, giving full play to the complementary advantages of multimodal data; by integrating an uncertainty quantification module and linking it with the sorting execution mechanism, a decision-making closed loop with reliability assessment capabilities is constructed, greatly improving the confidence and practicality of the automated sorting system, thus forming a complete technical solution that combines structural perception, knowledge memory, multimodal fusion, and reliability assurance. Attached Figure Description
[0016] Figure 1 This is a flowchart of the Transformer training method for AI defect recognition of paint surfaces in Example 1.
[0017] Figure 2 This is a schematic diagram of the spatial distribution of the industrial camera, 3D line laser scanner, and painted workpiece in the Transformer training method for AI defect recognition of painted surfaces in Example 1. Detailed Implementation
[0018] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0019] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0020] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0021] Example 1, referring to Figure 1-2 This is the first embodiment of the present invention, which provides a Transformer training method for AI defect recognition of paint surfaces, including the following steps: By using an industrial camera and a 3D line laser scanner at the end of a six-axis data acquisition robotic arm, RGB images and 3D point cloud data of painted workpieces are simultaneously acquired to form an original multimodal dataset. It should be noted that the image sensor is the core component inside an industrial camera, directly responsible for photoelectric conversion, converting light signals into electrical signals.
[0022] The original multimodal dataset is input into the fluid dynamics and ray tracing model to generate synthetic defect data, thereby outputting an expanded multimodal training sample set containing both real and synthetic samples; The multimodal training sample set is used to extract and serialize features from RGB images and point cloud data, and cross-modal semantic alignment is achieved by calculating contrastive learning loss, so as to output aligned feature sequences with a unified dimension. A dynamic routing attention network is used to aggregate feature sequences into high-level defect structure capsules that carry component-whole relationship information. Knowledge retrieval and fusion are performed by calculating the similarity between the prototype capsules stored in the prototype memory matrix and the high-level defect structure capsules, thereby outputting a comprehensive defect feature vector enhanced by knowledge. The comprehensive defect feature vector is used to perform defect classification, segmentation and detection tasks, and the uncertainty score of the identification results is calculated. Finally, the sorting robot arm is driven to perform sorting or re-inspection operations based on the classification results and uncertainty score.
[0023] It should be noted that this step involves constructing a multimodal data acquisition system by integrating a six-axis industrial robot, a high-resolution area array industrial camera, and a 3D line laser scanner. Under the unified scheduling of the programmable logic controller (PLC), the robotic arm performs a full-coverage scan of the workpiece surface along a preset bow-shaped trajectory, with its end effector coordinate system always perpendicular to the surface normal. During the movement, the PLC sends a precise synchronization signal to trigger the camera to perform global exposure and acquire a two-dimensional color image. Simultaneously, it drives the laser scanner to emit a linear laser and receive the reflected light band, generating 3D point cloud data in real time using the principle of triangulation. All acquired data is transmitted to a preprocessing server via industrial Ethernet. Timestamp matching and coordinate transformation algorithms are used to spatially align the 2D image pixels with the 3D point cloud coordinates, ultimately generating a pixel-level registered multimodal dataset.
[0024] By employing multi-sensor synchronous acquisition and spatial registration techniques, precise correspondence between two-dimensional texture information and three-dimensional shape data was achieved, providing a data foundation for subsequent multimodal feature fusion. This acquisition method overcomes the limitations of a single vision sensor in detecting surface unevenness defects, enabling the system to simultaneously capture both color anomalies and geometric deformation features, significantly improving the completeness of defect detection.
[0025] This step involves building a physical simulation engine based on computational fluid dynamics and optical rendering techniques. First, qualified samples are selected from the original dataset as a base. Then, a fluid dynamics simulator is used to solve the Navier-Stokes equations, simulating the dynamic process of paint forming defects such as bubbles and sagging under different viscosity and surface tension parameters, and simultaneously outputting corresponding 3D deformation data. Simultaneously, a ray tracing renderer is used to accurately calculate the light scattering, absorption, and transmission effects in the defect area based on the material's optical properties and actual workshop lighting conditions, generating 2D images with realistic optical performance from different viewing angles. Finally, the simulation data and measured data are mixed according to a preset ratio and batch normalized.
[0026] This data augmentation method, driven by physical mechanisms, effectively addresses the issues of scarce defect samples and class imbalance in actual production. The generated synthetic data maintains physical plausibility while encompassing rich morphological variations, significantly improving the generalization ability of subsequent model training and avoiding the distortion problems that may be introduced by traditional data augmentation methods.
[0027] This step employs a dual-branch architecture to process multimodal data. The image branch uses a pre-trained visual Transformer model to segment the input image into fixed-size patches, which are then converted into feature sequences after linear projection and positional encoding. The point cloud branch uses an improved lightweight point cloud processing network, first extracting global features through max pooling, then extracting detailed features through a local feature aggregation module, and finally concatenating the two types of features to form a point cloud sequence. A contrastive learning mechanism is established between the feature sequences of the two branches. By calculating the similarity matrix of positive and negative sample pairs, the information-noise contrast estimation loss function is used to optimize the feature space distribution.
[0028] Cross-modal contrastive learning achieves deep semantic alignment of features from different modalities, resolving the semantic gap problem in traditional multimodal fusion. This alignment method enables subsequent models to better understand the intrinsic relationship between two-dimensional appearance features and three-dimensional geometric features, providing richer feature representations for accurate defect identification.
[0029] This step constructs an attention network based on a dynamic routing mechanism. First, the input feature sequence is transformed into a set of primary capsules containing activation values and pose matrices. During the network's forward propagation, lower-level capsules generate prediction vectors for higher-level capsules through matrix transformations, and coupling coefficients are dynamically calculated using an iterative routing algorithm. In each iteration, the routing weights are updated based on the matching degree between the prediction vectors and higher-level capsules, enabling semantically related lower-level capsules to self-organize and cluster into their corresponding higher-level capsules. After multiple iterations, a high-level capsule representation with clear component-whole relationships is formed.
[0030] By employing a dynamic routing mechanism in capsule networks, explicit modeling of the spatial relationships and hierarchical structure among defective components is achieved. This method enables a better understanding of the compositional patterns of complex defects, such as distinguishing the continuity of scratches and the boundary characteristics of bubbles, significantly improving the accuracy of identifying complex-shaped defects and their structural consistency.
[0031] This step constructs a trainable prototype memory and knowledge retrieval mechanism. During model training, the prototype memory matrix is optimized through sparse coding constraints to store feature prototypes of various defects. During inference, the similarity distribution between the current sample features and all prototypes in the memory matrix is calculated, and the most relevant prototypes are selected using a Top-K filtering circuit. A differentiable gated fusion unit is designed to dynamically adjust the contribution of each prototype feature based on similarity weights, adaptively fusing the retrieved prototype knowledge with the current features.
[0032] By employing prototype memory and knowledge retrieval mechanisms, the model can leverage historical experience to aid current decision-making, significantly improving its ability to identify rare defects and marginal cases. This design mimics the experience reuse mechanism of human experts, effectively mitigating model bias caused by imbalanced data distribution.
[0033] This step constructs a multi-task output layer and a decision feedback system. The enhanced feature vectors are input in parallel into three specially designed output heads: a classification head outputs defect category probabilities through a fully connected layer, a segmentation head generates pixel-level segmentation masks through a transposed convolutional network, and a detection head outputs bounding box coordinates through an anchor point regression mechanism. Simultaneously, a Monte Carlo random deactivation technique is integrated into the classification head, and the statistical variance of the prediction results is calculated as an uncertainty measure through multiple forward propagations. Finally, the identification results and confidence assessments are transmitted to the actuator, driving the sorting robot arm to complete precise operations.
[0034] By employing multi-task collaborative learning and uncertainty quantification, the reliability assessment of detection results was achieved, providing a decision-making basis for automated sorting. This design not only ensures the accurate identification of common defects but also reduces the risk of misjudgment through a confidence mechanism, forming a complete detection-decision-execution closed loop, significantly improving the system's practicality and reliability.
[0035] Specifically, the process involves simultaneously acquiring RGB images and 3D point cloud data of the painted workpiece using an industrial camera and a 3D line laser scanner at the end of a six-axis data acquisition robotic arm to form an original multimodal dataset. The specific steps are as follows: The host computer control system plans a bow-shaped scanning path covering the entire surface of the workpiece for the six-axis data acquisition robot arm, ensuring that the end effector maintains a constant distance from the workpiece surface. During the movement of the robotic arm along the path, the programmable logic controller sends a synchronous trigger pulse to drive the industrial camera to perform global shutter exposure to capture RGB images, and at the same time drive the 3D line laser scanner to project laser stripes to collect point cloud data. Each set of RGB images and point cloud data collected is labeled with a unified timestamp and spatial coordinates, and then transmitted in real time to the data preprocessing server via gigabit industrial Ethernet. The preprocessing server performs pixel-level and point-level spatial registration of RGB images and point cloud data at the same time and location based on timestamps and spatial coordinates to generate the original multimodal dataset.
[0036] It should be noted that this step generates a bow-shaped scanning trajectory covering the entire surface of the workpiece for the six-axis data acquisition robot arm through path planning software in the host computer. This trajectory ensures that the end effector of the robot arm maintains the optimal detection distance from the workpiece surface throughout its movement. During the robot arm's movement along the predetermined trajectory, the programmable logic controller (PLC) generates a precise synchronization trigger signal, which is simultaneously sent to the industrial camera and the 3D line laser scanner. This drives the industrial camera to acquire high-resolution RGB images using a global shutter mode, and controls the line laser scanner to emit a laser plane of a specific wavelength for 3D point cloud data acquisition. All acquisition devices ensure data time consistency through a precision clock synchronization module. Each set of acquired data is automatically tagged with a timestamp and the robot arm's current spatial coordinates. This raw data, with complete spatiotemporal identification, is transmitted to a data preprocessing server via a gigabit industrial Ethernet network. The server uses coordinate transformation algorithms and image registration technology to precisely align the pixels of the 2D image with the 3D point cloud points at the same spatiotemporal coordinates, ultimately generating a pixel-level registered multimodal dataset.
[0037] By employing precise spatiotemporal synchronization technology and coordinate registration algorithms, accurate correspondence between two-dimensional visual information and three-dimensional geometric data was achieved, establishing a complete surface feature mapping relationship. This precise alignment of multimodal data provides a reliable data foundation for subsequent feature fusion and defect analysis, effectively solving the feature mismatch problem caused by the separation of two-dimensional and three-dimensional data in traditional detection, and laying a solid data foundation for comprehensively improving the accuracy and completeness of defect detection.
[0038] Specifically, the process of inputting the original multimodal dataset into the fluid dynamics and ray tracing model to generate synthetic defect data, thereby outputting an expanded multimodal training sample set containing both real and synthetic samples, involves the following steps: A batch of defect-free RGB images and point cloud data were randomly selected from the original multimodal dataset as the basis for simulation. The system calls upon a physics-based fluid dynamics simulation engine to simulate the dynamic process of paint bubbles or drips due to changes in viscosity and surface tension at a specified location on the substrate image, and simultaneously generates 3D point cloud data of the corresponding depressions or protrusions. Using a physically based ray tracing rendering engine, the base with simulated defects is rendered according to preset workshop lighting environment parameters, and RGB images with orange peel and color difference visual effects presented under different lighting angles are accurately generated. The simulated defect data is mixed with the real-collected data, and then normalized and standardized to form an expanded multimodal training sample set.
[0039] It should be noted that samples with acceptable surface quality were selected from the registered original multimodal database as basic data. Defect-free RGB images and corresponding 3D point cloud data were randomly selected using professional data management software according to a preset sampling ratio. Subsequently, a physical simulation platform integrated on the computing nodes was launched. This platform includes a specially developed computational fluid dynamics module, which simulates the complete physical process of surface tension and viscosity interacting to form defects such as bubbles and sagging under different paint parameters by solving the viscous fluid control equations. Simultaneously, the coordinate data of the 3D point cloud is updated in real time based on the fluid calculation results to reflect surface deformation. After completing the geometric simulation, the system calls a physically based optical renderer to calculate the light propagation path and reflection characteristics of the defect area at different observation angles based on the actual acquisition environment's light source parameters, camera parameters, and material optical properties, generating realistic optical images. Finally, the simulation data and measured data are input into the data pipeline, and batch processing is used for brightness equalization and coordinate unification to complete the construction of the multimodal training sample set.
[0040] By employing physics-based simulation techniques, the entire defect generation process, from geometric morphology to optical representation, was simulated, effectively addressing the issues of scarce and unevenly distributed defect samples in actual production. The use of a physics-rule-driven data generation method ensured the physical consistency between synthetic and real data, significantly improving the model's generalization ability. Co-simulation of multimodal data ensured the physical correlation between 2D visual features and 3D geometric features, providing a reliable data foundation for subsequent cross-modal feature learning. This data augmentation method overcomes the limitations of traditional image transformation techniques, expanding the diversity and representativeness of training data from the perspective of defect causes.
[0041] Specifically, the process involves extracting and serializing features from the multimodal training sample set using RGB images and point cloud data, and achieving cross-modal semantic alignment by calculating contrastive learning loss to output aligned feature sequences with a unified dimension. The specific steps are as follows: A pre-trained Vision Transformer model is used to segment RGB images into fixed-size image patches and linearly project them into image feature sequences. A lightweight PointNet network is used to convert 3D point cloud data into point cloud feature sequences composed of global and local features. Within a batch, the image feature sequence and point cloud feature sequence belonging to the same workpiece are used as positive sample pairs, and the feature sequences of other workpieces are used as negative sample pairs. In the shared projector network, the cosine similarity of all positive and negative sample pairs in the latent space is calculated, and optimization is performed based on the InfoNCE loss function to bring positive sample pairs closer and push negative sample pairs further apart. Once the contrastive learning loss converges, the output is an aligned feature sequence that achieves alignment in both feature dimension and semantics.
[0042] It should be noted that the data processing pipeline deployed on the graphics workstation first begins execution. A Vision Transformer model pre-trained on a large image dataset is used as the image feature extractor. The input high-resolution RGB image is segmented into multiple non-overlapping square image patches according to a preset size specification. Each image patch is converted into a feature vector through a linear projection layer and positional encoding information is added, forming an image feature sequence with spatial order. Simultaneously, the 3D point cloud data processing channel uses an optimized lightweight PointNet network architecture. This network processes the coordinate information of each point through a multilayer perceptron, extracts the global geometric features of the point cloud using max pooling, and then captures local details such as point cloud density distribution and curvature changes through a local feature aggregation module. Finally, the global and local features are concatenated along the feature dimension to form a point cloud feature sequence containing rich geometric information. After the feature sequence is generated, the system initiates a cross-modal contrastive learning process. From the current training batch, the corresponding image sequence and point cloud sequence are paired according to the workpiece number to form positive sample pairs. Simultaneously, different samples are randomly selected from other workpieces to form negative sample pairs. The feature sequences of all positive and negative sample pairs are fed into a multilayer perceptron projection head with shared parameters, mapping features from different modalities to a unified latent space. Within this space, the cosine similarity matrix between all sample pairs is calculated, and the loss function is iteratively optimized based on information-noise contrast estimation. The parameters of the feature extractor and projection head are continuously adjusted through gradient backpropagation, gradually reducing the distance between positive sample pairs and increasing the distance between negative sample pairs in the latent space. The training process terminates when the loss function value stabilizes and meets the preset convergence condition. At this point, the system outputs a unified-dimensional feature sequence that achieves precise alignment at both the feature dimension and semantic level.
[0043] By combining a dual-branch feature extraction architecture with a contrastive learning mechanism, deep fusion of visual texture features and 3D geometric features in a unified semantic space is achieved, resolving the issue of inconsistent feature distribution in traditional multimodal fusion. The use of a pre-trained model combined with a lightweight network design significantly improves feature extraction efficiency while maintaining feature quality. Through a contrastive learning strategy using positive and negative sample pairs, the model automatically learns the semantic correspondences between different modalities, enhancing the discriminative power of feature representations. This cross-modal alignment method provides a semantically consistent feature foundation for subsequent defect structure analysis, significantly improving the accuracy of complex defect identification.
[0044] Specifically, the step of using a dynamic routing attention network to aggregate feature sequences into high-level defect structure capsules carrying component-whole relationship information involves the following steps: Each feature vector in the aligned feature sequence is initialized as a primary capsule containing feature activation values and an instantiation parameter matrix; In the first layer of the dynamic routing attention network, each primary capsule predicts the existence of the next layer capsule by linearly transforming its instantiation parameters, thus generating a voting vector. Iterative calculations are performed through the routing protocol layer integrated in the network. In each iteration, the routing weights are dynamically updated based on the consistency between the votes of the lower-level capsules and the activation values of the higher-level capsules, thereby strengthening the voting of capsules belonging to the same defective structure. After three rounds of iteration, the bottom-level capsules were clustered into multiple high-level capsules. The activation values and instantiation parameters of these high-level capsules together constitute high-level defect structure capsules that carry component-to-whole relationship information.
[0045] It should be noted that, firstly, the parameter configuration of the dynamic routing attention network is initialized on the graphics processor. Each feature vector in the aligned feature sequence output from the previous steps is converted into a primary capsule representation. Each primary capsule consists of two parts: feature activation values and an instantiated parameter matrix. During the first layer computation of the dynamic routing attention network, each primary capsule performs a linear transformation operation through its internal instantiated parameter matrix to generate prediction vectors for the next layer capsule. These prediction vectors constitute a voting mechanism for the lower-level capsules to pass information to the higher-level capsules. The network's built-in routing protocol layer begins to execute the iterative computation process. In each iteration, the matching degree between the voting vectors of the lower-level capsules and the activation values of the higher-level capsules is first calculated. Based on the matching degree result, the connection weight coefficients between the lower-level capsules and the higher-level capsules are dynamically adjusted to establish stronger connections between capsules representing the same defect structure. After three rounds of preset iterative computation, the system completes the clustering process from lower-level capsules to higher-level capsules. The generated higher-level capsules not only contain the aggregated feature activation information but also retain the spatial structure and relative positional relationships of the defective components through the instantiated parameter matrix, ultimately forming a high-level defect structure capsule output that can completely represent the hierarchical relationship between defective components and the whole.
[0046] By employing an iterative clustering mechanism with a dynamic routing attention network, explicit modeling of the relationship between local features and the overall structure of defects is achieved, effectively addressing the shortcomings of standard self-attention mechanisms in defect structure representation. The instantiation parameter passing method using capsule networks preserves the spatial hierarchy and relative positional relationships of defect components, enhancing the understanding of structural consistency in complex defect morphologies. Through a multi-round iterative routing protocol, the model can adaptively learn the combination patterns of defect components, improving the recognition accuracy for irregular defect boundaries. This structural awareness capability provides rich structured feature representations for subsequent defect classification and localization, significantly improving the recognition performance of complex defect patterns.
[0047] Specifically, the method involves calculating the similarity between the prototype capsules stored in a prototype memory matrix and the high-level defect structure capsules to perform knowledge retrieval and fusion, thereby outputting a knowledge-enhanced comprehensive defect feature vector. The specific steps are as follows: During the training phase, a prototype memory matrix is constructed through sparse coding constraints to store prototype capsules of various typical defects from the training set. Calculate the cosine similarity between the currently input high-level defect structure capsule and each prototype capsule in the memory matrix; The Top-K sorting selection circuit retrieves the three prototype capsules most similar to the current input, and a weighting coefficient is calculated based on the similarity score. A learnable gated neural network is used to control the feature fusion of the three retrieved prototype capsules and the current input capsule with weighted coefficients. The output of the gated neural network is the knowledge-enhanced comprehensive defect feature vector.
[0048] It should be noted that during the model training phase, a prototype memory matrix is first constructed using a sparse autoencoder. A loss function with sparsity constraints is used to train the memory matrix, enabling it to store feature prototypes of various typical defects extracted from the training set in a compact form. During the inference phase, the system receives a high-level defect structure capsule from the preceding steps as input. A dedicated computing unit calculates the cosine similarity between this capsule and all prototype capsules in the memory matrix, forming a complete similarity distribution vector. Subsequently, the system invokes a hardware-accelerated Top-K sorting selection circuit to quickly retrieve the three prototype capsules most similar to the current input from the memory matrix. Based on the calculated similarity scores, a softmax function is used to normalize the results and generate corresponding weighting coefficients. Finally, the three retrieved prototype capsules and the current input capsule are simultaneously input into a learnable gated neural network. This network contains multiple fully connected layers and gated activation units, dynamically adjusting the contribution of each prototype capsule according to the weighting coefficients. Deep fusion of multi-source features is achieved through feature concatenation and linear transformation. The final output of the gated neural network is the knowledge-enhanced comprehensive defect feature vector.
[0049] By constructing a prototype memory matrix with sparse coding constraints, compact storage and efficient retrieval of typical defect features are achieved, significantly improving the model's ability to manage historical knowledge. Employing a Top-K retrieval mechanism combined with a gated fusion network enables the model to adaptively select the most relevant prior knowledge for feature enhancement, effectively improving the recognition performance for rare defects and marginal cases. This knowledge fusion mechanism mimics the experience-learning process of human experts, enhancing the model's generalization ability under imbalanced data conditions by comparing and fusing currently detected features with stored prototype features. The introduction of the gated neural network makes the knowledge fusion process learnable, dynamically adjusting the contribution weights of features from different sources according to specific task requirements, thereby improving the overall quality and discriminative power of feature representation.
[0050] Specifically, the process involves performing defect classification, segmentation, and detection tasks using the comprehensive defect feature vector, calculating the uncertainty score of the identification results, and finally driving the sorting robot arm to perform sorting or re-inspection operations based on the classification results and uncertainty score. The specific steps are as follows: The comprehensive defect feature vector is simultaneously input into a classification head composed of fully connected layers, a segmentation head composed of transposed convolutional layers, and a detection head composed of anchor point regression layers to obtain defect categories, pixel-level segmentation masks, and bounding box coordinates in parallel. Monte Carlo Dropout technology is integrated into the classification head, and Dropout is kept active during inference and fifty forward propagations are performed. The uncertainty score is calculated based on the variance of the fifty output probabilities. The programmable logic controller receives the classification results and uncertainty score. When the classification confidence is higher than the first threshold and the uncertainty score is lower than the second threshold, a sorting instruction is generated. The sorting instructions are sent to the three-axis sorting robot arm, which performs precise gripping and removes defective workpieces from the production line. For workpieces that do not meet the requirements, the conveyor belt is controlled to guide them to the manual re-inspection station.
[0051] It should be noted that, firstly, a multi-task output architecture is deployed on the industrial computer system, simultaneously feeding the knowledge-enhanced comprehensive defect feature vector into three independently designed processing heads. The classification head consists of a multi-layer fully connected neural network, outputting the probability distribution of defect categories through a softmax activation function; the segmentation head employs a transposed convolutional neural network architecture, restoring the feature map to the original image resolution through multiple upsampling operations to generate pixel-level defect region segmentation masks; the detection head, based on an anchor point regression mechanism, outputs the precise location information of defect regions through a bounding box coordinate prediction layer. In the classification head module, the system integrates Monte Carlo random deactivation technology, keeping the random deactivation layer active during the inference phase, performing fifty independent forward propagation calculations, randomly masking some neuron connections in each calculation, and collecting fifty different sets of category probability outputs. The system then calculates the variance matrix of these probability outputs and transforms it into a single uncertainty quantification index through statistical analysis methods. The programmable logic controller (PLC) acquires category confidence data and uncertainty scores in real time via the industrial Ethernet protocol. When the detected category confidence value exceeds a preset first threshold and the uncertainty score is lower than a preset second threshold, a digital sorting instruction signal is automatically generated. The instruction is transmitted to the control system of the three-axis sorting robot arm via fieldbus. The robot arm plans its motion trajectory based on the received bounding box coordinate data, performs precise gripping operations, and removes defective workpieces from the main production line. For workpieces that do not meet the threshold standard, the controller drives the conveyor belt motor to transport them to a dedicated manual re-inspection area.
[0052] By combining a parallel multi-task processing architecture with Monte Carlo random deactivation technology, efficient collaborative execution of classification, localization, and segmentation tasks in defect identification is achieved, while providing a quantitative assessment of the reliability of identification results. Through the intelligent threshold decision-making mechanism of the programmable logic controller, automated sorting decisions based on dual-reset confidence are realized, ensuring accurate triage of different quality inspection results. This design not only guarantees the rapid processing efficiency of high-confidence defects but also provides a manual review channel for marginal cases through an uncertainty assessment mechanism, significantly improving the practicality and reliability of the entire detection system and effectively balancing the relationship between automated detection efficiency and quality control accuracy.
[0053] This embodiment also provides a Transformer training system for AI defect recognition of painted surfaces, including: The synchronous acquisition module uses an industrial camera and a 3D line laser scanner at the end of a six-axis data acquisition robotic arm to simultaneously acquire RGB images and 3D point cloud data of painted workpieces to form an original multimodal dataset. The simulation enhancement module inputs the original multimodal dataset into the fluid dynamics and ray tracing model to generate synthetic defect data, thereby outputting an expanded multimodal training sample set containing both real and synthetic samples. The feature alignment module extracts and serializes features from the multimodal training sample set using RGB images and point cloud data, and achieves cross-modal semantic alignment by calculating the contrastive learning loss, so as to output an aligned feature sequence with a unified dimension. The structural aggregation module uses a dynamic routing attention network to aggregate feature sequences into high-level defect structure capsules that carry component-whole relationship information. The knowledge fusion module performs knowledge retrieval and fusion by calculating the similarity between the prototype capsules stored in the prototype memory matrix and the high-level defect structure capsules, thereby outputting a comprehensive defect feature vector enhanced by knowledge. The intelligent decision-making module performs defect classification, segmentation, and detection tasks based on the comprehensive defect feature vector, calculates the uncertainty score of the identification results, and finally drives the sorting robot arm to perform sorting or re-inspection operations based on the classification results and uncertainty score.
[0054] This embodiment also provides a computer device applicable to the Transformer training method for AI defect recognition of paint surfaces, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the Transformer training method for AI defect recognition of paint surfaces as proposed in the above embodiment.
[0055] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0056] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the Transformer training method for AI defect recognition of paint surfaces as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0057] In summary, this invention achieves the following: by introducing a dynamic routing attention mechanism, it effectively establishes the component-to-whole hierarchical structure of defects, significantly improving the recognition accuracy and structural consistency of defects with complex shapes; by constructing a trainable prototype memory matrix and designing a knowledge retrieval and fusion mechanism, it enhances the model's ability to remember and generalize rare defect patterns in training data, effectively alleviating the data imbalance problem; by employing cross-modal contrastive learning, it achieves deep semantic alignment between visual features and three-dimensional morphological features, fully leveraging the complementary advantages of multimodal data; and by integrating an uncertainty quantification module and linking it with the sorting execution mechanism, it constructs a decision-making closed loop with reliability assessment capabilities, significantly improving the confidence and practicality of the automated sorting system, thus forming a complete technical solution that combines structural perception, knowledge memory, multimodal fusion, and reliability assurance.
[0058] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A Transformer training method for AI defect recognition of painted surfaces, characterized in that, Includes the following steps: By using an industrial camera and a 3D line laser scanner at the end of a six-axis data acquisition robotic arm, RGB images and 3D point cloud data of painted workpieces are simultaneously acquired to form an original multimodal dataset. The original multimodal dataset is input into the fluid dynamics and ray tracing model to generate synthetic defect data, thereby outputting an expanded multimodal training sample set containing both real and synthetic samples; The multimodal training sample set is used to extract and serialize features from RGB images and point cloud data, and cross-modal semantic alignment is achieved by calculating contrastive learning loss, so as to output aligned feature sequences with a unified dimension. A dynamic routing attention network is used to aggregate feature sequences into high-level defect structure capsules that carry component-whole relationship information. Knowledge retrieval and fusion are performed by calculating the similarity between the prototype capsules stored in the prototype memory matrix and the high-level defect structure capsules, thereby outputting a comprehensive defect feature vector enhanced by knowledge. The comprehensive defect feature vector is used to perform defect classification, segmentation and detection tasks, and the uncertainty score of the identification results is calculated. Finally, the sorting robot arm is driven to perform sorting or re-inspection operations based on the classification results and uncertainty score.
2. The Transformer training method for AI defect recognition of paint surfaces as described in claim 1, characterized in that: The process involves using an industrial camera and a 3D line laser scanner at the end of a six-axis data acquisition robotic arm to simultaneously acquire RGB images and 3D point cloud data of the painted workpiece, forming an original multimodal dataset. The specific steps are as follows: The host computer control system plans a bow-shaped scanning path covering the entire surface of the workpiece for the six-axis data acquisition robot arm, ensuring that the end effector maintains a constant distance from the workpiece surface. During the movement of the robotic arm along the path, the programmable logic controller sends a synchronous trigger pulse to drive the industrial camera to perform global shutter exposure to capture RGB images, and at the same time drive the 3D line laser scanner to project laser stripes to collect point cloud data. Each set of RGB images and point cloud data collected is labeled with a unified timestamp and spatial coordinates, and then transmitted in real time to the data preprocessing server via gigabit industrial Ethernet. The preprocessing server performs pixel-level and point-level spatial registration of RGB images and point cloud data at the same time and location based on timestamps and spatial coordinates to generate the original multimodal dataset.
3. The Transformer training method for AI defect recognition of paint surfaces as described in claim 2, characterized in that: The process involves inputting the original multimodal dataset into a fluid dynamics and ray tracing model to generate synthetic defect data, thereby outputting an expanded multimodal training sample set containing both real and synthetic samples. The specific steps are as follows: A batch of defect-free RGB images and point cloud data were randomly selected from the original multimodal dataset as the basis for simulation. The system invokes a physics-based fluid dynamics simulation engine to simulate the dynamic process of paint bubbles or drips due to changes in viscosity and surface tension at a specified location on the substrate image, and simultaneously generates 3D point cloud data of the corresponding depressions or protrusions. Using a physically based ray tracing rendering engine, the base with simulated defects is rendered according to preset workshop lighting environment parameters, and RGB images with orange peel and color difference visual effects presented under different lighting angles are accurately generated. The simulated defect data is mixed with the real-collected data, and then normalized and standardized to form an expanded multimodal training sample set.
4. The Transformer training method for AI defect recognition of paint surfaces as described in claim 3, characterized in that: The process involves extracting and serializing features from the multimodal training sample set using RGB images and point cloud data, and achieving cross-modal semantic alignment by calculating contrastive learning loss to output aligned feature sequences with a unified dimension. The specific steps are as follows: A pre-trained Vision Transformer model is used to segment RGB images into fixed-size image patches and linearly project them into image feature sequences. A lightweight PointNet network is used to convert 3D point cloud data into point cloud feature sequences composed of global and local features. Within a batch, the image feature sequence and point cloud feature sequence belonging to the same workpiece are used as positive sample pairs, and the feature sequences of other workpieces are used as negative sample pairs. In the shared projector network, the cosine similarity of all positive and negative sample pairs in the latent space is calculated, and optimization is performed based on the InfoNCE loss function to bring positive sample pairs closer and push negative sample pairs further apart. Once the contrastive learning loss converges, the output is an aligned feature sequence that achieves alignment in both feature dimension and semantics.
5. The Transformer training method for AI defect recognition of paint surfaces as described in claim 4, characterized in that: The specific steps for aggregating feature sequences into high-level defect structure capsules carrying component-whole relationship information using a dynamic routing attention network are as follows: Each feature vector in the aligned feature sequence is initialized as a primary capsule containing feature activation values and an instantiation parameter matrix; In the first layer of the dynamic routing attention network, each primary capsule predicts the existence of the next layer capsule by linearly transforming its instantiation parameters, thus generating a voting vector. Iterative calculations are performed through the routing protocol layer integrated in the network. In each iteration, the routing weights are dynamically updated based on the consistency between the votes of the lower-level capsules and the activation values of the higher-level capsules, thereby strengthening the voting of capsules belonging to the same defective structure. After three rounds of iteration, the bottom-level capsules were clustered into multiple high-level capsules. The activation values and instantiation parameters of these high-level capsules together constitute high-level defect structure capsules that carry component-to-whole relationship information.
6. The Transformer training method for AI defect recognition of paint surfaces as described in claim 5, characterized in that: The process involves calculating the similarity between the prototype capsules stored in a prototype memory matrix and the high-level defect structure capsules to perform knowledge retrieval and fusion, thereby outputting a knowledge-enhanced comprehensive defect feature vector. The specific steps are as follows: During the training phase, a prototype memory matrix is constructed through sparse coding constraints to store prototype capsules of various typical defects from the training set. Calculate the cosine similarity between the currently input high-level defect structure capsule and each prototype capsule in the memory matrix; The Top-K sorting selection circuit retrieves the three prototype capsules most similar to the current input, and a weighting coefficient is calculated based on the similarity score. A learnable gated neural network is used to control the feature fusion of the three retrieved prototype capsules and the current input capsule with weighted coefficients. The output of the gated neural network is the knowledge-enhanced comprehensive defect feature vector.
7. The Transformer training method for AI defect recognition of paint surfaces as described in claim 6, characterized in that: The process involves performing defect classification, segmentation, and detection tasks using the comprehensive defect feature vector, calculating the uncertainty score of the identification results, and finally driving the sorting robot arm to perform sorting or re-inspection operations based on the classification results and uncertainty score. The specific steps are as follows: The comprehensive defect feature vector is simultaneously input into a classification head composed of fully connected layers, a segmentation head composed of transposed convolutional layers, and a detection head composed of anchor point regression layers to obtain defect categories, pixel-level segmentation masks, and bounding box coordinates in parallel. Monte Carlo Dropout technology is integrated into the classification head, and Dropout is kept active during inference and fifty forward propagations are performed. The uncertainty score is calculated based on the variance of the fifty output probabilities. The programmable logic controller receives the classification results and uncertainty score. When the classification confidence is higher than the first threshold and the uncertainty score is lower than the second threshold, a sorting instruction is generated. The sorting instructions are sent to the three-axis sorting robot arm, which performs precise gripping and removes defective workpieces from the production line. For workpieces that do not meet the requirements, the conveyor belt is controlled to guide them to the manual re-inspection station.
8. A Transformer training system for AI defect recognition of paint surfaces, based on the Transformer training method for AI defect recognition of paint surfaces according to any one of claims 1 to 7, characterized in that: include, The synchronous acquisition module uses an industrial camera and a 3D line laser scanner at the end of a six-axis data acquisition robotic arm to simultaneously acquire RGB images and 3D point cloud data of painted workpieces to form an original multimodal dataset. The simulation enhancement module inputs the original multimodal dataset into the fluid dynamics and ray tracing model to generate synthetic defect data, thereby outputting an expanded multimodal training sample set containing both real and synthetic samples. The feature alignment module extracts and serializes features from the multimodal training sample set using RGB images and point cloud data, and achieves cross-modal semantic alignment by calculating the contrastive learning loss, so as to output an aligned feature sequence with a unified dimension. The structural aggregation module uses a dynamic routing attention network to aggregate feature sequences into high-level defect structure capsules that carry component-whole relationship information. The knowledge fusion module performs knowledge retrieval and fusion by calculating the similarity between the prototype capsules stored in the prototype memory matrix and the high-level defect structure capsules, thereby outputting a comprehensive defect feature vector enhanced by knowledge. The intelligent decision-making module performs defect classification, segmentation, and detection tasks based on the comprehensive defect feature vector, calculates the uncertainty score of the identification results, and finally drives the sorting robot arm to perform sorting or re-inspection operations based on the classification results and uncertainty score.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the Transformer training method for AI defect recognition of paint surfaces as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the Transformer training method for AI defect recognition of paint surfaces as described in any one of claims 1 to 7.
Citation Information
Cited By
Multi-modal space-time fusion target detection method and device and medium
CN119107638A
A multi-modal spatio-temporal fusion target detection method, device and medium
CN119107638B