Adaptive defect detection method, platform and medium for titanium bar section
By building a visual inspection platform for titanium rods, utilizing the high-precision control of a linear CCD camera and backlight source, and combining it with an image twin network for defect detection, the problem of detection accuracy caused by unstable image acquisition quality of titanium rod cross-sections was solved, achieving efficient and accurate defect identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BAOJI YONGSHENGTAI TITANIUM IND
- Filing Date
- 2025-09-09
- Publication Date
- 2026-06-23
AI Technical Summary
The unstable quality of the titanium rod cross-section image acquisition and the surface condition lead to low defect detection accuracy.
A visual inspection platform for titanium rods was built, utilizing a linear CCD camera, a backlight source, and a servo motion device to ensure that the imaging optical axis is perpendicular to the titanium rod's cross-section. Defect identification and clustering were performed through an image twin network, and a multi-channel feature detection and quantitative evaluation system for cross-section defect detection was constructed.
It improves the accuracy and efficiency of titanium rod cross-section defect detection, effectively identifies minute defects such as cracks and pores, and reduces errors caused by uneven lighting and surface irregularities.
Smart Images

Figure CN121121180B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of defect detection technology, and in particular to an adaptive defect detection method, platform and medium for titanium rod cross-sections. Background Technology
[0002] In traditional image acquisition processes, uneven light source uniformity or strong reflectivity often leads to unstable image quality. Titanium rod surfaces may have oxide layers, scratches, oil stains, etc., at different processing stages, altering the intensity of reflected light. Uneven illumination is particularly common when the surface is contaminated or irregular, severely affecting image contrast and clarity, ultimately reducing defect detection accuracy. Furthermore, during image acquisition, imprecise control of the relative position and angle between the titanium rod's cross-section and the camera makes it difficult to accurately reflect the true condition of the cross-section. Especially when the titanium rod surface is uneven or reflective, errors can easily occur, causing defects to be obscured or distorted, thus affecting the accuracy of the detection results.
[0003] In summary, the existing technology suffers from low defect detection accuracy due to the unstable quality of titanium rod cross-section image acquisition and surface condition. Summary of the Invention
[0004] The purpose of this application is to provide an adaptive defect detection method, platform, and medium for titanium rod cross-sections, in order to solve the technical problem in the prior art where the defect detection accuracy is low due to the unstable image acquisition quality and surface condition of titanium rod cross-sections.
[0005] In view of the above problems, this application provides an adaptive defect detection method, platform and medium for titanium rod cross-sections.
[0006] Firstly, this application provides an adaptive defect detection method for titanium rod cross-sections. This method is implemented through an adaptive defect detection platform for titanium rod cross-sections. The method includes: constructing a titanium rod visual inspection platform, which comprises a linear CCD camera, a backlight source, and a servo motion device; fixing a target titanium rod on the servo motion device and controlling its movement so that the imaging optical axes of the linear CCD camera and the backlight source are perpendicular to the cross-section of the target titanium rod, and acquiring cross-section image data; performing defect identification and clustering on the cross-section image data according to a standard template for titanium rod cross-sections to obtain N cross-section defect type clusters, where N is a positive integer; constructing a multi-channel cross-section defect detection system; performing channel matching activation and defect feature detection on the N cross-section defect type clusters based on the multi-channel cross-section defect detection system to obtain N cross-section defect feature sets; and performing defect quantification evaluation based on the N cross-section defect feature sets to generate titanium rod cross-section defect detection results.
[0007] Optionally, the linear CCD camera and backlight source are activated to pre-acquire images of the target titanium rod, obtaining a test image of the titanium rod's cross-section; based on the test image of the titanium rod's cross-section, the optical axis of the linear CCD camera and backlight source is evaluated and calibrated to obtain a standard machine vision imaging system; motion analysis is performed on the structural shape and detection requirements of the target titanium rod to determine the preset motion parameters of the titanium rod, including the titanium rod's motion trajectory and motion speed; the servo motion device is activated to control the target titanium rod to move according to the preset motion parameters, so that the imaging optical axis of the standard machine vision imaging system is perpendicular to the cross-section of the target titanium rod while simultaneously acquiring cross-section image data of the titanium rod.
[0008] Optionally, contour recognition is performed on the titanium rod cross-section test image, and optical axis perpendicularity is evaluated based on the cross-section contour recognition result to obtain optical axis test perpendicularity; optical axis calibration is performed on the linear CCD camera and backlight source based on the optical axis test perpendicularity until the optical axis test perpendicularity is less than a preset deviation threshold, thus obtaining a usable machine vision imaging system; the quality of the titanium rod cross-section test image is compared and evaluated according to the titanium rod cross-section imaging quality standard to obtain cross-section imaging quality parameters to be optimized; based on the cross-section imaging quality parameters to be optimized, the equipment application parameters of the usable machine vision imaging system are tuned to obtain the standard machine vision imaging system.
[0009] Optionally, an image filter is initialized based on the noise characteristics of the titanium rod cross-section image data; the image filter is used to preprocess the titanium rod cross-section image data to generate usable titanium rod cross-section image data; an image twin network is constructed, and the similarity between the titanium rod cross-section standard template and the usable titanium rod cross-section image data is compared through the image twin network to obtain titanium rod defect region data; a cross-section defect type label library is collected, and the defect feature clustering of the titanium rod defect region data is performed according to the cross-section defect type label library to obtain N cross-section defect type clusters.
[0010] Optionally, based on the image twin network, a template twin sub-network and a detection twin sub-network are obtained, wherein the template twin sub-network and the detection twin sub-network are shared weight networks; based on the template twin sub-network and the detection twin sub-network, features are extracted from the standard template of the titanium rod cross-section and the image data of the usable titanium rod cross-section, respectively, to obtain a template cross-section feature set and a detection cross-section feature set; similarity comparison and loss analysis are performed on the template cross-section feature set and the detection cross-section feature set to output a cross-section feature loss dataset; based on the cross-section feature loss dataset, defect region feature labeling is performed to obtain the defect region data of the titanium rod.
[0011] Optionally, visual feature analysis is performed on each defect type in the cross-section defect type label library to determine the significant features of the multi-cross-section defect type; a multi-defect type model architecture is selected based on the significant features of the multi-cross-section defect type; association data mining is performed based on the significant features of the multi-cross-section defect type to obtain a multi-defect type feature dataset; and channel training and merging are performed on the multi-defect type feature dataset based on the multi-defect type model architecture to obtain a multi-channel cross-section defect detection.
[0012] Optionally, defect detection training is performed on the multi-defect type feature dataset based on the multi-defect type model architecture to obtain a multi-defect feature detection channel set; the multi-defect feature detection channel set is validated, optimized, and the channels are connected in parallel to obtain a multi-channel for cross-section defect detection, wherein the multi-channel for cross-section defect detection includes a texture defect detection channel, a color defect detection channel, a shape defect detection channel, and a depth defect detection channel.
[0013] Optionally, a cross-section defect evaluation index system is established, and the defects of the N cross-sections belonging to the same defect feature set are quantitatively evaluated according to the cross-section defect evaluation index system to obtain N cross-section defect index quantitative parameters; the cross-section defect evaluation index system is weighted according to the application target of the titanium rod to determine the dynamic weight factor of the cross-section index; the N cross-section defect index quantitative parameters are weighted and summed based on the dynamic weight factor of the cross-section index to generate the cross-section defect detection result of the titanium rod.
[0014] Secondly, this application also provides an adaptive defect detection platform for titanium rod cross-sections, used to execute the adaptive defect detection method for titanium rod cross-sections as described in the first aspect. The adaptive defect detection platform for titanium rod cross-sections includes: a detection platform construction module for building a titanium rod visual inspection platform, which comprises a linear CCD camera, a backlight source, and a servo motion device; and a cross-section image acquisition module for fixing the target titanium rod on the servo motion device for movement control, such that the imaging optical axes of the linear CCD camera and the backlight source are perpendicular to the target titanium rod. The system collects cross-sectional image data of titanium rods; a defect identification and clustering module is used to perform defect identification and clustering on the cross-sectional image data of titanium rods according to the standard template of titanium rod cross-sections to obtain N cross-sectional defect type clusters, where N is a positive integer; a defect feature detection module is used to construct a multi-channel for cross-sectional defect detection, and perform channel matching activation and defect feature detection on the N cross-sectional defect type clusters based on the multi-channel for cross-sectional defect detection to obtain N cross-sectional defect feature sets; a defect quantification and evaluation module is used to perform defect quantification and evaluation based on the N cross-sectional defect feature sets to generate titanium rod cross-sectional defect detection results.
[0015] Thirdly, a computer-readable storage medium storing a computer program that, when executed, implements the steps of the adaptive defect detection method for titanium rod cross-sections as described in any of the first aspects above.
[0016] One or more technical solutions provided in this application have at least the following beneficial effects:
[0017] A titanium rod visual inspection platform was constructed, consisting of a linear CCD camera, a backlight source, and a servo motion device. The target titanium rod was fixed on the servo motion device and its movement was controlled so that the imaging optical axes of the linear CCD camera and the backlight source were perpendicular to the cross-section of the target titanium rod, and cross-section image data was acquired. Defect identification and clustering were performed on the cross-section image data according to a standard template for titanium rod cross-sections, resulting in N cross-section defect type clusters, where N is a positive integer. A multi-channel cross-section defect detection system was constructed, and channel matching activation and defect feature detection were performed on the N cross-section defect type clusters based on these multi-channels, resulting in N cross-section defect feature sets. Defect quantification and evaluation were performed based on the N cross-section defect feature sets to generate titanium rod cross-section defect detection results. In other words, by building a titanium rod visual inspection platform to collect titanium rod cross-sectional image data, using standard templates for titanium rod cross-sections to perform defect identification and clustering, performing defect feature detection based on multi-channel cross-section defect detection, and performing defect quantification evaluation on N cross-sections belonging to the same defect feature set, the titanium rod cross-section defect detection results are obtained, thus improving the accuracy and efficiency of titanium rod cross-section defect detection.
[0018] The above description is merely an overview of the technical solution of this application. To better understand the technical means of this application and to facilitate its implementation according to the description, and to make the above and other objects, features, and advantages of this application more apparent, specific embodiments of this application are described below. It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent through the following description. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating the adaptive defect detection method for titanium rod cross-sections proposed in this application.
[0020] Figure 2 This is a schematic diagram of the adaptive defect detection platform for titanium rod cross-sections in this application.
[0021] Figure labeling: Detection platform construction module 11, cross-sectional image acquisition module 12, defect identification and clustering module 13, defect feature detection module 14, defect quantitative evaluation module 15. Detailed Implementation
[0022] This application provides an adaptive defect detection method, platform, and medium for titanium rod cross-sections, solving the technical problem of low defect detection accuracy in existing technologies due to unstable image acquisition quality and surface conditions of titanium rod cross-sections. By building a titanium rod visual inspection platform to acquire titanium rod cross-section image data, performing defect identification and clustering using standard titanium rod cross-section templates, conducting multi-channel defect feature detection based on cross-section defects, and performing defect quantification evaluation on N cross-sections belonging to the same defect feature set, the application obtains the titanium rod cross-section defect detection results, thus improving the accuracy and efficiency of titanium rod cross-section defect detection.
[0023] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. It should be understood that this application is not limited to the exemplary embodiments described herein. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application. It should also be noted that, for ease of description, only the parts related to this application are shown in the accompanying drawings, not all of them.
[0024] Example 1, please refer to the appendix. Figure 1 This application provides an adaptive defect detection method for titanium rod cross-sections, wherein the adaptive defect detection method for titanium rod cross-sections is executed through an adaptive defect detection platform for titanium rod cross-sections, and the adaptive defect detection method for titanium rod cross-sections specifically includes the following steps:
[0025] A visual inspection platform for titanium rods was constructed, which consists of a linear CCD camera, a backlight source, and a servo motion device.
[0026] Specifically, the titanium rod vision inspection platform is an equipment platform used for automated visual inspection of titanium rod surfaces. Combining machine vision with defect identification, it is widely used in the quality control stages of titanium rod production lines. The platform uses high-precision image acquisition and analysis to monitor and judge defects on the titanium rod surface in real time. A CCD is an image sensor that converts light signals into electrical signals. A linear CCD camera uses a linear array (rather than a traditional two-dimensional matrix array) image sensor, capable of scanning images line by line, making it particularly suitable for detecting surface defects on strip-shaped objects (such as titanium rods). A backlight source is a light source that illuminates an object from behind. In titanium rod inspection, the backlight source is usually located behind the cut surface of the titanium rod, providing uniform illumination and making defects on the cut surface more apparent, especially for surface defects such as small cracks or pores. The backlight source enhances the edge contrast of the object, aiding in the extraction of defect features. A servo motion device is a high-precision mechanical device, typically composed of a servo motor and control system, capable of precise position control of the titanium rod, allowing it to move along a predetermined trajectory or angle during inspection, ensuring the quality and accuracy of image acquisition.
[0027] A linear CCD camera captures clear image data by scanning the cross-sections of a titanium rod line by line. Since the cross-sections of titanium rods are typically long and uniform, a linear CCD camera can stably provide high-quality images in high-speed production lines while maintaining inspection speed. A backlight source is located on the back of the titanium rod's cross-sections, ensuring uniform and stable illumination of the surface during imaging. Because the titanium rod surface may have varying reflectivity, the backlight source effectively enhances the contrast of surface defects, helping the camera capture details such as minute cracks, pores, or surface scratches. The brightness of the backlight source should be adjusted according to the reflectivity of the titanium rod surface, with a commonly used brightness range of 50,000 to 80,000 lux. A servo motion device precisely controls the movement of the titanium rod along any of the X, Y, and Z axes during inspection, ensuring that each cross-section is aligned with the camera's imaging optical axis. Through feedback control, the servo motion device achieves precise positioning of 0.01 mm, ensuring the stability of the image acquisition angle and position, and avoiding image distortion caused by inaccurate camera positioning or motion errors.
[0028] A servo motion device ensures that the titanium rod remains within the camera's imaging range throughout its movement, maintaining the rod's cross-section perpendicular to the camera's optical axis. The rod typically moves along the X-axis (or Z-axis), with an accuracy of 0.01mm per movement, ensuring precise alignment of each cross-section for imaging. When the cross-section reaches the camera's imaging area, the linear CCD camera begins scanning the cross-section line by line. The camera electronically converts the light signals on the cross-section into electrical signals and outputs image data. The linear CCD camera has a resolution of 4096 pixels, scanning to a resolution of 0.03mm per image acquisition, ensuring the capture of minute defects. Image acquisition speeds can reach 30 frames per second, enabling rapid inspection on high-speed production lines. A backlight source is located behind the cross-section, providing uniform illumination. The brightness of the backlight source is precisely calculated based on the rod's diameter, optical path, and inspection accuracy requirements. This uniform illumination from the backlight source makes the contours of surface defects clearer. For example, if there are tiny cracks on the cut surface of a titanium rod, backlighting can make the edges of the cracks more visible, thereby improving the accuracy of defect identification.
[0029] For example, assuming a titanium rod is 500mm long and 50mm wide, its surface may have some tiny cracks or pores, resulting in uneven surface quality. A linear CCD camera with a resolution of 4096 pixels, a scanning interval of 0.02mm, and a line frequency of 12.5kHz operates in continuous scanning mode. A 120W blue LED backlight provides a uniform illumination of 60,000 lux, ensuring good contrast in the titanium rod cross-section image and effectively suppressing surface reflection. The servo motion device has an accuracy of 0.01mm and a repeatability of ±1μm, ensuring the titanium rod is accurately aligned with the camera's optical axis throughout the inspection process. The titanium rod passes continuously and uniformly through the inspection area at a speed of 500mm / s; scanning a 500mm long titanium rod takes only 1 second. The entire production line operates at a speed of 40 titanium rods per minute. The inspection time for each titanium rod is approximately 1.5 seconds. After image acquisition, defect identification and classification are automatically performed, and the defect detection results are output. The test results show that the titanium rod visual inspection platform can detect microcracks with a width greater than 0.08 mm and pores with a diameter greater than 0.12 mm, and effectively eliminates misjudgments caused by uneven lighting and irregularities on the surface of the titanium rod.
[0030] The titanium rod visual inspection platform combines a high-resolution linear CCD camera, a stable backlight source, and a servo motion device to achieve high-precision image acquisition and defect identification. Thanks to the high-precision control of the servo motion device, the titanium rod's cross-section can be accurately aligned with the camera's optical axis, avoiding the influence of positioning errors and improving the accuracy of defect detection.
[0031] The target titanium rod is fixed on the servo motion device for movement control, so that the imaging optical axis of the linear CCD camera and the backlight source is perpendicular to the cross-section of the target titanium rod and the cross-section image data of the titanium rod is acquired.
[0032] Furthermore, this application also includes the following steps:
[0033] The linear CCD camera and backlight source are activated to pre-acquire images of the target titanium rod, obtaining a test image of the titanium rod's cross-section. Based on the test image of the titanium rod's cross-section, the optical axis of the linear CCD camera and backlight source is evaluated and calibrated to obtain a standard machine vision imaging system. The structural shape and detection requirements of the target titanium rod are analyzed to determine the preset motion parameters of the titanium rod, including the titanium rod's motion trajectory and motion speed. The servo motion device is activated to control the target titanium rod to move according to the preset motion parameters, so that the imaging optical axis of the standard machine vision imaging system is perpendicular to the cross-section of the target titanium rod while simultaneously acquiring cross-section image data of the titanium rod.
[0034] Furthermore, this application also includes the following steps:
[0035] The titanium rod cross-section test image is subjected to contour recognition, and the optical axis perpendicularity is evaluated based on the cross-section contour recognition result to obtain the optical axis test perpendicularity. Based on the optical axis test perpendicularity, the optical axis of the linear CCD camera and the backlight source is calibrated until the optical axis test perpendicularity is less than a preset deviation threshold, thus obtaining a usable machine vision imaging system. The titanium rod cross-section test image is compared and evaluated according to the titanium rod cross-section imaging quality standard to obtain the cross-section imaging quality parameters to be optimized. Based on the cross-section imaging quality parameters to be optimized, the equipment application parameters of the usable machine vision imaging system are tuned to obtain the standard machine vision imaging system.
[0036] Specifically, the target titanium rod is fixed to a servo motion device to ensure that it does not shift during subsequent movement. After fixing, the titanium rod undergoes preliminary image acquisition under illumination and camera conditions. This involves activating a linear CCD camera and backlight source to pre-acquire images of the titanium rod's cross-section and perform optical axis evaluation and calibration. The linear CCD camera and backlight source are then activated, with the backlight source uniformly illuminating the cross-section of the titanium rod. The linear CCD camera acquires image data of the titanium rod's cross-section through line-by-line scanning, obtaining a preliminary image of the cross-section. The linear CCD camera acquires images of the titanium rod's cross-section through line-by-line scanning. Each scan covers a specific area, with a typical scan interval of 0.02 mm, ensuring that each pixel in the image clearly reflects the details of the titanium rod's cross-section. During image acquisition, the backlight source is positioned behind the titanium rod's cross-section, uniformly illuminating the entire cross-section. The purpose of the backlight source is to improve the contrast of the titanium rod's cross-section image, ensuring that even minor defects (such as cracks and pores) are clearly displayed. During this process, the brightness of the backlight source is usually set to 60,000 lux, which helps to ensure that the fine structures on the surface of the titanium rod (such as cracks, pores, etc.) can be clearly contrasted in the image.
[0037] The titanium rod cross-section test image is a preliminary image acquired for evaluating and calibrating the camera and light source. Contour recognition is performed on the titanium rod cross-section test image using image processing algorithms (such as Canny edge detection or Hough transform) to extract the outer contour of the titanium rod cross-section. Contour recognition refers to analyzing and extracting the edges or contours of objects in an image using image processing algorithms. The titanium rod cross-section test image is preprocessed to enhance image quality using common image preprocessing methods such as grayscale conversion, noise reduction, and contrast enhancement to remove noise and improve edge sharpness. Edge detection algorithms (such as Canny edge detection) are used to extract edge information from the image. Edge detection algorithms identify the edge between the titanium rod cross-section and the background by calculating the gradient of brightness changes in the image. The outer contour of the titanium rod is extracted using Hough transform, identifying the closed boundary of the titanium rod cross-section and obtaining its contour data.
[0038] In the image of a titanium rod cross-section, the goal of contour recognition is to extract the edge information of the cross-section to determine the angular relationship between the cross-section and the optical axis. Based on the contour recognition results, the perpendicularity of the optical axis is evaluated by analyzing the position and shape of the titanium rod cross-section in the image to determine the angle between the imaging optical axis and the cross-section. Ideally, the optical axis should be completely perpendicular to the titanium rod cross-section (angle of 0°). Specifically, based on the contour recognition results, the geometric center of the titanium rod cross-section test image is calculated by performing geometric calculations on the extracted contour, for example, using the minimum bounding rectangle or minimum bounding circle of the contour to find its centroid. The extracted contour data is then fitted using methods such as least squares. For the titanium rod cross-section, assuming it is circular or elliptical, the contour is fitted with a circle or ellipse using least squares to obtain an ideal cross-section shape. The geometric morphology of the titanium rod cross-section is described by the fitted cross-section parameters (such as the major axis, minor axis, and rotation angle of the ellipse). The perpendicularity of the optical axis is evaluated by calculating the angle between the fitted result and the imaging optical axis in the image. This is done by calculating the ratio of the product of the fitted normal vector and the unit vector of the optical axis to the magnitude of the fitted normal vector and the unit vector of the optical axis, and then performing an inverse cosine calculation on the ratio. If the imaging optical axis is perpendicular to the titanium rod's cross-section, the rotation angle between the optical axis and the fitted result should be close to 0°.
[0039] Optical axis perpendicularity assessment involves analyzing the angular relationship between the cross-section of the titanium rod in the image and the imaging optical axis, calculating the angle between the optical axis and the cross-section, and thus obtaining the optical axis perpendicularity test. For example, the edge of the cross-section in the image is extracted using Canny edge detection, and the outline of the titanium rod's cross-section is identified using Hough transform, revealing that the cross-section is elliptical with a major axis of 48 mm and a minor axis of 49 mm. Least squares fitting yields an angle of 0.4° between the direction of the major axis and the imaging optical axis, indicating an optical axis perpendicularity test of 0.4°.
[0040] If the tested perpendicularity exceeds a preset deviation threshold, adjustments need to be made to the linear CCD camera and backlight source to ensure the optical axis is as accurately perpendicular as possible to the titanium rod's cross-section. By adjusting the angles or positions of the camera and light source until the optical axis tested perpendicularity is less than the preset deviation threshold, a usable machine vision imaging system is obtained. Optical axis calibration involves adjusting the position and angle of the camera and light source to ensure the image's optical axis is precisely perpendicular to the target titanium rod's cross-section. The goal of calibration is to eliminate imaging errors as much as possible and improve image quality, especially in terms of detection accuracy. The installation angle of the linear CCD camera is finely adjusted to ensure its optical axis is perpendicular to the titanium rod's cross-section; simultaneously, the angle and position of the backlight source are adjusted to ensure the illumination angle of the light source is consistent with the titanium rod's cross-section, avoiding shadows or overexposure caused by inappropriate light source angles. After each adjustment, the change in optical axis perpendicularity is monitored in real-time via the image until the tested perpendicularity is less than the preset deviation threshold. Once the tested perpendicularity is less than the preset deviation threshold, it indicates that the optical axes of the linear CCD camera and backlight source are precisely perpendicular to the titanium rod's cross-section, and the optical axis calibration is successful. The resulting system is a usable machine vision imaging system.
[0041] The quality of titanium rod cross-section imaging images is evaluated through comparison according to the titanium rod cross-section imaging quality standards. These standards are a series of criteria established to ensure image quality meets requirements during titanium rod inspection, including image resolution, contrast, noise level, and defect identifiability. The pixel density of the titanium rod cross-section test images is calculated to assess whether the image resolution meets requirements. Contrast calculation algorithms (such as the standard deviation method) are used to evaluate the contrast of the titanium rod cross-section test images; if the contrast is too low, defects are difficult to identify. Noise measurement algorithms (such as calculating the noise variance of the image) are used to evaluate the noise level in the titanium rod cross-section test images; if the noise is too high, it may cause image distortion and affect defect identification. The brightness distribution of the titanium rod cross-section test images is analyzed to detect the presence of uneven lighting areas, such as shadows or overexposure.
[0042] Based on the quality comparison and evaluation results, the cross-sectional imaging quality parameters that need optimization are identified, i.e., the cross-sectional imaging quality parameters to be optimized. For example, if the image contrast is lower than the standard requirement, or the image noise level exceeds the set range, these are cross-sectional imaging quality parameters to be optimized. Based on these parameters, the parameters of the available machine vision imaging system, such as the linear CCD camera and backlight source, are adjusted. This includes increasing camera resolution, adjusting light source brightness, and reducing image noise, thereby optimizing image quality and ensuring the final image meets the standard. After parameter tuning, the image quality is evaluated again to ensure it meets the set standard.
[0043] After optical axis calibration and equipment optimization, a standard machine vision imaging system is finally obtained, which can provide high-quality images of titanium rod cross-sections, meeting requirements for image clarity, contrast, and resolution, for subsequent defect detection. For example, without changing the line frequency (i.e., without reducing the scanning speed), adjusting the exposure parameters and increasing the light source brightness (from 80% to 90%) significantly improves image contrast and clarity.
[0044] Motion analysis is performed on the target titanium rod's structural shape and inspection requirements. This involves analyzing the target titanium rod's geometric shape and dimensional characteristics, and calculating the motion parameters of the titanium rod during the inspection process, based on the specific inspection requirements. The structural shape of the titanium rod refers to its physical dimensions, shape, and surface features. Generally, the length, diameter, and parameters such as the flatness and roundness of the cross-section are all part of its structural shape. The inspection requirements of the titanium rod refer to the targets and standards that need to be considered during the inspection process. The preset motion parameters of the titanium rod refer to the control parameters, such as the titanium rod's motion trajectory and speed, set in advance to achieve efficient and accurate visual inspection. The titanium rod's motion trajectory is the path along which the titanium rod moves under the control of a servo motion device, such as a straight line or a curve, determining the direction and path of movement. The titanium rod's motion speed refers to the rate at which the titanium rod moves along the motion trajectory, avoiding speeds that are too slow or too fast. For example, the titanium rod has a diameter of 50mm, a length of 500mm, and a cross-sectional width of 50mm. The detection target is the tiny cracks and pores on the cross-section of the titanium rod. The preset motion parameters include: the titanium rod needs to be translated along the X-axis, with each movement step being 0.01mm, and the motion speed is set to 500mm / s.
[0045] The servo motion device is activated, and the preset motion parameters of the titanium rod are input to precisely control its movement. During each movement, the position of the titanium rod is adjusted according to the preset trajectory, keeping the cut surface perpendicular to the camera's optical axis. For example, if the titanium rod moves at a speed of 500 mm / s during inspection, then each 1 mm movement takes 2 ms. A backlight source provides uniform illumination, ensuring that the titanium rod's cut surface is free of shadows or overexposure during imaging, guaranteeing image contrast and clarity. When the titanium rod's cut surface passes through the imaging area, the linear CCD camera is activated, beginning to scan the titanium rod's cut surface line by line to acquire image data. Throughout the process, the servo motion device continuously adjusts the position of the titanium rod, ensuring that each cut surface is perpendicular to the imaging optical axis.
[0046] Through precise optical axis calibration and servo motion control, the cross-section of the titanium rod is ensured to be perpendicular to the imaging optical axis, avoiding image distortion or blurring caused by misalignment and guaranteeing image clarity. Based on the structural shape of the titanium rod and the inspection requirements, a reasonable motion trajectory and speed are preset, enabling effective acquisition of each cross-section and ensuring the detection accuracy of minute defects (such as microcracks and pores). The servo motion device precisely controls the movement of the titanium rod, significantly reducing the inspection time for each rod.
[0047] Defect identification and clustering are performed on the titanium rod cross-section image data according to the standard template of titanium rod cross-section to obtain N cross-section defect type clusters, where N is a positive integer.
[0048] Furthermore, this application also includes the following steps:
[0049] Based on the noise characteristics of the titanium rod cross-section image data, an image filter is initialized; the image filter is used to preprocess the titanium rod cross-section image data to generate usable titanium rod cross-section image data; an image twin network is constructed, and the similarity between the titanium rod cross-section standard template and the usable titanium rod cross-section image data is compared through the image twin network to obtain titanium rod defect region data; a cross-section defect type label library is collected, and the defect region data of the titanium rod is clustered according to the cross-section defect type label library to obtain N cross-section defect type clusters.
[0050] Furthermore, this application also includes the following steps:
[0051] Based on the image twin network, a template twin subnetwork and a detection twin subnetwork are obtained, wherein the template twin subnetwork and the detection twin subnetwork are shared weight networks. Based on the template twin subnetwork and the detection twin subnetwork, features are extracted from the standard template of the titanium rod cross-section and the image data of the usable titanium rod cross-section, respectively, to obtain a template cross-section feature set and a detection cross-section feature set. Similarity comparison and loss analysis are performed on the template cross-section feature set and the detection cross-section feature set to output a cross-section feature loss dataset. Based on the cross-section feature loss dataset, defect region feature labeling is performed to obtain the defect region data of the titanium rod.
[0052] Specifically, the noise characteristics of the titanium rod cross-section image data are obtained, i.e., the noise in the titanium rod cross-section image data caused by various factors (such as environmental interference, equipment noise, uneven lighting, etc.). Based on the noise characteristics of the titanium rod cross-section image data (such as noise intensity and type), an appropriate image filter is selected. For example, if the noise type of the titanium rod cross-section image data is Gaussian noise with a standard deviation of 2, a Gaussian filter with a kernel size of 5x5 is selected to remove the noise. The initialized image filter is used to filter the original titanium rod cross-section image data. For example, assuming the image resolution is 4096 pixels and the noise intensity of the original image is 5%, using a Gaussian filter effectively removes the noise from the titanium rod cross-section image data, making the image smoother and preserving details well. After filtering, the noise intensity is reduced to 1%, and the image becomes clearer.
[0053] The image obtained after filtering preprocessing is the usable titanium rod cross-section image data, i.e., the titanium rod cross-section image data after noise removal. An image twin network is constructed, consisting of two identical convolutional neural networks: a template twin sub-network and a detection twin sub-network. The template twin sub-network and the detection twin sub-network share weights and are used to process the standard titanium rod cross-section template and the usable titanium rod cross-section image data, respectively. The standard titanium rod cross-section template is a predefined image of a defect-free titanium rod cross-section, serving as a comparison benchmark. Through the shared weight design, the template twin sub-network and the detection twin sub-network use the same neural network structure and parameters. The template twin sub-network processes the standard titanium rod cross-section template, while the detection twin sub-network processes the actually acquired usable titanium rod cross-section image data. The goal of both is to identify the differences between them by comparing their features.
[0054] During training, the template twin network and the detection twin network use the same parameters (i.e., weights). This means that whether processing template or detection images, each layer of the network (such as convolutional layers, fully connected layers, etc.) uses the same weights. By sharing weights, the twin network can learn the similarity between images, reducing the number of parameters and thus improving the model's efficiency and generalization ability.
[0055] The template twin sub-network extracts features from a standard titanium rod cross-section template image, including shape, texture, and edge information, to represent the structure of the standard image. The template cross-section feature set is a set of features extracted from the standard titanium rod cross-section template image, used to describe the morphological features of the standard titanium rod cross-section, such as texture, shape, and edges. The detection twin sub-network extracts features from available titanium rod cross-section image data; these features are compared with the features of the template image to help identify differences between the images. The detection cross-section feature set is a set of features extracted from actual detected titanium rod cross-section images, used to describe the details of the titanium rod surface, and compared with the standard titanium rod cross-section template features.
[0056] The similarity between the template cross-sectional feature set and the detected cross-sectional feature set is measured by calculating similarity (such as Euclidean distance, cosine similarity, etc.). Cosine similarity is used as the similarity metric, calculating the cosine of the angle between each feature in the template and detected cross-sectional feature sets. The cosine similarity value ranges from -1 to 1; the closer the value is to 1, the more similar the two feature vectors are. A loss function is used to analyze the similarity difference. By comparing the distance difference between positive and negative sample pairs, a difference metric between the template and detected cross-sectional feature sets is obtained. A larger loss value indicates a greater difference between the template and detected cross-sectional feature sets, meaning a more obvious defect in the available titanium rod cross-sectional image data. The cross-sectional feature loss dataset contains the loss value for each image region, reflecting the location and size of the defect region in the image. The location of the defect region is determined by associating the cross-sectional feature loss dataset with the pixel coordinates of the available titanium rod cross-sectional image data.
[0057] Based on the cross-sectional feature loss dataset, defect region features are labeled, and the defect region data of the titanium rod is output, including the location, type (such as cracks, pores, etc.) and size of the defects. For example, the similarity between the template cross-sectional feature set and the detected cross-sectional feature set is 0.85. The difference is calculated by the loss function, and the result is 0.15, identifying a crack with a width of 0.08 mm, and this region is marked as a defect.
[0058] Various types of titanium rod surface defects were collected and labeled to construct a surface defect type label library. This library is a dataset containing different defect types and their corresponding labels. Each label represents a type of titanium rod surface defect, such as cracks, porosity, or surface scratches. Based on the titanium rod defect region data, the surface defect type label library was traversed to determine the defect type corresponding to each defect region. Cluster analysis was performed based on the identified defect types of each region, grouping regions of the same type together. An expected number of clusters, N, was set, and then defect region data were assigned to appropriate clusters by minimizing the distance within each cluster. After each iteration, the cluster centroids were updated to optimize the clustering results. For example, if multiple cracks and porosity were detected, after clustering, cracks might be grouped into one cluster, while porosity might be grouped into another. Each cluster contains multiple defects with similar characteristics.
[0059] Clustering algorithms yield N clusters of cross-sectional defect types. Each cluster represents a defect type, with defects sharing similar shapes, sizes, or other characteristics. Filtering effectively removes noise from the image, improving image quality. Image twinning networks are used for similarity comparison to accurately identify parts inconsistent with the standard template, thus efficiently recognizing defect regions. Clustering analysis groups similar defect features together, enhancing the accuracy of defect identification.
[0060] A multi-channel for detecting surface defects is constructed. Based on the multi-channel for detecting surface defects, channel matching activation and defect feature detection are performed on the N clusters of surface defect types to obtain N sets of defect features belonging to the same category.
[0061] Furthermore, this application also includes the following steps:
[0062] Visual feature analysis is performed on each defect type in the cross-section defect type label library to determine the significant features of the multi-cross-section defect type; a multi-defect type model architecture is selected based on the significant features of the multi-cross-section defect type; association data mining is performed based on the significant features of the multi-cross-section defect type to obtain a multi-defect type feature dataset; channel training and merging are performed on the multi-defect type feature dataset based on the multi-defect type model architecture to obtain a multi-channel cross-section defect detection.
[0063] Furthermore, this application also includes the following steps:
[0064] Based on the multi-defect type model architecture, defect detection training is performed on the multi-defect type feature dataset to obtain a multi-defect feature detection channel set; the multi-defect feature detection channel set is validated, optimized, and the channels are connected in parallel to obtain a multi-channel for cross-section defect detection, which includes a texture defect detection channel, a color defect detection channel, a shape defect detection channel, and a depth defect detection channel.
[0065] Specifically, visual feature analysis is performed on each defect type in the cross-sectional defect type label library to extract and analyze key features that describe the defect type. Different types of defects typically have different visual features, and analyzing these features helps to distinguish and detect various defects. Through image analysis, significant visual features of different defect types are extracted. For example, cracks and scratches are usually linear defects, relying on edge and gradient features in the image, and edge detection algorithms (such as Canny edge detection) are used to extract these features; pores and inclusions are usually geometric, relying on contour and area features, and are extracted using contour detection algorithms (such as edge tracking and Hough transform); color anomalies such as oxidation and corrosion cause abnormal color distribution in the image, usually relying on RGB color features or color distribution features, and are extracted using methods such as color histogram analysis and color space conversion.
[0066] The salient features of multi-faceted defect types refer to the differentiated and easily identifiable features that effectively distinguish different defect types. Based on these salient features, a multi-defect type model architecture is selected. For example, for linear defects, a lightweight convolutional neural network is used, which is suitable for processing edge and gradient features and can efficiently extract detailed information from images. For geometric defects such as pores and inclusions, a target detection model, such as YOLOv8, is selected, which can accurately locate and identify target defects in images, and is particularly suitable for circular or irregularly shaped defects. For color aberration defects, a color histogram classifier (such as SVM or random forest) is selected, which performs color classification and anomaly detection based on features such as RGB values and HSV color space.
[0067] Based on the significant characteristics of multi-faceted defect types, representative features of each defect type are extracted using data mining techniques (such as clustering and feature selection). The multi-defect type feature dataset is a collection of data extracted from titanium rod cross-section images for training and testing, containing representative defect features of different types. Association data mining is a process of discovering potential patterns and regularities by analyzing the correlations between data. It involves analyzing the relationships between different defect features to find patterns in their occurrence under specific conditions. The feature correlations between defect types are analyzed from the significant characteristics of multi-faceted defect types in the US dataset to discover which features have strong correlations with certain defect types. For example, there is a strong correlation between cracks and edge features, and between pores and contour features. Clustering algorithms are used to group similar defect features into one category, thereby finding feature patterns of multiple defect types within the dataset. During the mining process, some redundant or irrelevant features may be found. Principal component analysis is used to remove irrelevant features to improve the training efficiency and performance of the model. Based on the association results obtained from data mining, a dataset containing multiple defect types and related features is constructed, including multi-dimensional features of different defect types, such as edge features of cracks, contour features of pores, and color distribution features of oxidation.
[0068] A mapping was established between the multi-defect type feature dataset and the multi-defect type model architecture to obtain the defect type feature dataset corresponding to each defect type model architecture. The multi-defect type feature dataset was normalized, scaling pixel values to the [0,1] range, and data augmentation (such as rotation, flipping, scaling, etc.) was performed to enhance the model's generalization ability. The multi-defect type feature dataset was divided into multiple training sets and multiple validation sets. Multiple training sets were input into the corresponding multi-defect type model architecture for training. During training, the backpropagation algorithm was used to adjust the weight parameters of each channel, optimizing the network to better identify the features of different defects. After model training, multiple validation sets were used to evaluate the multi-defect type model architecture. The purpose of the validation sets was to test the model's performance on unseen data, ensuring its strong generalization ability. Based on the evaluation results of the validation sets, hyperparameter tuning (such as learning rate, batch size, etc.) and model architecture optimization were performed. Through tuning, the model's performance on different defect types was further improved.
[0069] Each detection channel (texture, color, shape, depth, etc.) operates independently, but they process the input data in parallel and output the corresponding defect features. Channel parallelization refers to connecting different types of defect detection channels (such as texture defect detection channels, color defect detection channels, shape defect detection channels, and depth defect detection channels) in parallel within the model structure. The multi-channel cross-sectional defect detection includes texture defect detection channels, color defect detection channels, shape defect detection channels, and depth defect detection channels, each used to detect corresponding defects, namely texture, color, shape, and depth.
[0070] The texture defect detection channel specifically detects texture anomalies (such as cracks or scratches), the color defect detection channel is responsible for identifying color changes (such as oxidation, corrosion, etc.), the shape defect detection channel focuses on geometric anomalies (such as pores, inclusions, etc.), and the depth defect detection channel focuses on the depth information of defects (e.g., the impact of defect depth changes on detection). Based on the multi-channel cross-sectional defect detection, channel matching activation is performed on N clusters of cross-sectional defect types. That is, the N defect type clusters obtained through clustering analysis are matched with the multi-channel cross-sectional defect detection. Each defect type cluster activates the corresponding detection channel based on its characteristics (such as texture, color, shape, depth, etc.). For example, if a defect cluster is mainly composed of cracks, the texture defect detection channel is activated; if a defect cluster is mainly composed of oxidized regions, the color defect detection channel is activated.
[0071] After activation, N corresponding defect detection channels perform detailed analysis and feature extraction on N cross-sectional defect type clusters. The texture defect detection channel extracts crack edge information, crack length, width, etc.; the color defect detection channel identifies color changes in the oxidation area, extracting features such as hue, saturation, and brightness; the shape defect detection channel identifies features such as the shape, area, and roundness of pores; and the depth defect detection channel identifies depth changes, extracting the depth data of the defects. Each defect type cluster, after passing through its corresponding detection channel, yields a set of feature data containing different dimensions of features (such as texture, color, shape, and depth). The N cross-sections belonging to the same defect feature set include defect features obtained through multi-channel detection, representing the defect regions in the titanium rod cross-section image. Each cross-sectional defect type cluster obtains multi-dimensional defect information through different channel detections. For example, activating the texture defect detection channel for cluster 1 (crack region) successfully identified the crack, extracting a crack length of 5 mm and a width of 0.2 mm; activating the shape defect detection channel for cluster 2 (pore region) successfully identified the pore, with a pore diameter of 1.2 mm and an area of 1.13 mm². 2 The color defect detection channel was activated for cluster 3 (oxidized region), and the oxidized region was successfully identified. The RGB value of the oxidized region is (240, 210, 180), the hue is 30°, and the saturation is 0.25.
[0072] By operating multiple detection channels in parallel, different types of defects can be detected simultaneously, significantly improving detection speed and accuracy. Through refined visual feature analysis and selection of appropriate model architecture, different types of defects, such as cracks, porosity, and oxidation, can be accurately distinguished. Automated defect detection is achieved through multi-channel parallel operation and model training, with the detection performance of each channel optimized based on feedback. Parallel operation of different detection channels allows for the simultaneous processing of multiple defect types, extracting features for different defect types, thereby improving detection efficiency and accuracy. Each channel focuses on the features of a specific type of defect, enabling more precise extraction of defect information and enhancing the accuracy of defect identification.
[0073] Based on the N defect feature sets belonging to the same cross-section, a defect quantification assessment is performed to generate the defect detection results of the titanium rod cross-section.
[0074] Furthermore, this application also includes the following steps:
[0075] A cross-section defect assessment index system is established. Based on this index system, the defect feature sets of the N cross-sections are quantitatively assessed to obtain N quantitative parameters for cross-section defect indices. Weights are assigned to the cross-section defect assessment index system according to the application goals of the titanium rod, determining dynamic weight factors for the cross-section indices. Based on these dynamic weight factors, the quantitative parameters for the N cross-section defect indices are summed using a weighted deduction method to generate the cross-section defect detection results for the titanium rod.
[0076] Specifically, the cross-section defect evaluation index system is a multi-dimensional standard system for measuring cross-section defects in titanium rods. It includes multiple evaluation indicators for quantifying defect characteristics. Each indicator quantifies the characteristics of different defect types, such as crack length, pore diameter, and color change in the oxide region. For example, the evaluation index system includes defect area (A), defect depth (D), defect number (N), and defect location (P). The defect area is defined as the number of pixels in the defect region, the defect depth as the maximum depth value of the defect, the defect number as the total number of defects, and the defect location as the specific position of the defect on the cross-section. The purpose of the cross-section defect evaluation index system is to provide a unified evaluation standard, enabling different types of defects to be compared and evaluated using standardized quantitative parameters.
[0077] Based on the established cross-sectional defect assessment index system, N cross-sectional defect feature sets are quantitatively assessed to obtain N quantitative parameters for cross-sectional defect indices. In other words, the N cross-sectional defect feature sets are quantitatively assessed according to defined indices, and the assessment results are converted into numerical parameters to obtain the corresponding quantitative parameters. For example, the quantitative parameter for texture defects is 0.5; the RGB difference of color defects is normalized to obtain a quantitative parameter for cross-sectional defects of 0.4; the area of shape defects is normalized to obtain a quantitative parameter for cross-sectional defects of 0.1; and the depth of depth defects is normalized to obtain a quantitative parameter for cross-sectional defects of 0.2.
[0078] Based on the intended application of the titanium rods, weights are assigned to the cross-sectional defect evaluation index system. The importance of defect types varies depending on the application. For example, in the aerospace field, cracks may be more fatal than porosity, therefore crack-related evaluation indexes have higher weights. The weighting factors for each defect index are adjusted according to the application field and usage environment of the titanium rods, resulting in dynamic weighting factors for the cross-sectional indicators. For example, the weighting factor for texture defects is 0.4, for color defects it is 0.1, for shape defects it is 0.2, and for depth defects it is 0.3. Based on the quantitative parameters of each defect and its corresponding weighting factor, a weighted sum is performed to obtain the overall defect score for each titanium rod cross-section. For example, a weighted sum of defects is performed based on the dynamic weighting factor of the cross-section index and the quantitative parameters of N cross-section defect indices. This involves multiplying each quantitative parameter of a cross-section defect index by its corresponding dynamic weighting factor and summing the products. The final defect score is then calculated as: 0.5*0.4 + 0.4*0.1 + 0.1*0.2 + 0.2*0.3 = 0.2 + 0.04 + 0.02 + 0.06 = 0.32, yielding the cross-section defect detection result for the titanium rod. Based on this result, the product's conformity is determined, and whether further processing adjustments are necessary.
[0079] By establishing a cross-sectional defect assessment index system and assigning weights, a precise quantitative assessment of cross-sectional defects in titanium rods was achieved. Dynamic weights were set for each defect type, allowing for flexible adjustments to the impact of different defects based on actual application needs, thus adapting to the quality requirements of titanium rods in various fields. A comprehensive defect detection score was provided by weighted summation of all defects, thereby helping to evaluate the overall quality of the titanium rods.
[0080] In summary, the adaptive defect detection method for titanium rod cross-sections provided in this application has the following beneficial effects:
[0081] A titanium rod visual inspection platform was constructed, consisting of a linear CCD camera, a backlight source, and a servo motion device. The target titanium rod was fixed on the servo motion device and its movement was controlled so that the imaging optical axes of the linear CCD camera and the backlight source were perpendicular to the cross-section of the target titanium rod, and cross-section image data was acquired. Defect identification and clustering were performed on the cross-section image data according to a standard template for titanium rod cross-sections, resulting in N cross-section defect type clusters, where N is a positive integer. A multi-channel cross-section defect detection system was constructed, and channel matching activation and defect feature detection were performed on the N cross-section defect type clusters based on these multi-channels, resulting in N cross-section defect feature sets. Defect quantification and evaluation were performed based on the N cross-section defect feature sets to generate titanium rod cross-section defect detection results. In other words, by building a titanium rod visual inspection platform to collect titanium rod cross-sectional image data, using standard templates for titanium rod cross-sections to perform defect identification and clustering, performing defect feature detection based on multi-channel cross-section defect detection, and performing defect quantification evaluation on N cross-sections belonging to the same defect feature set, the titanium rod cross-section defect detection results are obtained, thus improving the accuracy and efficiency of titanium rod cross-section defect detection.
[0082] Example 2: Based on the same inventive concept as the adaptive defect detection method for titanium rod cross-sections in Example 1, this application also provides an adaptive defect detection platform for titanium rod cross-sections. Please refer to the appendix. Figure 2 The adaptive defect detection platform for titanium rod cross-sections includes:
[0083] The inspection platform construction module 11 is used to build a titanium rod visual inspection platform, which consists of a linear CCD camera, a backlight source, and a servo motion device. The cross-section image acquisition module 12 is used to fix the target titanium rod on the servo motion device for movement control, so that the imaging optical axis of the linear CCD camera and the backlight source is perpendicular to the cross-section of the target titanium rod and acquires cross-section image data of the titanium rod. The defect identification and clustering module 13 is used to perform defect identification and clustering on the cross-section image data of the titanium rod according to the standard template of the titanium rod cross-section to obtain N cross-section defect type clusters, where N is a positive integer. The defect feature detection module 14 is used to construct a multi-channel cross-section defect detection, and perform channel matching activation and defect feature detection on the N cross-section defect type clusters based on the multi-channel cross-section defect detection to obtain N cross-section defect feature sets. The defect quantification and evaluation module 15 is used to perform defect quantification and evaluation based on the N cross-section defect feature sets to generate titanium rod cross-section defect detection results.
[0084] Furthermore, the cross-section image acquisition module 12 in the adaptive defect detection platform for titanium rod cross-sections is also used for: activating the linear CCD camera and backlight source to pre-acquire images of the target titanium rod, obtaining a cross-section test image of the titanium rod; performing optical axis evaluation and calibration of the linear CCD camera and backlight source based on the cross-section test image of the titanium rod, obtaining a standard machine vision imaging system; performing motion analysis on the structural shape and detection requirements of the target titanium rod, determining preset motion parameters of the titanium rod, the preset motion parameters of the titanium rod including the titanium rod motion trajectory and the titanium rod motion speed; activating the servo motion device to control the target titanium rod to move according to the preset motion parameters of the titanium rod, so that the imaging optical axis of the standard machine vision imaging system is perpendicular to the cross-section of the target titanium rod while acquiring cross-section image data of the titanium rod.
[0085] Furthermore, the cross-section image acquisition module 12 in the adaptive defect detection platform for titanium rod cross-sections is also used for: performing contour recognition on the titanium rod cross-section test image, and evaluating the optical axis perpendicularity based on the cross-section contour recognition result to obtain the optical axis test perpendicularity; calibrating the optical axis of the linear CCD camera and backlight source based on the optical axis test perpendicularity until the optical axis test perpendicularity is less than a preset deviation threshold to obtain a usable machine vision imaging system; performing quality comparison and evaluation on the titanium rod cross-section test image according to the titanium rod cross-section imaging quality standard to obtain the cross-section imaging quality parameters to be optimized; and optimizing the equipment application parameters of the usable machine vision imaging system based on the cross-section imaging quality parameters to be optimized to obtain the standard machine vision imaging system.
[0086] Furthermore, the defect identification and clustering module 13 in the adaptive defect detection platform for titanium rod cross-sections is also used for: initializing an image filter based on the noise characteristics of the titanium rod cross-section image data; preprocessing the titanium rod cross-section image data using the image filter to generate usable titanium rod cross-section image data; constructing an image twin network, comparing the similarity between the titanium rod cross-section standard template and the usable titanium rod cross-section image data through the image twin network to obtain titanium rod defect region data; collecting a cross-section defect type label library, and clustering the titanium rod defect region data according to the cross-section defect type label library to obtain N cross-section defect type clusters.
[0087] Furthermore, the defect identification and clustering module 13 in the adaptive defect detection platform for titanium rod cross-sections is also used for: obtaining a template twin sub-network and a detection twin sub-network based on the image twin network, wherein the template twin sub-network and the detection twin sub-network are shared weight networks; extracting features from the standard template of the titanium rod cross-section and the available titanium rod cross-section image data based on the template twin sub-network and the detection twin sub-network respectively to obtain a template cross-section feature set and a detection cross-section feature set; performing similarity comparison and loss analysis on the template cross-section feature set and the detection cross-section feature set to output a cross-section feature loss dataset; and performing defect region feature labeling based on the cross-section feature loss dataset to obtain the defect region data of the titanium rod.
[0088] Furthermore, the defect feature detection module 14 in the adaptive defect detection platform for titanium rod cross-sections is also used for: performing visual feature analysis on each defect type in the cross-section defect type label library to determine the significant features of multiple cross-section defect types; selecting a multi-defect type model architecture based on the significant features of the multiple cross-section defect types; performing association data mining based on the significant features of the multiple cross-section defect types to obtain a multi-defect type feature dataset; and performing channel training and merging on the multi-defect type feature dataset based on the multi-defect type model architecture to obtain a multi-channel cross-section defect detection system.
[0089] Furthermore, the defect feature detection module 14 in the adaptive defect detection platform for titanium rod cross-sections is also used to: train the multi-defect type feature dataset for defect detection based on the multi-defect type model architecture to obtain a multi-defect feature detection channel set; and perform verification, optimization, and channel paralleling on the multi-defect feature detection channel set to obtain a cross-section defect detection multi-channel, wherein the cross-section defect detection multi-channel includes a texture defect detection channel, a color defect detection channel, a shape defect detection channel, and a depth defect detection channel.
[0090] Furthermore, the defect quantification and evaluation module 15 in the adaptive defect detection platform for titanium rod cross-sections is also used for: establishing a cross-section defect evaluation index system; performing defect quantification and evaluation on the N cross-section defect feature sets according to the cross-section defect evaluation index system to obtain N cross-section defect index quantification parameters; assigning weights to the cross-section defect evaluation index system according to the titanium rod application target to determine the dynamic weight factor of the cross-section index; and performing defect weighted summation on the N cross-section defect index quantification parameters based on the dynamic weight factor of the cross-section index to generate the titanium rod cross-section defect detection result.
[0091] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Figure 1The adaptive defect detection method and specific examples for titanium rod cross-sections in Example 1 are also applicable to the adaptive defect detection platform for titanium rod cross-sections in this embodiment. Through the foregoing detailed description of the adaptive defect detection method for titanium rod cross-sections, those skilled in the art can clearly understand the adaptive defect detection platform for titanium rod cross-sections in this embodiment. Therefore, for the sake of brevity, it will not be described in detail here.
[0092] In Embodiment 3, based on the same inventive concept as the adaptive defect detection method for titanium rod cross-section in Embodiment 1, this application also provides a computer-readable storage medium storing a computer program that, when executed, implements the steps of the adaptive defect detection method for titanium rod cross-section described in any one of Embodiment 1.
[0093] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0094] Obviously, those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.
Claims
1. An adaptive defect detection method for titanium rod cross-sections, characterized in that, include: A titanium rod visual inspection platform is constructed, which consists of a linear CCD camera, a backlight source, and a servo motion device. The target titanium rod is fixed on the servo motion device for movement control, so that the imaging optical axis of the linear CCD camera and the backlight source is perpendicular to the cross-section of the target titanium rod and the cross-section image data of the titanium rod is acquired. According to the standard template of titanium rod cross-section, the titanium rod cross-section image data is subjected to defect identification and clustering to obtain N cross-section defect type clusters, where N is a positive integer; A multi-channel detection system for cross-section defects is constructed, comprising a texture defect detection channel, a color defect detection channel, a shape defect detection channel, and a depth defect detection channel. The texture defect detection channel is used to detect texture anomalies, the color defect detection channel is used to identify color changes, the shape defect detection channel is used to identify geometric shape anomalies, and the depth defect detection channel is used to identify the depth information of defects. Based on the multi-channel detection system, channel matching activation and defect feature detection are performed on the N cross-section defect type clusters. Specifically, the N cross-section defect type clusters obtained through cluster analysis are matched with the multi-channel detection system. Each defect type cluster activates the corresponding detection channel according to its features. After each defect type cluster passes through the corresponding detection channel, a set of feature data is obtained, containing different dimensional features of the defect cluster, resulting in a defect feature set belonging to N cross-sections. Based on the N defect feature sets belonging to the same cross-section, a defect quantification assessment is performed to generate the defect detection results of the titanium rod cross-section.
2. The adaptive defect detection method for titanium rod cross-section as described in claim 1, characterized in that, The step of aligning the imaging optical axes of the linear CCD camera and the backlight source perpendicular to the cross-section of the target titanium rod and acquiring cross-sectional image data of the titanium rod includes: The linear CCD camera and backlight source are activated to pre-acquire images of the target titanium rod, thereby obtaining test images of the titanium rod's cross-section. Based on the test image of the titanium rod cross section, the optical axis of the linear CCD camera and the backlight source is evaluated and calibrated to obtain a standard machine vision imaging system. Motion analysis is performed on the structural shape and detection requirements of the target titanium rod to determine the preset motion parameters of the titanium rod, which include the titanium rod's motion trajectory and motion speed. The servo motion device is activated to control the target titanium rod to move according to the preset motion parameters of the titanium rod, so that the imaging optical axis of the standard machine vision imaging system is perpendicular to the cross-section of the target titanium rod and simultaneously acquires cross-sectional image data of the titanium rod.
3. The adaptive defect detection method for titanium rod cross-section as described in claim 2, characterized in that, The obtained standard machine vision imaging system includes: Contour recognition is performed on the cross-sectional test image of the titanium rod, and the optical axis perpendicularity is evaluated based on the cross-sectional contour recognition results to obtain the optical axis test perpendicularity. Based on the optical axis test perpendicularity, the optical axis of the linear CCD camera and the backlight source are calibrated until the optical axis test perpendicularity is less than a preset deviation threshold, thus obtaining a usable machine vision imaging system. The quality of the titanium rod cross-section test image is compared and evaluated according to the titanium rod cross-section imaging quality standard to obtain the cross-section imaging quality parameters to be optimized. Based on the image quality parameters of the section to be optimized, the equipment application parameters of the available machine vision imaging system are tuned to obtain the standard machine vision imaging system.
4. The adaptive defect detection method for titanium rod cross-section as described in claim 1, characterized in that, The obtained N clusters of cross-sectional defect types include: Initialize the image filter based on the noise characteristics of the titanium rod cross-section image data; The image filter is used to preprocess the titanium rod cross-section image data to generate usable titanium rod cross-section image data; An image twin network is constructed, and the similarity between the standard template of the titanium rod cross-section and the image data of the available titanium rod cross-section is compared through the image twin network to obtain the data of the defect area of the titanium rod; Collect a label library of cross-sectional defect types, and perform defect feature clustering on the defect region data of the titanium rod according to the label library of cross-sectional defect types to obtain N cross-sectional defect type clusters.
5. The adaptive defect detection method for titanium rod cross-section as described in claim 4, characterized in that, The acquisition of defect region data in the titanium rod includes: Based on the image twin network, a template twin subnetwork and a detection twin subnetwork are obtained, wherein the template twin subnetwork and the detection twin subnetwork are shared weight networks; Based on the template twin network and the detection twin network, feature extraction is performed on the standard template of the titanium rod cross-section and the image data of the usable titanium rod cross-section, respectively, to obtain the template cross-section feature set and the detection cross-section feature set; The template section feature set and the detected section feature set are compared and analyzed for similarity, and the section feature loss dataset is output. Based on the cross-sectional feature loss dataset, defect region feature labeling is performed to obtain the defect region data of the titanium rod.
6. The adaptive defect detection method for titanium rod cross-section as described in claim 4, characterized in that, The constructed multi-channel cross-sectional defect detection system includes: Visual feature analysis is performed on each defect type in the aforementioned cross-sectional defect type label library to determine the significant features of multi-cross-sectional defect types; Based on the significant characteristics of the multi-faceted defect types, a multi-defect type model architecture is selected; Based on the significant features of the multi-faceted defect types, correlation data mining is performed to obtain a multi-defect type feature dataset. Based on the multi-defect type model architecture, the feature dataset of the multi-defect type is trained and merged to obtain multi-channel cross-section defect detection.
7. The adaptive defect detection method for titanium rod cross-section as described in claim 6, characterized in that, The method for obtaining multi-channel cross-sectional defect detection includes: Based on the multi-defect type model architecture, defect detection training is performed on the multi-defect type feature dataset to obtain a multi-defect feature detection channel set. The multi-defect feature detection channel set is verified, optimized, and connected in parallel to obtain a multi-channel for cross-sectional defect detection. The multi-channel for cross-sectional defect detection includes a texture defect detection channel, a color defect detection channel, a shape defect detection channel, and a depth defect detection channel.
8. The adaptive defect detection method for titanium rod cross-section as described in claim 1, characterized in that, The generated titanium rod cross-section defect detection results include: A cross-section defect assessment index system is established, and the defect quantitative assessment of the N cross-sections belonging to the same defect feature set is carried out according to the cross-section defect assessment index system to obtain the quantitative parameters of the N cross-section defect indexes. The cross-section defect evaluation index system is weighted according to the application objectives of titanium rods, and the dynamic weight factor of the cross-section index is determined. Based on the dynamic weighting factor of the cross-section index, the quantitative parameters of the N cross-section defect indices are summed by defect weighting to generate the cross-section defect detection result of the titanium rod.
9. An adaptive defect detection platform for titanium rod cross-sections, characterized in that, The step of implementing the adaptive defect detection method for titanium rod cross-sections according to any one of claims 1 to 8, wherein the adaptive defect detection platform for titanium rod cross-sections comprises: The detection platform construction module is used to build a titanium rod visual inspection platform, which consists of a linear CCD camera, a backlight source, and a servo motion device. The cross-section image acquisition module is used to fix the target titanium rod on the servo motion device for movement control, so that the imaging optical axis of the linear CCD camera and the backlight source is perpendicular to the cross-section of the target titanium rod and acquires cross-section image data of the titanium rod. The defect identification and clustering module is used to perform defect identification and clustering on the titanium rod cross-section image data according to the titanium rod cross-section standard template, to obtain N cross-section defect type clusters, where N is a positive integer; The defect feature detection module is used to construct a multi-channel for cross-section defect detection. Based on the multi-channel for cross-section defect detection, channel matching activation and defect feature detection are performed on the N cross-section defect type clusters to obtain N cross-section defect feature sets. The defect quantification and evaluation module is used to perform defect quantification and evaluation based on the defect feature set of the N cross-sections, and generate defect detection results for the titanium rod cross-sections.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the steps of the adaptive defect detection method for titanium rod cross-sections as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Defect detection system and method utilizing template comparison based on twin neural network
CN111179251A
Titanium alloy bar visual detection method based on image segmentation
CN119991670A