Visual detection method for motor shaft
By combining CPS data models and digital twin models with deep reinforcement learning, the dynamic blurring and distortion problems of motor shafts at high speeds were solved, achieving clear imaging and high-precision defect detection in vibration environments, and improving the detection rate and classification accuracy of minute defects.
Patent Information
- Application Number
- CN202511856520.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-12-10
AI Technical Summary
Traditional visual inspection systems struggle to capture dynamic blur and microscopic defects in motor shafts at high speeds, resulting in high rates of missed detection due to image distortion and minute defects.
By combining the CPS data model with the digital twin model, and through deep reinforcement learning and multi-station collaborative imaging technology, imaging parameters and image preprocessing are adjusted in real time to perform multi-scale feature fusion and hierarchical classification, thereby achieving defect detection.
It ensures clear imaging under high speed and vibration environments, improves the detection capability of minute defects and the accuracy of defect classification, and is adaptable to defect detection of different scales.
Smart Images

Figure CN121458705A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of visual detection, and in particular to a visual detection method for a motor shaft. BACKGROUND
[0002] The motor shaft is the core component of various motors, and the quality of the shaft (such as shaft diameter tolerance, overall shaft bending degree, surface defects, etc.) directly affects the quality of the entire motor. Traditional manual visual inspection is limited by dynamic interference in high-speed working conditions (such as centrifugal force deformation and surface oil film reflection), and the rule-based optical detection system is difficult to capture the transient defect evolution process. The bearing visual detection system is reconfiguring the quality control system in high-speed scenarios through the collaborative innovation of high-speed imaging technology, multi-dimensional feature fusion algorithm and life prediction model.
[0003] In the traditional high-speed bearing detection system, there is a coupling effect between dynamic blur and microscopic defects, that is, when the bearing speed exceeds , the exposure time of the traditional camera needs to be shortened to the microsecond level to avoid image smearing, but the signal-to-noise ratio decreases sharply, resulting in a high rate of missing small defects (such as micro-cracks and peeling). At the same time, there is a problem of image distortion, that is, the part size is qualified, but the visual detection system determines that it is out of tolerance. Such problems are often difficult to detect, but can cause serious consequences, such as size measurement deviation, defect missing, and even cause the entire detection system to malfunction. SUMMARY
[0004] The purpose of the present application is to provide a visual detection method for a motor shaft to solve the problems raised in the background art.
[0005] The specific technical solution provided by the present application is as follows: a visual detection method for a motor shaft, comprising the following operation steps: Step S1: Real-time acquisition of relevant parameters of the motor shaft, construction of a CPS data model of the motor shaft, real-time association of the physical detection unit with the digital twin model, and digital mapping of the manufacturing process state and data transformation time sequence.
[0006] Preferably, the construction of the digital twin model comprises: a: Geometric modeling of the motor shaft; b: Adding material properties and physical characteristics to the geometric model; c: Simulating the deformation, vibration and thermal distribution behavior of the motor shaft during operation through finite element analysis and multi-body dynamics simulation; d: Integrating detection rules, process parameters and quality standards into the digital twin; e: Developing a data interface with the physical detection unit including sensors and cameras for real-time data inflow and instruction issuance.
[0007] Step S2: Based on the real-time state vector output by the fusion of multi-source data and digital twin model, adaptive imaging parameter regulation based on deep reinforcement learning and multi-station collaborative imaging planning are performed.
[0008] Preferably, the implementation process includes: Step S21: Establish a camera imaging model and an illumination model; Step S22: Use a deep reinforcement learning model to output the optimal camera parameters and illumination parameters with the output real-time state vector as input; Step S23: According to the key detection parts of the motor shaft, plan the shooting timing and viewing angle of multiple cameras, set the collaborative triggering strategy, and use a graph optimization model to allocate shooting tasks, aiming to minimize the total shooting time and maximize the coverage; Preferably, the implementation process further includes: Step S231: Identify the key detection parts and establish a key part priority matrix , which divides the priority into , 1 for high priority, corresponding to bearing position and knurling area (defect zero tolerance), for medium priority, corresponding to shaft shoulder and keyway, for low priority, corresponding to optical axis area and chamfer; Step S232: Construct a viewing angle requirement matrix to generate a task for each camera, each part, and each required viewing angle; Step S233: Construct a directed graph , define each generated task as a node, define two types of edges including timing edges and conflict edges, for two tasks of the same camera, they cannot be executed simultaneously, so a conflict edge is added, and for two tasks of the same part, when they require different viewing angles but do not require to be shot by the same camera, they may not conflict, but when they are within the same time window and shot by different cameras, they can be performed simultaneously, therefore, according to the process requirements, some tasks must be executed in sequence (e.g., first shoot the bearing position and then shoot the knurling), so a timing edge is added.
[0009] Step S234: Establish an optimization objective including minimizing the total shooting time and maximizing the coverage; Step S235: Use position-based triggering, install an encoder on the motor shaft, trigger the camera when the encoder reading reaches the preset value, and the central controller sends 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 a dedicated controller.
[0011] Step S3: image preprocessing based on real-time state vector and imaging parameters, using a distortion correction algorithm based on a physical model to compensate for dynamic deformation.
[0012] Preferably, the specific implementation process includes: Step S31: estimate using a dynamic point spread function, establish a motion blur PSF model according to the rotational speed, vibration and exposure time in the real-time state vector, construct a composite PSF for camera shake caused by deformation and vibration caused by centrifugal force, and estimate the residual blur kernel from the blurred image using a convolutional neural network, which is complementary to the physical model PSF; Step S32: combine the physical model PSF and the PSF estimated by the CNN, use a non-blind deconvolution algorithm to restore the image, introduce a variational model containing a data fidelity term and a regularization term, and solve the clear image by iterative optimization; Step S33: use the CAD model of the motor shaft and the camera calibration parameters to 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 use a thin plate spline or polynomial model for distortion correction, and the model parameters are updated by real-time data; Step S34: use an image enhancement method based on a generative adversarial network, train a conditional GAN, input the corrected image, and output an enhanced image; Step S35: calculate the image quality index after preprocessing, compare it with the image before preprocessing, and output the image after preprocessing.
[0013] Step S4: combine multi-station images and use a multi-scale feature fusion algorithm to detect micro-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, and 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 a detection head to detect defects, use a 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 class confidence of the defect, and use non-maximum suppression to remove overlapping detection boxes, set a confidence threshold, and filter out low-confidence detection results.
[0015] Step S5: construct a hierarchical attention classification network to perform hierarchical classification of defects, and simultaneously establish a graph neural network for multi-modal fusion to diagnose and output the causes of defects.
[0016] Preferably, the specific implementation process comprises: Step S51: hierarchical classification of defects is performed using a hierarchical attention classification network, including a first level of defect category classification and a second level of fine-grained classification; Step S52: multi-modal features are extracted from the detected defect area, including depth features, geometric features and context features; Step S53: multi-source data including sensor data and process parameters are used for defect cause analysis, a cause diagnosis model is constructed, defect features, real-time state vectors and process parameters are input, and a probability distribution of defect causes is output; Step S54: the defect classification and cause diagnosis results are fed back to the digital twin model, the model parameters are updated based on the diagnosis results, and the process parameters are optimized.
[0017] Compared with the prior art, the present application has the following beneficial effects: (1) The present application solves the problems of dynamic blur and distortion through CPS data model and adaptive imaging; (2) The present application adopts multi-station cooperation and illumination adjustment to adapt to high speed and vibration environment, ensures clear imaging, solves the technical problems of large axial size of motor shaft, multiple nodes, high axial size precision, mirror reflection, large dynamic shooting interference, etc., ensures clear imaging in vibration condition, improves the adaptability and precision of motor shaft fast detection imaging, and ensures the industrialized production application of visual technology.
[0018] (3) The present application improves the detection ability of micro-defects by using multi-dimensional feature fusion and adaptive receptive field, and the hierarchical classification network realizes fine area classification of defects, which can adapt to defects of different scales, and at the same time ensures the detection rate and accuracy rate of key part defects such as severe defects, micro-defects and knurling. BRIEF DESCRIPTION OF DRAWINGS
[0019] Fig. 1 is a step flow chart of the visual detection method for motor shaft provided by the embodiment of the present application; Fig. 2 is a logic architecture diagram of the motor shaft visual detection provided by the embodiment of the present application. DETAILED DESCRIPTION
[0020] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art belong to the scope of protection of the present application.
[0021] Embodiment 1: In combination Figs. 1-2 As shown, the embodiment describes a visual detection method for motor shaft, including the following operation steps: Step S1: Real-time acquisition of relevant parameters of motor shaft, construction of CPS data model of motor shaft, real-time association of physical detection unit and digital twin model, digital mapping of manufacturing process state and data transformation time sequence, providing unified data basis for subsequent detection, avoiding data island problem in traditional system.
[0022] In this embodiment, based on the real-time acquisition of relevant parameters of motor shaft by various sensors deployed on the motor shaft production line, the various sensors used in the application include: encoder for measuring speed and position; acceleration sensor for measuring vibration; temperature sensor for measuring shaft surface temperature; force sensor for measuring processing force; high-definition industrial camera for collecting image data. The collected relevant parameters include: motor shaft production process data, state data and environment data.
[0023] For example, use PLC or data acquisition card (such as NI DAQ) to collect sensor data, and transmit to CPS platform through OPC UA or MQTT protocol. Set the acquisition frequency according to the detection requirements, for example, the vibration data acquisition frequency is 10 kHz, and the image acquisition frequency is 1000 fps (according to the camera performance). Preprocess the collected raw data to ensure data quality, use box plot or Law to identify outliers, and replace them with interpolated data before and after, using linear interpolation or spline interpolation to fill in missing points. At the same time, due to the different acquisition frequencies and timestamps of different sensors, time alignment is required. Use interpolation method to unify the data to the same timestamp. For high-dimensional data (such as images), use principal component analysis (PCA) or automatic encoder (Autoencoder) for dimension reduction, retaining the main features. Finally, scale the data to interval, eliminating the influence of dimension.
[0024] For example, the construction of CPS data model of motor shaft includes: establishing a parameterized CAD model of motor shaft, which contains accurate geometric dimensions and tolerance information. Establish a material microstructure model to simulate material behavior through crystal plastic finite element method. Establish a thermal-mechanical coupled physical field model to predict deformation behavior under different working conditions. The digital twin model is a dynamic mapping of the physical entity (motor shaft) in the virtual space throughout its life cycle, including geometric model, physical model, behavior model and rule model. The construction process of 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 high-precision geometric models through 3D scanning, save them in STEP or IGES format, and convert them into lightweight mesh models (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 characteristics (such as thermal expansion coefficient, electrical conductivity) to the geometric model, which are obtained through material certificates and experimental data.
[0026] c: Behavior model construction: Simulate the deformation, vibration, heat distribution, and other behaviors of the motor shaft during operation through finite element analysis (FEA) and multi-body dynamics simulation. For example, perform static and dynamic analysis through ANSYS to obtain stress-strain distribution and natural frequency under different rotational speeds and loads.
[0027] d: Rule model integration: Integrate detection rules, process parameters, and quality standards into the digital twin, such as tolerance ranges, defect definitions, etc.
[0028] e: Data interface development: Develop data interfaces with physical detection units (sensors, cameras) to achieve real-time data streaming and command issuance.
[0029] In this embodiment, a deep learning model is introduced in the invention for real-time anomaly detection and correction. Recurrent Neural Networks (RNN) or Long Short-Term Memory Networks (LSTM) are used for anomaly detection on time series data. Model training uses normal production data, and when the input data deviates from the prediction by more than a threshold value, it is marked as abnormal. Train the LSTM model using normal data to learn the time-dependent relationship of the data. Real-time data is input into the LSTM, and the residual error between the predicted value and the actual value is calculated. If the residual error is greater than the set threshold, it is determined to be abnormal. For abnormal data, use a Generative Adversarial Network (GAN) to generate normal data to replace it. Train a GAN model to generate data similar to the distribution of normal data, and when an anomaly is detected, replace the abnormal point with the data generated by the GAN. Finally, fuse the multi-source data (sensor data, image data) with the digital twin model to form a unified real-time state vector output.
[0030] For example, extract features from images (such as defect features, size features), and extract statistical features from sensor data (such as mean, variance, peak value). Use Kalman filtering or particle filtering for data fusion to estimate the real-time state of the motor shaft (such as bending, surface roughness). According to the fused data, update the state of the digital twin model in real time, including: update the shape of the geometric model according to the detected deformation. Update the physical properties (such as material fatigue) according to the temperature and vibration data. Adjust the parameters of the behavior model to make the simulation closer to reality.
[0031] Step S2: Based on the real-time state vector output by the fusion of multi-source data and digital twin model, adaptive imaging parameter regulation and multi-station collaborative imaging planning based on deep reinforcement learning are performed.
[0032] In this embodiment, the application solves the problems of large motor shaft axial size, multiple nodes, mirror reflection, and large dynamic shooting interference by automatically adjusting camera parameters and station cooperation strategies according to real-time working conditions. Clear imaging is realized under vibration conditions through large depth of field dark field illumination and multi-station collaboration. The specific implementation process includes: Step S21: Establish a camera imaging model and an illumination model. The camera imaging model includes intrinsic parameters (focal length, principal point, distortion coefficient) and extrinsic parameters (camera position and attitude), and the illumination model is used to describe the relationship between light source position, angle, intensity and imaging quality.
[0033] Step S22: Use a deep reinforcement learning model to input the output real-time state vector and output the optimal camera parameters (exposure time, aperture, gain) and illumination parameters (light source intensity, angle).
[0034] For example, by defining the state space wherein, is the motor shaft speed in the real-time state vector, is the surface temperature, is the vibration acceleration, is the ambient light intensity, and the action space is defined as wherein, is the exposure time, is the aperture value, is the gain, is the illumination intensity, is the illumination angle, and the reward function is further designed as wherein, is the weight coefficient determined by the AHP or expert scoring, is the image quality, which is calculated by comprehensive indicators such as image sharpness (such as gradient square sum), contrast, noise level, etc., is the energy efficiency, is the motion blur index, is the overexposure index.
[0035] Further, the deep deterministic policy gradient (DDPG) algorithm is used for training in the application to realize control of continuous action space, which specifically includes: an actor-critic structure is used, the actor network outputs actions according to states, and the critic network evaluates the value of state-action. The target network and online network are used to improve training stability, and the experience replay mechanism is used to break data correlation.
[0036] Step S23: According to the key detection positions of the motor shaft (such as bearing position, knurling, shaft shoulder, etc.), the shooting time sequence and viewing angle of multiple cameras are planned, the cooperative triggering strategy is set, the interference caused by simultaneous shooting is avoided, and all key positions are ensured to be covered. The shooting task is allocated using a graph optimization model, aiming to minimize the total shooting time and maximize the coverage.
[0037] In this embodiment, by listing all the key positions of the motor shaft that need to be detected, and determining the angle (viewing angle) and required image resolution of each position that needs to be detected. Each position may need one or more cameras to shoot from different angles to ensure that all areas where defects may occur are covered. Therefore, according to the position and detection requirements of the key positions, multiple cameras are arranged on the production line, and each camera is responsible for the shooting of one or more positions. 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 avoid simultaneous shooting to cause data transmission bandwidth conflict, the invention designs a triggering time sequence to trigger the cameras in sequence while ensuring that the shooting can be completed when the motor shaft passes through each station. Considering the speed of the motor, the window time for each camera to shoot is calculated.
[0038] Exemplary, each shooting task (one camera shooting one position) is regarded as a node in the graph. The edges between the nodes represent the time sequence relationship (such as the order) and the conflict relationship (such as the same camera cannot shoot two positions at the same time, or two cameras use the same light source, etc.) between two tasks. The weight of the edge can represent the switching time (such as the time for the camera to adjust the focal length, the time for the light source to change) or the conflict cost. At the same time, the optimization objective including minimizing the total shooting time and maximizing the coverage is defined, wherein the minimizing the total shooting time is from the first camera starts shooting to the last camera completes shooting; the maximizing the coverage is to ensure that all key positions are covered and meet the detection requirements (such as resolution, angle). Finally, a time-based trigger or a location-based trigger is used to trigger the corresponding camera when the motor shaft reaches a predetermined position, a central controller (such as PLC) is used to coordinate the triggering signals of each camera to avoid simultaneous triggering, and a graph optimization model is solved to avoid conflicts (such as adjacent nodes cannot be executed at the same time) using graph coloring algorithm, and a variant of the traveling salesman problem (TSP) is used to plan the shooting order to minimize the total time.
[0039] Exemplary, by defining the station as a node, a directed graph model is constructed , the edge represents the cooperative relationship between the stations, and the integer linear programming (ILP) is used to solve the optimal shooting plan, and the objective function is defined as: , wherein, is the total time step, is the number of stations, To shoot the workstations , is a binary decision variable, indicating whether to shoot the workstation at time , while defining the constraints: , , , , To shoot the workstations at time , that is, each key position is at least shot 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 camera triggering through PLC or a dedicated controller.
[0041] Step S3: Perform image preprocessing based on the 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, for image blur and distortion caused by high-speed rotation, real-time state vectors (such as rotation speed, vibration) and imaging parameters are used to perform real-time preprocessing operations for image restoration and distortion correction, improve image quality, and lay the foundation for defect detection. The specific implementation process includes: Step S31: Estimate using a dynamic point spread function (PSF), establish a motion blur PSF model according to the rotation speed, vibration, and exposure time in the real-time state vector, construct a composite PSF for camera jitter caused by deformation and vibration caused by centrifugal force, and use a convolutional neural network (CNN) 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 in the image within the exposure time. When the camera is directly opposite the rotation axis, the blur path is a circular arc. For a point in the image, the blur path can be represented as: Let the rotation center be , then the blur path is a circular arc from angle to , the rotation angular velocity is , and the exposure time is . However, since the actual image is two-dimensional, a linear motion is usually used to approximate local motion. For high-speed rotation, the motion is decomposed into tangential and radial directions, or the motion blur PSF is modeled as a line spread function along the motion direction. For rotational motion, the linear velocity at a distance of from the rotation center is , so the exposure time The distance of the point movement is (in pixels), since the motion direction is tangential, for each point in the image, its motion direction is perpendicular to the line connecting the point and the rotation center. However, since the motion of the whole image is not consistent, the image is usually divided into multiple regions, and the motion in each region is approximately uniform linear motion. Therefore, in the present application, the image is divided into blocks, and a PSF is estimated for each block.
[0044] For example, for camera shake caused by vibration, the vibration acceleration can be obtained by integration to get displacement, when the vibration is a simple harmonic vibration, the displacement function is , where is the vibration frequency. In the exposure time, the camera shake trajectory can be represented as a series of displacement vectors, so the corresponding PSF is generated according to the shake trajectory. Further, the rotation motion blur PSF and the vibration blur PSF are convolved to obtain the composite PSF. In the present application, the two PSFs are generated differently, the rotation motion blur is the motion of the object in the scene itself, while the vibration blur is caused by the camera motion, in the imaging model, both can be represented as a convolution kernel, in practice, there may be a vibration frequency that cannot be accurately known, so the main frequency component of the vibration is obtained from the CPS data, when the vibration data is random vibration, the main frequency is obtained by power spectral density analysis. The image to be deblurred is input into the trained CNN to obtain the estimated PSF kernel, which includes blur factors that are not captured by the physical model.
[0045] Step S32: Combine the physical model PSF and the CNN-estimated PSF, and use a non-blind deconvolution algorithm to restore the image, introduce a variational model containing a data fidelity term and a regularization term, and solve the clear image by iterative optimization.
[0046] For example, the physical model PSF and the CNN-estimated PSF are fused by weighted averaging to obtain the final PSF estimate : , where is an adjustable parameter, which can also be determined adaptively according to the confidence of the two PSFs, is the physical model PSF, is the CNN-estimated PSF.
[0047] Step S33: Establish the mapping relationship between the ideal image and the actual image using the CAD model of the motor shaft and the camera calibration parameters, obtain the real-time deformation data of the motor shaft from the digital twin model, correct the geometric distortion, and use thin plate spline (TPS) or polynomial model for distortion correction, and the model parameters are updated in real time.
[0048] Step S34: using a GAN-based image enhancement method to improve image contrast and details, i.e. training a conditional GAN to input the corrected image and output an enhanced image to make the defects more obvious.
[0049] Step S35: calculate the image quality indicators (such as PSNR, SSIM) after preprocessing, and compare them with those before preprocessing, and output the preprocessed image.
[0050] Step S4: combine multi-station images and use a multi-scale feature fusion algorithm to detect micro defects of motor shafts including micro cracks and peeling, solving the problem of missed detection caused by low signal-to-noise ratio.
[0051] In this embodiment, since the defects of the motor shafts may occur at different scales, it is necessary to fuse multi-scale features to improve the detection capability. In this application, multi-scale features (such as texture, edge) are extracted from the preprocessed images, the features are fused and input into the defect detection model, and the specific implementation process includes: Step S41: using a multi-scale image pyramid, down-sampling the same image at different scales to obtain images at multiple scales, at each scale, using a convolutional neural network (such as ResNet, VGG) to extract features, in this application, a pre-trained model can be selected as a feature extractor, specifically, for an image , an image pyramid is constructed: , where is the original image, is down-sampling by half, is down-sampling by half again, for each scale of image, the feature map is extracted by CNN, denoted as .
[0052] Step S42: up-sample the feature maps at different scales to the original image size, then fuse them, the up-sampling uses bilinear interpolation or transposed convolution, the fusion method uses splicing or weighted summation, for example: up-sample and to the same size as , then splice them together to get the fused feature .
[0053] Step S43: Based on the fusion features, defect detection is performed using a detection head. In the present application, the detection head is selected from Faster R-CNN, YOLO, or SSD, etc. A region proposal network (RPN) is used to generate candidate regions (for Faster R-CNN) or directly regress the bounding box (for YOLO). For each candidate region, features are extracted from the fusion feature map, classification and bounding box regression are performed, and the bounding box and class confidence of the defect 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 low-confidence detection results.
[0054] Step S5: A hierarchical attention classification network is constructed to perform hierarchical defect classification, and a multi-modal fusion graph neural network is established to diagnose and output the defect causes.
[0055] In the present embodiment, the detected defects are finely classified and the defect causes are diagnosed to provide a basis for process improvement. The specific implementation process includes: Step S51: A hierarchical attention classification network is used to classify defects hierarchically. The first level is a defect classification including crack, peeling, scratch, porosity, and inclusion. The second level is a fine-grained classification, for example, the crack class is further divided into micro-crack, macro-crack, and fatigue crack, and the peeling class is divided into point peeling, sheet peeling, and net peeling, etc. to simulate the hierarchical decision-making process of expert diagnosis.
[0056] Step S52: Multi-modal features are extracted from the detected defect regions, including: using CNN to extract deep features of the defect region. Geometric features such as size, shape, and position of the defect, and context features corresponding to process information (such as the machining process of the part) of the defect part are extracted.
[0057] Step S53: Defect cause analysis is performed in combination with multi-source data (sensor data, process parameters) to construct a cause diagnosis model. The input includes defect features, real-time state vectors, process parameters, etc., and the output is the probability distribution of defect causes (such as overload, material problem, and improper machining parameters, etc.).
[0058] For example, the defect diagnosis problem is modeled as a graph structure. The nodes in the graph represent defect instances, process steps, device states, etc. The edges represent the relationship between the nodes (such as the defect occurring at a certain process step, and the process step using a certain device). The features of the defect node include image features and geometric features. The features of the process step node include process parameters. The features of the device state node include sensor data. Message passing is performed through a graph neural network, and finally the cause classification is output on the defect node.
[0059] Step S54: feedback the defect classification and cause diagnosis result to the digital twin model, update the model parameters based on the diagnosis result, and drive the process parameter optimization.
[0060] It should be noted that the relational terms herein such as first and second and the like are used solely to distinguish one entity or action from another, without necessarily requiring or implying any such actual relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus.
[0061] Finally, it should be noted that the above only describes the preferred embodiments of the present application and is not intended to limit the present application. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art will still be able to modify the technical solutions described in the foregoing embodiments or make equivalent replacements to some of the technical features, and any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
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 classification of defects, and simultaneously establish a multimodal fusion graph neural network to diagnose the causes of defects.
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 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.
5. The visual inspection method for motor shafts according to claim 4, characterized in that: 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.
6. The visual inspection method for motor shafts according to claim 5, characterized in that: 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 the two tasks, and the weight of the edge represents the switching time or conflict cost.
7. The visual inspection method for motor shafts according to claim 6, characterized in that: 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.
8. The visual inspection method for motor shafts according to claim 7, 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: Employ an image enhancement method based on generative adversarial networks, train a conditional GAN, take the corrected image as input, and output the enhanced image; Step S35: Calculate the image quality index after preprocessing and compare it with that before preprocessing, then output the preprocessed image.
9. A visual inspection method for motor shafts according to claim 8, 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.
10. A visual inspection method for motor shafts according to claim 9, 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
Product visual image accurate identification and processing integrated platform
CN118982543A
Automatic visual inspection system applied to charging pile production
CN119762486A
Deep learning-based tiny target defect identification model training method
CN120451160A
Construction quality detection method and system based on image monitoring
CN120672683A
Chip surface defect visual detection method and system
CN120746995A