Piston connecting rod intelligent assembly equipment detection method and device based on machine vision

By optimizing the loss function of the target detection model through an improved combined intelligent algorithm, the problems of insufficient piston and piston ring recognition accuracy and real-time performance are solved, and high-precision and efficient piston connecting rod assembly equipment detection is achieved.

CN120673110APending Publication Date: 2025-09-19SHANDONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510523375.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-24
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

The existing engine piston and piston ring identification methods are affected by the size differences of pistons and piston rings, and the recognition accuracy and real-time performance are insufficient, making it difficult to meet the needs of fully automatic intelligent piston-connecting rod assembly equipment.

Method used

An improved combined intelligent algorithm is adopted. By integrating the capture process and migration process of the Black Hawk algorithm into the hiking algorithm, combined with the scanning factor update, the loss function of the target detection model is optimized to improve the recognition accuracy and real-time performance.

Benefits of technology

The recognition accuracy and detection real-time performance of piston-connecting rod intelligent assembly equipment have been significantly improved, meeting the requirements of fully automatic assembly equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120673110A_ABST
    Figure CN120673110A_ABST
Patent Text Reader

Abstract

The invention provides a method and a device for detecting intelligent piston connecting rod assembly equipment based on machine vision, and the method comprises the steps: improving a scanning factor of a hiking algorithm through a capturing process of a black eagle algorithm, and integrating a migration process and a courtship process of the black eagle algorithm into the hiking algorithm to jump out of local optimization to obtain a global optimal solution. Then, the improved combined intelligent algorithm is used for carrying out weight optimization on a loss function of the target detection model, and the new target detection model is used for training the target detection model to identify the types of the engine piston and the piston ring. And the detection and identification precision and the detection real-time performance of the intelligent assembly equipment are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of intelligent detection, and in particular relates to a method and device for detecting piston connecting rod intelligent assembly equipment based on machine vision. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] At present, the sealing form of the piston used in the engine needs to rely on piston rings to achieve. The piston surface is provided with multiple annular grooves of different diameters, heights and depths for installing piston rings of different diameters, heights and depths. The assembly of the piston directly affects the working performance of the piston and the power of the engine. Poor assembly quality will lead to poor quality of piston products and low production efficiency. With the development of technology, the research and development of fully automatic intelligent piston-connecting rod assembly equipment (such as robots, etc.) is the key to improving assembly quality and production efficiency. The key to the normal operation of fully automatic intelligent piston-connecting rod assembly equipment is the accurate identification of pistons and piston rings.

[0004] As a detection method, machine vision can obtain the required useful information more quickly than other detection methods, and can automatically process the obtained information. It is also easy to integrate with design information and processing control information. However, the existing engine piston and piston ring recognition methods are affected by the various sizes of pistons and piston rings, which greatly affects the recognition accuracy and real-time performance. Summary of the Invention

[0005] In order to solve the above problems, the present invention proposes a piston connecting rod intelligent assembly equipment detection method and device based on machine vision. The capture process of the Black Hawk algorithm is improved by the scanning factor α of the hiking algorithm, and the migration process and courtship process of the Black Hawk algorithm are integrated into the hiking algorithm to jump out of local optimization and obtain the global optimal solution. An improved combined intelligent algorithm is obtained, and then the improved combined intelligent algorithm is used to perform weighted optimization on the loss function of the target detection model. The new target detection model is used to train the target detection model to identify the type of engine pistons and piston rings, which greatly improves the detection and recognition accuracy and real-time detection of intelligent assembly equipment.

[0006] According to some embodiments, the present invention adopts the following technical solutions:

[0007] A machine vision-based detection method for piston-connecting rod intelligent assembly equipment includes the following steps:

[0008] Acquire two-dimensional image data of the engine piston and piston ring to be inspected;

[0009] The target detection model is improved using a combined intelligent algorithm and trained based on the two-dimensional image data of the engine piston and piston ring to be detected.

[0010] The trained target detection model is used to identify the two-dimensional image data of the target engine piston and piston ring to obtain the recognition result;

