Cable Quality Detection System and Method Based on Infrared Short-Wave and Visible Light Image Feature Fusion
Through the cable quality detection system that integrates infrared shortwave and visible light image features, the problems of low cable detection efficiency and insufficient accuracy in the prior art are solved, and efficient and accurate cable surface quality detection is achieved.
Patent Information
- Application Number
- CN202411482514.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2044-10-23
AI Technical Summary
Existing cable quality detection technologies have problems such as low efficiency, expensive equipment or susceptible to interference from ambient light and material characteristics, making it difficult to achieve accurate and fast cable surface quality inspection.
A cable quality detection system based on the fusion of infrared shortwave and visible light image features is adopted. Through image acquisition, processing, feature extraction and model training, combined with OTSU algorithm and lightweight attention feature fusion technology, efficient detection and classification of cable surface quality is achieved.
It improves the accuracy and reliability of the detection results, reduces the error detection rate of single data feature detection, and ensures the efficiency and accuracy of cable quality detection.
Smart Images

Figure CN119540146B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of cable quality detection, and specifically relates to a cable quality detection system and method based on the fusion of infrared short-wave and visible light image features. Background Art
[0002] As an important power transmission and communication device, the surface quality problem of cables in the actual production process directly affects their reliability and safety. To ensure the accurate detection of the surface quality during the cable production process, traditional detection technologies such as ultrasonic detection, X-ray detection, infrared image detection, and visible light image detection have been widely used. However, these technologies also pose some challenges in practical applications. For example, ultrasonic detection requires contact detection of the cable, which affects production efficiency; X-ray detection equipment is expensive and requires professional operators; infrared and visible light image detections are sensitive to environmental light and material surface characteristics and are easily interfered.
[0003] To solve these problems, emerging technologies such as intelligent vision technology based on deep learning have gradually attracted attention. These technologies can use a large amount of data for pattern recognition and feature extraction, realizing efficient detection and classification of the cable surface quality, and providing a more accurate and rapid quality control method for the cable production process. For the surface quality detection of cables, the present invention studies a neural network detection method that combines infrared images and visible light images, which can ensure the accuracy and reliability of the detection results. The present invention effectively analyzes and comprehensively evaluates the infrared and visible light image data obtained from the cable quality detection based on the neural network to identify possible defects in the cable, such as conductor breakage, insulation layer damage, etc., and reduces the false detection rate relying on single data features. Summary of the Invention
[0004] The present invention aims to solve the deficiencies of the prior art and provides the following solutions:
[0005] A cable quality detection system based on the fusion of infrared short-wave and visible light image features, comprising: an image acquisition module, an image processing module, a feature extraction module, a model training module, and a detection module;
[0006] The image acquisition module is used to acquire the cable surface image and grayscale the cable surface image to obtain the grayscaled image, and the grayscaled image includes: an initial infrared grayscale image and an initial visible light grayscale image;
[0007] The image processing module is used to process the grayscaled image to obtain infrared grayscale images and visible light grayscale images of the same size;
[0008] The feature extraction module is used to extract infrared image features and visible light image features of the infrared grayscale image and the visible light grayscale image respectively;
[0009] The model training module is used to fuse the infrared image features and the visible light image features to obtain the fused features, and train a cable quality detection model based on the fused features;
[0010] The detection module is used to acquire a real-time cable surface image, and perform cable quality detection on the real-time cable surface image based on the cable quality detection model.
[0011] Preferably, the image acquisition module includes: an infrared image acquisition unit, a visible light image acquisition unit, and a grayscale unit;
[0012] The infrared image acquisition unit is used to acquire an infrared image of the cable surface;
[0013] The visible light image acquisition unit is used to acquire a visible light image of the cable surface;
[0014] The grayscale unit is used to grayscale the infrared image and the visible light image to obtain the initial infrared grayscale image and the initial visible light grayscale image.
[0015] Preferably, the image processing module includes: an equalization unit, a filtering unit, and a cropping unit;
[0016] The equalization unit is used to perform histogram equalization processing on the grayscaled image to obtain an equalized image;
[0017] The filtering unit is used to perform high-pass filtering processing on the equalized image to obtain a filtered image;
[0018] The cropping unit is used to crop the filtered image into the same size to obtain the infrared grayscale image and the visible light grayscale image of the same size.
[0019] Preferably, the feature extraction module includes: an infrared feature extraction unit and a visible light feature extraction unit;
[0020] The infrared feature extraction unit extracts the infrared image features of the infrared grayscale image based on optimal threshold segmentation;
[0021] The visible light feature extraction unit extracts the visible light image features of the visible light grayscale image based on edge feature detection.
[0022] Preferably, the working process of the infrared feature extraction unit includes:
[0023] Using the OTSU algorithm to determine optimal threshold segmentation, and converting the infrared grayscale image into an infrared binary image;
[0024] Perform rejection of false defects on the infrared binary image, and extract the infrared image features of the processed image.
[0025] Preferably, the working process of the visible light feature extraction unit includes:
[0026] Divide the visible light grayscale image into several grayscale intervals by threshold segmentation to generate a visible light binary image;
[0027] Perform re-folding iteration on the visible light binary image, and use a structuring element to cover and replace the interference factors in the image;
[0028] Extract the visible light image features of the replaced image.
[0029] Preferably, the model training module includes: a feature encoding correction unit, a feature fusion unit, and a network training unit;
[0030] The feature encoding correction unit is used to encode the infrared image features and the visible light image features, and correct the encoded infrared image features and the encoded visible light image features to the same length;
[0031] The feature fusion unit is used to perform feature fusion on the corrected infrared image features and the corrected visible light image features to obtain fused features;
[0032] The network training unit trains the cable quality detection model based on the fused features.
[0033] The present invention also provides a cable quality detection method based on the fusion of infrared short-wave and visible light image features. The detection method is applied to the detection system described in any one of the above, and includes the following steps:
[0034] Collect the cable surface image, and gray-scale the cable surface image to obtain a gray-scaled image, where the gray-scaled image includes: an initial infrared gray-scale image and an initial visible light gray-scale image;
[0035] Process the gray-scaled image to obtain infrared and visible light gray-scale images of the same size;
[0036] Extract the infrared image features and the visible light image features of the infrared gray-scale image and the visible light gray-scale image respectively;
[0037] Fuse the infrared image features and the visible light image features to obtain fused features, and train the cable quality detection model based on the fused features;
[0038] Obtain a real-time cable surface image, and perform cable quality detection on the real-time cable surface image based on the cable quality detection model.
[0039] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0040] By using the OTSU algorithm to convert a grayscale image into a binary image and rejecting false defects, the present invention can achieve optimal threshold segmentation of the image, obtain a clear binary image, and at the same time remove the interference of negative factors such as background noise, false defects, and edge burrs. By using an edge detection algorithm to extract the main features of the defect area of the visible light binary image, accurate positioning of the defect area of the image can be achieved, the structural characteristics of the image can be maximally retained, and the amount of data required for processing and calculation can be reduced. Through the lightweight attention feature fusion technology, based on a neural network, effective analysis and comprehensive evaluation of the infrared and visible light image data obtained from cable quality detection are carried out, efficient detection and classification of the cable surface quality are realized, the false detection rate relying on a single data feature is reduced, and the accuracy and reliability of the detection results are ensured. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the present invention, the accompanying drawings required for use in the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0042] Figure 1 It is a schematic diagram of the system structure of an embodiment of the present invention;
[0043] Figure 2 It is a schematic diagram of the working process of the infrared feature extraction unit of an embodiment of the present invention;
[0044] Figure 3 It is a schematic diagram of the working process of the visible light feature extraction unit of an embodiment of the present invention;
[0045] Figure 4 It is a schematic diagram of the method flow of an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0046] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0047] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0048] Embodiment 1
[0049] In this embodiment, as Figure 1 shown, the cable quality detection system based on the fusion of infrared short-wave and visible light image features includes: an image acquisition module, an image processing module, a feature extraction module, a model training module, and a detection module.
[0050] The image acquisition module is used to acquire the cable surface image, and grayscale the cable surface image to obtain the grayscaled image, which includes: an initial infrared grayscale image and an initial visible light grayscale image.
[0051] The image acquisition module includes: an infrared image acquisition unit, a visible light image acquisition unit, and a grayscaling unit; the infrared image acquisition unit is used to acquire the infrared image of the cable surface; the visible light image acquisition unit is used to acquire the visible light image of the cable surface; the grayscaling unit is used to grayscale the infrared image and the visible light image to obtain the initial infrared grayscale image and the initial visible light grayscale image.
[0052] In this embodiment, the visible light image acquisition unit uses a high-performance image acquisition device to acquire the visible light image of the cable surface. The high-performance image acquisition device uses an optical microscopy imaging mode, which can be moderately magnified during the image acquisition process, and can better capture the tiny cracks, pits, and bulges on the cable surface. In order to ensure the quality of the acquired image during the acquisition process, a light source illumination system is introduced in this embodiment. The independent light source can avoid significant changes in light intensity and ensure the clarity of the images acquired by the high-performance image acquisition device for different models and colors of cables. The infrared image acquisition unit uses an infrared sensor, and places the infrared sensor at the same position as the high-performance image acquisition device to acquire the infrared image of the cable surface. Quality defects on the cable surface will cause grayscale changes in the infrared imaging. For the convenience of subsequent processing, the grayscaling unit performs grayscale conversion on the visible light image to obtain the initial visible light grayscale image. Since the infrared image is relatively blurred and lacks detailed features, the pixel data of the infrared image is mapped to the [0, 255] interval to obtain the initial infrared grayscale image.
[0053] The transmission speed of the cable during the manufacturing process is usually 1 - 2.5 m / s. In order to ensure that all surface defects of the cable are captured, the frame rate of the camera is set to 100 images per second. This embodiment uses four high-performance image acquisition devices placed simultaneously in four directions of the cable, which can process 400 images within one second, and the processing time for each frame is within 2.5 ms.
[0054] The image processing module is used to process the grayscaled image to obtain infrared grayscale images and visible light grayscale images of the same size.
[0055] The image processing module includes: an equalization unit, a filtering unit, and a cropping unit; the equalization unit is used to perform histogram equalization processing on the grayscale image to obtain an equalized image; the filtering unit is used to perform high-pass filtering processing on the equalized image to obtain a filtered image; the cropping unit is used to crop the filtered image into the same size to obtain infrared grayscale images and visible light grayscale images of the same size.
[0056] In this embodiment, the equalization unit can enrich the detailed features of the image, make the image clearer, highlight the texture and details of the cable surface, and thus make it easier to analyze and identify by performing histogram equalization processing on the cable surface image. The filtering unit can enhance the high-frequency information of the image, highlight the fine texture and edge features in the image, and thus enhance the contrast by performing high-pass filtering processing on the cable surface image. The cable surface grayscale images collected by the cropping unit have different sizes, and all the infrared grayscale images and visible light grayscale images are unified into the same size through image cropping.
[0057] The feature extraction module is used to extract infrared image features and visible light image features of the infrared grayscale image and the visible light grayscale image respectively.
[0058] The feature extraction module includes: an infrared feature extraction unit and a visible light feature extraction unit; the infrared feature extraction unit extracts infrared image features of the infrared grayscale image based on optimal threshold segmentation; the visible light feature extraction unit extracts visible light image features of the visible light grayscale image based on edge feature detection.
[0059] The working process of the infrared feature extraction unit includes: using the OTSU algorithm to determine optimal threshold segmentation, converting the infrared grayscale image into an infrared binary image; performing false defect rejection processing on the infrared binary image, and extracting infrared image features of the processed image.
[0060] In this embodiment, as Figure 2 shown, in order to distinguish the foreground and background regions of the image, the infrared feature extraction unit first uses the OTSU algorithm to convert the grayscale image into a binary image to achieve image threshold segmentation. The OTSU algorithm uses the grayscale histogram of the image, and dynamically determines the optimal threshold segmentation through the maximum variance between the foreground and the background, so as to obtain the corresponding binary image. Assuming that L is the gray level of the image, its pixels can be divided into two categories, C0 and C1, and their probabilities can be described by the following equations respectively:
[0061]
[0062] Among them, P r( ) represents the probability of the pixels within the parentheses, w0 represents the proportion of pixels belonging to the foreground region, w1 represents the proportion of pixels in the background region, p(i) represents the probability of pixels with the i-th gray level, i represents a natural number, t represents the threshold of the image, and L represents the gray level of the image; assuming that the gray mean square error (GMSE) of the entire image is represented as μ, then the variance between the two categories can be defined as:
[0063]
[0064] where μ₀ represents the GMSE of the foreground and μ₁ represents the GMSE of the background. To evaluate the quality, this embodiment introduces a judgment function for the threshold:
[0065]
[0066] where t* represents the optimal threshold segmentation when reaches the maximum value, and the OTSU algorithm expects to convert the gray image into a binary image. represents the negation function, which is the t value when the objective function within the parentheses reaches the maximum value, and l represents the number of gray levels of the image. After threshold segmentation, a clear binary image is obtained, but the image still contains background noise, false defects, and edge burrs; in order to remove the above negative factors and false defects, the image needs to be processed to reject false defects; assuming that the minimum size of the defects to be recognized by the system is ε mm × ε mm, then the lowest resolution should satisfy the pixels corresponding to ε 2 mm 2 To improve the accuracy of detection, this embodiment creates a corresponding pixel for ∈ 2 mm 2 (∈ < ε) under a certain redundancy. Assuming that the number of pixels of the relevant minimum defect is P, P is selected as the fixed threshold to segment true detections and false detections, which can be expressed as:
[0067] P = [ε / ∈]
[0068] Then the algorithm for rejecting pseudo-defects can be described as: (1) Find the neighborhood connection domain; (2) Calculate the area of each connection domain, expressed as S k (k = 1, …, N)(3) The resulting image after defect filtering processing should meet the following requirements:
[0069] f i = B, S k < P
[0070] Among them, fi represents the filtering result of pixel i, that is, the gray value after defect filtering processing. B represents the gray value of the background area, which is 0 in this embodiment. The connected regions with an area smaller than the threshold P are regarded as false defect pixels, and their gray levels are changed to 0, otherwise they are changed to 255. After completing the processing of absolute false defects, the infrared image features of the processed image are extracted.
[0071] The working process of the visible light feature extraction unit includes: dividing the visible light gray image into several gray intervals by using threshold segmentation to generate a visible light binary image; performing re-folding iteration on the visible light binary image and using a structuring element to cover and replace the interference factors in the image; extracting the visible light image features of the replaced image.
[0072] In this embodiment, as Figure 3 shown, the cable defect image is divided into multiple gray intervals by using threshold segmentation technology, a suitable threshold is selected, each pixel in the visible light image is compared, the pixels of the visible light image are divided into foreground and background, and the OTSU algorithm is used for adaptive threshold segmentation. The uniformity of the gray distribution of the image is measured by variance to generate a visible light binary image. Then, re-folding iteration of the gray cable image is performed: (1) Select an initial estimate T0 for a grayed visible light binary image; (2) Segment the image with T0 and divide it into two parts (less than the gray value T0 and greater than the gray value T0) to generate two groups of pixels, G1 and G2. G1 consists of all pixels in the cable image with a gray value greater than T0, while G2 consists of all images in the cable image with a gray value less than or equal to T0; (3) Calculate the average gray values u1 and u2 of all pixels in G1 and G2 in the cable image; (4) Calculate the new threshold of the cable picture: T = 1 / 2(u1 + u2); (5) Repeat steps (2) to (4) until the difference between the T values in the obtained cable picture is less than the predefined parameter T0, and then the picture parameter T0 is the required threshold; in the thresholded cable defect image, there are some very small isolated points or gaps formed by random reasons, which are not the defect features to be extracted, and morphological operations need to be applied to filter out these interferences. Replace the origin value of the structuring element with the minimum value of the pixels in the target image covered by the structuring element, and replace the interference factors in the image one by one; for the binary cable defect image, if all the points covered by the structuring element are in the background or foreground, the minimum value in this range is equal to the origin value, that is, the origin value is not replaced; if the structuring element covers an edge, the origin value will be replaced by the minimum value (i.e., 0), resulting in boundary contraction, and then the replacement of interference factors is completed. Finally, the visible light image features of the replaced image are extracted.
[0073] The model training module is used to fuse the infrared image features and visible light image features to obtain the fused features, and train the cable quality detection model based on the fused features.
[0074] The model training module includes: a feature encoding correction unit, a feature fusion unit, and a network training unit; the feature encoding correction unit is used to encode the infrared image features and visible light image features, and correct the encoded infrared image features and encoded visible light image features to the same length; the feature fusion unit is used to perform feature fusion on the corrected infrared image features and corrected visible light image features to obtain fused features; the network training unit trains a cable quality detection model based on the fused features.
[0075] In this embodiment, the feature encoding correction unit encodes the infrared image features and visible light image features, and corrects the encoded infrared image features and encoded visible light image features to the same length. Suppose the feature x is represented by m1 infrared short-wave image feature sets {f v,1 (x), …, f v,m1 (x)}, and the feature q is represented by m2 visible light image feature sets {f s,1 (q), …, f s,m2 (q)}; two feature fusion blocks are used to encode the infrared short-wave image features and visible light image features into their d-dimensional cross-modal embeddings e(x) and e(q) respectively. According to the two embeddings, the feature similarity s(x, q) can be measured:
[0076]
[0077] where fusion v () represents the fusion of infrared short-wave image features, fusion s () represents the fusion of visible light image features, and similarity() represents a function for calculating the similarity between two embedding vectors e(x) and e(q); without loss of generality, a set of m different features {f1, …, f m} with sizes {d1, …, d m} is obtained. Since the features are obtained by different extractors and are not compatible, this embodiment uses a feature transformation layer to correct the different features to the same length. The feature fusion unit performs feature fusion on the corrected infrared image features and corrected visible light image features to obtain fused features. To transform the i-th feature into a new d-dimensional feature, the following is used:
[0078]
[0079] where σ is a non-linear activation function, and Linear di×d represents a fully connected layer with an input size of d i and an output size of d. Each input feature has its own linear layer, which is optional when d i is equal to d; although the transformed features {fi ′} are comparable, but they are not equally important for representing short-wave infrared features and visible light features. Therefore, weighted fusion is used to fuse the features of the corrected infrared image and the corrected visible light image:
[0080]
[0081] {a1, …, a i} = softmax(Linear d×1 {f′1, …, f′ n}))
[0082] Among them, represents the fused feature, n represents the number of features, ai represents the weight, softmax represents the normalization activation function, and Linear d×1 represents the linear transformation layer, which is a linear mapping from the d-dimensional feature space to the 1-dimensional space. When the weights in the forced equation are uniform, the attention-free feature fusion block is a special case, that is, a i = 1 / n. The network training unit trains the cable quality detection model based on the fused feature. Specifically, the triplet ranking loss with hard negative mining is used as the base loss function. For the feature q in a given training batch, let x + and x - be the relevant and irrelevant features to q, and is the hard negative that most violates the ranking constraint. Then there is:
[0083]
[0084] Among them, α is a positive hyperparameter that controls the magnitude of the ranking loss, and argmax x- represents the value of x - when s(x + , q)-s(x - , q) takes the maximum value, and max represents taking the maximum value; when training a cross-modal network that generates multiple similarities, it is better to combine the losses of each similarity than to use a single loss with the combined similarity. Therefore, we follow this strategy and calculate the loss loss i (q), that is, calculate the loss in the i-th space by replacing s with s i in the equation, and train the network to minimize the combined loss to obtain the network at this time, that is, the cable quality detection model.
[0085] The detection module acquires the real-time cable surface image and performs cable quality detection on the real-time cable surface image based on the cable quality detection model.
[0086] Embodiment 2
[0087] In this embodiment, a cable quality detection method based on the fusion of infrared short-wave and visible light image features is as follows Figure 4 shown, and includes the following steps:
[0088] S1. Collect the cable surface image and grayscale the cable surface image to obtain the grayscaled image, which includes: the initial infrared grayscale image and the initial visible light grayscale image. S2. Process the grayscaled image to obtain infrared grayscale images and visible light grayscale images of the same size. S3. Extract the infrared image features and visible light image features of the infrared grayscale image and the visible light grayscale image respectively. S4. Fuse the infrared image features and visible light image features to obtain the fused features, and train a cable quality detection model based on the fused features. S5. Obtain the real-time cable surface image and perform cable quality detection on the real-time cable surface image based on the cable quality detection model.
[0089] The above-described embodiments are only descriptions of the preferred embodiments of the present invention, and do not limit the scope of the present invention. Without departing from the design spirit of the present invention, various deformations and improvements made by those of ordinary skill in the art to the technical solutions of the present invention shall fall within the protection scope determined by the claims of the present invention.
Claims
1. A cable quality detection system based on the feature fusion of infrared short-wave and visible light images, characterized in that Including: An image acquisition module, an image processing module, a feature extraction module, a model training module, and a detection module; The image acquisition module is used to acquire the cable surface image, and grayscale the cable surface image to obtain the grayscaled image, where the grayscaled image includes: an initial infrared grayscale image and an initial visible light grayscale image; The image processing module is used to process the grayscaled image to obtain an infrared grayscale image and a visible light grayscale image of the same size; The feature extraction module is used to extract the infrared image feature and the visible light image feature of the infrared grayscale image and the visible light grayscale image respectively; The model training module is used to fuse the infrared image feature and the visible light image feature to obtain the fused feature, and train the cable quality detection model based on the fused feature; The detection module is used to acquire the real-time cable surface image, and perform cable quality detection on the real-time cable surface image based on the cable quality detection model; The feature extraction module includes: an infrared feature extraction unit and a visible light feature extraction unit; The infrared feature extraction unit extracts the infrared image feature of the infrared grayscale image based on the optimal threshold segmentation; The infrared feature extraction unit, in order to distinguish the foreground and background regions of the image, first uses the OTSU algorithm to convert the grayscale image into a binary image to achieve image threshold segmentation; the OTSU algorithm uses the grayscale histogram of the image, and dynamically determines the optimal threshold segmentation through the maximum variance between the foreground and the background, so as to obtain the corresponding binary image; let L be the grayscale level of the image, then its pixels can be divided into two categories C0 and C1, and their probabilities are respectively: where P r () represents the probability of the pixel within the parentheses, w0 represents the proportion of pixels belonging to the foreground region, w1 represents the proportion of pixels belonging to the background region, p(i) represents the probability of a pixel with the i-th gray level, i represents a natural number, t represents the threshold of the image, and L represents the gray level of the image; assuming that the gray mean square error (GMSE) of the entire image is denoted as μ, then the variance between the two classes can be defined as: Among them, μ0 represents the GMSE of the foreground, and μ1 represents the GMSE of the background; a threshold judgment function is introduced to evaluate the quality: Among them, t* represents the optimal threshold segmentation at which the OTSU algorithm expects to convert a grayscale image into a binary image when reaches the maximum value. represents the inverse function, which is the t value when the objective function in the parentheses reaches the maximum value. l represents the number of gray levels of the image; after threshold segmentation, a clear binary image is obtained, and the binary image is processed to reject false defects: Let the minimum size of the defect to be recognized by the system be ε mm×ε mm, then the lowest resolution should satisfy the pixels corresponding to ε 2 mm 2 and make a pixel corresponding to ∈ 2 mm 2 (∈ < ε) under a certain redundancy; Let the number of pixels of the relevant minimum defect be P, and P is selected as the fixed threshold to segment true detections and false detections, which can be expressed as: P = [ε / ∈] The algorithm for rejecting pseudo-defects can be described as follows:
1. Find the neighborhood connection domain; 2. Calculate the area of each connection domain, denoted as S k (k = 1, …, N); 3. The result image after defect filtering processing should meet the following requirements: f i = B,S k <P Among them, f i represents the filtering result of pixel i, B represents the gray value of the background region, the connected region with an area smaller than the threshold P is regarded as a false defect pixel, and the gray level is changed to 0, otherwise it is changed to 255; after completing the processing of absolute false defects, the infrared image features of the processed image are extracted; The visible light feature extraction unit extracts the visible light image feature of the visible light grayscale image based on edge feature detection; The working process of the infrared feature extraction unit includes: using the OTSU algorithm to determine the optimal threshold segmentation, converting the infrared grayscale image into an infrared binary image; performing false defect rejection processing on the infrared binary image, and extracting the infrared image feature of the processed image; The working process of the visible light feature extraction unit includes: using threshold segmentation to divide the visible light grayscale image into several grayscale intervals to generate a visible light binary image; performing re-folding iteration on the visible light binary image, and using a structural element to cover and replace the interference factors in the image; extracting the visible light image feature of the replaced image; The model training module includes: a feature coding correction unit, a feature fusion unit, and a network training unit; The feature coding correction unit is used to encode the infrared image feature and the visible light image feature, and correct the encoded infrared image feature and the encoded visible light image feature to the same length; the feature fusion unit is used to perform feature fusion on the corrected infrared image feature and the corrected visible light image feature to obtain the fused feature; the network training unit trains the cable quality detection model based on the fused feature; The feature encoding correction unit encodes the infrared image features and the visible light image features, and corrects the encoded infrared image features and the encoded visible light image features to the same length; assume that the feature x is represented by m1 infrared short-wave image feature sets {f v,1 (x), …, f v,m1 (x)}, and the feature q is represented by m2 visible light image feature sets {f s,1 (q), …, f s,m2 (q)}; two feature fusion blocks are used to encode the infrared short-wave image features and the visible light image features into their d-dimensional cross-modal embeddings e(x) and e(q) respectively; the feature similarity s(x, q) can be measured based on the two embeddings: Among them, fusion v () represents the infrared short-wave image feature fusion, and fusion s () represents the visible light image feature fusion. Similarity() represents a function for calculating the similarity between two embedding vectors e(x) and e(q); a set of different m features {f1,..., f m} with sizes {d1,..., d m} are obtained; the feature transformation layer is used to correct the different features to the same length; the feature fusion unit fuses the corrected infrared image features and the corrected visible light image features to obtain the fused features. To transform the i-th feature into a new d-dimensional feature, use: where σ is a non-linear activation function, Linear di×d represents a fully connected layer with an input size of d i , and the output size is d; weighted fusion is used to perform feature fusion on the corrected infrared image features and the corrected visible light image features: {a1,..., a i} = softmax(Linear d×1 ({f′1,..., f′ n})) Among them, represents the fused feature, n represents the number of features, and a i represents the weight, softmax represents the normalization activation function, and Linear d×1 represents the linear transformation layer, which is a linear mapping from a d-dimensional feature space to a 1-dimensional space. When the weights in the forced equation are uniform, a i = 1 / n; The network training unit trains the cable quality detection model based on the fused features: using the triplet ranking loss with hard negative mining as the base loss function. For the feature q in a given training batch, let x + and x - be the relevant and irrelevant features to q, and is the hard negative that most violates the ranking constraint. Then there is: Among them, α is a positive hyperparameter that controls the magnitude of the ranking loss, argmax x- represents s(x - ,q)-s(x + ,q) takes the maximum value when x - The value of max represents the maximum value; when training a cross-modal network that generates multiple similarities, it is better to combine the losses of each similarity than to use a single loss with the combined similarity; calculate the loss loss i (q), that is, by using s in the equation i Instead of s, calculate the loss in the i-th space and train the network to minimize the combined loss The network at this time is obtained, that is, the cable quality detection model.
2. The cable quality detection system based on the fusion of infrared short-wave and visible light image features according to claim 1, characterized in that, The image acquisition module includes: an infrared image acquisition unit, a visible light image acquisition unit, and a grayscale unit; The infrared image acquisition unit is used to acquire infrared images of the cable surface; The visible light image acquisition unit is used to acquire visible light images of the cable surface; The grayscale unit is used to grayscale the infrared image and the visible light image to obtain the initial infrared grayscale image and the initial visible light grayscale image.
3. The cable quality detection system based on the fusion of infrared short-wave and visible light image features according to claim 1, wherein The image processing module includes: an equalization unit, a filtering unit, and a cropping unit; The equalization unit is used to perform histogram equalization processing on the grayscaled image to obtain an equalized image; The filtering unit is used to perform high-pass filtering on the equalized image to obtain a filtered image; The cropping unit is used to crop the filtered image into the same size to obtain the infrared grayscale image and the visible light grayscale image of the same size.
4. A cable quality detection method based on the feature fusion of infrared short-wave and visible light images, the detection method being applied to the detection system according to any one of claims 1-3, characterized in that, It includes the following steps: Acquire cable surface images, and grayscale the cable surface images to obtain grayscaled images, where the grayscaled images include: an initial infrared grayscale image and an initial visible light grayscale image; Process the grayscaled images to obtain infrared grayscale images and visible light grayscale images of the same size; Extract infrared image features and visible light image features of the infrared grayscale image and the visible light grayscale image respectively; Fuse the infrared image features and the visible light image features to obtain fused features, and train a cable quality detection model based on the fused features; Obtain real-time cable surface images, and perform cable quality detection on the real-time cable surface images based on the cable quality detection model.
Citation Information
Patent Citations
Photovoltaic array hot spot inspection system and method based on unmanned aerial vehicle dual-light imaging
CN118379249A