A method and system for detecting defects in cable production
By building an end-to-end defect detection model and using heterogeneous feature sets for training, the problems of inefficiency and insufficient accuracy of traditional cable defect detection methods are solved, efficient and accurate detection and positioning of cable defects are achieved, and the stability and reliability of cable production are ensured.
Patent Information
- Application Number
- CN202510205950.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-02-25
AI Technical Summary
Traditional cable defect detection methods are inefficient, difficult to accurately locate and classify defects, and cannot meet the needs of modern cable production for efficient and precise quality control.
A defect detection method in cable production is adopted. By acquiring cable image data, an image data set containing defect locations and categories is generated, data optimization and feature extraction are performed, an end-to-end defect detection model is constructed, and the model is trained through heterogeneous feature sets to achieve accurate detection and positioning of cable defects.
It improves the accuracy and efficiency of defect detection, can quickly process a large amount of cable image data, accurately output the coordinates of defects in the image, effectively deal with the ever-changing defect types and complex situations in cable production, and ensures the stability and reliability of cable production.
Smart Images

Figure CN119693368B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cable detection, and in particular to a method and system for detecting defects in cable production. Background Art
[0002] In cable production, ensuring product quality is one of the key factors for the survival and development of enterprises. With the increasing application scenarios of cables, the requirements for cable performance and reliability are also rising. Traditional cable defect detection methods mainly rely on manual visual inspection and simple electrical tests. Manual visual inspection is extremely inefficient, and factors such as fatigue and experience differences of inspectors make it difficult to ensure the accuracy and consistency of the test results. For example, when faced with a large number of cable products, inspectors may miss some subtle defects, such as tiny cracks in the cable insulation layer or slight corrosion on the conductor surface.
[0003] Although simple electrical tests can detect some defects that affect electrical performance, they cannot effectively identify some physical defects that are not related to electrical performance, such as sheath appearance flaws, uneven insulation thickness, etc. Moreover, these traditional methods cannot accurately locate and classify defects, making it difficult to meet the needs of modern cable production for efficient and accurate quality control. Summary of the invention
[0004] In order to solve the problem that the related technology cannot accurately locate defects in cable production, the present invention provides a method and system for defect detection in cable production, which can effectively solve the problems in the background technology.
[0005] In order to solve the above technical problems, the technical solutions provided by the present invention are as follows:
[0006] The embodiment of the present invention discloses a method for detecting defects in cable production, comprising the following steps:
[0007] Acquire at least one type of defect cable image data, and generate a first image data set including defect locations and type annotations based on the image data;
[0008] Optimizing the first image data set to generate a second image data set, and generating an image feature set based on the second image data set;
[0009] Generate a non-image feature set according to the auxiliary features of the second image data set, and generate a heterogeneous feature set corresponding to each element of the second image data set according to the image feature set and the non-image feature set;
[0010] Constructing an end-to-end defect detection model and a selection processing layer, adding the selection processing layer to the defect detection model, and training the defect detection model through the heterogeneous feature set;
[0011] The production process image data of the cable to be detected is input into the defect detection model to obtain the defect category of the cable to be detected, and an alarm prompt and the coordinates of the defect in the image are output according to the defect category.
[0012] In any of the above solutions, it is preferred that at least one defect type cable image data is obtained, and a first image data set including defect location and category annotation is generated according to the image data, including:
[0013] Defect labels are pre-marked in image data of at least one defective category of cable according to historical cable production data to obtain a first image data set, wherein the defect labels include defect locations and defect categories.
[0014] In any of the above solutions, preferably, optimizing the first image data set to generate a second image data set, and generating an image feature set according to the second image data set includes:
[0015] According to the formula: , perform enhancement operations on each element in the first image data set to obtain a sub-image data set, where, is the image after the enhancement operation, s is the preset scaling factor, N is the preset noise matrix, I is the image in the first image data set, is the preset rotation angle, For zoom operation, For rotation operation;
[0016] Using a machine learning method to restore and denoise the sub-image dataset to obtain a second image dataset;
[0017] Setting a convolutional neural network, and extracting spatial structural features corresponding to each element of the second image data set through the convolutional neural network to obtain a first image feature set, wherein the spatial structural features include edge contour clarity of the cable defect area, the area of the cable defect area, the intensity of grayscale value change of the cable defect area, and the uneven change rate of the cable diameter along the length direction;
[0018] Acquire semantic features of each element of the second image data set according to the first image feature set to obtain a second image feature set;
[0019] The first image feature set is combined with the second image feature set to generate an image feature set.
[0020] In any of the above solutions, preferably, a convolutional neural network is set, and the spatial structural features corresponding to each element of the second image data set are extracted by the convolutional neural network to obtain the first image feature set, which may include:
[0021] Using the second image data set as an input layer of the convolutional neural network, and performing a convolution operation on the input data of the convolutional neural network by setting a convolution kernel to obtain a primary spatial feature map;
[0022] Repeating the nonlinear transformation through the activation function on the output of each layer of the convolutional neural network to extract the main features of each element of the second image data set layer by layer;
[0023] The main features extracted layer by layer are integrated through the fully connected layer of the convolutional neural network to obtain a first image feature set.
[0024] In any of the above solutions, preferably, acquiring the semantic features of each element of the second image data set according to the first image feature set to obtain the second image feature set may include:
[0025] The defect gathering area is obtained according to the edge contour clarity of the cable defect area, and the connection point area is determined through the defect gathering area to obtain the possible location of the connection point;
[0026] Set an area threshold, determine the range of different connection segments according to the area size of the cable defect area, and distinguish the connection segments to obtain the range of different connection segments;
[0027] According to the change point of the gray value change intensity of the cable defect area, the junction of the connection point and the connection segment is determined to obtain the junction position of the connection point and the connection segment;
[0028] According to the edge contour clarity and area of the cable defect area, the connection point is accurately located to obtain the connection point coordinates;
[0029] The segment type is judged according to the area of the cable defect region and the distribution pattern of the gray value change intensity of the cable defect region to obtain the connection segment type, wherein the connection segment type includes a light defect segment and a heavy defect segment;
[0030] The performance of the connection section is evaluated according to the uneven change rate of the cable diameter along the length direction in the connection section to obtain the connection section evaluation value;
[0031] The network topology is constructed according to the connection point coordinates, connection segment type, and connection segment evaluation value to obtain the defective topology of the cable;
[0032] The defect topological structure of the cable is used as the semantic feature of the elements of the second image data set to obtain a second image feature set.
[0033] In any of the above schemes, preferably, by the formula:
[0034] ; Calculate the connection segment evaluation value P, where is the area of the i-th defect region in the connection segment, is the number of defective areas in the connection segment, is the preset standard area, is the discreteness of the defect area relative to the standard, is the standard deviation of the gray value change intensity of the i-th defect area in the connection segment, is the preset standard gray value standard deviation, is the stability of gray value change in defect area, is the uneven change rate of the cable diameter along the length direction, The cable diameter uneven change rate is the preset standard. is the square of the deviation between the actual diameter uneven change rate and the standard value, , , are weight coefficients, which respectively indicate the importance of the defect area deviation, gray value standard deviation deviation and diameter uneven change rate deviation on the performance of the connection section.
[0035] In any of the above solutions, preferably, generating a non-image feature set according to the auxiliary features of the second image data set, and generating a heterogeneous feature set corresponding to each element of the second image data set according to the image feature set and the non-image feature set may include:
[0036] Taking each row of data of an element of the second image data set as a signal sequence, and combining the signal sequences into a time series signal data set corresponding to the element in time sequence;
[0037] Using fast Fourier transform to transform each element in the time series signal data set into the frequency domain to obtain a frequency spectrum corresponding to the time series signal data set;
[0038] The time-frequency features corresponding to the elements are determined according to the frequency spectrum to obtain a non-image feature set corresponding to each element of the second image data set.
[0039] In any of the above solutions, preferably, generating a non-image feature set according to the auxiliary features of the second image data set, and generating a heterogeneous feature set corresponding to each element of the second image data set according to the image feature set and the non-image feature set may include:
[0040] Perform dimension-up operations on the image feature set elements and the non-image feature set elements so that the lengths of the image feature set elements and the non-image feature set elements are consistent;
[0041] The image feature set elements and the non-image feature set elements are normalized and feature fusion is performed to obtain a heterogeneous feature set.
[0042] In any of the above solutions, preferably, an end-to-end defect detection model and a selection processing layer are constructed, the selection processing layer is added to the defect detection model, and the defect detection model is trained by the heterogeneous feature set, including:
[0043] The selective connection layer is set between the hidden layer and the fully connected layer of the defect detection model;
[0044] Use the fully connected layer of the defect detection model to map the heterogeneous feature set to the hidden layer of the defect detection model to obtain an intermediate representation;
[0045] By formula: Select Score = , calculate the selection score, where is a function that transforms a set of real numbers into a probability distribution, and They are different weight matrices preset according to the characteristics of cable defect detection. is the hyperbolic tangent function, and are the preset bias vectors respectively;
[0046] Apply the selection score to the intermediate representation to obtain a weighted representation, where the weighted representation = selection score ⊙ intermediate representation, ⊙ is an element-by-element multiplication operation;
[0047] Performing average pooling on the weighted representation to obtain an output of the selected processing layer;
[0048] The output of the selection processing layer is input into multiple Transformer encoder layers for encoding, where each Transformer layer includes a multi-head self-attention mechanism and a feedforward neural network;
[0049] Use a fully connected layer to map the output of the Transformer encoder layer to the output layer of the defect detection model;
[0050] The heterogeneous feature set is divided into a training set and a test set, and the defect detection model is trained by the training set and the test set.
[0051] In a second aspect, a cable production defect detection system includes:
[0052] An acquisition module, used to acquire at least one defect category cable image data, and generate a first image data set including defect location and category annotation according to the image data;
[0053] an optimization module, configured to optimize the first image data set to generate a second image data set, and generate an image feature set based on the second image data set;
[0054] A generating module, configured to generate a non-image feature set according to the auxiliary features of the second image data set, and to generate a heterogeneous feature set corresponding to each element of the second image data set according to the image feature set and the non-image feature set;
[0055] A construction module, used for constructing an end-to-end defect detection model and a selection processing layer, adding the selection processing layer to the defect detection model, and training the defect detection model through the heterogeneous feature set;
[0056] The alarm module is used to input the production process image data of the cable to be detected into the defect detection model, obtain the defect category of the cable to be detected, and output an alarm prompt and the coordinates of the defect in the image according to the defect category.
[0057] Compared with the prior art, the present invention has the following beneficial effects:
[0058] The present invention can comprehensively and deeply mine the information of cable defects, effectively avoiding the misjudgment and missed judgment caused by the traditional method due to the single information, greatly improving the accuracy of defect detection, and can quickly process a large amount of cable image data and accurately output the coordinates of the defects in the image without a lot of manual intervention; it can effectively deal with the ever-changing defect types and complex situations in the cable production process, and ensure the stability and reliability of cable production. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The accompanying drawings are used for further understanding of the present invention and are used to explain the present invention together with the embodiments of the present invention, but do not constitute a limitation of the present invention.
[0060] Figure 1 It is a schematic flow chart of a defect detection method in cable production of the present invention;
[0061] Figure 2 It is a module schematic diagram of the defect detection system in cable production of the present invention.
[0062] Description of the numbers in the figure:
[0063] 10. Acquisition module; 20. Optimization module; 30. Generation module; 40. Construction module; 50. Alarm module. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0065] It should be noted that when an element is referred to as being "fixed to" or "disposed on" another element, it can be directly on the other element or indirectly on the other element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element.
[0066] In the description of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship are based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0067] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0068] In order to better understand the above technical solution, the technical solution of the present invention will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0069] like Figure 1 As shown, the present invention provides a method for detecting defects in cable production, comprising the following steps:
[0070] Step 1, obtaining at least one defect type cable image data, and generating a first image data set including defect location and category annotations according to the image data;
[0071] Step 2, optimizing the first image data set to generate a second image data set, and generating an image feature set based on the second image data set;
[0072] Step 3, generating a non-image feature set according to the auxiliary features of the second image data set, and generating a heterogeneous feature set corresponding to each element of the second image data set according to the image feature set and the non-image feature set;
[0073] Step 4, constructing an end-to-end defect detection model and a selection processing layer, adding the selection processing layer to the defect detection model, and training the defect detection model through the heterogeneous feature set;
[0074] Step 5: Input the production process image data of the cable to be detected into the defect detection model to obtain the defect category of the cable to be detected, and output an alarm prompt and the coordinates of the defect in the image according to the defect category.
[0075] In a preferred embodiment of the present invention, the above step 1, obtaining at least one defect type cable image data, and generating a first image data set including defect location and category annotations according to the image data, may include:
[0076] Step 11, pre-marking defect labels in image data of at least one defective category of cable according to historical cable production data to obtain a first image data set, wherein the defect label includes a defect location and a defect category.
[0077] In the above steps, the image data of the cable can be obtained through high-resolution cameras, X-ray imaging equipment, etc. on the production line, so as to collect historical image data recorded in the cable production process, and ensure that the collected historical cable production data can cover various defects that may occur in the production process, including but not limited to cracks, bubbles, peeling, impurities, etc.; and ensure that the collected image data covers different cable types and production batches to ensure the diversity and representativeness of the first image data set; further, the defect locations and defect categories on the collected historical cable image data can be annotated through annotation tools such as LabelImg, VGG Image Annotator (VIA), RectLabel, etc., so as to facilitate subsequent analysis and processing of the first image data set.
[0078] In a preferred embodiment of the present invention, the above step 2, optimizing the first image data set to generate a second image data set, and generating an image feature set based on the second image data set, may include:
[0079] Step 21, according to the formula: , perform enhancement operations on each element in the first image data set to obtain a sub-image data set, where, is the image after the enhancement operation, s is the preset scaling factor, N is the preset noise matrix, I is the image in the first image data set, is the preset rotation angle, For zoom operation, For rotation operation;
[0080] Step 22: Use a machine learning method to restore and denoise the sub-image data set to obtain a second image data set.
[0081] In the above steps, the image is scaled by a preset scaling factor s and rotated by a preset rotation angle, which can simulate the appearance changes of the cable at different shooting angles and distances. For example, in an actual production environment, the cable may have certain deformation and perspective differences in the acquired image due to factors such as differences in position on the production line and different installation angles of the detection equipment. The data enhancement operation can cover these potential changes, so that the model can be exposed to more diverse image data during the training process, thereby improving the model's ability to recognize cable defects of different forms and enhancing the generalization performance of the model. By adding a preset noise matrix N, various interferences that the cable image may be subjected to during the acquisition and transmission process, such as electromagnetic interference, equipment noise, etc., can be simulated. When the model is exposed to image data containing noise during the training process, it can learn how to accurately identify cable defects in a noisy environment and avoid misjudgment or missed judgment due to noise interference. Using machine learning methods to restore and denoise the sub-image data set can effectively remove the noise introduced during the data enhancement process and the noise and interference that may exist in the original image data, and restore the true information of the image. For example, some tiny defect features may be blurred due to the presence of noise. After restoration and denoising, these defect features can be presented more clearly, improving the clarity and recognizability of the image, which helps to extract image features more accurately in the future. The signal-to-noise ratio of the second image data set after restoration and denoising is improved, making the subsequent spatial structure feature extraction based on methods such as convolutional neural networks more accurate and effective. It avoids feature extraction errors or deviations caused by noise and interference, and improves the accuracy and reliability of the entire defect detection process.
[0082] In a preferred embodiment of the present invention, the above step 2, optimizing the first image data set to generate a second image data set, and generating an image feature set based on the second image data set, may also include:
[0083] Step 23, setting a convolutional neural network, and extracting the spatial structural features corresponding to each element of the second image data set through the convolutional neural network to obtain a first image feature set, wherein the spatial structural features include edge contour clarity of the cable defect area, the area of the cable defect area, the intensity of grayscale value change of the cable defect area, and the uneven change rate of the cable diameter along the length direction;
[0084] Step 24, acquiring semantic features of each element of the second image data set according to the first image feature set to obtain a second image feature set;
[0085] Step 25: merge the first image feature set and the second image feature set to generate an image feature set.
[0086] In the above steps, step 23 can automatically and efficiently extract key spatial structural features from the second image data set by setting a convolutional neural network specifically for cable defect detection. For the feature of edge contour clarity of the cable defect area, the convolutional neural network can use its multi-layer convolution layer and pooling layer structure to gradually focus on the subtle changes in the edge of the defect, thereby accurately defining the scope and morphology of the defect, which is an accuracy that is difficult to achieve with manual detection. For example, when detecting tiny cracks in the cable insulation layer, the neural network can clearly identify the starting point, extension direction and end point of the crack, providing accurate basic information for subsequent analysis. By considering multiple features such as the area of the cable defect area, the intensity of grayscale value change, and the uneven change rate of the cable diameter along the length direction, the description of the cable defect is more comprehensive. Different defect types often show different combination patterns in these features. For example, the bulging defect of the cable sheath may cause the local diameter uneven change rate to increase, and the grayscale value of the bulging area will also be different from the surrounding normal area, and the area feature can reflect the size of the bulge. Combining these features can accurately distinguish defects of different types and severity, avoid the limitations of single feature judgment, and improve the accuracy and reliability of defect identification. Step 24 can better understand the defect structure inside the cable by analyzing the distribution pattern and mutual relationship of the defect area. For example, by judging whether multiple small area defects have a tendency to cluster in space, it can be inferred whether there are potential systemic production problems, such as multiple defects caused by local unevenness of raw materials, rather than just looking at each defect in isolation. This semantic level analysis helps to understand the quality status of the cable more deeply and provide more valuable basis for subsequent decision-making. In the process of determining the relevant information of the connection point and the connection segment, such as determining the connection point area, boundary determination and precise connection point positioning through features such as edge contour clarity and area, the correlation between different defects can be accurately sorted out, especially for some complex composite defects composed of multiple small defects. For the problem of broken wires in multiple strands of cable conductors, the connection relationship between the broken wire points can be accurately identified, and the degree of its influence on the overall conductivity can be judged, so as to make a more accurate assessment of the severity of the defect and improve the detection and analysis capabilities of complex defects.
[0087] In a preferred embodiment of the present invention, the above step 23, setting a convolutional neural network, and extracting the spatial structural features corresponding to each element of the second image data set through the convolutional neural network to obtain the first image feature set, may include:
[0088] Step 231, using the second image data set as the input layer of the convolutional neural network, and performing a convolution operation on the input data of the convolutional neural network by setting a convolution kernel to obtain a primary spatial feature map;
[0089] Step 232, repeatedly performing nonlinear transformation on the output of each layer of the convolutional neural network through an activation function to extract the main features of each element of the second image data set layer by layer;
[0090] Step 233, integrating the main features extracted layer by layer through the fully connected layer of the convolutional neural network to obtain a first image feature set.
[0091] In the above steps, in step 231, the ability of convolutional neural network to extract features from images is utilized, and local feature information in the image can be captured through convolution operation; in step 232, the use of activation function can introduce nonlinear relationship, increase the expression ability of the network, and enable the network to better abstract and represent image features; in step 233, the fully connected layer can perform global feature integration on the output of the network, and fuse features at different levels to obtain image features with more semantic information.
[0092] In a preferred embodiment of the present invention, the above step 24, obtaining the semantic features of each element of the second image data set according to the first image feature set to obtain the second image feature set, may include:
[0093] Step 241, obtaining a defect gathering area according to the edge contour clarity of the cable defect area, and determining the connection point area through the defect gathering area to obtain a possible position of the connection point;
[0094] Step 242, setting an area threshold, determining the ranges of different connection segments according to the area size of the cable defect area, and distinguishing the connection segments to obtain the ranges of different connection segments;
[0095] Step 243, judging the boundary between the connection point and the connection segment according to the change point of the gray value change intensity of the cable defect area, so as to obtain the boundary position between the connection point and the connection segment;
[0096] Step 244, accurately locate the connection point according to the edge contour clarity of the cable defect area and the area of the cable defect area to obtain the connection point coordinates;
[0097] Step 245, judging the segment type according to the area of the cable defect region and the distribution pattern of the gray value change intensity of the cable defect region to obtain the connection segment type, wherein the connection segment type includes a light defect segment and a heavy defect segment;
[0098] Step 246, evaluating the performance of the connection segment according to the uneven change rate of the cable diameter in the connection segment along the length direction to obtain an evaluation value of the connection segment;
[0099] Step 247, constructing a network topology structure according to the connection point coordinates, the connection segment type, and the connection segment evaluation value, and obtaining a defective topology structure of the cable;
[0100] Step 248: Using the defective topological structure of the cable as a semantic feature of an element of the second image data set to obtain a second image feature set.
[0101] In step 241, if there are multiple defective areas with similar edge contour clarity and close to each other within a certain range (such as an area of 8 pixels × 8 pixels), it can be considered that these areas may be related to each other, and then determined as possible locations of connection points. For example, in the cable insulation layer image, multiple small damaged areas with similar edge blur and adjacent to each other may be caused by problems in the same production link, and the vicinity of the center of these areas can be used as possible locations of connection points. In step 242, different area thresholds are set. When the total area of the defective areas in a section of cable exceeds a certain threshold (such as 4 square millimeters), it is divided into a connection segment; at the same time, combined with the length information of the cable, for example, every 12 centimeters is a basic analysis unit, and the area of the defective areas in each unit is traversed to determine the range of different connection segments. If there are multiple defective areas with larger areas and the total area reaches 6 square millimeters in a certain 12-centimeter cable segment, the segment is demarcated as a connection segment. In step 243, based on the intensity of the grayscale value change in the cable defect area, find points or areas where the grayscale value changes dramatically. These points or areas may be the key parts of the defect or the junctions of different defect types. Combined with the structural characteristics and production process of the cable, when the grayscale value suddenly changes from a lower value to a higher value at a certain position and the change amplitude exceeds the set difference (such as 45 grayscale units), and there is an obvious edge contour of the defect area near the position, it can be determined that this is the junction of the connection point and the connection segment. For example, in the cable conductor image, if a grayscale value suddenly changes from 95 to 140 and there are suspected impurities around the edge of the defect area, this is an important junction. In step 244, using the image coordinate system, with the defect pixel point with the clearest edge contour and the largest area as the core, the coordinates of its center position are calculated, and combined with the conversion relationship between pixels and actual sizes (such as each pixel represents 0.1 mm), the connection point coordinates are obtained accurately to the millimeter level. For example, in the cable conductor image, a corrosion area with clear edges and an area of 3 square millimeters can be determined by analyzing its pixel coordinates and converting them to determine its precise position coordinates on the cable. In step 245, if the defect area in a section of cable is generally small (such as an average area of no more than 1.5 square millimeters) and the gray value changes relatively evenly (the change amplitude is within 30 gray units), it can be determined as a slightly defective section; if there is a defective area with a large area (such as more than 4 square millimeters) and a drastic change in gray value (the change amplitude exceeds 70 gray units), it is determined to be a severely defective section. For example, in an image of a section of the cable insulation layer, multiple bubble areas with small areas and stable gray values can be classified as slightly defective sections, while if there is a large area of damaged area with a sudden change in gray value, it is a severely defective section.In step 246, different thresholds of uneven change rate are set. If the uneven change rate of the cable diameter in the connection segment along the length direction exceeds the set uneven change rate threshold (such as 0.08), it indicates that the connection segment has a major problem in the mechanical structure, which may affect the overall performance of the cable and give a lower evaluation value; if the uneven change rate is within a reasonable range (such as less than 0.03), the evaluation value is relatively high; for example, in a section of cable, after measuring its diameter change rate of 0.12, it indicates that the section of cable may have uneven stretching or extrusion, and its connection segment evaluation value will be low. In step 247, using graphical tools or data structures, the connection points and connection segments are represented in the form of nodes and line segments, and a topological diagram is constructed based on the positional relationship and performance association between them, depicting the distribution and mutual influence relationship of the internal defects of the cable, and obtaining the defect topological structure of the cable; for example, a severely defective segment is connected with an adjacent slightly defective segment, and the coordinates of the connection points and the performance evaluation of the connection segments are marked, so as to clearly show the overall defect situation of the cable.
[0102] In a preferred embodiment of the present invention, the above step 246, performing a connection segment performance evaluation according to the uneven change rate of the cable diameter in the connection segment along the length direction to obtain a connection segment evaluation value, includes:
[0103] Step 2461, by formula:
[0104] ; Calculate the connection segment evaluation value P, where is the area of the i-th defect region in the connection segment, is the number of defective areas in the connection segment, is the preset standard area, is the discreteness of the defect area relative to the standard, is the standard deviation of the gray value change intensity of the i-th defect area in the connection segment, is the preset standard gray value standard deviation, is the stability of gray value change in defect area, is the uneven change rate of the cable diameter along the length direction, The cable diameter uneven change rate is the preset standard. is the square of the deviation between the actual diameter uneven change rate and the standard value, , , are weight coefficients, which respectively indicate the importance of the defect area deviation, gray value standard deviation deviation and diameter uneven change rate deviation on the performance of the connection section.
[0105] In the above steps, by considering the key factors of the area of the defective area in the connection segment, the standard deviation of the gray value change intensity, and the uneven change rate of the cable diameter along the length direction, the actual performance status of the connection segment can be judged more accurately, avoiding the one-sided conclusion that may be caused by the evaluation of a single factor. By presetting the standard area, standard gray value standard deviation, and standard cable diameter uneven change rate, and calculating the deviation between the actual value and the standard value, the performance evaluation of the connection segment is converted into a quantifiable value, so that the performance comparison between different connection segments is scientific and objective. For example, in large-scale cable production inspection, cable connection segments of different batches or different production stages can be sorted and screened according to the evaluation value, and the parts with poor performance can be quickly and accurately identified, providing a clear basis for quality control. It can be flexibly adjusted according to the type, application scenario, and quality requirements of the cable, so that the evaluation results are more in line with actual needs. The connection segment evaluation value P obtained by calculation can not only determine whether the connection segment has defects, but also deeply analyze the severity and potential impact of the defects. For connection segments with low evaluation values, specific influencing factors can be further traced back, such as whether the defect area in a certain area is too large, or the uneven change rate of the cable diameter exceeds the normal range too much. It helps to find the root cause of the problem in time during the cable production process and take targeted improvement measures, thereby improving the overall quality and reliability of the cable and reducing safety hazards caused by cable defects.
[0106] In a preferred embodiment of the present invention, the above step 3, generating a non-image feature set according to the auxiliary features of the second image data set, and generating a heterogeneous feature set corresponding to each element of the second image data set according to the image feature set and the non-image feature set, may include:
[0107] Step 31, taking each row of data of an element of the second image data set as a signal sequence, and combining the signal sequences into a time series signal data set corresponding to the element in time sequence;
[0108] Step 32, using fast Fourier transform to transform each element in the time series signal data set into the frequency domain, so as to obtain a frequency spectrum corresponding to the time series signal data set;
[0109] Step 33: determining the time-frequency features corresponding to the elements according to the frequency spectrum to obtain a non-image feature set corresponding to each element of the second image data set.
[0110] In a preferred embodiment of the present invention, the above step 3 may further include:
[0111] Step 34, performing a dimension-up operation on the image feature set elements and the non-image feature set elements so that the lengths of the image feature set elements and the non-image feature set elements are consistent;
[0112] Step 35, normalize the image feature set elements and the non-image feature set elements, and perform feature fusion to obtain a heterogeneous feature set.
[0113] In the above content, step 31 can convert image data into a series of time series signals, providing a data basis for subsequent frequency domain analysis; step 32 can convert time domain signals into frequency domain signals through Fourier transform, so that the frequency components and features of the signals can be analyzed and extracted; step 33 can extract the time-frequency features of image elements by analyzing the spectrum, and these features can be used for subsequent non-image feature analysis and processing; step 34 can unify the lengths of different feature sets through dimensionality increase operations, facilitating subsequent feature fusion and processing; step 35 can unify and combine different types of features through normalization and feature fusion to obtain a heterogeneous feature set containing image features and non-image features, providing more comprehensive feature input for subsequent other algorithms.
[0114] In a preferred embodiment of the present invention, the above step 4, constructing an end-to-end defect detection model and a selection processing layer, adding the selection processing layer to the defect detection model, and training the defect detection model through the heterogeneous feature set, may include:
[0115] Step 41, setting the selective connection layer between the hidden layer and the fully connected layer of the defect detection model;
[0116] Step 42, using the fully connected layer of the defect detection model to map the heterogeneous feature set to the hidden layer of the defect detection model to obtain an intermediate representation;
[0117] Step 43, select score by formula: , calculate the selection score, where is a function that transforms a set of real numbers into a probability distribution, and They are different weight matrices preset according to the characteristics of cable defect detection. is the hyperbolic tangent function, and are the preset bias vectors respectively;
[0118] Step 44, applying the selection score to the intermediate representation to obtain a weighted representation, wherein the weighted representation = selection score ⊙ intermediate representation, ⊙ is an element-by-element multiplication operation;
[0119] Step 45, performing average pooling on the weighted representation to obtain the output of the selection processing layer;
[0120] Step 46, inputting the output of the selection processing layer into a plurality of Transformer encoder layers for encoding, wherein each Transformer layer includes a multi-head self-attention mechanism and a feed-forward neural network;
[0121] Step 47, using a fully connected layer to map the output of the Transformer encoder layer to the output layer of the defect detection model;
[0122] Step 48, dividing the heterogeneous feature set into a training set and a test set, and training the defect detection model using the training set and the test set.
[0123] In the above content, the selective connection layer is used to connect the heterogeneous feature set to the model, and provide weight selection and influence the contribution of different features to defect detection; the fully connected layer of the defect detection model is used to map the heterogeneous feature set to the hidden layer to obtain the intermediate representation. This step is to introduce the heterogeneous feature set into the defect detection model for further processing and learning through forward propagation; the importance of each feature in the heterogeneous feature set is determined by calculating the selection score. The calculation of the selection score depends on the preset weight matrix, hyperbolic tangent function and bias vector, which converts a set of real numbers into a probability distribution to measure the importance of each feature; the selection score is applied to the intermediate representation to obtain a weighted representation. The weighted representation multiplies the selection score with the intermediate representation through an element-by-element multiplication operation (⊙), thereby weighting the contribution of each feature to defect detection; the weighted representation is average pooled to obtain the output of the selection processing layer. The average pooling operation can compress the weighted representation into a vector of fixed length for extracting higher-level feature representations; the output of the selection processing layer is input into multiple Transformer encoder layers for encoding. Each Transformer encoder layer is used for encoding. The nsformer layer includes a multi-head self-attention mechanism and a feedforward neural network for further feature extraction and modeling of the input; a fully connected layer is used to map the output of the Transformer encoder layer to the output layer of the defect detection model, so that the fully connected layer can map the encoded features to the final defect detection results; the heterogeneous feature sets are divided into training sets and test sets, and the fault location model is trained through the training sets and test sets, the model parameters are learned and adjusted through the samples and labels of the training sets, and then the performance and accuracy of the model are evaluated using the test set; the features are weightedly selected by selecting the connection layer, so as to extract and learn the most important feature representations.
[0124] In a preferred embodiment of the present invention, in the above step 5, the defect category includes no defect or defective, wherein defective includes different types of defects; if the defect detection model outputs a defect, a light-sensing alarm is prompted and the coordinates of the defect in the image are accurately output to realize an active alarm for the cable defect position coordinates.
[0125] like Figure 2 As shown, the present invention also provides a defect detection system in cable production, comprising:
[0126] An acquisition module 10 is used to acquire at least one type of defect cable image data and generate a first image data set including defect locations and type annotations based on the image data;
[0127] An optimization module 20, configured to optimize the first image data set to generate a second image data set, and generate an image feature set based on the second image data set;
[0128] A generating module 30, configured to generate a non-image feature set according to the auxiliary features of the second image data set, and to generate a heterogeneous feature set corresponding to each element of the second image data set according to the image feature set and the non-image feature set;
[0129] A construction module 40, for constructing an end-to-end defect detection model and a selection processing layer, adding the selection processing layer to the defect detection model, and training the defect detection model through the heterogeneous feature set;
[0130] The alarm module 50 is used to input the production process image data of the cable to be detected into the defect detection model, obtain the defect category of the cable to be detected, and output an alarm prompt and the coordinates of the defect in the image according to the defect category.
[0131] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for detecting defects in cable production, characterized in that: The method comprises: Acquire at least one type of defect cable image data, and generate a first image data set including defect locations and type annotations based on the image data; Optimizing the first image data set to generate a second image data set, and generating an image feature set based on the second image data set, including according to the formula: , perform enhancement operations on each element in the first image data set to obtain a sub-image data set, where, is the image after the enhancement operation, s is the preset scaling factor, N is the preset noise matrix, I is the image in the first image data set, is the preset rotation angle, For zoom operation, The invention relates to a method for performing a rotation operation; restoring and denoising the sub-image data set using a machine learning method to obtain a second image data set; setting a convolutional neural network, and extracting the spatial structural features corresponding to each element of the second image data set through the convolutional neural network to obtain a first image feature set, wherein the spatial structural features include the edge contour clarity of the cable defect area, the area of the cable defect area, the intensity of the grayscale value change of the cable defect area, and the uneven change rate of the cable diameter along the length direction; obtaining the semantic features of each element of the second image data set according to the first image feature set to obtain a second image feature set; merging the first image feature set with the second image feature set to generate an image feature set; Generate a non-image feature set according to the auxiliary features of the second image data set, and generate a heterogeneous feature set corresponding to each element of the second image data set according to the image feature set and the non-image feature set; Constructing an end-to-end defect detection model and a selection processing layer, adding the selection processing layer to the defect detection model, and training the defect detection model through the heterogeneous feature set; The production process image data of the cable to be detected is input into the defect detection model to obtain the defect category of the cable to be detected, and an alarm prompt and the coordinates of the defect in the image are output according to the defect category.
2. The method for detecting defects in cable production according to claim 1, characterized in that: Acquiring at least one defective cable image data, and generating a first image data set including defect locations and category annotations based on the image data, including: Defect labels are pre-marked in image data of at least one defective category of cable according to historical cable production data to obtain a first image data set, wherein the defect labels include defect locations and defect categories.
3. The method for detecting defects in cable production according to claim 2, characterized in that: Setting a convolutional neural network, and extracting spatial structural features corresponding to each element of the second image data set through the convolutional neural network to obtain a first image feature set, including: Using the second image data set as an input layer of the convolutional neural network, and performing a convolution operation on the input data of the convolutional neural network by setting a convolution kernel to obtain a primary spatial feature map; Repeating the nonlinear transformation through the activation function on the output of each layer of the convolutional neural network to extract the main features of each element of the second image data set layer by layer; The main features extracted layer by layer are integrated through the fully connected layer of the convolutional neural network to obtain a first image feature set.
4. The method for detecting defects in cable production according to claim 3, characterized in that: Acquiring semantic features of each element of the second image data set according to the first image feature set to obtain a second image feature set includes: The defect gathering area is obtained according to the edge contour clarity of the cable defect area, and the connection point area is determined through the defect gathering area to obtain the possible location of the connection point; Set an area threshold, determine the range of different connection segments according to the area size of the cable defect area, and distinguish the connection segments to obtain the range of different connection segments; According to the change point of the gray value change intensity of the cable defect area, the junction of the connection point and the connection segment is determined to obtain the junction position of the connection point and the connection segment; According to the edge contour clarity and area of the cable defect area, the connection point is accurately located to obtain the connection point coordinates; The segment type is judged according to the area of the cable defect region and the distribution pattern of the gray value change intensity of the cable defect region to obtain the connection segment type, wherein the connection segment type includes a light defect segment and a heavy defect segment; The performance of the connection section is evaluated according to the uneven change rate of the cable diameter along the length direction in the connection section to obtain the connection section evaluation value; The network topology is constructed according to the connection point coordinates, connection segment type, and connection segment evaluation value to obtain the defective topology of the cable; The defect topological structure of the cable is used as the semantic feature of the elements of the second image data set to obtain a second image feature set.
5. The method for detecting defects in cable production according to claim 4, characterized in that: By formula: ; Calculate the connection segment evaluation value P, where: is the area of the i-th defect region in the connection segment, is the number of defective areas in the connection segment, is the preset standard area, is the discreteness of the defect area relative to the standard, is the standard deviation of the gray value change intensity of the i-th defect area in the connection segment, is the preset standard gray value standard deviation, Stability of gray value changes in defective areas, is the uneven change rate of the cable diameter along the length direction, The cable diameter uneven change rate is the preset standard. is the square of the deviation between the actual diameter uneven change rate and the standard value, , , are weight coefficients, which respectively indicate the importance of the defect area deviation, gray value standard deviation deviation and diameter uneven change rate deviation on the performance of the connection section.
6. The method for detecting defects in cable production according to claim 5, characterized in that: Generating a non-image feature set according to the auxiliary features of the second image data set, and generating a heterogeneous feature set corresponding to each element of the second image data set according to the image feature set and the non-image feature set, including: Taking each row of data of an element of the second image data set as a signal sequence, and combining the signal sequences into a time series signal data set corresponding to the element in time sequence; Using fast Fourier transform to transform each element in the time series signal data set into the frequency domain to obtain a frequency spectrum corresponding to the time series signal data set; The time-frequency features corresponding to the elements are determined according to the frequency spectrum to obtain a non-image feature set corresponding to each element of the second image data set.
7. The method for detecting defects in cable production according to claim 6, characterized in that: Generating a non-image feature set according to the auxiliary features of the second image data set, and generating a heterogeneous feature set corresponding to each element of the second image data set according to the image feature set and the non-image feature set, including: Perform dimension-up operations on the image feature set elements and the non-image feature set elements so that the lengths of the image feature set elements and the non-image feature set elements are consistent; The image feature set elements and the non-image feature set elements are normalized and feature fusion is performed to obtain a heterogeneous feature set.
8. The method for detecting defects in cable production according to claim 7, characterized in that: Constructing an end-to-end defect detection model and a selection processing layer, adding the selection processing layer to the defect detection model, and training the defect detection model through the heterogeneous feature set, including: The selective connection layer is set between the hidden layer and the fully connected layer of the defect detection model; Use the fully connected layer of the defect detection model to map the heterogeneous feature set to the hidden layer of the defect detection model to obtain an intermediate representation; By formula: , calculate the selection score, where is a function that transforms a set of real numbers into a probability distribution, and They are different weight matrices preset according to the characteristics of cable defect detection. is the hyperbolic tangent function, and are preset bias vectors respectively; Apply the selection score to the intermediate representation to obtain a weighted representation, where the weighted representation = selection score ⊙ intermediate representation, ⊙ is an element-by-element multiplication operation; Performing average pooling on the weighted representation to obtain an output of the selected processing layer; The output of the selection processing layer is input into multiple Transformer encoder layers for encoding, where each Transformer layer includes a multi-head self-attention mechanism and a feedforward neural network; Use a fully connected layer to map the output of the Transformer encoder layer to the output layer of the defect detection model; The heterogeneous feature set is divided into a training set and a test set, and the defect detection model is trained by the training set and the test set.
9. A defect detection system in cable production, characterized in that: include: An acquisition module (10) is used to acquire at least one type of defect cable image data and generate a first image data set containing defect locations and type labels based on the image data; The optimization module (20) is used to optimize the first image data set to generate a second image data set, and to generate an image feature set based on the second image data set, including according to the formula: , perform enhancement operations on each element in the first image data set to obtain a sub-image data set, where, is the image after the enhancement operation, s is the preset scaling factor, N is the preset noise matrix, I is the image in the first image data set, is the preset rotation angle, For zoom operation, The invention relates to a method for performing a rotation operation; restoring and denoising the sub-image data set using a machine learning method to obtain a second image data set; setting a convolutional neural network, and extracting the spatial structural features corresponding to each element of the second image data set through the convolutional neural network to obtain a first image feature set, wherein the spatial structural features include the edge contour clarity of the cable defect area, the area of the cable defect area, the intensity of the grayscale value change of the cable defect area, and the uneven change rate of the cable diameter along the length direction; obtaining the semantic features of each element of the second image data set according to the first image feature set to obtain a second image feature set; merging the first image feature set with the second image feature set to generate an image feature set; A generating module (30) is used to generate a non-image feature set based on the auxiliary features of the second image data set, and to generate a heterogeneous feature set corresponding to each element of the second image data set based on the image feature set and the non-image feature set; A construction module (40) is used to construct an end-to-end defect detection model and a selection processing layer, add the selection processing layer to the defect detection model, and train the defect detection model using the heterogeneous feature set; The alarm module (50) is used to input the production process image data of the cable to be detected into the defect detection model, obtain the defect category of the cable to be detected, and output an alarm prompt and the coordinates of the defect in the image according to the defect category.
Citation Information
Patent Citations
Double-learning insulator string defect identification method and equipment
CN113256604A
Cable head defect intelligent detection system
CN117455843A