[0011] Among them, the process of using the combined intelligent algorithm to improve the target detection model is as follows: using the capture process of the Black Hawk algorithm to improve the speed update of the hiking algorithm, in the optimization process of the hiking algorithm, combining the position of the hiker and the position of the Black Hawk to update the scanning factor, using the changed scanning factor to update the position of the hiker, using the migration process and courtship process of the Black Hawk algorithm to integrate into the hiking algorithm to jump out of local optimization and obtain the global optimal solution, iterating the optimization process until the iteration requirements are met, forming a combined intelligent algorithm, and obtaining the final optimal solution. The final optimal solution is used as the loss weight and introduced into the loss function of the target detection model to achieve the improvement of the target detection model.

[0012] As an optional embodiment, the process of obtaining two-dimensional image data of the engine piston and piston ring to be inspected includes taking different photos of the piston-connecting rod mechanism, piston and piston ring from multiple angles through an industrial camera, including combined images of the piston and piston ring from different perspectives. For different pistons and piston rings, their two-dimensional photos are used to form a visual inspection data set of the piston and piston ring.

[0013] As an optional implementation, the capture process of the Black Hawk algorithm is used to improve the speed update of the walking tour algorithm. In the optimization process of the walking tour algorithm, the process of updating the scanning factor based on the position of the hiker and the position of the Black Hawk includes:

[0014] The capture process of the Black Hawk algorithm is:

[0015]

[0016] Where s0 is a number between 0.5 and 1, and X t is the current position of the Black Hawk, X t+1 It is the next position of the black hawk standing on the high ground to look for prey, is the current best position, representing the position of the prey, X * It is the position that the Black Hawk adjusts before capturing to reduce the eccentricity of its position relative to the current best position. D1 is the first position adjustment coefficient, and D2 is the second position adjustment coefficient. The calculation formula is:

[0017]

[0018]

[0019] Where n is the number of Black Hawks, X i is the current position of Black Hawk i, X i * is the position that Black Hawk i adjusts before capturing. During the pedestrian search, its speed is improved by the Black Hawk algorithm by the scanning factor α, specifically:

[0020]

[0021] Among them, φ L is the lower bound of the space, φ U is the upper bound of the space, β best is the position of the leading hiker. During the search iteration, the value of α will continue to decrease, making the hiker tend to local exploration and search.

[0022] As an optional implementation, the migration process and courtship process of the Black Hawk algorithm are integrated into the hiking algorithm to break away from local optimization and obtain the global optimal solution. The process includes:

[0023] Black Hawk Migration Process:

[0024]

[0025] Where, X t+1 It is the next position of the black hawk standing on the high ground to look for prey, is the current best position, representing the position of the prey, s is a d-dimensional column vector whose elements are between -1 and 1, t is a random number between 0.4 and 1 formed by the Tent hybrid mapping, and the calculation formula of the parameter z is:

[0026]

[0027] Where, f best is the current best fitness value, f(i) is the current fitness value of the i-th individual, and ε is a very small value to avoid the denominator being 0;

[0028] Black Hawk courtship process:

[0029]

[0030] Where, X i t is the position of Black Hawk i in the t-th iteration, r1 and r3 are random numbers between 0 and 1, r2 and r4 are d-dimensional column vectors whose elements obey the normal distribution, and k is the step factor, which is calculated as follows:

[0031]

[0032] Where T is the total number of iterations at present, let It represents the difference between the hiker's position after iteration t+1 and iteration t divided by the hiker's position at iteration t, β i,t is the current position of hiker i, β i,t+1 is the position of hiker i at the next moment;

[0033] When the hiking combination algorithm continuously T n When Z(t+1) is less than the set value for the first time, it means that the hiker's position has changed very little, and the position at this time is recorded as Use the black hawk migration formula to migrate individuals and adjust their positions using the courtship strategy. The new positions are:

[0034]

[0035] W i,t Represents the current speed of hiker i, uses the new position to recalculate the value of the scanning factor α, and then uses the scanning factor α to search for optimization during the iteration process.

[0036] As a further limited implementation method, the iterative optimization process is performed until the iteration requirements are met, a combined intelligent algorithm is formed, and the process of obtaining the final optimal solution includes the following steps: n When Z(t+1) is less than the set value for the first time, the new optimal solution is compared with the previous optimal solution, and the best of the two is selected. n Record the number of times. When the number of bounces reaches T nn The iteration stops when the number of times or iterations reaches the maximum, and the optimal position is obtained. Form a combined intelligent algorithm.

