A visual inspection method for motor shafts
Patent Information
- Application Number
- CN202511856520.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2045-12-10
AI Technical Summary
[0003]传统高转速轴承检测系统中,存在动态模糊与微观缺陷的耦合效应,即当轴承转速超过时,传统相机曝光时间需缩短至微秒级以避免图像拖影,但信噪比急剧下降导致微小缺陷(如微裂纹、剥落)漏检率偏高
(1)本发明通过CPS数据模型和自适应成像,解决了动态模糊和畸变问题;
Smart Images

Figure CN121458705B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual inspection technology, and more specifically to a visual inspection method for motor shafts. Background Technology
[0002] The motor shaft is a core component of all types of motors. The quality of the shaft (such as shaft diameter tolerance, overall shaft curvature, surface defects, etc.) directly affects the quality of the entire motor. Traditional manual visual inspection is limited by dynamic interference under high-speed conditions (such as centrifugal force deformation, surface oil film reflection), while rule-based optical inspection systems struggle to capture the instantaneous evolution of defects. Bearing vision inspection systems, through the collaborative innovation of high-speed imaging technology, multi-dimensional feature fusion algorithms, and life prediction models, are reconstructing the quality control system for high-speed scenarios.
[0003] Traditional high-speed bearing testing systems suffer from a coupling effect between dynamic fuzziness and microscopic defects; that is, when the bearing speed exceeds... In such cases, traditional camera exposure times need to be shortened to the microsecond level to avoid image ghosting, but the signal-to-noise ratio drops sharply, resulting in a high rate of missed detection of minute defects (such as microcracks and peeling). At the same time, there are also cases where the dimensions of the parts are clearly within acceptable limits, but the vision inspection system judges them to be out of tolerance, that is, there is an image distortion problem. These problems are often difficult to detect, but can lead to serious consequences, such as dimensional measurement deviations, missed defects, or even cause the entire inspection system to malfunction. Summary of the Invention
[0004] The purpose of this invention is to provide a visual inspection method for motor shafts to solve the problems mentioned in the background art.
[0005] The specific technical solution provided by this invention is as follows: A visual inspection method for motor shafts, comprising the following operational steps: Step S1: Collect relevant parameters of the motor shaft in real time, construct a CPS data model of the motor shaft, associate the physical detection unit with the digital twin model in real time, and digitally map the manufacturing process status and data transformation sequence.
[0006] Preferably, the construction of a digital twin model includes: a: Perform geometric modeling of the motor shaft; b: Add material properties and physical characteristics to the geometric model; c: Through finite element analysis and multibody dynamics simulation, the deformation, vibration, and heat distribution behavior of the motor shaft during operation are simulated; d: Integrate testing rules, process parameters, and quality standards into the digital twin; e: Develop data interfaces with physical detection units, including sensors and cameras, to enable real-time data inflow and command issuance.
[0007] Step S2: Based on the real-time state vector output by the fusion of multi-source data and digital twin model, perform adaptive imaging parameter adjustment and multi-station collaborative imaging planning based on deep reinforcement learning.
[0008] Preferably, the specific implementation process includes: Step S21: Establish the camera imaging model and lighting model; Step S22: Using a deep reinforcement learning model, take the output real-time state vector as input and output the optimal camera parameters and lighting parameters; Step S23: Based on the key detection parts of the motor shaft, plan the shooting sequence and angle of multiple cameras, set a collaborative triggering strategy, and use a graph optimization model to allocate shooting tasks with the goal of minimizing the total shooting time and maximizing the coverage. Preferably, the specific implementation process further includes: Step S231: Identify key detection areas and establish a priority matrix for key areas. Prioritize, that is 1 indicates high priority, corresponding to bearing positions and knurled areas (zero tolerance for defects). Medium priority, corresponding to the shoulder and keyway. Low priority, corresponding to the optical axis area and chamfer; Step S232: Construct a viewpoint requirement matrix, generating a task for each camera, each part, and each required viewpoint; Step S233: Construct a directed graph Each node is defined as a generated task. Two types of edges are defined, including time-series edges and conflict edges. For two tasks with the same camera, they cannot be executed simultaneously, so conflict edges are added. For two tasks with the same part, if they require different perspectives but are not required to be shot by the same camera, they are not necessarily in conflict. However, if they are within the same time window and are shot by different cameras, they may be performed simultaneously. Therefore, according to process requirements, some tasks must be executed in sequence (e.g., shooting the bearing position first and then the knurling), so time-series edges are added.
[0009] Step S234: Establish an optimization objective that includes minimizing total shooting time and maximizing coverage; Step S235: Using position-based triggering, an encoder is installed on the motor shaft. When the encoder reading reaches a preset value, the camera is triggered. The central controller sends out trigger signals in sequence according to the encoder reading and the time window of each camera.
[0010] Step S24: Deploy the deep reinforcement learning model to the edge computing device, adjust the imaging parameters in real time, and execute parameter adjustment and trigger the camera through PLC or dedicated controller.
[0011] Step S3: Perform image preprocessing based on real-time state vector and imaging parameters, and use a distortion correction algorithm based on a physical model to compensate for dynamic deformation.
[0012] Preferably, the specific implementation process includes: Step S31: The dynamic point spread function is used for estimation. A motion blur PSF model is established based on the rotation speed, vibration and exposure time in the real-time state vector. A composite PSF is constructed for the camera shake caused by deformation and vibration caused by centrifugal force. A convolutional neural network is used to estimate the residual blur kernel from the blurred image, which is complementary to the physical model PSF. Step S32: Combining the physical model PSF and the PSF estimated by CNN, a non-blind deconvolution algorithm is used to restore the image. A variational model is introduced, which includes data fidelity terms and regularization terms. The clear image is solved through iterative optimization. Step S33: Using the CAD model of the motor shaft and camera calibration parameters, establish the mapping relationship between the ideal image and the actual image, obtain the real-time deformation data of the motor shaft from the digital twin model, correct the geometric distortion, and at the same time use thin plate spline or polynomial model for distortion correction. The model parameters are updated through real-time data. Step S34: Use a generative adversarial network-based image enhancement method to train a conditional GAN, which takes the corrected image as input and outputs an enhanced image; Step S35: Calculate the image quality index after preprocessing and compare it with that before preprocessing, then output the preprocessed image.
[0013] Step S4: Combine multi-station images and use a multi-scale feature fusion algorithm to detect minute defects in the motor shaft.
[0014] Preferably, the specific implementation process includes: Step S41: Use a multi-scale image pyramid to downsample the same image at different scales to obtain images at multiple scales. At each scale, use a convolutional neural network to extract features. Step S42: Upsample the feature maps at different scales to the original image size and fuse them to obtain fused features; Step S43: Use the detection head to perform defect detection, use the region proposal network to generate candidate regions, extract features from the fused features for each candidate region, perform classification and bounding box regression, output the bounding box and category confidence of the defect, and use non-maximum suppression to remove overlapping detection boxes, set a confidence threshold, and filter out detection results with low confidence.
[0015] Step S5: Construct a hierarchical attention classification network to perform hierarchical classification of defects, and simultaneously establish a multimodal fusion graph neural network to diagnose the causes of defects.
[0016] Preferably, the specific implementation process includes: Step S51: Use a hierarchical attention classification network to classify defects hierarchically, including a first level of defect category classification and a second level of fine-grained classification. Step S52: Extract multimodal features from the detected defect region. The multimodal features include: depth features, geometric features, and contextual features. Step S53: Utilize multi-source data, including sensor data and process parameters, to perform defect cause analysis, construct a cause diagnosis model, and input defect characteristics, real-time state vector, and process parameters, and output the probability distribution of defect causes. Step S54: Feed the defect classification and cause diagnosis results back to the digital twin model, update the model parameters based on the diagnosis results, and drive the optimization of process parameters.
[0017] Compared with the prior art, the beneficial effects achieved by the present invention are: (1) This invention solves the problems of dynamic blur and distortion by using CPS data model and adaptive imaging; (2) The present invention adopts multi-station collaboration and lighting adjustment to adapt to high speed and vibration environment, ensuring clear imaging. It solves the technical problems of large axial dimension of motor shaft, many nodes, high axial dimension accuracy, mirror reflection, and large dynamic shooting interference, ensuring clear imaging even under vibration conditions. It improves the adaptability and accuracy of motor shaft fast inspection imaging, and ensures the industrial production application of vision technology.
[0018] (3) This invention utilizes multidimensional feature fusion and adaptive receptive field to improve the detection capability of minute defects. At the same time, the hierarchical classification network realizes the fine classification of defects, which can adapt to defects of different scales. Meanwhile, it ensures the detection rate of critical defects, minute defects, knurling and other key part defects and the accuracy of defect classification. Attached Figure Description
[0019] Figure 1 This is a flowchart of the steps of the visual inspection method for motor shafts provided in an embodiment of the present invention; Figure 2 This is a logical architecture diagram of the motor shaft visual inspection provided in an embodiment of the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention are within the scope of protection of the present invention.
[0021] Example 1: Combination Figures 1-2 As shown in the figure, the visual inspection method for motor shafts described in this embodiment includes the following operational steps: Step S1: Collect relevant parameters of the motor shaft in real time, construct a CPS data model of the motor shaft, associate the physical detection unit with the digital twin model in real time, and digitally map the manufacturing process status and data transformation sequence to provide a unified data foundation for subsequent inspection and avoid the data silo problem in traditional systems.
[0022] In this embodiment, various sensors deployed on the motor shaft production line are used to collect relevant parameters of the motor shaft in real time. The various sensors used in this invention include: an encoder for measuring rotational speed and position; an acceleration sensor for measuring vibration; a temperature sensor for measuring shaft surface temperature; a force sensor for measuring processing force; and a high-definition industrial camera for acquiring image data. The relevant parameters collected include: production process data, status data, and environmental data of the motor shaft.
[0023] For example, a PLC or data acquisition card (such as an NI DAQ) is used to collect sensor data and transmit it to the CPS platform via OPC UA or MQTT protocols. The acquisition frequency is set according to the detection requirements, for example, 10kHz for vibration data acquisition and 1000fps for image acquisition (depending on camera performance). The raw data is preprocessed to ensure data quality, using box plots or... The algorithm identifies outliers and replaces them with interpolated data from preceding and following data, using linear or spline interpolation to fill missing points. Simultaneously, due to differences in sensor acquisition frequencies and timestamps, time alignment is necessary. Interpolation methods are used to unify the data to the same timestamp. For high-dimensional data (such as images), principal component analysis (PCA) or an autoencoder is used for dimensionality reduction, preserving key features. Finally, the data is scaled to... Intervals, eliminating the influence of dimensions.
[0024] For example, the construction of a CPS data model for a motor shaft includes: establishing a parametric CAD model of the motor shaft, containing precise geometric dimensions and tolerance information; establishing a material microstructure model and simulating material behavior using the crystal plasticity finite element method; and establishing a thermo-mechanical coupled physical field model to predict deformation behavior under different working conditions. A digital twin model, on the other hand, is a dynamic mapping of the physical entity (motor shaft) throughout its entire lifecycle in virtual space, including a geometric model, physical model, behavioral model, and rule model. The construction process of a digital twin model includes: a: Geometric modeling: Based on the CAD drawings of the motor shaft, use 3D modeling software (such as SolidWorks) or obtain a high-precision geometric model through 3D scanning, save it as STEP or IGES format, and convert it into a lightweight mesh model (such as OBJ, STL) for real-time rendering.
[0025] b: Physical property assignment: Add material properties (such as density, elastic modulus, Poisson's ratio) and physical properties (such as coefficient of thermal expansion, electrical conductivity) to the geometric model. These properties are obtained through material certificates and experimental data.
[0026] c: Behavioral Model Construction: Through finite element analysis (FEA) and multibody dynamics simulation, the deformation, vibration, and heat distribution of the motor shaft during operation are simulated. For example, static and dynamic analyses are performed using ANSYS to obtain the stress-strain distribution and natural frequencies under different speeds and loads.
[0027] d: Rule model integration: Integrate inspection rules, process parameters, and quality standards into the digital twin, such as tolerance ranges and defect definitions.
[0028] e: Data interface development: This invention develops a data interface with physical detection units (sensors, cameras) to enable real-time data inflow and command issuance.
[0029] In this embodiment, a deep learning model is introduced for real-time anomaly detection and correction. A recurrent neural network (RNN) or a long short-term memory network (LSTM) is used to detect anomalies in time-series data. The model is trained using normal production data; when the deviation between the input data and the prediction exceeds a threshold, it is marked as an anomaly. The LSTM model is trained using normal data to learn the temporal dependencies of the data. Real-time data is input into the LSTM, and the residual between the predicted and actual values is calculated. If the residual is greater than a set threshold, it is determined to be an anomaly. For anomalous data, a generative adversarial network (GAN) is used to generate normal data to replace it. A GAN model is trained to generate data with a distribution similar to normal data. When an anomaly is detected, the anomaly point is replaced with the data generated by the GAN. Finally, multi-source data (sensor data, image data) is fused with the digital twin model to form a unified real-time state vector output.
[0030] For example, features (such as defect features and dimensional features) are extracted from images, and statistical features (such as mean, variance, and peak value) are extracted from sensor data. Kalman filtering or particle filtering is used for data fusion to estimate the real-time state of the motor shaft (such as curvature and surface roughness). Based on the fused data, the state of the digital twin model is updated in real time, including updating the shape of the geometric model based on detected deformations, and updating physical properties (such as material fatigue) based on temperature and vibration data. The parameters of the behavioral model are adjusted to make the simulation more realistic.
[0031] Step S2: Based on the real-time state vector output by the fusion of multi-source data and digital twin model, perform adaptive imaging parameter adjustment and multi-station collaborative imaging planning based on deep reinforcement learning.
[0032] In this embodiment, the present invention solves problems such as large axial dimension of the motor shaft, numerous nodes, specular reflection, and significant dynamic shooting interference by automatically adjusting camera parameters and workstation collaboration strategies according to real-time operating conditions. Simultaneously, it achieves clear imaging under vibration conditions through large depth-of-field dark-field illumination and multi-workstation collaboration. The specific implementation process includes: Step S21: Establish the camera imaging model and the illumination model. The camera imaging model includes intrinsic parameters (focal length, principal point, distortion coefficient) and extrinsic parameters (camera position and attitude). The illumination model is used to describe the relationship between the position, angle, intensity of the light source and the image quality.
[0033] Step S22: Using a deep reinforcement learning model, take the output real-time state vector as input and output the optimal camera parameters (exposure time, aperture, gain) and illumination parameters (light source intensity, angle).
[0034] For example, by defining a state space ,in, This represents the motor shaft speed in the real-time state vector. Surface temperature, For vibration acceleration, Define motion space based on ambient light intensity. ,in, For the exposure time, This is the aperture value. For gain, For lighting intensity, To determine the lighting angle, a reward function is further designed. ,in, The weighting coefficients are determined using the analytic hierarchy process or expert scoring. Image quality is calculated comprehensively using indicators such as image sharpness (e.g., sum of squared gradients), contrast, and noise level. For energy efficiency, For motion fuzziness index, This is an indicator of overexposure.
[0035] Furthermore, this invention employs the Deep Deterministic Policy Gradient (DDPG) algorithm for training to achieve control over the continuous action space. Specifically, it includes: adopting an actor-critic structure, where the actor network outputs actions based on the state, and the critic network evaluates the value of the state-action pair. By utilizing both the target network and the online network, training stability is improved, while an experience replay mechanism breaks down data correlations.
[0036] Step S23: Based on the key detection parts of the motor shaft (such as bearing seats, knurling, shaft shoulders, etc.), plan the shooting sequence and angle of multiple cameras, set a collaborative triggering strategy to avoid interference caused by simultaneous shooting, and ensure coverage of all key parts. Use a graph optimization model to allocate shooting tasks with the goal of minimizing the total shooting time and maximizing coverage.
[0037] In this embodiment, all key parts of the motor shaft that need to be inspected are listed, and the required angle (viewing angle) and image resolution for each part are determined. Each part may require one or more cameras to capture images from different angles to ensure coverage of all areas where defects may occur. Therefore, based on the location of the key parts and the inspection requirements, multiple cameras are arranged on the production line, with each camera responsible for capturing images of one or more parts. The intrinsic parameters (focal length, pixel size, etc.) and extrinsic parameters (position, orientation) of each camera are determined based on a deep reinforcement learning model. Since multiple cameras may share a light source or to avoid data transmission bandwidth conflicts caused by simultaneous shooting, this invention designs a triggering sequence so that the cameras are triggered sequentially, while ensuring that shooting is completed when the motor shaft passes through each station. Considering the speed of the motor, the shooting window time for each camera is calculated.
[0038] For example, each shooting task (one camera shooting one part) is treated as a node in a graph. Edges between nodes represent the temporal relationship (e.g., sequence) and conflict relationship (e.g., one camera cannot simultaneously shoot two parts, or two cameras use the same light source). The edge weights can represent switching time (e.g., the time for camera to adjust focus, the time for light source changes) or conflict costs. An optimization objective is defined that includes minimizing the total shooting time and maximizing coverage. Minimizing the total shooting time is the time from when the first camera starts shooting to when the last camera finishes shooting; maximizing coverage ensures that all key parts are covered and that detection requirements (e.g., resolution, angle) are met. Finally, time-based or position-based triggering is used to trigger the corresponding camera when the motor shaft reaches a predetermined position. A central controller (e.g., PLC) coordinates the trigger signals of each camera to avoid simultaneous triggering. A graph optimization model is solved, and a graph coloring algorithm is used to avoid conflicts (e.g., adjacent nodes cannot execute simultaneously). A variant of the Traveling Salesman Problem (TSP) is used to plan the shooting sequence to minimize the total time.
[0039] For example, a directed graph model can be constructed by defining workstations as nodes. Let the edges represent the collaborative relationships between workstations. Integer linear programming (ILP) is used to solve for the optimal shooting plan, and the objective function is defined as: ,in, For the total time step, For the number of workstations, For workstations The cost of filming The binary decision variable represents the workstation. In time Whether to take a picture, and define the constraints: , , , , For workstations In time Whether or not to take photos means that each key part is photographed at least once, there is no conflict between workstations, and the timing requirements are met.
[0040] Step S24: Deploy the deep reinforcement learning model to the edge computing device, adjust the imaging parameters in real time, and execute parameter adjustment and trigger the camera through PLC or dedicated controller.
[0041] Step S3: Perform image preprocessing based on real-time state vector and imaging parameters, and use a distortion correction algorithm based on a physical model to compensate for dynamic deformation.
[0042] In this embodiment, to address image blurring and distortion caused by high-speed rotation, real-time preprocessing operations for image restoration and distortion correction are performed using real-time state vectors (such as rotational speed and vibration) and imaging parameters. This improves image quality and lays the foundation for defect detection. The specific implementation process includes: Step S31: The dynamic point spread function (PSF) is used for estimation. A motion blur PSF model is established based on the rotation speed, vibration and exposure time in the real-time state vector. A composite PSF is constructed for the deformation caused by centrifugal force and the camera shake caused by vibration. A convolutional neural network (CNN) is used to estimate the residual blur kernel from the blurred image, which is complementary to the physical model PSF.
[0043] In this embodiment, due to the rotation of the motor shaft, the object rotates within the image during the exposure time. When the camera is directly facing the rotation axis, the blur path is an arc. For a point in the image... Its fuzzy path can be represented as: Let the center of rotation be... The fuzzy path is from the angle arrive The arc, The rotational angular velocity is, This refers to the exposure time. However, since actual images are two-dimensional, linear motion is often used to approximate local motion. For high-speed rotation, this is achieved by decomposing the motion into tangential and radial components, or by modeling the motion blur PSF as a line spread function along the direction of motion. For rotational motion, the distance from the center of rotation is considered. The linear velocity at that point is Therefore, during the exposure time Within, the distance that the point moves is (In pixels), since the direction of motion is tangential, for each point in the image, its direction of motion is perpendicular to the line connecting that point and the center of rotation. However, because the motion of the entire image is inconsistent, the image is usually divided into multiple regions, and the motion within each region is approximately uniform linear motion. Therefore, in this invention, the image is divided into... For each block, estimate a PSF.
[0044] For example, for camera shake caused by vibration, vibration acceleration The displacement can be obtained by integration. When the vibration is simple harmonic motion, the displacement function is: ,in The vibration frequency is used. During the exposure time, the camera's motion blur trajectory can be represented as a series of displacement vectors, thus generating a corresponding PSF based on the motion blur trajectory. Further, the rotational motion blur PSF and the vibration blur PSF are convolved to obtain a composite PSF. In this invention, the two PSFs are generated in different ways: rotational motion blur is due to the motion of objects in the scene, while vibration blur is caused by camera motion. In the imaging model, both can be represented as convolution kernels. In practice, however, the vibration frequency may not be accurately known. Therefore, the main frequency components of vibration are obtained from CPS data. When the vibration data is random vibration, the main frequencies are obtained through power spectral density analysis. The image to be deblurred is input into a trained CNN to obtain an estimated PSF kernel, which contains blurring factors not captured by the physical model.
[0045] Step S32: Combining the physical model PSF and the PSF estimated by CNN, a non-blind deconvolution algorithm is used to restore the image. A variational model is introduced, which includes data fidelity terms and regularization terms. The clear image is solved through iterative optimization.
[0046] For example, a weighted average is used to fuse the PSF of the physical model and the PSF estimated by the CNN to obtain the final PSF estimate. : ,in It is an adjustable parameter, and can also be determined adaptively based on the confidence levels of the two PSFs. For the physical model PSF, PSF estimated by CNN.
[0047] Step S33: Using the CAD model of the motor shaft and camera calibration parameters, establish a mapping relationship between the ideal image and the actual image, obtain real-time deformation data of the motor shaft from the digital twin model, correct geometric distortion, and use thin plate spline (TPS) or polynomial model for distortion correction. The model parameters are updated through real-time data.
[0048] Step S34: Use an image enhancement method based on generative adversarial networks (GANs) to improve image contrast and details. That is, train a conditional GAN, take the corrected image as input, and output an enhanced image to make defects more obvious.
[0049] Step S35: Calculate the image quality metrics (such as PSNR, SSIM) after preprocessing, compare them with those before preprocessing, and output the preprocessed image.
[0050] Step S4: Combining multi-station images, a multi-scale feature fusion algorithm is used to detect minute defects in the motor shaft, including micro-cracks and peeling, to solve the problem of missed detection caused by low signal-to-noise ratio.
[0051] In this embodiment, since defects in the motor shaft may appear at different scales, it is necessary to fuse multi-scale features to improve detection capability. In this invention, multi-scale features (such as texture and edges) are extracted from the preprocessed image, fused, and input into the defect detection model. The specific implementation process includes: Step S41: Using a multi-scale image pyramid, the same image is downsampled at different scales to obtain images at multiple scales. At each scale, features are extracted using a convolutional neural network (such as ResNet or VGG). In this invention, a pre-trained model can be selected as the feature extractor. Specifically, for the image... Constructing an image pyramid: ,in This is the original image. To reduce the sampling rate by half, To further downsample by half, feature maps are extracted from the image at each scale using a CNN, denoted as... .
[0052] Step S42: Upsample feature maps of different scales to the original image size, and then fuse them. Upsampling uses bilinear interpolation or transposed convolution, and fusion is performed by concatenation or weighted summation. For example: and Upsampling to The same size is then spliced together to obtain the fused feature. .
[0053] Step S43: Based on the fused features, defect detection is performed using a detection head. In this invention, the detection head is selected from Faster R-CNN, YOLO, or SSD, etc. Candidate regions are generated using a Region Proposal Network (RPN) (for Faster R-CNN) or bounding boxes are directly regressed (for YOLO). For each candidate region, features are extracted from the fused feature map, and classification and bounding box regression are performed. The bounding box of the defect and the category confidence are output. At the same time, non-maximum suppression (NMS) is used to remove overlapping detection boxes, and a confidence threshold is set to filter out detection results with low confidence.
[0054] Step S5: Construct a hierarchical attention classification network to perform hierarchical defect classification, and establish a multimodal fusion graph neural network to diagnose the causes of defects.
[0055] In this embodiment, the detected defects are finely classified and their causes are diagnosed to provide a basis for process improvement. The specific implementation process includes: Step S51: Utilize a hierarchical attention classification network to classify defects hierarchically. The first level is a broad category classification including cracks, spalling, scratches, porosity, and inclusions. The second level is a fine-grained classification, for example, further dividing cracks into microcracks, macrocracks, and fatigue cracks, and spalling into point spalling, sheet spalling, and network spalling, thereby simulating the hierarchical decision-making process of expert diagnosis.
[0056] Step S52: Extract multimodal features from the detected defect region, including: extracting depth features of the defect region using CNN; extracting geometric features corresponding to the size, shape, and location of the defect, as well as contextual features corresponding to the process information of the defect location (such as the processing steps that the location has undergone).
[0057] Step S53: Combine multi-source data (sensor data, process parameters) to perform defect cause analysis, construct a cause diagnosis model, inputs include defect characteristics, real-time state vector, process parameters, etc., and output the probability distribution of defect causes (e.g., overload, material problems, improper processing parameters, etc.).
[0058] For example, the defect diagnosis problem can be modeled as a graph structure, where nodes represent defect instances, process steps, equipment status, etc., and edges represent relationships between nodes (e.g., a defect occurs in a certain process step, and a certain piece of equipment is used in that process step). The features of defect nodes include image features and geometric features; the features of process step nodes include process parameters; and the features of equipment status nodes include sensor data. Messages are passed through a graph neural network, and finally, a cause classification is output at the defect node.
[0059] Step S54: Feed the defect classification and cause diagnosis results back to the digital twin model, update the model parameters based on the diagnosis results, and drive the optimization of process parameters.
[0060] It should be noted that, in this invention, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus.
[0061] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A visual inspection method for motor shafts, characterized in that: The following steps are included: Step S1: Collect relevant parameters of the motor shaft in real time, construct a CPS data model of the motor shaft, associate the physical detection unit with the digital twin model in real time, and digitally map the manufacturing process status and data transformation sequence. Step S2: Based on the real-time state vector output by the fusion of multi-source data and digital twin model, perform adaptive imaging parameter adjustment and multi-position collaborative imaging planning based on deep reinforcement learning; Step S3: Perform image preprocessing based on real-time state vector and imaging parameters, and use a distortion correction algorithm based on a physical model to compensate for dynamic deformation; Step S4: Combine multi-station images and use a multi-scale feature fusion algorithm to detect minute defects in the motor shaft; Step S5: Construct a hierarchical attention classification network to perform hierarchical defect classification, and simultaneously establish a multimodal fusion graph neural network to diagnose the causes of defects. The implementation process of step S2 includes: Step S21: Establish the camera imaging model and lighting model; Step S22: Using a deep reinforcement learning model, take the output real-time state vector as input and output the optimal camera parameters and lighting parameters; Step S23: Based on the key detection parts of the motor shaft, plan the shooting sequence and angle of multiple cameras, set a collaborative triggering strategy, and use a graph optimization model to allocate shooting tasks with the goal of minimizing the total shooting time and maximizing the coverage. Step S24: Deploy the deep reinforcement learning model to the edge computing device, adjust the imaging parameters in real time, and execute parameter adjustment and trigger the camera through PLC or dedicated controller; The implementation process of step S23 includes: Step S231: Identify key detection areas, establish a priority matrix for key areas, and assign priorities; Step S232: Construct a viewpoint requirement matrix, generating a task for each camera, each part, and each required viewpoint; Step S233: Construct a directed graph, define each node as a generated task, and define two types of edges, including sequential edges and conflict edges; Step S234: Establish an optimization objective that includes minimizing total shooting time and maximizing coverage; Step S235: Using position-based triggering, an encoder is installed on the motor shaft. When the encoder reading reaches a preset value, the camera is triggered. The central controller sends out trigger signals in sequence according to the encoder reading and the time window of each camera. Step S233 also includes: Add a conflict edge when two tasks cannot be executed simultaneously on the same camera or when two cameras use the same light source. When there are two or more shooting tasks for the same part, and different perspectives and time sequences are required, add a time sequence edge; Each shooting task is considered as a node in a graph. The edges between nodes represent the temporal and conflict relationships between two tasks, and the weight of the edge represents the switching time or conflict cost. The implementation process of step S233 includes: Define workstations as nodes, construct a directed graph model, where edges represent the collaborative relationships between workstations, and use integer linear programming to solve for the optimal shooting plan. Define the objective function as: in, For the total time step, For the number of workstations, For workstations The cost of filming The binary decision variable represents the workstation. In time Whether to take photos; Simultaneously define constraints: , , For workstations In time Whether or not to take photos means that each key part is photographed at least once, there is no conflict between workstations, and the timing requirements are met.
2. The visual inspection method for motor shafts according to claim 1, characterized in that: The CPS data model of the motor shaft constructed in step S1 includes: a parametric CAD model of the motor shaft, a material microstructure model, and a thermo-mechanical coupling physical field model.
3. The visual inspection method for motor shafts according to claim 2, characterized in that: The construction of the digital twin model in step S1 includes: a: Perform geometric modeling of the motor shaft; b: Add material properties and physical characteristics to the geometric model; c: Through finite element analysis and multibody dynamics simulation, the deformation, vibration, and heat distribution behavior of the motor shaft during operation are simulated; d: Integrate testing rules, process parameters, and quality standards into the digital twin; e: Develop data interfaces with physical detection units, including sensors and cameras, to enable real-time data inflow and command issuance.
4. The visual inspection method for motor shafts according to claim 3, characterized in that: The implementation process of step S3 includes: Step S31: The dynamic point spread function is used for estimation. A motion blur PSF model is established based on the rotation speed, vibration and exposure time in the real-time state vector. A composite PSF is constructed for the camera shake caused by deformation and vibration caused by centrifugal force. A convolutional neural network is used to estimate the residual blur kernel from the blurred image, which is complementary to the physical model PSF. Step S32: Combining the physical model PSF and the PSF estimated by CNN, a non-blind deconvolution algorithm is used to restore the image. A variational model is introduced, which includes data fidelity terms and regularization terms. The clear image is solved through iterative optimization. Step S33: Using the CAD model of the motor shaft and camera calibration parameters, establish the mapping relationship between the ideal image and the actual image, obtain the real-time deformation data of the motor shaft from the digital twin model, correct the geometric distortion, and at the same time use thin plate spline or polynomial model for distortion correction. The model parameters are updated through real-time data. Step S34: Use a generative adversarial network-based image enhancement method to train a conditional GAN, which takes the corrected image as input and outputs an enhanced image; Step S35: Calculate the image quality index after preprocessing and compare it with that before preprocessing, then output the preprocessed image.
5. The visual inspection method for motor shafts according to claim 4, characterized in that: The implementation process of step S4 includes: Step S41: Use a multi-scale image pyramid to downsample the same image at different scales to obtain images at multiple scales. At each scale, use a convolutional neural network to extract features. Step S42: Upsample the feature maps at different scales to the original image size and fuse them to obtain fused features; Step S43: Use the detection head to perform defect detection, use the region proposal network to generate candidate regions, extract features from the fused features for each candidate region, perform classification and bounding box regression, output the bounding box and category confidence of the defect, and use non-maximum suppression to remove overlapping detection boxes, set a confidence threshold, and filter out detection results with low confidence.
6. The visual inspection method for motor shafts according to claim 5, characterized in that: The implementation process of step S5 includes: Step S51: Use a hierarchical attention classification network to classify defects hierarchically, including a first level of defect category classification and a second level of fine-grained classification. Step S52: Extract multimodal features from the detected defect region. The multimodal features include: depth features, geometric features, and contextual features. Step S53: Utilize multi-source data, including sensor data and process parameters, to perform defect cause analysis, construct a cause diagnosis model, and input defect characteristics, real-time state vector, and process parameters, and output the probability distribution of defect causes. Step S54: Feed the defect classification and cause diagnosis results back to the digital twin model, update the model parameters based on the diagnosis results, and drive the optimization of process parameters.
Citation Information
Patent Citations
Automatic visual inspection system applied to charging pile production
CN119762486A
Chip surface defect visual detection method and system
CN120746995A