Threaded component defect detection method
By adopting machine vision and airflow cleaning technology in threaded component detection, the problems of low detection efficiency and limited application scope in the prior art are solved, and more efficient and accurate threaded component defect detection is achieved.
Patent Information
- Application Number
- CN202510385811.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-29
- Publication Date
- 2025-06-20
AI Technical Summary
The prior art has low efficiency and limited application scope in the detection of threaded components, especially in the production of reused threaded components and assembly lines, with low detection accuracy.
Using a detection method based on machine vision, the surface cleaning of the threaded member is used to remove attachments, and defect recognition is performed by combining the camera to capture images from multiple angles. The detection devices used include positioning tooling, camera stand, cleaning air holes and discharge air holes, and automatic positioning, cleaning and discharge of threaded members through airflow.
It improves the accuracy and efficiency of threaded component defect detection, is suitable for reusable threaded components and assembly line production, reduces missed inspections, and simplifies the inspection process.
Smart Images

Figure CN120177488A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of quality inspection of threaded components, and particularly to a method for detecting defects of threaded components. Background Art
[0002] For threaded components represented by bolts and screws, defect detection is required to ensure reliable quality during production or use. Traditional defect detection of threaded components is carried out by manual sampling inspection and cooperative measurement with a gauge having a corresponding screw hole structure, which is time-consuming and laborious, and the detection efficiency is too low.
[0003] In order to improve the efficiency, there are already some technologies for defect detection of threaded components based on machine vision in the prior art. After relying on a camera to photograph a threaded component, the obtained picture is input into a computer, and defect recognition is directly carried out by relying on a pre-trained image recognition model. Detecting in this way by relying on artificial intelligence can better improve the detection efficiency.
[0004] For example, CN216094943U once disclosed a bolt detection device, including an electric cabinet, a vibrating disk, a detection mechanism and a transmission mechanism. The vibrating disk is connected to a chassis below. One end of the transmission mechanism is connected to the feeding port of the vibrating disk. The detection mechanism and the transmission mechanism are assembled on the electric cabinet. The detection mechanism includes a camera, a photoelectric sensor and a light source generator. The light source generator is connected to the camera. The transmission mechanism is provided with a belt line and a motor. One end of the belt line is connected to the feeding port of the vibrating disk. The motor is assembled below the other end of the belt line. The bolt detection device further includes a cylinder, and the cylinder is arranged on one side of the belt line and connected to the electric cabinet. The device of this solution can rely on the vibrating disk to automatically arrange bolts and input them one by one to the camera shooting station for camera shooting and then carry out image recognition, realizing a pipeline-type detection based on the principle of visual image recognition. However, this solution can only achieve single-sided shooting of bolts, and it is easy to cause missed detection.
[0005] CN118583870B provides a bolt detection device, method and bolt detection platform, which relates to the technical field of bolt detection. The device includes: a clamping component, a first tray, a first sensor, a camera device, and a first controller. Among them, the first tray is used to place the bolt to be detected; the first sensor is used to collect the first position data of the bolt to be detected; when the first controller determines that the bolt to be detected has reached the first preset position based on the first position data, it controls the limiting components at both ends to move to clamp the bolt to be detected, and controls the bolt to be detected to roll and rotate at least one week; the first controller is further used to control the camera device to take pictures of the bolt to be detected to obtain a target image set and send it to the target terminal, so that the target terminal can judge whether there is a crack in the bolt to be detected based on the target image set. This solution can control the rotation of the bolt to take pictures from multiple angles for detection, improving the detection accuracy. However, there are still the following defects: 1. The clamping of the bolt by this device is not convenient. In actual operation, manual or high-precision robotic arms are required to cooperate for clamping, which is not conducive to improving the detection efficiency. 2. This solution only considers the thread defects of the bolt itself and is more suitable for detecting newly manufactured bolts. When detecting recycled threaded components or extension rods for stud welding (a welding auxiliary tool component with threads at one end), etc., the components are likely to carry material debris, which affects the detection accuracy.
[0006] Therefore, how to design a more accurate and efficient defect detection solution for threaded components has become a problem that needs to be considered by those skilled in the art. Summary of the Invention
[0007] Aiming at the above deficiencies of the prior art, the technical problem to be solved by the present invention is: how to provide a threaded component defect detection method with higher detection accuracy and efficiency based on machine vision recognition, so that it can be applicable to the detection of recycled threaded components and can be better applicable to pipeline production.
[0008] To solve the above technical problems, the present invention adopts the following technical solutions:
[0009] A threaded component defect detection method, which takes a target image by using a camera after clamping the threaded component, inputs the image information into a computer for processing, and relies on a trained recognition model for defect recognition. It is characterized in that after the threaded component is clamped, the surface is first cleaned to remove the attached debris before taking pictures.
[0010] In this way, before taking pictures of the threaded component, the surface is first cleaned to remove the attached debris, avoiding the influence of the attached substances on image recognition, better improving the detection quality, and making this method particularly suitable for the defect detection of recycled threaded components.
[0011] Furthermore, the surface of the threaded component is cleaned by wind blowing, which is simple to operate, convenient to clean, easy to implement and does not affect subsequent camera recognition.
[0012] Furthermore, when the camera is used for shooting, the threaded component is rotated and images of the threaded component at multiple angles are obtained. In this way, defect recognition is performed on the images of the threaded component at multiple angles, thereby better avoiding missed detection and improving detection accuracy.
[0013] Furthermore, the method is implemented by a threaded component defect detection device, which includes a detection table, on which a positioning tool for positioning the threaded component is installed, a camera stand is fixed on one side of the positioning tool, a camera is installed on the upper end of the camera stand, the camera lens is arranged downward facing the positioning tool, the camera is connected to a computer with a preset threaded component image defect recognition model, the positioning tool includes an elongated positioning seat, a V-shaped groove is provided on the upper surface of the positioning seat, the depth of the V-shaped groove is greater than the diameter of the threaded component to be detected and is used to achieve the positioning of the threaded component to be detected, one end of the V-shaped groove is closed and has a vertical end face, a discharging air hole is provided on the installation station facing the bottom of the V-shaped groove on the end face, a cleaning air hole is provided above the discharging air hole, the discharging air hole and the cleaning air hole are respectively connected to an external air pipeline and connected to an air source, the other end of the V-shaped groove is open and a tightening device is installed, the tightening device has a movably arranged rolling roller, and the axial direction of the rolling roller is arranged in the same direction as the length direction of the V-shaped groove.
[0014] In this way, when the device is used, the threaded components to be detected are sent into the V-groove of the positioning seat one by one, and the rolling roller of the pressing device is pressed against the end of the threaded component from the direction of the V-groove opening, so that the other end of the threaded component is pressed against the end face of one end of the V-groove closed setting, so as to realize the positioning of the threaded component. Then the air outlet of the cleaning pore can be controlled, and the surface of the threaded component can be cleaned by blowing with a strong airflow. After cleaning, the image information of the threaded component is obtained by the camera above, and the information is input into the computer to realize defect recognition by the image defect recognition model of the threaded component (the recognition program can be realized by the existing image defect recognition model of the threaded component in the prior art). After the detection is completed, the pressing device is removed, and the air outlet of the discharge pore is controlled, and the strong airflow blown directly at one end of the threaded component is blown out from the open end of the V-groove to realize the discharge. The defect detection of the threaded component is completed. In this way, the attachments on the surface of the threaded component are cleaned by the air outlet before the detection, so as to avoid the influence on the image detection and improve the detection accuracy. After the detection, the discharge is blown by the airflow, which is convenient and fast and easy to realize assembly line production.
[0015] Furthermore, one side of the V-shaped groove is adjacent to the camera stand, and the other side is a feeding side for connecting with a feeding mechanism, and a discharging station for installing a discharging mechanism is reserved on the inspection table outside the open end of the V-shaped groove.
[0016] In this way, it is convenient to implement the pipeline recognition process of the detection process. The feeding mechanism can be obtained by connecting a vibrating disk device capable of automatically sorting threaded components to a conveyor belt, and the discharging mechanism can be implemented by a discharging conveyor belt or a receiving tray, both of which belong to existing mature device structures and will not be elaborated here.
[0017] Furthermore, a ring light source that irradiates downward is fixedly installed around the lens.
[0018] In this way, the threaded components to be detected can be better illuminated to facilitate taking picture data of the components.
[0019] Furthermore, the positioning seat is made of a transparent material, and a backlight source that irradiates upward is also provided below the positioning seat.
[0020] In this way, the light emitted by the backlight source passes through the positioning seat, which is more conducive to edge recognition when processing the captured component pictures.
[0021] Furthermore, the positioning seat is made of transparent acrylic material, which has the effects of low cost, sufficient strength, wear resistance and anti-breakage.
[0022] Furthermore, vertical through holes are provided at the four corners of the positioning seat, and four positioning seat studs are slidably arranged up and down in the through holes. The lower ends of the positioning seat studs are fixed on the detection table, and positioning seat fixing nuts are also connected to the positioning seat studs at the positions above and below the positioning seat. The backlight source is fixed on the detection table and is located between the four positioning seat studs.
[0023] In this way, the vertical height distance of the positioning seat can be adjusted when needed to adjust the lighting angle of the backlight source to better meet the imaging requirements.
[0024] Furthermore, the discharge air hole is arranged at the bottom of the V-shaped groove and is smaller than the cross-sectional circular area of the threaded component. In this way, the air flow blown out by the discharge air hole can better push the threaded component to achieve discharging.
[0025] Furthermore, there are at least two cleaning air holes respectively arranged at adjacent positions on both sides above the discharge air hole. In this way, the air flow blown out by the cleaning air holes can better clean the surface of the threaded component.
[0026] Furthermore, the air source is a blower, the outlet of the blower is connected to the inlet of an air path shunt, and the air path shunt has a plurality of air outlets that can control opening and closing. Each air outlet is respectively connected to the discharge air hole and each cleaning air hole through an air path pipeline.
[0027] In this way, the supply and distribution of the air flow can be better ensured.
[0028] Further, the pressing device includes a guide rail horizontally installed on the detection table in front of the open end of the V-shaped groove along the length direction of the V-shaped groove. Above the guide rail, a support plate is installed. The support plate includes a horizontal lower bottom plate, a vertical middle plate, and a horizontal upper bottom plate, and the three are fixedly connected to form a Z-shaped structure. The lower end of the lower bottom plate is slidably installed on the guide rail. On one side of the guide rail, a horizontal telescopic cylinder is arranged side by side in the same direction. The telescopic head of the horizontal telescopic cylinder is arranged facing the V-shaped groove and is fixedly connected to the support plate. A power motor is fixedly installed on the upper surface of the lower bottom plate. The output end of the power motor is connected to a driving wheel vertically installed on one side of the lower part of the middle plate facing the V-shaped groove. The driving wheel is connected to a driven wheel installed on the upper part of the middle plate through a synchronous belt. A vertical telescopic cylinder is also installed on the upper bottom plate. The telescopic arm of the vertical telescopic cylinder is arranged vertically downward, and a horizontally arranged roller shaft is installed at the lower end through a bearing seat. The roller shaft is arranged along the length direction of the bottom gap of the V-shaped groove, and the rolling roller is coaxially installed at one end. The other end of the roller shaft away from the V-shaped groove is coaxially installed with a transmission roller. The outer side of the transmission roller is in transmission contact with the outer side of the synchronous belt.
[0029] In this way, when the pressing device is used, the vertical telescopic cylinder can be relied on to control the rolling roller to descend to the height position at the bottom of the V-shaped groove. At this time, the horizontal telescopic cylinder controls the overall movement of the support plate to drive the rolling roller towards the threaded component, and the end of the threaded component can be pressed and positioned. At this time, the air flow cleaning of the threaded component can be completed. After cleaning, the rolling roller can be controlled to move away to avoid interference with the camera. After imaging, the rolling roller can be further controlled to move above the threaded component and then move down to fit with the circumferential surface of the threaded component. At this time, the power motor drives the transmission roller to rotate through the synchronous belt, and then the rotation of the rolling roller can drive the threaded component to rotate circumferentially. After the threaded component rotates a certain angle, a photo is taken again to obtain a photo. Therefore, it is convenient to control the acquisition of photos at various circumferential angles of the threaded component for detection, avoiding missed detection of defects and greatly improving the detection accuracy.
[0030] Further, friction sleeves made of rubber material are detachably sleeved on the outer circumferential surfaces of the rolling roller and the transmission roller respectively.
[0031] In this way, the surface of the friction sleeve has a certain roughness and elasticity, and can better realize the transmission of rotational torque after being pressed against each other. At the same time, after the size specifications of the threaded component to be detected change, different specifications of friction sleeves can be correspondingly replaced to adapt and match.
[0032] Further, a horizontal guide block is fixedly arranged at the lower end of the telescopic arm of the vertical telescopic cylinder. A vertical guide hole is arranged on the guide block, and a guide rod is vertically slidably arranged in the guide hole. The upper end of the guide rod is fixed on the upper bottom plate and the lower end is suspended.
[0033] In this way, it is possible to better ensure the smoothness of the control during the up-and-down movement of the rolling roller.
[0034] Further, two sets of the guiding holes and guiding rods are correspondingly arranged and are respectively located on both sides of the roller shaft.
[0035] In this way, relying on the guiding rod, the reverse acting force of the torque transmitted by the rolling roller and the driving roller during the transmission process can be transmitted upward to the upper bottom plate and offset, better ensuring the smooth and reliable operation process.
[0036] Further, a vertical adjusting sliding hole is also provided at the upper part of the middle plate. The rotating shaft of the driving wheel can slidably pass through the adjusting sliding hole up and down and form a clamping joint that expands on both sides in the horizontal direction. The clamping joint has a vertically arranged threaded hole, and a vertically arranged adjusting stud is screwed and fitted in the threaded hole. The upper end of the adjusting stud passes upward through a limiting block located at the upper end of the middle plate. The adjusting stud and the limiting block are rotatably matched, and shoulders are provided on the upper and lower sides of the limiting block to achieve vertical limiting. The end of the adjusting stud exposed above the limiting block is provided with an adjusting head with a larger diameter for rotational adjustment.
[0037] In this way, the adjusting head can be rotated. Since the adjusting stud is vertically limited by the limiting block, it can only rotate horizontally. The clamping joint and the adjusting stud form a screw-nut transmission fit, thereby realizing the vertical translational adjustment of the clamping joint and further realizing the up-and-down position adjustment of the driving wheel. When the driving wheel moves upward for adjustment (fine adjustment), the transmission belt can fit more tightly with the outer surface of the driving roller. When the output speed of the power motor remains unchanged, a larger rotational torque can be transmitted to the driving roller and the rolling roller. In this way, when the size specification of the threaded component to be detected changes, the above structure can be used to adjust the magnitude of the transmission torque under the condition of constant speed, ensuring a stable and reliable turning effect on the threaded component to be detected and an unchanged turning rate.
[0038] Therefore, this method has the advantages of higher detection accuracy and higher efficiency, and is particularly suitable for the defect detection of reused threaded components, especially extension rod components. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a schematic structural diagram of the threaded component defect detection device adopted in the present invention.
[0040] Figure 2 is Figure 1 a schematic structural diagram of the single positioning seat part in DETAILED DESCRIPTION OF THE EMBODIMENTS
[0041] The present invention will be further described in detail below in conjunction with the specific embodiments.
[0042] Specific implementation manner: A method for detecting defects of threaded components. After clamping the threaded components, a camera is used to take a target image, and the image information is input into a computer for processing and defect recognition is performed relying on a trained recognition model. The feature lies in that after clamping the threaded components, surface cleaning is first carried out to remove the attached foreign matters (debris) and then imaging is performed.
[0043] In this way, before imaging the threaded components, surface cleaning is carried out first to remove the attached debris, avoiding the influence of foreign matters on image recognition, better improving the detection quality, and making this method particularly suitable for defect detection of reused threaded components.
[0044] Among them, the surface cleaning of the threaded components is realized by means of blowing with air flow. This operation is simple, the cleaning is convenient, it is easy to implement and does not affect subsequent imaging recognition.
[0045] Among them, when using the camera to take pictures, the threaded components are rotated and images of the threaded components at multiple angles are obtained. In this way, defect recognition is performed on the images of the threaded components at multiple angles, better avoiding missed inspections and improving the detection accuracy.
[0046] Among them, this method is realized relying on a device for detecting defects of threaded components. For the device for detecting defects of threaded components, refer to Figure 1-2 , which includes a detection table 1. A positioning tooling for positioning the threaded components is installed on the detection table 1. A camera stand 2 is fixed on one side of the positioning tooling. A camera 3 is installed at the upper end of the camera stand 2. The lens 4 of the camera 3 faces downward and is directly opposite to the positioning tooling. The camera 3 is connected to a computer (not shown in the figure) preset with a defect recognition model of threaded component images. The positioning tooling includes a long strip-shaped positioning seat 5. A V-shaped groove 6 is opened on the upper surface of the positioning seat 5. The depth of the V-shaped groove 6 is greater than the diameter of the threaded component to be detected and is used to position the threaded component to be detected. One end of the V-shaped groove 6 is closed and has a vertical end face. An air outlet hole 7 is arranged on this end face opposite to the installation station at the bottom of the V-shaped groove. A cleaning air hole 8 is arranged above the air outlet hole 7. The air outlet hole 7 and the cleaning air hole 8 are respectively externally connected to air pipeline and connected to an air source 9. The other end of the V-shaped groove is open and is provided with a pressing device. The pressing device has a movably arranged rolling roller 10. The axis direction of the rolling roller 10 is the same as the length direction of the V-shaped groove.
[0047] In this way, when the device is in use, the threaded components to be detected are fed one by one into the V-shaped groove of the positioning seat. Relying on the rolling rollers of the pressing device, the end of the threaded component is pressed against from the open direction of the V-shaped groove, so that the other end of the threaded component abuts against the end face of the closed end of the V-shaped groove, realizing the positioning of the threaded component. Then, the cleaning air hole can be controlled to discharge air, and relying on the strong air flow blowing, the surface of the threaded component can be cleaned. After cleaning, the image information of the threaded component is obtained by the camera shooting above, and the defect recognition is realized by inputting it into the computer and relying on the threaded component image defect recognition model (the recognition program can be realized by using the existing threaded component image defect recognition model in the prior art). After the detection is completed, the pressing device is removed, and by controlling the discharge air hole to discharge air, the strong air flow blowing out directly against one end of the threaded component blows the threaded component out from the open end of the V-shaped groove to realize discharging. The defect detection of the threaded component is completed. In this way, before the detection, the attachments on the surface of the threaded component are cleaned by discharging air, avoiding the influence on the picture detection and improving the detection accuracy. After the detection, the discharging is realized by the air flow blowing, which is convenient and fast and is convenient for realizing the assembly line production.
[0048] Among them, one side of the V-shaped groove 6 is adjacent to the camera stand 2, and the other side is the feeding side for connecting with the feeding mechanism. There is a discharging station for installing the discharging mechanism left on the detection table outside the open end of the V-shaped groove.
[0049] In this way, it is convenient to realize the assembly line recognition process of the detection process. The feeding mechanism can be obtained by connecting a vibrating disc device capable of realizing automatic sorting of threaded components to a conveyor belt. The discharging mechanism can be realized by a discharging conveyor belt or a receiving tray, which all belong to the existing mature device structures and will not be elaborated here.
[0050] Among them, a ring-shaped light source 11 that irradiates downward is fixedly installed around the lens 4.
[0051] In this way, the threaded component to be detected can be better illuminated to facilitate taking the component photo data.
[0052] Among them, the positioning seat 5 is made of a transparent material, and an upward-irradiating backlight 12 is also arranged below the positioning seat 5.
[0053] In this way, the light emitted by the backlight passes through the positioning seat, which is more conducive to the edge recognition when processing the taken component pictures.
[0054] Among them, the positioning seat 5 is made of transparent acrylic material. It has the effects of low cost, sufficient strength, wear resistance and anti-breakage.
[0055] Among them, vertical through holes are provided at the four corners of the positioning seat 5. Four positioning seat studs 13 are slidably arranged up and down in the through holes. The lower ends of the positioning seat studs 13 are fixed on the detection table 1. Positioning seat fixing nuts are also connected to the positioning seat studs 13 at the upper and lower positions of the positioning seat 5. The backlight 12 is fixed on the detection table 1 and is located between the four positioning seat studs 13.
[0056] In this way, the vertical height distance of the positioning seat can be adjusted when needed to adjust the lighting angle of the backlight, better meeting the imaging requirements.
[0057] Among them, the material discharge air hole 7 is arranged at the bottom position of the V-shaped groove and is smaller than the cross-sectional circular area of the threaded member 14. In this way, the air flow blown out from the material discharge air hole can better push the threaded member to achieve material discharge.
[0058] Among them, there are at least two cleaning air holes 8 respectively arranged at the adjacent positions on both sides above the material discharge air hole 7. In this way, the air flow blown out from the cleaning air holes can better clean the surface of the threaded member.
[0059] Among them, the air source 9 is a blower. The outlet of the blower 9 is connected to the inlet of an air path diverter 15. The air path diverter 15 has a plurality of air outlets that can control opening and closing. Each air outlet is respectively connected to the material discharge air hole and each cleaning air hole through an air path pipeline.
[0060] In this way, the supply and distribution of the air flow can be better ensured.
[0061] Among them, the pressing device includes a guide rail 16 horizontally installed on the detection table in front of the open end of the V-shaped groove along the length direction of the V-shaped groove. A support plate 17 is installed above the guide rail. The support plate includes a horizontal lower bottom plate 18, a vertical middle plate 19 and a horizontal upper bottom plate 20, and the three are fixedly connected to form a Z-shaped. The lower end of the lower bottom plate 18 is slidably installed on the guide rail 16. A horizontal telescopic cylinder 21 is arranged side by side in the same direction on one side of the guide rail 16. The telescopic head 22 of the horizontal telescopic cylinder 21 is arranged facing the V-shaped groove direction and is fixedly connected to the support plate 17. A power motor 23 is fixedly installed on the upper surface of the lower bottom plate. The output end of the power motor 23 is connected to a driving wheel 24 vertically installed on the lower part of the middle plate facing the V-shaped groove direction. The driving wheel 24 is connected to a driven wheel 26 installed on the upper part of the middle plate through a synchronous belt 25. A vertical telescopic cylinder 27 is also installed on the upper bottom plate 20. The telescopic arm of the vertical telescopic cylinder 27 is arranged vertically downward and a horizontally arranged roller shaft 29 is installed at the lower end by a bearing seat. The roller shaft 29 is arranged facing the length direction of the bottom gap of the V-shaped groove and the rolling roller 10 is coaxially installed at one end. The other end of the roller shaft away from the V-shaped groove is coaxially installed with a transmission roller 30. The outer side of the transmission roller 30 is in transmission contact with the outer side of the synchronous belt 25.
[0062] In this way, when the clamping device is in use, relying on the vertical telescopic cylinder, the rolling roller can be controlled to descend to the height position at the bottom of the V-shaped groove. At this time, the horizontal telescopic cylinder controls the whole supporting plate to drive the rolling roller to move towards the threaded component, so as to realize the clamping and positioning of the end of the threaded component. At this time, the blowing air flow cleaning of the threaded component can be completed. After the cleaning is completed, the rolling roller can be controlled to move away to avoid interference with the camera. After the imaging is completed, the rolling roller can be further controlled to move above the threaded component and then move down to fit the circumferential surface of the threaded component. At this time, the power motor drives the transmission roller to rotate through the synchronous belt, and then the rotation of the rolling roller can drive the threaded component to rotate circumferentially. After the threaded component rotates a certain angle, photos are taken again to obtain photos. Therefore, it is convenient to control the acquisition of photos at various circumferential angles of the threaded component for detection, avoiding the missed detection of defects and greatly improving the detection accuracy.
[0063] Wherein, friction sleeves made of rubber material are detachably sleeved on the outer circumferential surfaces of the rolling roller 10 and the transmission roller 30 respectively.
[0064] In this way, the surface of the friction sleeve has a certain roughness and elasticity, so that the transmission of the rotation torque can be better realized after being pressed against each other. At the same time, after the size specifications of the threaded components to be detected change, friction sleeves of different specifications can be correspondingly replaced to adapt and match them.
[0065] Wherein, a horizontal guide block 31 is fixedly arranged at the lower end of the telescopic arm of the vertical telescopic cylinder 27. A vertical guide hole is arranged on the guide block 31, and a guide rod 32 is vertically slidably arranged in the guide hole. The upper end of the guide rod 32 is fixed on the upper bottom plate 20 and the lower end is suspended.
[0066] In this way, the smoothness of the control of the up and down movement of the rolling roller can be better ensured.
[0067] Wherein, two groups of corresponding guide holes and guide rods 32 are respectively arranged on both sides of the roller shaft 29.
[0068] In this way, relying on the guide rod, the reverse acting force of the torque transmitted by the rolling roller and the transmission roller during the transmission process can be transmitted upward to the upper bottom plate and offset, better ensuring the smooth and reliable operation process.
[0069] Among them, a vertical adjustment sliding hole is further provided at the upper position of the intermediate plate 19. The rotating shaft of the driving wheel 26 can slide up and down through the adjustment sliding hole and form a clamping joint 33 that expands on both sides in the horizontal direction. The clamping joint 33 has a vertically arranged threaded hole, and a vertically arranged adjustment screw 34 is rotatably fitted in the threaded hole. The upper end of the adjustment screw 34 passes upward through a limiting block 35 located at the upper end of the intermediate plate. The adjustment screw 34 and the limiting block 35 are rotatably matched, and shoulders are provided on the upper and lower sides of the limiting block to achieve vertical limitation. An adjustment head 36 with a larger diameter for rotational adjustment is provided at the end of the adjustment screw 34 exposed above the limiting block.
[0070] In this way, the adjustment head can be rotated. Due to the vertical limitation of the limiting block, the adjustment screw can only rotate horizontally. The clamping joint and the adjustment screw form a screw-nut transmission fit, thereby realizing the vertical translation adjustment of the clamping joint and further realizing the up and down position adjustment of the driving wheel. When the driving wheel moves upward for adjustment (fine adjustment), the transmission belt can fit more tightly with the outer surface of the transmission roller. When the output speed of the power motor remains unchanged, a greater rotational torque can be transmitted to the transmission roller and the rolling roller. In this way, when the size specification of the threaded component to be detected changes, the above structure can be used to adjust the magnitude of the transmission torque under the condition of constant speed, ensuring that the turning effect on the threaded component to be detected is stable and reliable and the turning rate remains unchanged.
[0071] During implementation, further, the threaded component image defect recognition model in the computer is an extension rod image defect recognition model (the extension rod is a tooling component used to assist in the assembly and welding of threaded parts. The overall structure is cylindrical, one end has a threaded section, and the other end usually has a cross-shaped opening. The extension rod is a tooling used repeatedly and needs to be regularly detected to ensure reliable use). The extension rod image defect recognition model is obtained by the camera collecting sample images of the extension rod to make a data set and training with the YOLO computer vision recognition model. The computer can realize the following recognition steps based on this extension rod image defect recognition model:
[0072] Step 1: Obtain the image of the extension rod to be tested collected by the camera, and preprocess the collected image, including grayscale conversion and smoothing processing;
[0073] Step 2: Perform Blob rough positioning on the preprocessed extension rod image (Blob in computer vision refers to a connected area in the image, here referring to the area where the extension rod is located in the photo image). The Blob rough positioning includes threshold segmentation, morphological processing, and Blob analysis and positioning to obtain a rough positioning binary image that only includes the area where the extension rod is located;
[0074] Step 3: Perform a logical AND operation on the binary image obtained by inverting the rough positioning binary image of the extension rod and the preprocessed grayscale image to obtain a grayscale image containing only the extension rod;
[0075] Step 4: Use an edge extraction algorithm for fine positioning, and measure the length of the extension rod and the position diameter of the non-threaded section. Compare the measured length and position diameter values of the extension rod with the standard values respectively. If the difference is greater than the threshold, it is determined that the extension rod is unqualified; otherwise, proceed with subsequent processing;
[0076] Step 5: Use the difference in the rectangularity of the two ends of the extension rod to find the direction where the threaded section is located, and extract the image of the threaded section;
[0077] Step 6: Use an edge extraction algorithm to measure the thread specification of the extension rod. Compare the measured value with the standard value. If the difference is greater than the threshold, it is determined that the extension rod is unqualified; otherwise, proceed with subsequent processing;
[0078] Step 7: Use the trained YOLO11s model (a graphic object recognition model) to perform defect detection and recognition on the threaded end image.
[0079] Further, in Step 1, the weighted average method is used for image grayscale processing.
[0080] In this way, the image grayscale processing is a method of converting a color image into a grayscale image, that is, removing color information and only retaining brightness information. Since a color image is composed of pixel points, and each pixel point includes pixel values of the red, green, and blue channels. The present invention uses the weighted average method, and its principle is to assign different weights to the three components according to the different sensitivities of the human eye to the red, green, and blue components. The weighted average method belongs to the prior art, and its calculation formula is as follows:
[0081] Gray = 0.11B + 0.59G + 0.3R
[0082] In the formula, R, G, and B respectively represent the pixel values of the red, green, and blue channels. The pixel values of these three channels are 0 - 255. Gray refers to the grayscale value (also called the pixel value) after pixel point grayscale processing, that is, the pixel values of the three channels are changed to a single-channel pixel value, and the pixel value range of this channel is 0 - 255. In this way, through grayscale processing, the computational complexity of the original image of the extension rod in subsequent image processing can be greatly reduced, the computational efficiency can be improved, and the interference caused by color can be avoided.
[0083] Further, in Step 1, for the smoothing processing of the image, the bilateral filtering method is used; its calculation formula is as follows:
[0084]
[0085] Where, Ω is the neighborhood window at the pixel point (x0, y0), f(x, y) is the pixel value of the pixel point within the neighborhood window Ω at the pixel point (x0, y0), g(x0, y0) is the pixel value after bilateral filtering at the pixel point (x0, y0), (x, y) is the position of the pixel point within the neighborhood window Ω at the pixel point (x0, y0), and w(x, y, x0, y0) is the filter kernel of the bilateral filtering. The expression of the filter kernel w(x, y, x0, y0) is as follows:
[0086]
[0087] Where, d(x, y, x0, y0) refers to the spatial kernel of the bilateral filtering, σ d is the standard deviation in the spatial kernel, r(x, y, x0, y0) refers to the range kernel of the bilateral filtering, σ r is the standard deviation in the range kernel. Among them, the standard deviation σ r in the spatial kernel is set to 10, and the standard deviation σ d in the range kernel is set to 25.
[0088] In this way, the smoothing process of the image is a method used in the image preprocessing stage to reduce image noise and retain its detailed features. The present invention adopts bilateral filtering, and its principle is that the bilateral filtering introduces the spatial kernel d(x, y, x0, y0) and the range kernel r(x, y, x0, y0). The weights of these two filter kernels respectively depend on the geometric distance between pixels and the difference in gray values, which enables the bilateral filtering to effectively retain edge information while smoothing the image. In this way, through this filter, while smoothing the image, the contour edge details of the extension rod in the image can be retained, achieving the purpose of removing noise while retaining edge features. In the present invention, since the size of the extension rod needs to be measured, it is necessary to preferably retain the edge and avoid over-blurring the edge. In bilateral filtering, if the gray domain value is large, the filtering effect is stronger, but it will cause over-smoothing and may lose details. If the spatial domain value is large, the influence range is wider, but the calculation amount is also larger. Therefore, in the present invention, the size of the neighborhood window Ω is set to 9, the standard deviation σ r in the spatial kernel is set to 10, and the standard deviation σ d in the range kernel is set to 25, which can not only remove noise and retain the edge, but also reduce the calculation amount.
[0089] Furthermore, in step 2, the threshold segmentation (also known as binary processing) distinguishes the digital image into two parts, foreground and background, by setting a critical value, and its function expression is as follows:
[0090]
[0091] Wherein, T is a set pixel threshold, and x is the pixel value of the pixel point (the pixel value ranges from 0 to 255. The larger the pixel value, the brighter the pixel point, that is, the whiter it is; the smaller the pixel value, the darker the pixel point, that is, the blacker it is). In the present invention, the extension rod is placed in the middle of the backlight source, and the periphery of the backlight source is an irrelevant background area. The backlight source of the present invention is lit towards the industrial camera. Therefore, in the image captured by the camera, the backlight source is a very bright area, and the area outside the backlight source is a darker area. Also, because the extension rod is in the middle of the backlight source and blocks the light source in the middle, the area where the extension rod is located in the middle of the backlight source is darker, that is, the area where the extension rod is located in the middle of the whole image is darker, the area of the backlight source except where the extension rod is located is brighter, and the area outside the backlight source is darker. The present invention sets the pixel threshold T to 200 and uses a three-step method based on this function expression to realize the segmentation of the extension rod and the background image (including the backlight source and the area outside the backlight source): In the first step, the area with a gray value greater than T is selected as the area where the backlight source is located. At this time, the backlight source is separated from the rest of the area, but does not include the area where the extension rod is located on the backlight source, because the gray value of this area is less than T. It can be known from the threshold segmentation formula that a binary image is obtained at this time, that is, the pixel value of the area of the backlight source except where the extension rod is located is 1, and the pixel value of the rest of the area is 0; In the second step, the circumscribed rectangle of the backlight source area is obtained, and the original image after image preprocessing is cropped according to the obtained circumscribed rectangle to obtain an image including only the backlight source and the extension rod; In the third step, the area with a gray value less than T is selected from the cropped image to realize the separation of the extension rod and the backlight source, and a binary image with the pixel value of the area where the extension rod is located being 0 and the pixel value of the backlight source area being 1 is obtained. However, it is undeniable that when placing the extension rod, there may be dropped impurities on the backlight source, or due to long-term use, the surface of the backlight source may be scratched. At this time, these areas belong to darker areas and will still be judged as part of the extension rod during threshold segmentation and need to be removed in subsequent steps.
[0092] In this way, T is a set pixel threshold, and an industrial camera captures a color image. Each pixel in the image contains three RGB components. Different colors are freely combined by these three components, and the value range of each component is 0 - 255. Since gray processing is performed and the three components are combined into one component, the value range of each pixel point in the present invention is 0 - 255. In this way, since the present invention uses a backlight source, except for the position where the extension rod is located on the backlight source, it presents a full white value (≥230), while the gray values of the area outside the backlight source and the area where the extension rod is located are relatively small (≤100), that is, the contrast difference between the backlight source area and the background and the extension rod area is relatively large. Therefore, the set range of the pixel threshold T can be relatively wide, and the separation of the extension rod, the backlight source, and the background can be realized. In this way, the present invention sets the pixel threshold T to 200 and can obtain better processing effects based on the presence of the backlight source.
[0093] Further, in step 2, during the morphological processing, a processing method of first erosion and then dilation is adopted, and its expression is as follows:
[0094]
[0095] In the formula, the binary image A after threshold segmentation is subjected to opening operation with the structuring element B, and the result image is A'; represents the erosion operation, represents the dilation operation;
[0096] The erosion operation is defined as follows:
[0097]
[0098] In the formula, B z represents the translation of the structuring element B centered on z, that is, the structuring element B slides on the image A, and only when all pixel points of B are included in the foreground area of A, the center point will be retained; where the structuring element B is set to a size of 5×5. Through the erosion operation, the extension rod area can be made smaller, the burrs and smaller noise points generated in the extension rod area can be removed, and at the same time, the small connecting parts can also be disconnected;
[0099] The dilation operation is defined as follows:
[0100]
[0101] In the formula, B z represents the translation of the structuring element B centered on z, and the result image is A'; that is, when the structuring element B has an intersection with the image A, the center point will be added to the result; similarly, a structuring element of 5×5 is set. Through dilation, the extension rod area can be made larger, and some of the main structures corroded can be restored.
[0102] In this way, because after threshold segmentation, burrs and edge losses will occur in the area where the extension rod is located, and at the same time, if there are impurities in the background, they cannot be removed through threshold segmentation; therefore, after the above processing, through the operation of first dilation and then erosion in the present invention, the narrow connections smaller than the structuring element can be disconnected, small burrs and isolated noise points can be eliminated, and the main area of the extension rod can be retained.
[0103] Further, in step 2, during the Blob analysis and positioning, according to the area size, the rough positioning of the extension rod is carried out on the condition that the area of the region is the largest, and a rough positioning binary image including only the area where the extension rod is located is obtained.
[0104] The conventional method for blob analysis and positioning is to analyze the connected regions to obtain parameters such as the area, roundness, and centroid of the regions, which are used to select the target region. The region after the previous morphological processing still belongs to one region, and it is necessary to perform connected component segmentation on it to divide the non-intersecting regions into separate regions. Since the area of the extension rod region is always the largest among the segmented regions, the present invention roughly locates the extension rod according to the area size of all separate regions, and can quickly obtain a rough positioning binary image that only includes the region where the extension rod is located through comparison.
[0105] Further, step 3 is specifically as follows: After obtaining the rough positioning binary image that only includes the region where the extension rod is located, (because the region where the extension rod is located in the aforementioned binary image is 0, and the region where the non-extension rod is located is 1) invert the binary image, so that the region where the extension rod is located becomes 1, and the region where the non-extension rod is located becomes 0. Use the inverted binary image as a mask to perform a logical AND operation with the preprocessed image, that is, 1&1 = 1, 1&0 = 0; in this way, a grayscale image that only includes the extension rod is obtained through logical operations.
[0106] After obtaining the grayscale image of the extension rod in this way, it is convenient for subsequent processing.
[0107] Further, in step 4, when using an edge extraction algorithm for fine positioning, the Sobel first-order edge detection operator is used for edge extraction calculation.
[0108] The edge of an image refers to the region where the pixel brightness changes significantly. Through backlight illumination and the aforementioned image preprocessing method in the present invention, the outer contour edge of the extension rod can be clearly observed on the image. At present, there are many very mature edge extraction algorithms. The present invention selects the Sobel first-order edge detection operator according to actual needs. This operator can effectively suppress image noise while accurately giving the edge information of the image.
[0109] Further, in step 4, the process of measuring the length and diameter of the extension rod is as follows: First, obtain the minimum bounding rectangle of the outer contour edge of the extension rod. The length of the minimum bounding rectangle is the pixel size of the length of the extension rod, and the width of the minimum bounding rectangle is the pixel size of the diameter of the extension rod. By converting the obtained pixel sizes of the length and diameter of the extension rod into sizes in the world coordinate system, the actual sizes of the extension rod are obtained.
[0110] In this way, the length and diameter of the extension rod can be quickly measured according to the obtained outer contour edge of the extension rod.
[0111] Further, in step 5, the process of obtaining the thread segment image is as follows: First, the extension rod is divided into a thread end on one side and a bottom end on the other side with the center of the extension rod as the boundary. The minimum circumscribed rectangles of both ends are of the same size. Then, the area ratios of the thread end region and the bottom end region are calculated respectively. The direction of the region with the smaller area ratio is the direction where the thread segment is located. The area ratio formula is as follows:
[0112]
[0113] In the formula, A r is the area ratio of the region, A origin is the actual area of the region, obtained from the number of pixels in the region, and A box is the area of the minimum circumscribed rectangle of the region;
[0114] Then, the position where the extension direction of the outer edge of the extension rod at the end where the thread segment is located changes suddenly is determined as the starting point of the thread segment, and the end of this end of the extension rod is taken as the end point of the thread segment, and the image of the thread segment is intercepted.
[0115] This is because one end of the extension rod is a thread segment, and the other end is usually a cross-shaped opening. When the side of the opening happens to be at the positions on both sides of the extension rod in the photo, there will also be a sudden change in the edge extension direction at this position. Therefore, the starting point position of the thread segment cannot be directly confirmed by detecting the position of the edge mutation. Since one end of the thread segment has a smaller area, the direction where the thread segment is located can be determined first by calculating the area ratio, and then the starting point of the thread segment can be detected according to the sudden change in the edge extension direction.
[0116] Further, in step 6, after obtaining the thread segment image, an edge extraction algorithm is used to extract the outer contour edge of the thread. The overall length of the thread segment, the pitch between any two adjacent teeth, and the pixel size of the outer diameter at multiple equally divided positions along the length direction of the thread segment are calculated respectively. When calculating the outer diameter, a part of the thread segment is intercepted and the circumscribed rectangle of the outer contour edge of this section of the thread is obtained. The direction of the circumscribed rectangle with the same width as the circumscribed rectangle of the entire extension rod is the pixel size of the outer diameter of the thread. Then, the pixel size is converted into the size in the world coordinate system, and the actual size of the thread is obtained and used for comparison with the standard value for judgment.
[0117] In this way, when the length of the thread segment no longer meets the usage requirements, or the pitch or outer diameter at any position no longer meets the requirements, defects can be detected, which better improves the comprehensiveness and accuracy of defect detection.
[0118] Further, in step 7, the training process of the YOLO11s model includes the following steps:
[0119] a. Prepare a data set; obtain an extension rod including the following defect types to be tested, and use a camera to take pictures under the condition of backlight (preferably, use the threaded component defect detection device as described above to take pictures to obtain image data) to obtain a data set of images of the defective extension rods, wherein the defect types to be tested include thread stripping, thread defect, thread head breakage, thread foreign matter and thread oil stain;
[0120] b. Classifying the defective extension rod image dataset according to the defect types to be detected and preprocessing them respectively. The preprocessing process includes graying and smoothing and extracting thread segments (the specific processing process is consistent with the previous steps and will not be repeated here). The preprocessed images are enhanced. The enhancement methods include but are not limited to rotation, scaling, mirroring, filtering and contrast enhancement. The enhanced dataset is annotated and converted into YOLO format (a dataset format used by the YOLO algorithm for target detection);
[0121] c. Constructing a YOLO11s network model, using a lightweight Ghost-C3Faster (an original network structure of the present invention, i.e., a lightweight convolution fast detection model, Ghost means lightweight, C3 means performing three convolution operations, and Faster means fast detection) network as the backbone network; at the same time, introducing a context conversion module in the neck network; and then using the WiseIoU-WHR (a loss function of the present invention that adds image width and height information to the WiseIoU (Wise Intersection over Union, a dynamic non-monotonic loss function) loss function) function as the loss function to construct a YOLO11s network model;
[0122] This is because the traditional YOLO11s model has good detection effect for obvious defects such as thread head fracture, but it is difficult for the traditional YOLO11s model to identify and locate cases of thread slipping, defect with only a few teeth, very small foreign objects, and severe oil contamination (resulting in unclear lighting). At the same time, due to the relatively fast production line rhythm, in order to better meet the production requirements, there is still room for further improvement in the detection speed of the traditional YOLO11s model. Therefore, aiming at the problems existing in the traditional YOLO11s model, the lightweight Ghost-C3Faster network is adopted in the above steps to replace the original backbone network of YOLO11s, which is used to improve the detection speed and the detection accuracy of small targets; at the same time, it is proposed to introduce a Contextual Transformer (COT) module in the neck network, which can better improve problems such as inaccurate recognition of small-area features and lighting interference in the detection process of the extension rod thread; then replace the CIoU (Complete Intersection over Union) loss function in the YOLO11s model with the WiseIoU-WHR loss function, which can improve the generalization ability of the model and the localization ability of small targets.
[0123] Among them, the lightweight Ghost-C3Faster network is mainly used to improve the detection speed of the model and, to a certain extent, improve the detection ability for small targets such as thread slipping, defect, and foreign objects. Compared with the original network, the Ghost-C3Faster network has been optimized in many aspects. The lightweight GhostConv (lightweight convolution) module is used to replace the Conv (convolution) module in the backbone network for feature extraction. GhostConv reduces the number of channels for direct convolution operations, thereby reducing the computational amount and the number of parameters. Since a lot of Bottleneck structures are stacked in the C3 module of the C3k2 module in the original backbone network, although different-scale features can be better utilized, it inevitably leads to excessive redundancy of channel information and a large model computational amount. Therefore, in the present invention, all the Bottleneck structures of the C3 module in the backbone network C3k2 module are replaced with the FasterBlock structure in FasterNet. The total computational amount of FasterBlock is less than that of Bottleneck, so that the model has a smaller volume and a higher small-target detection ability.
[0124] In this way, by replacing the Conv module in the backbone network with a lightweight GhostConv module and changing the Bottlenneck structure of the C3 module in the C3k2 module to a lightweight FasterBlock structure, the model reduces the complexity of the model while improving the extraction capability and reasoning speed of smaller features in extension rod defects such as thread stripping, thread defects, and thread foreign matter. At the same time, it achieves rapid detection of all types of extension rod defects and meets the production rhythm on the production line.
[0125] Among them, the contextual transformer (COT) module is mainly used to detect inaccurate small-area features such as thread stripping, defects, and foreign objects, as well as unclear lighting caused by excessive oil pollution. Through convolution operations, key information such as texture, defects, and position changes between different keys is extracted, and this contextual information is used to enhance the learning ability of the self-attention mechanism, thereby improving the model's ability to express detailed features such as extension rod thread texture and defects, and helping to more accurately capture the contextual relationship of these features.
[0126] Thus, by adding the COT module to the neck network, this method helps to effectively solve the problem of contextual information loss in the extension rod image due to the relatively small area of features such as thread texture and defects, as well as illumination changes and interference, thereby improving the accuracy and reliability of image processing.
[0127] Among them, the CIoU loss function in the YOLO11s model is replaced with the WiseIoU-WHR loss function to improve the positioning accuracy of the target and the generalization ability of the model. In the YOLO11s model, the CIoU loss function originally used has a high computational complexity, resulting in a slow convergence speed of the model. At the same time, this loss function relies on the complete cross-area calculation and correction factor, which not only increases the computational burden during the training process, but also cannot effectively handle the low-quality anchor frames generated in the task of small target defect detection in the extension rod, thereby affecting the generalization ability of the model. In contrast, the WiseIoU loss function (a dynamic non-monotonic loss function) pays more attention to the processing of low-quality samples, has a faster calculation speed, and while improving the convergence speed of the model, it enhances its generalization ability and overall detection performance.
[0128] The WiseIoU-WHR loss function (the loss function after the improvement of WiseIoU in this invention) adds the width and height information of the image to the WiseIoU loss function, so that it can adapt to images of different sizes and aspect ratios, and further optimizes the performance of the model in detecting and locating small targets.
[0129] Specifically, the formula of the WiseIoU-WHR loss function is as follows:
[0130]
[0131] In the formula, d1 and d2 are the distances from the upper left corner and the lower right corner between the ground truth box and the predicted box respectively, h image and w image are the height and width of the image respectively. The WiseIoU loss function constructs distance attention based on distance metrics and obtains WIoUv1 (the first version of the WiseIoU loss function) with a two-layer attention mechanism:
[0132] L WIoUv1 = R WIoU L IoU
[0133]
[0134] In the formula, R WIoU ∈ [1, e) is used to significantly enhance the ordinary quality anchor box L IoU , L IoU ∈ [0, 1] is used to significantly reduce the high-quality anchor box R WIoU . (x, y), (x gt , y gt ) are the center coordinates of two anchor boxes respectively, W g , H g are the width and height of the smallest enclosing box. To prevent R WIoU from generating gradients that hinder convergence, W g , H g are detached from the computational graph (the superscript * represents this operation); IoU is used to measure the overlap degree between the predicted box and the ground truth box in the object detection task. By introducing the outlier degree (β) to describe the quality of the anchor box, the outlier degree is represented by the ratio of the recalculated value through WIoUv1 and the initial L IoU . Further, a non-monotonic focusing coefficient r is constructed and applied to the WIoUv1 model to obtain WIoUv3 (the third version of the WiseIoU loss function) with a dynamic non-monotonic focusing module (FM), and its formula is as follows:
[0135]
[0136] In the formula, α and δ represent two hyperparameters during the training process. In this way, after introducing WIoUv3, the model can dynamically adjust the attention to anchor boxes of different qualities, reduce the influence of high-quality anchor boxes, and reduce the interference of low-quality samples. This method effectively improves the training efficiency of the extension rod defect detection task, avoids overfitting and the decline of generalization ability, and enhances the stability of the model. At the same time, the present invention adds the width and height information of the image, improving the performance of the model in detecting and locating small targets.
[0137] Of course, in implementation, step c can also directly construct the YOLO11s network model in a conventional manner; it can also complete the entire visual defect recognition process, but the recognition and detection effect for some defects is poor.
[0138] d Use the YOLO format dataset obtained in step b to train the YOLO11s model constructed in step c to obtain the trained YOLO11s network model.
[0139] During implementation, the applicant conducted the following comparative verification on the network model of the training results.
[0140] The image resolution during the training of the present invention is 640×640, the learning rate decay coefficient is 0.005, the initial learning rate is set to 0.001, the learning momentum is 0.9, the number of iterations E is set to 300, and common evaluation indicators such as Precision (P), Recall (R), mean Average Precision (mAP), and detection speed (Frames Per Second, FPS, f / s) are adopted. Through 4 groups of ablation experiments, the performance indicators of each model added and the final improved model are obtained. The experimental results are shown in the following table, where "√" indicates adding this module to the network.
[0141]
[0142] As can be seen from the table, Experiment 1 was to use the original YOLO11s network model to detect defects in the threads of the extension rod. Experiment 2 was to optimize the bounding box features after only introducing the WiseIoU-WHR loss function, and both mAP and FPS were improved. Experiment 3 was to only introduce the COT module, which printed out the interference in the complex environment, improved the accuracy and reliability of image processing. The detection speed decreased slightly, but the mAP reached 94.8%, an increase of 3.4%. Experiment 4 was to replace the original backbone network with Ghost-C3Faster, which improved the feature extraction ability and inference speed for the defects of the extension rod, and the FPS increased by 5.6%. Experiment 5 was the final improved model, with mAP and FPS reaching 95.2% and 116.9 f / s respectively, an increase of 3.8% and 4.9% respectively. In summary, after 300 rounds of training, the improved YOLO11s model has better detection accuracy and detection speed.
[0143] This application has the following advantages: 1. The detection method of the present invention replaces manual detection, improves the detection efficiency, and avoids the situations of missed detection and misdetection; 2. It improves the robustness and adaptability of traditional image processing algorithms and can adapt to various external environments and types of extension rods; 3. It meets the requirements of real-time detection on the production line; 4. The optimized dimension measurement algorithm can meet the dimension measurement of various extension rods and improves the detection accuracy of dimension detection; 5. The improved YOLO11s network model can effectively detect various types of thread defects, and both the detection accuracy and detection speed are better than those of the YOLO11s before improvement. 6. The detection device of the present invention can meet the identification of all types of extension rods and each angle of the extension rod.
Claims
1. A method for detecting defects in threaded components, wherein a camera is used to capture a target image of the threaded component after the component is clamped, the image information is input into a computer for processing, and defect recognition is performed based on a trained recognition model, wherein: After the threaded component is clamped, the surface is cleaned first to remove the attached attachments (debris) before taking the photo.
2. The threaded member defect detection method according to claim 1, characterized in that: The surface of the threaded component is cleaned by using wind blowing.
3. The threaded member defect detection method according to claim 1, characterized in that: When the camera is used for shooting, the threaded component is rotated and images of the threaded component at multiple angles are obtained.
4. The threaded member defect detection method according to claim 1, characterized in that: The method is implemented by a threaded component defect detection device, which includes a detection table, on which a positioning tool for positioning the threaded component is installed, a camera stand is fixed on one side of the positioning tool, a camera is installed on the upper end of the camera stand, the camera lens is arranged downwardly facing the positioning tool, the camera is connected to a computer with a preset threaded component image defect recognition model, the positioning tool includes an elongated positioning seat, a V-shaped groove is provided on the upper surface of the positioning seat, the depth of the V-shaped groove is greater than the diameter of the threaded component to be detected and is used to realize the positioning of the threaded component to be detected, one end of the V-shaped groove is closed and has a vertical end face, a discharging air hole is provided on the installation station facing the bottom of the V-shaped groove on the end face, a cleaning air hole is provided above the discharging air hole, the discharging air hole and the cleaning air hole are respectively connected to an external air pipeline and connected to an air source, the other end of the V-shaped groove is open and a tightening device is installed, the tightening device has a movably arranged rolling roller, and the axial direction of the rolling roller is arranged in the same direction as the length direction of the V-shaped groove.
5. The threaded member defect detection method according to claim 4, characterized in that: One side of the V-shaped groove is adjacent to the camera stand, and the other side is a feeding side for connecting with a feeding mechanism. A discharging station for installing a discharging mechanism is reserved on the inspection table outside the open end of the V-shaped groove.
6. The method for detecting defects in threaded components according to claim 4, characterized in that: A ring-shaped light source for irradiating downwards is also fixedly mounted on the periphery of the lens.
7. The method for detecting defects in threaded components according to claim 4, characterized in that: The positioning seat is made of transparent material, and a backlight source for irradiating upward is arranged under the positioning seat; The positioning seat is made of transparent acrylic material; The four corners of the positioning seat are provided with vertical through holes, and four positioning seat studs are slidably arranged in the through holes, the lower ends of the positioning seat studs are fixed on the detection table, and the positioning seat studs on the upper and lower sides of the positioning seat are also connected with positioning seat fixing nuts, and the backlight source is fixed on the detection table and located between the four positioning seat studs.
8. The threaded member defect detection method according to claim 4, characterized in that: The discharge air hole is arranged at the bottom of the V-shaped groove and is smaller than the cross-sectional circular area of the threaded member; There are at least two cleaning holes respectively arranged at adjacent positions on both sides above the discharge hole; The air source is a blower, the outlet of the blower is connected to the air inlet of an air path diverter, the air path diverter has a plurality of air outlets that can be controlled to open and close, and each air outlet is connected to the discharge air hole and each cleaning air hole through an air path pipeline.
9. The method for detecting defects in threaded components according to claim 4, characterized in that: The clamping device comprises a guide rail horizontally installed on the detection platform in front of the open end of the V-shaped groove along the length direction of the V-shaped groove, a support plate is installed above the guide rail, the support plate comprises a horizontal lower bottom plate, a vertical middle plate and a horizontal upper bottom plate, and the three are fixedly connected to form a Z-shape, the lower end of the lower bottom plate can be slidably mounted on the guide rail, a horizontal telescopic cylinder is arranged in parallel in the same direction on one side of the guide rail, the telescopic head of the horizontal telescopic cylinder is arranged in the direction of the V-shaped groove and is fixedly connected to the support plate, a power motor is fixedly installed on the upper surface of the lower bottom plate, and the power motor output The output end is connected to a driving wheel vertically installed on the lower part of the middle plate facing the side of the V-shaped groove, and the driving wheel is connected to a driven wheel installed on the upper part of the middle plate through a synchronous belt. A vertical telescopic cylinder is also installed on the upper bottom plate. The telescopic arm of the vertical telescopic cylinder is vertically downwardly arranged and a horizontally arranged roller shaft is installed at the lower end relying on a bearing seat. The roller shaft is arranged in the length direction of the gap at the bottom of the V-shaped groove and the rolling roller is coaxially installed at one end. A transmission roller is coaxially installed at the other end of the roller shaft away from the V-shaped groove, and the outer side of the transmission roller and the outer side of the synchronous belt are in contact with the transmission arrangement.
10. The threaded member defect detection method according to claim 9, characterized in that: The outer circumferential surfaces of the rolling roller and the driving roller are respectively detachably sleeved with friction sleeves made of rubber material; A horizontal guide block is fixedly arranged at the lower end of the telescopic arm of the vertical telescopic cylinder, a vertical guide hole is arranged on the guide block, a guide rod is arranged in the guide hole so as to be vertically slidable, the upper end of the guide rod is fixed on the upper bottom plate and the lower end is suspended; The guide holes and guide rods are provided in two groups correspondingly and are respectively located on both sides of the roller shaft; A vertical adjustment slide hole is also provided at the upper position of the middle plate, and the rotating shaft of the transmission wheel can slide up and down through the adjustment slide hole to form a clamping joint that is enlarged on both sides in the horizontal direction. The clamping joint is provided with a vertically arranged threaded hole, and a vertically arranged adjustment stud is screwed in the threaded hole. The upper end of the adjustment stud passes upward through a limit block located at the upper end of the middle plate, and the adjustment stud and the limit block can be rotatably matched, and shaft shoulders are provided on the upper and lower sides of the limit block to realize vertical limiting, and an adjustment head with an enlarged diameter for rotation adjustment is provided at the end of the adjustment stud exposed above the limit block.
Citation Information
Patent Citations
Bolt detection device, method and bolt detection platform
CN118583870B
Bolt detection device
CN216094943U