[0037] As an optional implementation, the process of introducing the final optimal solution as the loss weight into the loss function of the target detection model includes: the loss function of the target detection model is: L = L bound +L confidence +L class

[0038] Where, L bound represents the bounding box coordinate loss, L confidence represents the target confidence loss, L class Represents the target classification loss; the confidence loss and classification loss are calculated using the binary cross entropy loss function, and the bounding box coordinate loss is used to measure the positional relationship between the predicted box and the true box. The calculation formula is:

[0039] L bound =P object ×L CIoU

[0040] Where, P object Represents the cell target object judgment index. When there is a detection target in the cell, P object The value is 1, otherwise it is 0. CIoU refers to the intersection-over-union ratio, which represents the position relationship between the predicted box and the real box. CIoU is the loss function, and the calculation formula is as follows:

[0041] L CIoU =w1·L IoG +w2·L IoU +w3·L GIoU

[0042] Where w1, w2, and w3 are weights, and the sum of the three is 1. w1 and w2 are given by the combined intelligent algorithm, and the ranges are [0.1, 0.2] and [0.2, 0.3] respectively. w3 is given by w1 and w2, and the calculation formula is w3 = 1-w1-w2, and the range is [0.5, 0.7]. IoG, IoU, and GIoU are all intersection-over-union ratios, and the calculation formulas are:

[0043]

[0044] Where A is the box predicted by the model, B is the real target box, C is the minimum bounding rectangle of the area covered by A and B, and L IoG 、L IoU 、L GIoU They are the loss functions of IoG, IoU, and GIoU, and the calculation formulas are:

[0045]

[0046] L IoU =1-IoU

[0047] L GIoU =1-GIoU

[0048] Where, and All are losses, The role of is to make the current bounding box as far away from the surrounding real box as possible. The role of is to make the prediction box as far away from the surrounding prediction boxes as possible and reduce the intersection-union ratio between them. and The calculation formula is:

[0049]

[0050]

[0051] Where, is a smoothing parameter used to adjust the sensitivity of the rejection loss to outliers, Pi and P j Corresponding to different groups of prediction boxes.

[0052] As an optional implementation, in the process of training the improved target detection model based on the two-dimensional image data of the engine piston and piston ring to be detected, the fitness function is defined as mAP, and the calculation formula is:

[0053]

[0054] Where P is precision, R is recall, AP is average precision, mAP is mean average precision, TP is the number of correctly detected positive samples, FP is the number of negative samples incorrectly detected as positive samples, FN is the number of positive samples incorrectly detected as negative samples, k is the number of categories, and the maximum fitness function is the training objective function.

[0055] A machine vision-based detection system for intelligent piston and connecting rod assembly equipment, comprising:

[0056] An image acquisition module, used to acquire two-dimensional image data of the engine piston and piston ring to be inspected;

[0057] A model improvement and training module is used to improve the target detection model using a combined intelligent algorithm and train the improved target detection model based on two-dimensional image data of the engine piston and piston ring to be detected;

[0058] The piston recognition module is used to use the trained target detection model to identify the two-dimensional image data of the target engine piston and piston ring to obtain the recognition result;

[0059] Among them, the process of using the combined intelligent algorithm to improve the target detection model is as follows: using the capture process of the Black Hawk algorithm to improve the speed update of the hiking algorithm, in the optimization process of the hiking algorithm, combining the position of the hiker and the position of the Black Hawk to update the scanning factor, using the changed scanning factor to update the position of the hiker, using the migration process and courtship process of the Black Hawk algorithm to integrate into the hiking algorithm to jump out of local optimization and obtain the global optimal solution, iterating the optimization process until the iteration requirements are met, forming a combined intelligent algorithm, and obtaining the final optimal solution. The final optimal solution is used as the loss weight and introduced into the loss function of the target detection model to achieve the improvement of the target detection model.

[0060] A computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by a processor, the steps in the above method are completed.

[0061] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps in the above method are completed.

[0062] Compared with the prior art, the present invention has the following beneficial effects:

