A center alignment positioning method and system based on YOLOv8-RBT
Through the center alignment positioning method based on YOLOv8-RBT, the problem of insufficient alignment accuracy for complex items in the prior art is solved, and high-precision center alignment of shaft-type parts is realized, and the control process is simplified.
Patent Information
- Application Number
- CN202411614063.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-11-13
AI Technical Summary
The existing central alignment device has problems of uncontrollable force and insufficient alignment accuracy when aligning complex objects, making it difficult to adapt to objects of different sizes and shapes.
The center alignment positioning method based on YOLOv8-RBT is adopted to obtain image data of shaft-type parts, perform image preprocessing and object detection, and use the improved YOLOv8-RBT model to detect the center position of shaft-type parts, and control the center alignment device. Perform tightening movements to achieve alignment.
The accuracy of position, size and angle of shaft parts is improved, and the center alignment of the shaft diameter of shaft parts within the preset range is realized, the control process is simplified, and the clamping device of multiple sizes is avoided.
Smart Images

Figure CN119131331B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of workpiece alignment and positioning, and in particular to a center alignment and positioning method and system based on YOLOv8-RBT. Background Art
[0002] The center alignment device is a device for precise positioning and alignment, which is usually used in industrial manufacturing and assembly processes. The center alignment device can mainly play the role of clamping, guiding, and impact protection during work. The related technology uses the elastic deformation of elastic sheets or the parallel clamping mechanism composed of flexible materials and has been widely used in the center alignment device using passive compliance. The device can achieve the repositioning and orientation of the object while ensuring stable grasping without contact sensors. Although the parallel clamping centering device has good stability, it can only meet the centering of simple objects and is not suitable for the centering of complex objects. Since the force of this type of center alignment device is uncontrollable, it is not suitable for parts that are easily deformed. In addition, although the underactuated manipulator has better adaptability in the center alignment device, it can adapt to almost any size and shape of objects, and can clamp and manipulate objects more stably, its grasping force and alignment accuracy cannot meet the actual engineering needs. Summary of the invention
[0003] In order to solve the above technical problems, the purpose of the present invention is to provide a center alignment positioning method and system based on YOLOv8-RBT, which can improve the accuracy of position, size and angle of shaft parts detection and realize the center alignment of the shaft diameter of shaft parts within a preset range.
[0004] The first technical solution adopted by the present invention is: a center alignment positioning method based on YOLOv8-RBT, comprising the following steps:
[0005] Acquire image data of the shaft part to be positioned and perform image preprocessing to obtain a preprocessed image of the shaft part to be positioned;
[0006] Introducing the deformable convolution module, the bidirectional feature pyramid network structure and the fusion receptive field attention mechanism module to build an improved YOLOv8-RBT model;
[0007] Based on the improved YOLOv8-RBT model, target detection is performed on the preprocessed image of the shaft parts to be located to obtain the center position of the shaft parts;
[0008] The center position of the shaft part is made to coincide with the center coordinate of the center alignment device, and the center alignment device is controlled to perform a tightening movement on the shaft part to obtain the center alignment positioning result of the shaft part.
[0009] Further, the step of acquiring image data of the shaft part to be positioned and performing image preprocessing to obtain the preprocessed image of the shaft part to be positioned specifically includes:
[0010] Acquire image data of the shaft parts to be positioned according to a preset acquisition method, wherein the preset acquisition method includes a hand-eye coupling method and an off-body vision method, wherein the hand-eye coupling method indicates that the camera and the shaft parts to be positioned are in the same horizontal plane, and the off-body vision method indicates that the camera and the shaft parts to be positioned are in the same vertical plane;
[0011] Performing image denoising on the image data of the shaft part to be positioned, and obtaining a denoised image of the shaft part to be positioned;
[0012] The denoised image of the shaft parts to be positioned is subjected to image enhancement processing to obtain a preprocessed image of the shaft parts to be positioned.
[0013] Further, the improved YOLOv8-RBT model includes a backbone network module, a neck module and a prediction module, the output end of the backbone network module is connected to the input end of the neck module, and the output end of the neck module is connected to the input end of the prediction module, wherein:
[0014] The backbone network module includes a convolution module, a fused receptive field attention mechanism module and a spatial pyramid pooling module. The fused receptive field attention mechanism module includes a global average pooling layer, a first linear activation function layer, a second linear activation function layer, a grouped convolution layer, a normalized linear rectification layer, a shape matching layer, an average maximum pooling layer, a first convolution activation function layer, a second convolution activation function layer and a convolution layer, wherein the global average pooling layer, the first linear activation function layer and the second linear activation function layer are connected in sequence, the grouped convolution layer, the normalized linear rectification layer and the shape matching layer are connected in sequence, the output end of the second linear activation function layer is connected to the first input end of the second convolution activation function layer, the output end of the shape matching layer is respectively connected to the input end of the average maximum pooling layer and the second input end of the second convolution activation function layer, the output end of the average maximum pooling layer is connected to the input end of the first convolution activation function layer, the output end of the first convolution activation function layer is connected to the third input end of the second convolution activation function layer, and the output end of the second convolution activation function layer is connected to the input end of the convolution layer;
[0015] The neck module adopts a bidirectional feature pyramid network structure;
[0016] The prediction module includes a first group of normalization layers, a second group of normalization layers, a mask bias generation module, a first task alignment module, a second task alignment module, a deformable convolution module, a convolution activation module and an output module, wherein the output module includes several convolution layers, wherein the output end of the first group of normalization layers is connected to the input end of the second group of normalization layers, the output end of the second group of normalization layers is respectively connected to the input end of the mask bias generation module, the input end of the first task alignment module, the input end of the second task alignment module, and the input end of the convolution activation module, the output end of the mask bias generation module and the input end of the deformable convolution module are connected to the input end of the first task alignment module, and the output end of the deformable convolution module, the output end of the second task alignment module, and the output end of the convolution activation module are connected to the input end of the output module.
[0017] Further, the bidirectional feature pyramid network structure includes a first convolution layer, a second convolution layer, a third convolution layer, a fourth convolution layer, a fifth convolution layer, a sixth convolution layer, a first fusion layer, a second fusion layer, a third fusion layer, a fourth fusion layer, a fifth fusion layer, a first upsampling layer, a second upsampling layer, a first C2F module, a second C2F module, a third C2F module, a fourth C2F module, and a fifth C2F module, wherein the output end of the first convolution layer and the output end of the fourth convolution layer are connected to the input end of the third fusion layer, and the first convolution layer, the second fusion layer, the second C2F module, the third fusion layer, the third C2F module and the fifth convolution layer are connected. The first output end of the second convolutional layer, the first output end of the first C2F module, and the output end of the fifth convolutional layer are connected to the input end of the fourth fusion layer. The second convolutional layer, the first fusion layer, and the first C2F module are connected to the second upsampling layer in sequence. The first output end of the third convolutional layer is connected to the input end of the first upsampling layer, and the output end of the first upsampling layer is connected to the input end of the first fusion layer. The fourth fusion layer, the fourth C2F module, and the sixth convolutional layer are connected in sequence. The second output end of the third convolutional layer and the output end of the sixth convolutional layer are connected to the input end of the fifth fusion layer, and the output end of the fifth fusion layer is connected to the input end of the fifth C2F module.
[0018] Further, the step of performing target detection on the preprocessed image of the shaft parts to be located based on the improved YOLOv8-RBT model to obtain the center position of the shaft parts specifically includes:
[0019] Input the preprocessed image of the shaft parts to be positioned into the improved YOLOv8-RBT model;
[0020] Based on the backbone network module of the improved YOLOv8-RBT model, feature extraction is performed on the preprocessed image of the shaft parts to be located to obtain the feature image of the shaft parts to be located;
[0021] Based on the neck module of the improved YOLOv8-RBT model, feature fusion processing is performed on the feature images of the shaft parts to be located to obtain the feature fusion images of the shaft parts to be located;
[0022] Based on the prediction module of the improved YOLOv8-RBT model, defect feature detection is performed on the feature fusion image of the shaft parts to be positioned, and the center position of the shaft parts is output.
[0023] Furthermore, the prediction module based on the improved YOLOv8-RBT model performs defect feature detection processing on the feature fusion image of the shaft parts to be positioned, and outputs the center position of the shaft parts, which specifically includes:
[0024] Input the feature fusion image of the shaft parts to be positioned into the prediction module of the improved YOLOv8-RBT model;
[0025] Based on the first group of normalization layers and the second group of normalization layers of the prediction module, the feature fusion images of the shaft parts to be located are normalized and added to obtain a normalized feature map of the shaft parts;
[0026] The mask offset generation module based on the prediction module calculates the mask offset of the normalized feature map of the shaft part to obtain the mask offset value;
[0027] Based on the first task alignment module and the second task alignment module of the prediction module, the normalized shaft part feature graphs are aligned to obtain a first aligned shaft part feature graph and a second aligned shaft part feature graph;
[0028] Based on the deformable convolution module of the prediction module, a regression calculation is performed on the mask offset value and the first aligned shaft part feature map to obtain a regressed shaft part feature map;
[0029] Based on the convolution activation module of the prediction module, the normalized shaft part feature map is mapped and multiplied with the second aligned shaft part feature map to obtain a weighted convolution weight;
[0030] Based on the output module of the prediction module, the regressed shaft part feature map and the weighted convolution weight are combined and output to obtain the center position of the shaft part.
[0031] Furthermore, the step of aligning the center position of the shaft part with the center coordinate of the center alignment device, controlling the center alignment device to tighten the shaft part, and obtaining the center alignment positioning result of the shaft part specifically includes:
[0032] Constructing a center alignment device, obtaining the center coordinates of the center alignment device and constructing a kinematic model of the center alignment device;
[0033] Obtaining the device displacement equation according to the kinematic model of the center alignment device;
[0034] Differentiate the displacement equation of the device to obtain the velocity equation of the clamping point of the device;
[0035] Differentiating the velocity equation of the device clamping point to obtain the acceleration equation of the device clamping point;
[0036] The center position of the shaft parts is overlapped with the center coordinates of the center alignment device. Combined with the acceleration equation of the device clamping point, the center alignment device is controlled to tighten the shaft parts to obtain the center alignment positioning result of the shaft parts.
[0037] Furthermore, the center alignment device is obtained by mirror-assembling a plurality of local connecting rod slider structures, each of which includes a plurality of connecting rods connected by flexible hinges.
[0038] The second technical solution adopted by the present invention is: a center alignment positioning system based on YOLOv8-RBT, comprising:
[0039] The first module is used to obtain image data of the shaft part to be positioned and perform image preprocessing to obtain a preprocessed image of the shaft part to be positioned;
[0040] The second module is used to introduce the deformable convolution module, the bidirectional feature pyramid network structure and the fusion receptive field attention mechanism module to build an improved YOLOv8-RBT model;
[0041] The third module is used to perform target detection on the preprocessed image of the shaft parts to be located based on the improved YOLOv8-RBT model to obtain the center position of the shaft parts;
[0042] The fourth module is used to make the center position of the shaft part coincide with the center coordinates of the center alignment device, control the center alignment device to tighten the shaft part, and obtain the center alignment positioning result of the shaft part.
[0043] The method and system of the present invention have the following beneficial effects: the present invention acquires image data of shaft parts to be positioned and introduces a deformable convolution module, a bidirectional feature pyramid network structure and a fusion receptive field attention mechanism module, thereby constructing an improved YOLOv8-RBT model; the deformable convolution module can appropriately deform the input feature map, so that the convolution kernel can well adapt to the shape and posture changes of different objects, thereby improving the detection accuracy of rotating targets; the bidirectional feature pyramid network structure can better fuse the low-level fine-grained position information and the high-level semantic features, improve the accuracy of detecting the position, size and angle of rotating targets; the fusion receptive field attention mechanism module can capture more detail information of the feature map; further based on the improved YOLOv8-RBT model, the preprocessed image of the shaft parts to be positioned is subjected to target detection to obtain the center position of the shaft parts; finally, the center position of the shaft parts is coincided with the center coordinate of the center alignment device; the center alignment device is controlled to tighten the shaft parts to obtain the center alignment positioning result of the shaft parts; no sensor is required, the control process is simplified, the center alignment of the shaft diameter within a certain range can be achieved, and the clamping devices of various sizes are avoided in the industrial process. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a flowchart of the steps of a center alignment positioning method based on YOLOv8-RBT of the present invention;
[0045] Figure 2 It is a structural block diagram of a center alignment positioning system based on YOLOv8-RBT of the present invention;
[0046] Figure 3 It is a schematic diagram of the structure of an improved YOLOv8-RBT model provided by a specific embodiment of the present invention;
[0047] Figure 4 It is a structural diagram of a fusion receptive field attention mechanism module provided in a specific embodiment of the present invention;
[0048] Figure 5 is a schematic diagram of a bidirectional feature pyramid network structure provided by a specific embodiment of the present invention;
[0049] Figure 6 is a schematic diagram of an improved detection head structure provided by a specific embodiment of the present invention;
[0050] Figure 7 is a schematic diagram comparing the detection effects of improved front and rear axle parts provided by a specific embodiment of the present invention;
[0051] Figure 8 is a schematic diagram of a camera installation method provided by a specific embodiment of the present invention;
[0052] Fig. 9 is a schematic diagram of a two-dimensional structure of a center alignment device provided in a specific embodiment of the present invention;
[0053] Fig.10 It is a schematic diagram of the improved partial connecting rod slider structure provided by a specific embodiment of the present invention;
[0054] Fig.11 It is a simplified schematic diagram of the movement of the improved local connecting rod slider mechanism provided by a specific embodiment of the present invention;
[0055] Fig.12 is a schematic diagram of displacement curves of clamping points A and C provided in a specific embodiment of the present invention;
[0056] Fig.13 is a schematic diagram of displacement errors of clamping points A and C provided in a specific embodiment of the present invention;
[0057] Fig.14 It is a schematic diagram of the speed curve of the clamping points A and C provided by a specific embodiment of the present invention;
[0058] Fig.15 is a schematic diagram of the speed error of the clamping points A and C provided by a specific embodiment of the present invention;
[0059] Fig.16 is a schematic diagram of acceleration curves of clamping points A and C provided in a specific embodiment of the present invention;
[0060] Fig.17 is a schematic diagram of acceleration errors of clamping points A and C provided in a specific embodiment of the present invention;
[0061] Fig.18 The specific embodiment of the present invention provides Take the motion trajectory diagram of clamping as an example;
[0062] Fig.19 is a front view schematic diagram of a three-dimensional structure of a center alignment device provided by a specific embodiment of the present invention;
[0063] Fig. 20 It is a schematic diagram of the three-dimensional structure of the center alignment device provided in a specific embodiment of the present invention. DETAILED DESCRIPTION
[0064] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only provided for the convenience of explanation and description, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0065] Reference Figure 1, the present invention provides a center alignment positioning method based on YOLOv8-RBT, the method comprising the following steps:
[0066] S100, acquiring image data of the shaft part to be positioned and performing image preprocessing to obtain a preprocessed image of the shaft part to be positioned;
[0067] Specifically, image data of the shaft parts to be positioned are acquired according to a preset acquisition method, wherein the preset acquisition method includes a hand-eye coupling method and an off-body vision method, wherein the hand-eye coupling method indicates that the camera and the shaft parts to be positioned are in the same horizontal plane, and the off-body vision method indicates that the camera and the shaft parts to be positioned are in the same vertical plane; image denoising is performed on the image data of the shaft parts to be positioned to obtain a denoised image of the shaft parts to be positioned; image enhancement is performed on the denoised image of the shaft parts to be positioned to obtain a preprocessed image of the shaft parts to be positioned.
[0068] In this embodiment, the camera is installed as follows Figure 8 . During the positioning process of shaft parts, due to the limitation of production space, the placement of the camera is divided into two types: one is the hand-eye coupling method, the camera is fixed on the end effector, and the lens is horizontal to the working platform; the other is the off-body vision method, the camera is fixed in the working space, and the lens is perpendicular to the working platform. The camera is connected to the host computer system and transmits real-time image data through the USB interface or industrial camera interface. The images collected by the camera are preprocessed, including image denoising, enhancement and other operations. The preprocessed image is transmitted to the target detection algorithm module.
[0069] S200, introduces the deformable convolution module, the bidirectional feature pyramid network structure and the fusion receptive field attention mechanism module to build an improved YOLOv8-RBT model;
[0070] Specifically, the improved YOLOv8-RBT model includes a backbone network module, a neck module and a prediction module, wherein the output end of the backbone network module is connected to the input end of the neck module, and the output end of the neck module is connected to the input end of the prediction module, wherein:
[0071] like Figure 4As shown, the backbone network module includes a convolution module, a fused receptive field attention mechanism module and a spatial pyramid pooling module, and the fused receptive field attention mechanism module includes a global average pooling layer, a first linear activation function layer, a second linear activation function layer, a grouped convolution layer, a normalized linear rectification layer, a shape matching layer, an average maximum pooling layer, a first convolution activation function layer, a second convolution activation function layer and a convolution layer, wherein the global average pooling layer, the first linear activation function layer and the second linear activation function layer are connected in sequence, the grouped convolution layer, the normalized linear rectification layer and the shape matching layer are connected in sequence, the output end of the second linear activation function layer is connected to the first input end of the second convolution activation function layer, the output end of the shape matching layer is respectively connected to the input end of the average maximum pooling layer and the second input end of the second convolution activation function layer, the output end of the average maximum pooling layer is connected to the input end of the first convolution activation function layer, the output end of the first convolution activation function layer is connected to the third input end of the second convolution activation function layer, and the output end of the second convolution activation function layer is connected to the input end of the convolution layer;
[0072] It should be noted that in the YOLOv8-obb architecture, the backbone network is responsible for extracting multi-level features from the input image to provide basic information for subsequent detection tasks. The embodiment of the present invention replaces the c2f module of the original yolov8 backbone network with the RFCBAM module (fused receptive field attention mechanism module), which can improve the representation ability of target features, improve the feature representation ability of the target, and capture more detailed information.
[0073] The neck module adopts a bidirectional feature pyramid network structure;
[0074] In order to improve the robustness of the model and enable it to have superior detection performance in various environments, the embodiment of the present invention uses BIFPN (bidirectional feature pyramid network structure) to replace the feature fusion method of Yolov8. The neck network of YOLOv8 adopts the PANet structure. Compared with PANet, BIFPN can better fuse the low-level fine-grained position information and high-level semantic features through bottom-up and top-down bidirectional feature fusion, which is very helpful for accurately detecting the position, size and angle of rotating targets.
[0075] like Figure 6As shown, the prediction module includes a first group of normalization layers, a second group of normalization layers, a mask bias generation module, a first task alignment module, a second task alignment module, a deformable convolution module, a convolution activation module and an output module, wherein the output module includes several convolution layers, wherein the output end of the first group of normalization layers is connected to the input end of the second group of normalization layers, the output end of the second group of normalization layers is respectively connected to the input end of the mask bias generation module, the input end of the first task alignment module, the input end of the second task alignment module, and the input end of the convolution activation module, the output end of the mask bias generation module and the input end of the deformable convolution module are connected to the input end of the first task alignment module, and the output end of the deformable convolution module, the output end of the second task alignment module, and the output end of the convolution activation module are connected to the input end of the output module.
[0076] Among them, in order to further improve the detection capability of rotating targets, the embodiment of the present invention introduces the DCNV2 deformable convolution in the detection head. Compared with the translation invariant convolution kernel used in ordinary convolution, DCNv2 can appropriately deform the input feature map by learning the offset of the convolution kernel, so that the convolution kernel can adapt well to the shape and posture changes of different objects, thereby improving the detection accuracy of rotating targets. However, directly replacing the convolution of the original detection head with DCNv2 will lead to a surge in the amount of calculation. Therefore, the embodiment of the present invention adopts the idea of task classification (Task-aligned) to separate the regression task of the bounding box from the classification task. Specifically, the original detection head regresses the object position, category and rotation angle through 9 convolution layers, and the amount of calculation is huge. The new detection head separates these tasks and processes them by different convolution layers, which greatly reduces the amount of calculation while still ensuring accuracy.
[0077] like Figure 5As shown, it is further necessary to explain that the bidirectional feature pyramid network structure includes a first convolutional layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a fifth convolutional layer, a sixth convolutional layer, a first fusion layer, a second fusion layer, a third fusion layer, a fourth fusion layer, a fifth fusion layer, a first upsampling layer, a second upsampling layer, a first C2F module, a second C2F module, a third C2F module, a fourth C2F module, and a fifth C2F module, wherein the output end of the first convolutional layer and the output end of the fourth convolutional layer are connected to the input end of the third fusion layer, and the first convolutional layer, the second fusion layer, the second C2F module, the third fusion layer, and the third C2F module are connected to The fifth convolutional layer is connected in sequence, the first output end of the second convolutional layer, the first output end of the first C2F module, and the output end of the fifth convolutional layer are connected to the input end of the fourth fusion layer, the second convolutional layer, the first fusion layer, the first C2F module and the second upsampling layer are connected in sequence, the first output end of the third convolutional layer is connected to the input end of the first upsampling layer, the output end of the first upsampling layer is connected to the input end of the first fusion layer, the fourth fusion layer, the fourth C2F module and the sixth convolutional layer are connected in sequence, the second output end of the third convolutional layer and the output end of the sixth convolutional layer are connected to the input end of the fifth fusion layer, and the output end of the fifth fusion layer is connected to the input end of the fifth C2F module.
[0078] S300, based on the improved YOLOv8-RBT model, target detection is performed on the preprocessed image of the shaft parts to be located to obtain the center position of the shaft parts;
[0079] First of all, it should be noted that the improved YOLOv8 model is used to analyze the preprocessed image, identify shaft parts and determine their position, size and posture information. The results of the algorithm processing are output to the host computer system in the form of feature point coordinates, such as Figure 7 As shown in the figure, the system accurately finds the center position and classification results of shaft parts through the YOLOv8-RBT algorithm. With the coordinates of the target center point and the coordinates of the line connecting the midpoints of the center alignment device clamping points, the system can accurately control the center alignment device to move directly above the target through motion planning.
[0080] exist Figure 7In the method, the camera is fixed outside the workspace and captures the shaft parts in the entire work area in a horizontal perspective. Through the YOLOv8-RBT target detection algorithm, the system can identify and locate the shaft parts in the workspace in real time and generate a bounding box containing the parts. Since the shaft parts are in the form of a rotating body structure, the line connecting the midpoints in the bounding box represents its axis. In this method, the midpoint coordinates of the clamping point connection line of the center alignment device are determined by the preset relative coordinates of the camera and the device. Based on the detected axis and midpoint coordinates, the system performs motion planning to ensure that the device moves directly above the target part. Compared with the positioning of shaft parts in a top-down perspective, there may be certain errors when moving the device directly above the target through this method. However, since the center alignment device has an automatic deviation correction function and can adapt to shaft parts of different sizes, the impact of these errors is effectively controlled and does not affect its precise positioning.
[0081] Specifically, the preprocessed image of the shaft parts to be positioned is input into the improved YOLOv8-RBT model; based on the backbone network module of the improved YOLOv8-RBT model, feature extraction is performed on the preprocessed image of the shaft parts to be positioned to obtain the feature image of the shaft parts to be positioned; based on the neck module of the improved YOLOv8-RBT model, feature fusion is performed on the feature image of the shaft parts to be positioned to obtain the feature fusion image of the shaft parts to be positioned; based on the prediction module of the improved YOLOv8-RBT model, defect feature detection is performed on the feature fusion image of the shaft parts to be positioned, and the center position of the shaft parts is output.
[0082] Among them, it should be noted that the process of performing defect feature detection on the feature fusion image of the shaft parts to be positioned is to input the feature fusion image of the shaft parts to be positioned into the prediction module of the improved YOLOv8-RBT model; based on the first group of normalization layers and the second group of normalization layers of the prediction module, the feature fusion image of the shaft parts to be positioned is normalized and added to obtain the normalized shaft parts feature map; based on the mask offset generation module of the prediction module, the mask offset is calculated on the normalized shaft parts feature map to obtain the mask offset value; based on the first task alignment module and the second task alignment module of the prediction module, the normalized The first aligned shaft part feature map and the second aligned shaft part feature map are aligned to obtain the first aligned shaft part feature map and the second aligned shaft part feature map; based on the deformable convolution module of the prediction module, the mask offset value and the first aligned shaft part feature map are regressed to obtain the regressed shaft part feature map; based on the convolution activation module of the prediction module, the normalized shaft part feature map is mapped and multiplied with the second aligned shaft part feature map to obtain the weighted convolution weight; based on the output module of the prediction module, the regressed shaft part feature map and the weighted convolution weight are combined and output to obtain the center position of the shaft part.
[0083] Furthermore, it should be specifically explained that the neck network uses multi-scale feature fusion BiFPN. First, the TOOD_DCNV2 module is constructed. The module accepts the feature maps of three scales transmitted by the neck network, and after two group normalization operations, the results of the two group normalizations are added to obtain a new feature map concat_feat. The new feature map is connected to the TaskDecomposition module (task alignment module), and the output is the feature map for classification and regression tasks. concat_feat is connected to the mask / offset_conv module (mask bias generation module). The output is the feature map of the mask and offset for the regression task, which is connected to the deformable convolution DCNv2 module to output the regression feature map. Concat_feat is connected to the cls_conv module (group normalization), and the output is multiplied by the feature map for the classification task to output the classification feature map.
[0084] Construct the task alignment module TaskDecomposition, which inputs the feature map after global average pooling. The feature map is connected to the convolution layer and the Relu module to obtain the weight, and then the weight is connected to the convolution layer and the Sigmoid module to obtain the new attention weight weight. Then multiply the attention weight weight and the reduction_conv module with the initialization parameter as the normal distribution to obtain the weighted convolution weight. Use the weighted convolution weight to perform convolution operation with the input feature map to obtain the weighted feature map feat. Finally, pass the weighted feature map to the reduction_conv module to obtain the final output feature map, and construct the reduction_conv module, which includes a normal convolution connection group normalization layer connected to the Relu activation function, and construct the mask and offset generation module mask / offset_conv, which contains a convolution layer.
[0085] 1.3.4 Construct the convolution module cls_conv for classification tasks. This module contains a convolution, a Relu, a convolution, and a Sigmoid module. These modules are connected in sequence.
[0086] S400, aligning the center position of the shaft part with the center coordinate of the center alignment device, controlling the center alignment device to tighten the shaft part, and obtaining the center alignment positioning result of the shaft part.
[0087] First, according to the positioning data of the shaft parts provided by the host computer system, the center alignment device is driven to make corresponding adjustments and moves to achieve precise centering. The control unit is closely connected to the mechanical structure, and the motion path is adjusted through real-time feedback to ensure the precise positioning of the parts. The host computer system, as the control core of the system, is responsible for processing the output results of the target detection algorithm, planning the motion path and issuing control signals. The system monitors the dynamic state of the entire positioning process, and displays the operating status and detection results through the human-computer interaction interface. The host computer system also has the function of storing and managing historical data to facilitate the maintenance and optimization of the equipment.
[0088] Specifically, a center alignment device is constructed, the center coordinates of the center alignment device are obtained and a kinematic model of the center alignment device is constructed; the device displacement equation is obtained according to the kinematic model of the center alignment device; the device displacement equation is differentiated to obtain the velocity equation of the device clamping point; the velocity equation of the device clamping point is differentiated to obtain the acceleration equation of the device clamping point; the center position of the shaft part is made to coincide with the center coordinates of the center alignment device, and combined with the acceleration equation of the device clamping point, the center alignment device is controlled to perform a tightening movement on the shaft part, so as to obtain the center alignment positioning result of the shaft part.
[0089] It should be noted that the center alignment device is obtained by mirror-assembling a number of local connecting rod slider structures, each of which includes a number of connecting rods connected by flexible hinges.
[0090] In this embodiment, a linear contact type adaptive center alignment device is provided, and the centering device is 3D printed using PLA. The main structure is composed of a plurality of improved local connecting rod slider mechanisms, so that these mechanisms can achieve flexible movement. This mechanism can achieve four-point clamping of the target under the condition of only one motive force, and complete the positioning of the shaft segment size within a certain area. The center alignment device includes four local connecting rod slider structures, which are installed in a mirror image. Each local connecting rod slider structure includes five connecting rods, which are connected together by flexible hinges. The center alignment device can achieve the clamping / alignment of shaft segments of various sizes within a certain range.
[0091] like Fig.18 As shown, when the upper and lower surfaces of the center alignment device are subjected to external forces, the local connecting rod slider structures at the upper and lower ends are deformed by the external forces, and the four clamping points at the upper, lower, left and right sides will move linearly within a certain range.
[0092] Specifically, Fig. 9 and Fig.11 As shown in the figure, by applying a downward force to the BC side, the local connecting rod slider structure will deform, and the clamping point will move downward, thereby clamping the shaft segment. This linear contact clamping method can ensure that the shaft segment is fully aligned with the center axis of the device, thereby achieving precise center alignment.
[0093] like Fig.10 As shown in the figure, the improved local connecting rod slider structure has 5 active components and 7 low pairs, and its degree of freedom is F = 3 × 5-2 × 7 = 1. When the number of prime movers is 1, the movement of the mechanism is determined.
[0094] by As the independent variable, transform it from 0° to 90°, calculate the displacement, velocity, and acceleration values corresponding to the clamping point, and draw the curve graph of Xa and Ya. And calculate the error graph of Xa and Ya. By analyzing the displacement error graph, it can be seen that the clamping point A can maintain an approximate linear relationship near ∠CBD=20°~40°, which can stably clamp the shaft segment with a diameter of 10~13mm.
[0095] The center alignment device is 3D printed using PLA, and the hinge in the middle of the connecting rod is designed using a flexible hinge to replace the ordinary hinge (such as Fig.11 Points A, B, D, E, F, G). The design adopts a one-way notched hinge solution, such as Fig.19 and Fig. 20As shown. The one-way notch flexible hinge is a spring with a notch, which can bend and deform when a force is applied perpendicular to the notch, and has a certain strength and rigidity when a force is applied in the notch direction.
[0096] Then the design of the local connecting rod slider is explained, such as Fig.11 As shown, to make the axis and Directional force needs to meet the following conditions:
[0097] ;
[0098] because and is part of a rhombus structure, from which we can obtain:
[0099] ;
[0100] The centering posture of the mechanism needs to be analyzed to construct auxiliary line segments , , and .
[0101] exist There is the following relationship:
[0102] ;
[0103] exist There is the following relationship:
[0104] ;
[0105] exist There is the following relationship:
[0106] ;
[0107] In the four-bar mechanism There is the following relationship:
[0108] ;
[0109] Also because
[0110] ;
[0111] Therefore, we can get:
[0112] ;
[0113] The contact point can be obtained from the geometric relationship The coordinates are as follows:
[0114] ;
[0115] The above conditions give the following design data table, as shown in Table 1.
[0116] Table 1 Local connecting rod slider structure relationship data table
[0117]
[0118] The kinematic model is established by mathematical modeling, the displacement equation of the model is obtained, and the motion curve of the clamping point is drawn through Excel, such as Fig.12 and Fig.13 shown.
[0119] Specifically, The relationship can be expressed by The relationship between and Can be used separately The relationship and The relational expression is as follows:
[0120] ;
[0121] Through the above The expression of The relationship is:
[0122] ;
[0123] Will Substitute contact points In the expression of the coordinates of , The relationship between is the independent variable, , is the dependent variable.
[0124] ;
[0125] By differentiating the displacement equation, we get the velocity equation of the clamping point, and use the numerical method to calculate the velocity of the clamping point and draw the velocity curve, such as Fig.14 and Fig.15 shown.
[0126] Specifically, the contact point By differentiating the coordinate expression of Point Direction and The speed in the direction is:
[0127] ;
[0128] according to Taking the derivative, we get:
[0129] ;
[0130] according to Taking the derivative, we get:
[0131] ;
[0132] by is an object, then there exists:
[0133] ;
[0134] by For the object:
[0135] ;
[0136] By differentiating the velocity equation, we get the acceleration equation of the clamping point, and use the numerical method to calculate the acceleration of the clamping point and draw the acceleration curve, such as Fig.16 and Fig.17 shown.
[0137] Specifically, the vertical coordinate velocity of point A is:
[0138] ;
[0139] according to Derivative:
[0140] ;
[0141] according to Derivative:
[0142] ;
[0143] by For the object:
[0144] ;
[0145] by For the object:
[0146] ;
[0147] The relationship between Xa and Ya acceleration is:
[0148] Continue to Taking the derivative of the expression for the object, we get:
[0149] ;
[0150] Reference Figure 2 , a center alignment positioning system based on YOLOv8-RBT, comprising:
[0151] The first module 201 is used to obtain image data of the shaft part to be positioned and perform image preprocessing to obtain a preprocessed image of the shaft part to be positioned;
[0152] The second module 202 is used to introduce a deformable convolution module, a bidirectional feature pyramid network structure and a fusion receptive field attention mechanism module to build an improved YOLOv8-RBT model;
[0153] The third module 203 is used to perform target detection on the preprocessed image of the shaft part to be located based on the improved YOLOv8-RBT model to obtain the center position of the shaft part;
[0154] The fourth module 204 is used to make the center position of the shaft part coincide with the center coordinates of the center alignment device, control the center alignment device to tighten the shaft part, and obtain the center alignment positioning result of the shaft part.
[0155] The contents of the above method embodiments are all applicable to the present system embodiments. The functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0156] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A center alignment positioning method based on YOLOv8-RBT, characterized in that: The following steps are involved: Acquire image data of the shaft part to be positioned and perform image preprocessing to obtain a preprocessed image of the shaft part to be positioned; Introducing the deformable convolution module, the bidirectional feature pyramid network structure and the fusion receptive field attention mechanism module to build an improved YOLOv8-RBT model; Input the preprocessed image of the shaft parts to be positioned into the improved YOLOv8-RBT model; Based on the backbone network module of the improved YOLOv8-RBT model, feature extraction is performed on the preprocessed image of the shaft parts to be located to obtain the feature image of the shaft parts to be located; Based on the neck module of the improved YOLOv8-RBT model, feature fusion processing is performed on the feature images of the shaft parts to be located to obtain the feature fusion images of the shaft parts to be located; Based on the prediction module of the improved YOLOv8-RBT model, the defect feature detection process is performed on the feature fusion image of the shaft parts to be positioned, and the center position of the shaft parts is output; Constructing a center alignment device, obtaining the center coordinates of the center alignment device and constructing a kinematic model of the center alignment device; Obtaining the device displacement equation according to the kinematic model of the center alignment device; Differentiate the displacement equation of the device to obtain the velocity equation of the clamping point of the device; Differentiating the velocity equation of the device clamping point to obtain the acceleration equation of the device clamping point; The center position of the shaft parts is overlapped with the center coordinates of the center alignment device. Combined with the acceleration equation of the device clamping point, the center alignment device is controlled to tighten the shaft parts to obtain the center alignment positioning result of the shaft parts.
2. According to claim 1, a center alignment positioning method based on YOLOv8-RBT is characterized in that: The step of acquiring image data of the shaft part to be positioned and performing image preprocessing to obtain the preprocessed image of the shaft part to be positioned specifically includes: Acquire image data of the shaft parts to be positioned according to a preset acquisition method, wherein the preset acquisition method includes a hand-eye coupling method and an off-body vision method, wherein the hand-eye coupling method indicates that the camera and the shaft parts to be positioned are in the same horizontal plane, and the off-body vision method indicates that the camera and the shaft parts to be positioned are in the same vertical plane; Performing image denoising on the image data of the shaft part to be positioned, and obtaining a denoised image of the shaft part to be positioned; The denoised image of the shaft parts to be positioned is subjected to image enhancement processing to obtain a preprocessed image of the shaft parts to be positioned.
3. According to claim 2, a center alignment positioning method based on YOLOv8-RBT is characterized in that: The improved YOLOv8-RBT model includes a backbone network module, a neck module and a prediction module, wherein the output end of the backbone network module is connected to the input end of the neck module, and the output end of the neck module is connected to the input end of the prediction module, wherein: The backbone network module includes a convolution module, a fused receptive field attention mechanism module and a spatial pyramid pooling module. The fused receptive field attention mechanism module includes a global average pooling layer, a first linear activation function layer, a second linear activation function layer, a grouped convolution layer, a normalized linear rectification layer, a shape matching layer, an average maximum pooling layer, a first convolution activation function layer, a second convolution activation function layer and a convolution layer, wherein the global average pooling layer, the first linear activation function layer and the second linear activation function layer are connected in sequence, the grouped convolution layer, the normalized linear rectification layer and the shape matching layer are connected in sequence, the output end of the second linear activation function layer is connected to the first input end of the second convolution activation function layer, the output end of the shape matching layer is respectively connected to the input end of the average maximum pooling layer and the second input end of the second convolution activation function layer, the output end of the average maximum pooling layer is connected to the input end of the first convolution activation function layer, the output end of the first convolution activation function layer is connected to the third input end of the second convolution activation function layer, and the output end of the second convolution activation function layer is connected to the input end of the convolution layer; The neck module adopts a bidirectional feature pyramid network structure; The prediction module includes a first group of normalization layers, a second group of normalization layers, a mask bias generation module, a first task alignment module, a second task alignment module, a deformable convolution module, a convolution activation module and an output module, wherein the output module includes several convolution layers, wherein the output end of the first group of normalization layers is connected to the input end of the second group of normalization layers, the output end of the second group of normalization layers is respectively connected to the input end of the mask bias generation module, the input end of the first task alignment module, the input end of the second task alignment module, and the input end of the convolution activation module, the output end of the mask bias generation module and the input end of the deformable convolution module are connected to the input end of the first task alignment module, and the output end of the deformable convolution module, the output end of the second task alignment module, and the output end of the convolution activation module are connected to the input end of the output module.
4. According to claim 3, a center alignment positioning method based on YOLOv8-RBT is characterized in that: The bidirectional feature pyramid network structure includes a first convolution layer, a second convolution layer, a third convolution layer, a fourth convolution layer, a fifth convolution layer, a sixth convolution layer, a first fusion layer, a second fusion layer, a third fusion layer, a fourth fusion layer, a fifth fusion layer, a first upsampling layer, a second upsampling layer, a first C2F module, a second C2F module, a third C2F module, a fourth C2F module, and a fifth C2F module, wherein the output end of the first convolution layer and the output end of the fourth convolution layer are connected to the input end of the third fusion layer, and the first convolution layer, the second fusion layer, the second C2F module, the third fusion layer, the third C2F module and the fifth convolution layer are connected in sequence. The first output end of the second convolutional layer, the first output end of the first C2F module, and the output end of the fifth convolutional layer are connected to the input end of the fourth fusion layer. The second convolutional layer, the first fusion layer, and the first C2F module are connected to the second upsampling layer in sequence. The first output end of the third convolutional layer is connected to the input end of the first upsampling layer, the output end of the first upsampling layer is connected to the input end of the first fusion layer, the fourth fusion layer, the fourth C2F module are connected to the sixth convolutional layer in sequence, the second output end of the third convolutional layer and the output end of the sixth convolutional layer are connected to the input end of the fifth fusion layer, and the output end of the fifth fusion layer is connected to the input end of the fifth C2F module.
5. According to claim 4, a center alignment positioning method based on YOLOv8-RBT is characterized in that: The prediction module based on the improved YOLOv8-RBT model performs defect feature detection processing on the feature fusion image of the shaft parts to be positioned, and outputs the center position of the shaft parts. The step specifically includes: Input the feature fusion image of the shaft parts to be positioned into the prediction module of the improved YOLOv8-RBT model; Based on the first group of normalization layers and the second group of normalization layers of the prediction module, the feature fusion images of the shaft parts to be located are normalized and added to obtain a normalized feature map of the shaft parts; The mask offset generation module based on the prediction module calculates the mask offset of the normalized feature map of the shaft part to obtain the mask offset value; Based on the first task alignment module and the second task alignment module of the prediction module, the normalized shaft part feature graphs are aligned to obtain a first aligned shaft part feature graph and a second aligned shaft part feature graph; Based on the deformable convolution module of the prediction module, a regression calculation is performed on the mask offset value and the first aligned shaft part feature map to obtain a regressed shaft part feature map; Based on the convolution activation module of the prediction module, the normalized shaft part feature map is mapped and multiplied with the second aligned shaft part feature map to obtain a weighted convolution weight; Based on the output module of the prediction module, the regressed shaft part feature map and the weighted convolution weight are combined and output to obtain the center position of the shaft part.
6. According to claim 5, a center alignment positioning method based on YOLOv8-RBT is characterized in that: The center alignment device is obtained by mirror-assembling a plurality of local connecting rod slider structures, each of which includes a plurality of connecting rods connected by flexible hinges.
7. A center alignment positioning system based on YOLOv8-RBT, characterized in that: Includes the following modules: The first module is used to obtain image data of the shaft part to be positioned and perform image preprocessing to obtain a preprocessed image of the shaft part to be positioned; The second module is used to introduce the deformable convolution module, the bidirectional feature pyramid network structure and the fusion receptive field attention mechanism module to build an improved YOLOv8-RBT model; The third module is used to input the preprocessed image of the shaft parts to be positioned into the improved YOLOv8-RBT model; Based on the backbone network module of the improved YOLOv8-RBT model, feature extraction is performed on the preprocessed image of the shaft parts to be located to obtain the feature image of the shaft parts to be located; Based on the neck module of the improved YOLOv8-RBT model, feature fusion processing is performed on the feature images of the shaft parts to be located to obtain the feature fusion images of the shaft parts to be located; Based on the prediction module of the improved YOLOv8-RBT model, the defect feature detection process is performed on the feature fusion image of the shaft parts to be positioned, and the center position of the shaft parts is output; The fourth module is used to construct a center alignment device, obtain the center coordinates of the center alignment device and construct a kinematic model of the center alignment device; Obtaining the device displacement equation according to the kinematic model of the center alignment device; Differentiate the displacement equation of the device to obtain the velocity equation of the clamping point of the device; Differentiating the velocity equation of the device clamping point to obtain the acceleration equation of the device clamping point; The center position of the shaft parts is overlapped with the center coordinates of the center alignment device. Combined with the acceleration equation of the device clamping point, the center alignment device is controlled to tighten the shaft parts to obtain the center alignment positioning result of the shaft parts.
Citation Information
Patent Citations
Lightweight part identifying and positioning method based on YOLOv5
CN116051808A
Underwater image target detection method of novel DDCE-YOLOv8s model
CN118247645A