[0063] The present invention provides a detection method for piston-connecting rod intelligent assembly equipment based on machine vision, proposes to improve the scanning factor α of the hiking algorithm by improving the capture process of the Black Hawk algorithm, and integrates the migration process and courtship process of the Black Hawk algorithm into the hiking algorithm to jump out of local optimization and obtain the global optimal solution, so that the hiking algorithm can find the optimal point locally and can jump out of the optimal point to a certain extent, realizing the ability of the algorithm to jump out of the local optimal point in complex, multi-peak data problems.

[0064] The present invention combines intelligent algorithms to optimize the weights of the improved target detection model loss function, and uses the new target detection model to train the target detection model to identify the types of engine pistons and piston rings, greatly improving the detection and recognition accuracy and real-time detection of piston connecting rod intelligent assembly equipment.

[0065] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0067] Figure 1 The present invention is a flow chart of a detection method for intelligent assembly equipment of piston and connecting rod based on machine vision in one embodiment. DETAILED DESCRIPTION

[0068] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0069] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.

[0070] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.

[0071] In the absence of conflict, the embodiments and features in the embodiments of this application can be combined with each other.

[0072] Example 1

[0073] As mentioned in the background technology, the existing engine piston and piston ring identification method is affected by the different diameters, heights, and depths of the pistons and piston rings, which greatly affects the recognition accuracy and real-time performance. In the engine piston and piston ring identification method of the present invention, the capture process of the Black Hawk algorithm is first improved to improve the scanning factor α of the hiking algorithm, and the migration process and courtship process of the Black Hawk algorithm are integrated into the hiking algorithm to jump out of the local optimization and obtain the global optimal solution, thereby obtaining an improved combined intelligent algorithm. The combined intelligent algorithm is then used to perform weighted optimization on the improved YOLOv5 algorithm loss function, and the new YOLOv5 algorithm is used to train the target detection model to identify the types of engine pistons and piston rings, thereby greatly improving the detection and recognition accuracy and the detection real-time performance.

[0074] like Figure 1 As shown, this embodiment provides a piston connecting rod intelligent assembly equipment detection method based on machine vision, comprising the following steps:

[0075] Step 1: Acquire image data of the engine piston and piston ring to be inspected;

[0076] The image data of the engine piston and piston ring to be inspected includes different photos of the piston-connecting rod mechanism, piston and piston ring from multiple angles, including but not limited to: front, side and top perspectives, and combined images of the piston and piston ring, and is preprocessed to produce a training data set.

[0077] Step 2: Use the Black Hawk algorithm to improve the hiking algorithm, specifically:

[0078] The basic content of the hiking algorithm is the location update of the hiker in the hiking algorithm, specifically:

[0079] The initial slope formula of the hiking algorithm is:

[0080]

[0081] Where dh and dx represent the hiker’s height difference and travel distance difference, respectively, θi,t is the slope angle of the path or terrain, S i,t represents the slope of the path or terrain. The initial speed of the hiker is given by the Tobler hiking function:

[0082]

[0083] Where W i,t It represents the speed of the initial hiker in the iteration time t, in km / h.

[0084] Initialize the population and use random numbers to randomly generate the initial positions of multiple hikers in the space. For the i-th hiker, its initial position is expressed as:

[0085] β i,0 =φ L +λ·(φ U -φ L )i=0,1,2,...,N

[0086] Where N represents the number of individuals, φ L is the lower bound of the space, φ U is the upper bound of the space, and λ is a randomly initialized number between 0 and 1.

[0087] The slope angle is initialized using the probability density function of the Weibull distribution:

[0088]

[0089] Here, x is a random variable, which is the initial slope angle faced by the hiker and is a random number between 0° and 50°. m>0 is the scale parameter, and η>0 is the shape parameter, which determines the shape of the distribution.

[0090] During the search process, the speed of the hiker is determined by the initial speed, the position of the leading hiker, the actual position of the hiker, and the scanning factor. Therefore, the current speed of the i-th hiker is:

[0091] W i,t =W i,t-1 +γ i,t (β best -α i,t β i,t )

[0092] Among them, γ i,t is a random number uniformly distributed between 0 and 1, α i,t is the scanning factor (SF) of hiker i, which ranges from [1,3] and ensures that hiker i does not stray too far from the leading hiker so that he can see the direction of the leading hiker and receive the signal from the leading hiker.i,t is the current position of hiker i, β best It is the position of the lead hiker, W i,t represents the current speed of hiker i, W i,t-1 represents the speed of hiker i at the last moment. According to the hiker’s speed, the new position update of hiker i should be:

[0093] β i,t+1 =β i,t +W i,t

[0094] Where, β i,t+1 is the updated position of hiker i. Hikers will continuously update their positions to reach the leader's position.

[0095] Black Hawk capture process:

[0096]

[0097]

[0098] Where s0 is a number between 0.5 and 1, and X t is the current position of the Black Hawk, X t+1 It is the next position of the black hawk standing on the high ground to look for prey, is the current best position, representing the position of the prey, X * It is the position that the Black Hawk adjusts before capturing to reduce the eccentricity of its position relative to the current best position. D1 is the position adjustment coefficient 1, and D2 is the position adjustment coefficient 2. The calculation formula is:

[0099]

[0100] Where n is the number of Black Hawks, X i is the current position of Black Hawk i, X i * This is the Black Hawk's adjustment of its own position before capture. The Black Hawk's migration process:

[0101]

[0102] Where s is a d-dimensional column vector whose elements are between -1 and 1, t is a random number between 0.4 and 1 formed by the Tent mixing map, and the calculation formula of z is:

[0103]

[0104] Where, f best is the current best fitness value, f(i) is the current fitness value of the i-th individual, and ε is a very small value to avoid the denominator being 0.

[0105] Black Hawk courtship process:

[0106]

[0107] Where r1 and r3 are random numbers between 0 and 1, r2 and r4 are d-dimensional column vectors whose elements follow a normal distribution, and k is the step factor, which is calculated as follows:

[0108]

[0109] During the walker's search, the speed is improved by the Black Hawk algorithm by the scanning factor, specifically:

[0110]

[0111] During the search iteration process, the value of α will continue to decrease, making the hiker tend to local exploration and search.

[0112] make It represents the difference between the position of the hiker after iteration t+1 and iteration t divided by the position of the hiker at iteration t. n When Z(t+1)<1% occurs for the first time, T n When the number of times is between 25 and 40, it means that the hiker's position changes very little. Jump out of this stage and record the position at this time as Use the black hawk migration formula to migrate individuals to a new location, and use the courtship strategy to adjust their location. The new location is:

[0113]

[0114]

[0115] Use the new position to recalculate the value of α, and use α to search for the best value in the iterative process. n When Z(t+1)<1% occurs for the first time, T n When the number of times is 25 to 40, compare the new optimal solution with the previous optimal solution, select the best one, and use M n Record the number of times. When the number of bounces reaches T nn times, T nn The iteration stops when the number of iterations reaches 5 to 10 or the maximum number of iterations is reached, and the optimal position is obtained. This resulted in a combined intelligent algorithm.

[0116] Step 3: Improve the loss function in the YOLOv5 algorithm, specifically:

[0117] The YOLOv5 algorithm is an efficient target detection algorithm that achieves end-to-end object detection through regression. It is based on a deep convolutional neural network, uses CSPDarknet as the backbone network, and combines a feature pyramid network with an adaptive anchor box mechanism, achieving high speed and high accuracy. In the YOLOv5 algorithm, the concept of a loss function is used to characterize the deviation between the network model's predicted value and the true value. The loss function can be calculated as follows:

[0118] L=L bound +L confidence +L class

[0119] Where, L bound represents the bounding box coordinate loss, L confidence represents the target confidence loss, L class Represents the target classification loss. Both confidence loss and classification loss can be calculated using the binary cross entropy loss function. The confidence of each predicted box represents the accuracy of the predicted box. The closer the confidence is to 1, the closer the predicted box is to the true box. The bounding box coordinate loss is used to measure the positional relationship between the predicted box and the true box. The calculation formula is:

[0120] L bound =P object ×L CIoU

[0121] Where, P object Represents the cell target object judgment index. When there is a detection target in the cell, P object The value is 1, otherwise it is 0. CIoU refers to the intersection over union ratio, which represents the position relationship between the predicted box and the real box. CIoU is the loss function, and the calculation formula is as follows:

[0122] L CIoU =w1·L IoG +w2·L IoU +w3·L GIoU

[0123] Where w1, w2, and w3 are weights, and their sum is 1. w1 and w2 are given by the combined intelligent algorithm, and are in the range of [0.1, 0.2] and [0.2, 0.3], respectively. w3 is given by w1 and w2, and the calculation formula is w3 = 1-w1-w2, and is in the range of [0.5, 0.7]. IoG, IoU, and GIoU are all intersection-over-union ratios, and the calculation formulas are:

[0124]

[0125] Where A is the box predicted by the model, B is the real target box, and C is the minimum bounding rectangle of the area covered by A and B. IoG 、L IoU 、L GIoU They are the loss functions of IoG, IoU, and GIoU, and the calculation formulas are:

[0126]

[0127] L IoU =1-IoU

[0128] L GIoU =1-GIoU

[0129] Where, and All are losses, The role of is to make the current bounding box as far away from the surrounding real box as possible. The role of is to make the prediction box as far away from the surrounding prediction boxes as possible and reduce the intersection-union ratio between them. and The calculation formula is:

[0130]

[0131] Where, is a smoothing parameter used to adjust the sensitivity of the rejection loss to outliers, P i and P j Corresponding to different groups of prediction boxes.

[0132] When using the YOLOv5 algorithm to train photos of assembly line tests, its fitness function is defined as mAP, and the calculation formula is:

[0133]

[0134] Where P is precision, R is recall, AP is average precision, mAP is mean average precision, TP is the number of correctly detected positive samples, FP is the number of negative samples incorrectly detected as positive samples, FN is the number of positive samples incorrectly detected as negative samples, k is the number of categories, and the maximum fitness function is the training objective function.

[0135] Step 4: Based on the image data of engine pistons and piston rings of various sizes and types, the improved YOLOv5 algorithm is used to train and identify engine pistons.

[0136] The specific process of this embodiment can also be described as:

[0137] First, for different pistons and piston rings, an industrial camera is used to generate a two-dimensional image to form a visual inspection dataset of pistons and piston rings. Then, a combined intelligent algorithm is used to calculate the weights w1 and w2 to obtain the improved loss function w1, w2, and w3, and the new loss function is used to replace the original loss function of the YOLOv5 algorithm. The improved YOLOv5 algorithm is then used for model training. Finally, the trained YOLOv5 algorithm is used to distinguish the real-time collected photos of pistons and piston rings.

[0138] Example 2

[0139] A machine vision-based detection system for intelligent piston and connecting rod assembly equipment, comprising:

[0140] An image acquisition module, used to acquire two-dimensional image data of the engine piston and piston ring to be inspected;

[0141] A model improvement and training module is used to improve the target detection model using a combined intelligent algorithm and train the improved target detection model based on two-dimensional image data of the engine piston and piston ring to be detected;

[0142] The piston recognition module is used to use the trained target detection model to identify the two-dimensional image data of the target engine piston and piston ring to obtain the recognition result;

[0143] Among them, the process of using the combined intelligent algorithm to improve the target detection model is as follows: using the capture process of the Black Hawk algorithm to improve the speed update of the hiking algorithm, in the optimization process of the hiking algorithm, combining the position of the hiker and the position of the Black Hawk to update the scanning factor, using the changed scanning factor to update the position of the hiker, using the migration process and courtship process of the Black Hawk algorithm to integrate into the hiking algorithm to jump out of local optimization and obtain the global optimal solution, iterating the optimization process until the iteration requirements are met, forming a combined intelligent algorithm, and obtaining the final optimal solution. The final optimal solution is used as the loss weight and introduced into the loss function of the target detection model to achieve the improvement of the target detection model.

[0144] Example 3

[0145] A computer-readable storage medium is used to store computer instructions, which, when executed by a processor, complete the steps of the method provided in embodiment 1.

[0146] Example 4

[0147] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps of the method provided in embodiment 1 are completed.

[0148] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0149] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0150] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0151] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0152] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made by those skilled in the art that fall within the spirit and principles of the present invention and do not require creative effort are intended to be within the scope of protection of the present invention.

Claims

1. A machine vision-based detection method for intelligent assembly equipment of piston and connecting rods, characterized in that: The following steps are involved: Acquire two-dimensional image data of the engine piston and piston ring to be inspected; The target detection model is improved using a combined intelligent algorithm and trained based on the two-dimensional image data of the engine piston and piston ring to be detected. The trained target detection model is used to identify the two-dimensional image data of the target engine piston and piston ring to obtain the recognition result; Among them, the process of using the combined intelligent algorithm to improve the target detection model is as follows: using the capture process of the Black Hawk algorithm to improve the speed update of the hiking algorithm, in the optimization process of the hiking algorithm, combining the position of the hiker and the position of the Black Hawk to update the scanning factor, using the changed scanning factor to update the position of the hiker, using the migration process and courtship process of the Black Hawk algorithm to integrate into the hiking algorithm to jump out of local optimization and obtain the global optimal solution, iterating the optimization process until the iteration requirements are met, forming a combined intelligent algorithm, and obtaining the final optimal solution. The final optimal solution is used as the loss weight and introduced into the loss function of the target detection model to achieve the improvement of the target detection model.

2. The machine vision-based piston connecting rod intelligent assembly equipment detection method according to claim 1, characterized in that: The process of obtaining two-dimensional image data of the engine piston and piston ring to be inspected includes using an industrial camera to take different photos of the piston-connecting rod mechanism, piston and piston ring from multiple angles, including combined images of the piston and piston ring from different perspectives. For different pistons and piston rings, their two-dimensional photos are used to form a visual inspection data set for the piston and piston ring.

3. The machine vision-based detection method for piston-connecting rod intelligent assembly equipment according to claim 1, characterized in that: The capture process of the Black Hawk algorithm is used to improve the speed update of the hiking algorithm. During the optimization process of the hiking algorithm, the process of updating the scanning factor based on the position of the hiker and the position of the Black Hawk includes: The capture process of the Black Hawk algorithm is: Where s0 is a number between 0.5 and 1, and X t is the current position of the Black Hawk, X t+1 It is the next position of the black hawk standing on the high ground to look for prey, is the current best position, representing the position of the prey, X * It is the position that the Black Hawk adjusts before capturing to reduce the eccentricity of its position relative to the current best position. D1 is the first position adjustment coefficient, and D2 is the second position adjustment coefficient. The calculation formula is: Where n is the number of Black Hawks, X i is the current position of Black Hawk i, X i * is the position that Black Hawk i adjusts before capturing. During the pedestrian search, its speed is improved by the Black Hawk algorithm by the scanning factor α, specifically: Among them, φ L is the lower bound of the space, φ U is the upper bound of the space, β best is the position of the leading hiker. During the search iteration, the value of α will continue to decrease, making the hiker tend to local exploration and search.

4. The machine vision-based detection method for piston-connecting rod intelligent assembly equipment according to claim 1, characterized in that: The migration process and courtship process of the Black Hawk algorithm are integrated into the hiking algorithm to break away from local optimization and obtain the global optimal solution. The process includes: Black Hawk Migration Process: Where, X t+1 It is the next position of the black hawk standing on the high ground to look for prey, is the current best position, representing the position of the prey, s is a d-dimensional column vector whose elements are between -1 and 1, t is a random number between 0.4 and 1 formed by the Tent hybrid mapping, and the calculation formula of the parameter z is: Where, f best is the current best fitness value, f(i) is the current fitness value of the i-th individual, and ε is a very small value to avoid the denominator being 0; Black Hawk courtship process: Where, is the position of Black Hawk i after the tth iteration, r1 and r3 are random numbers between 0 and 1, r2 and r4 are d-dimensional column vectors whose elements obey the normal distribution, and k is the step factor, which is calculated as follows: Where T is the total number of iterations at present, let It represents the difference between the hiker's position after iteration t+1 and iteration t divided by the hiker's position at iteration t, β i,t is the current position of hiker i, β i,t+1 is the position of hiker i at the next moment; When the hiking combination algorithm continuously T n When Z(t+1) is less than the set value for the first time, it means that the hiker's position has changed very little, and the position at this time is recorded as Use the black hawk migration formula to migrate individuals and adjust their positions using the courtship strategy. The new positions are: W i,t Represents the current speed of hiker i, uses the new position to recalculate the value of the scanning factor α, and then uses the scanning factor α to search for optimization during the iteration process.

5. The machine vision-based detection method for piston-connecting rod intelligent assembly equipment according to claim 4, characterized in that: Iterative optimization process, until the iteration requirements are met, a combined intelligent algorithm is formed, and the final optimal solution is obtained. The process includes continuous T n When Z(t+1) is less than the set value for the first time, the new optimal solution is compared with the previous optimal solution, and the best of the two is selected. n Record the number of times. When the number of bounces reaches T nn The iteration stops when the number of times or iterations reaches the maximum, and the optimal position is obtained. Form a combined intelligent algorithm.

6. The machine vision-based detection method for piston-connecting rod intelligent assembly equipment according to claim 1, characterized in that: The process of introducing the final optimal solution as the loss weight into the loss function of the target detection model includes: the loss function of the target detection model is: L = L bound +L confidence +L class Where, L bound represents the bounding box coordinate loss, L confidence represents the target confidence loss, L class Represents the target classification loss; the confidence loss and classification loss are calculated using the binary cross entropy loss function, and the bounding box coordinate loss is used to measure the positional relationship between the predicted box and the true box. The calculation formula is: L bound =P object ×L CIoU Where, P object Represents the cell target object judgment index. When there is a detection target in the cell, P object The value is 1, otherwise it is 0. CIoU refers to the intersection-over-union ratio, which represents the position relationship between the predicted box and the real box. CIoU is the loss function, and the calculation formula is as follows: L CIoU =w1·L IoG +w2·L IoU +w3·L GIoU Where w1, w2, and w3 are weights, and the sum of the three is 1. w1 and w2 are given by the combined intelligent algorithm, and the ranges are [0.1, 0.2] and [0.2, 0.3] respectively. w3 is given by w1 and w2, and the calculation formula is w3 = 1-w1-w2, and the range is [0.5, 0.7]. IoG, IoU, and GIoU are all intersection-over-union ratios, and the calculation formulas are: Where A is the box predicted by the model, B is the real target box, C is the minimum bounding rectangle of the area covered by A and B, and L IoG 、L IoU 、L GIoU They are the loss functions of IoG, IoU, and GIoU, and the calculation formulas are: L IoU =1-IoU L GIoU =1-GIoU Where, and All are losses, The role of is to make the current bounding box as far away from the surrounding real box as possible. The role of is to make the prediction box as far away from the surrounding prediction boxes as possible and reduce the intersection-union ratio between them. and The calculation formula is: Where, is a smoothing parameter used to adjust the sensitivity of the rejection loss to outliers, P i and P j Corresponding to different groups of prediction boxes.

7. The machine vision-based detection method for piston-connecting rod intelligent assembly equipment according to claim 1, characterized in that: In the process of training the improved target detection model based on the two-dimensional image data of the engine piston and piston ring to be detected, the fitness function is defined as mAP, and the calculation formula is: Where P is precision, R is recall, AP is average precision, mAP is mean average precision, TP is the number of correctly detected positive samples, FP is the number of negative samples incorrectly detected as positive samples, FN is the number of positive samples incorrectly detected as negative samples, k is the number of categories, and the maximum fitness function is the training objective function.

8. A machine vision-based intelligent assembly equipment detection system for piston and connecting rods, characterized by: include: An image acquisition module, used to acquire two-dimensional image data of the engine piston and piston ring to be inspected; A model improvement and training module is used to improve the target detection model using a combined intelligent algorithm and train the improved target detection model based on two-dimensional image data of the engine piston and piston ring to be detected; The piston recognition module is used to use the trained target detection model to identify the two-dimensional image data of the target engine piston and piston ring to obtain the recognition result; Among them, the process of using the combined intelligent algorithm to improve the target detection model is as follows: using the capture process of the Black Hawk algorithm to improve the speed update of the hiking algorithm, in the optimization process of the hiking algorithm, combining the position of the hiker and the position of the Black Hawk to update the scanning factor, using the changed scanning factor to update the position of the hiker, using the migration process and courtship process of the Black Hawk algorithm to integrate into the hiking algorithm to jump out of local optimization and obtain the global optimal solution, iterating the optimization process until the iteration requirements are met, forming a combined intelligent algorithm, and obtaining the final optimal solution. The final optimal solution is used as the loss weight and introduced into the loss function of the target detection model to achieve the improvement of the target detection model.

9. A computer-readable storage medium, characterized in that: Used to store computer instructions, which, when executed by a processor, complete the steps of the method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: The method comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein the steps of the method according to any one of claims 1 to 7 are completed when the computer instructions are executed by the processor.