Strain clamp picture deblurring method and device, computer equipment, readable storage medium and program product
By training the tension clamp pre-classification network and the defuzzy network, the blurred tension clamp pictures are defuzzy, which solves the problem of blurred images during drone shooting and improves the accuracy of defect detection.
Patent Information
- Application Number
- CN202411768205.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-07
AI Technical Summary
When taking X-ray pictures of tension-resistant wire clips, drones often jitter, resulting in blurred images, seriously affecting the accuracy of defect detection of image recognition algorithms.
By obtaining the sample set of tension clamps, preprocessing and classification, training the tension clamp pre-classification network and defuzzy network, generating a defuzzy data set, which is used to defuzzy the blurred pictures and obtain clear pictures.
It effectively reduces the interference of background images on the exercise of demotion blur network, improves the demotion blur effect of the defuzzy network on the subject of the tension clamp, and improves the accuracy of defect detection of the image recognition algorithm.
Smart Images

Figure CN119579463A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electrical technology, and in particular to a method, device, computer equipment, computer-readable storage medium and computer program product for deblurring a tension clamp image. Background Art
[0002] As a key component in power lines, the normal operation of tension clamps is directly related to the stability and safety of power supply. In order to detect the defects of tension clamps, thanks to the rapid development of drones, the use of drones to take X-ray images of tension clamps for defect detection has become a mainstream method. Based on the X-ray images of tension clamps taken by drones, the image recognition technology of deep learning can realize efficient and accurate identification of tension clamp defects.
[0003] However, since drones often shake during shooting, resulting in blurred images, this seriously affects the accuracy of defect detection by image recognition algorithms. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for deblurring images of tension clamps, which are capable of deblurring images of tension clamps, in order to address the above technical problems.
[0005] In a first aspect, the present application provides a method for deblurring a wire clip image, comprising:
[0006] Get a sample set of tension clamp images;
[0007] Selecting a preset number of tension clamp image samples from the tension clamp image sample set, preprocessing each tension clamp image sample, and obtaining a pre-classified data set;
[0008] Using the pre-classification data set to train the tension clamp pre-classification network to be trained, to obtain a trained tension clamp pre-classification network;
[0009] Using the trained tension clamp pre-classification network, classify each tension clamp image sample in the tension clamp image sample set to obtain a background image set and a target image set, and annotate each image in the target image set to obtain a deblurred data set;
[0010] The deblurring data set is used to train the deblurring network for the tension clamp to be trained, so as to obtain a trained deblurring network for the tension clamp; the trained deblurring network for the tension clamp is used to deblur the blurred image of the tension clamp, so as to obtain a clear image of the tension clamp.
[0011] In one embodiment, the preprocessing of each tension clamp image sample to obtain a pre-classified data set includes:
[0012] Each tension clamp image sample is cropped to obtain a cropped image; the cropped image is labeled, images whose entire content is background are labeled as background labels, and images containing tension clamps are labeled as target labels to obtain a labeling set; the labeling set is divided into a training set and a test set according to a predetermined ratio to form a pre-classified data set.
[0013] In one embodiment, the method of training the to-be-trained tension clamp pre-classification network using the pre-classification data set to obtain a trained tension clamp pre-classification network includes:
[0014] The training set in the pre-classification data set is input into the tension clamp pre-classification network to be trained, and the classification result of each picture is output; the classification result is a background picture or a target picture; a pre-set classification loss function is used to determine the classification result and label loss of each picture, and the parameters of the tension clamp pre-classification network are optimized through the loss; after all pictures are trained once, the current tension clamp pre-classification network is tested using the test set, and the accuracy of the current round and the loss of the current round are obtained and recorded to obtain the recorded result of the current round; when the accuracy of the current round no longer increases and the loss of the current round no longer decreases, the recorded results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recorded results are used as the trained parameters to obtain a trained tension clamp pre-classification network.
[0015] In one of the embodiments, the method uses the trained tension clamp pre-classification network to classify each tension clamp image sample in the tension clamp image sample set to obtain a background image set and a target image set, and annotates each image in the target image set to obtain a deblurred data set, including:
[0016] Crop each tension clamp image sample in the tension clamp image sample set to obtain a cropped image; input the cropped image into the trained tension clamp pre-classification network, classify the cropped image to obtain a background image set and a target image set; classify the target image set to obtain a clear image set and a fuzzy image set; for each fuzzy image in the fuzzy image set, calculate the similarity between the fuzzy image and each clear image in the clear image set, use the clear image with the highest similarity as the label image corresponding to the fuzzy image, and obtain the annotated fuzzy image set; divide the annotated fuzzy image set into a training set and a test set according to a predetermined ratio to form a defuzzified data set.
[0017] In one embodiment, the step of training the defuzzification network for the tension clamp to be trained using the defuzzification data set to obtain the trained defuzzification network for the tension clamp includes:
[0018] The training set in the fuzzy data set is input into the tension clamp defuzzification network to be trained to generate a defuzzified image; a pre-set defuzzification loss function is used to determine the loss of the defuzzified image and the corresponding label image, and the parameters of the tension clamp defuzzification network are optimized through the loss; after all images are trained once, the current tension clamp defuzzification network is tested using the test set to obtain the peak signal-to-noise ratio of the current round and the loss of the current round and record them to obtain the recording result of the current round; when the peak signal-to-noise ratio of the current round no longer increases and the loss of the current round no longer decreases, the recording results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recording results are used as the trained parameters to obtain a trained tension clamp defuzzification network.
[0019] In one embodiment, the trained deblurring network for tension clamps is used to deblur a blurred image of the tension clamps to obtain a clear image of the tension clamps, including:
[0020] When it is necessary to deblur the blurred image of the tension clamp, the blurred image is input into the trained tension clamp deblurring network to generate a clear image of the tension clamp, and the clear image of the tension clamp is used for defect detection of the tension clamp image.
[0021] In a second aspect, the present application also provides a device for deblurring a tension clamp image, comprising:
[0022] An acquisition module is used to acquire a sample set of tension clamp images;
[0023] A preprocessing module, used for selecting a preset number of tension clamp image samples from the tension clamp image sample set, preprocessing each tension clamp image sample, and obtaining a pre-classified data set;
[0024] A pre-classification module, used for training the pre-classification network of the tension clamp to be trained using the pre-classification data set to obtain a trained pre-classification network of the tension clamp;
[0025] A labeling module is used to classify each tension clamp image sample in the tension clamp image sample set by using the trained tension clamp pre-classification network to obtain a background image set and a target image set, and label each image in the target image set to obtain a deblurred data set;
[0026] The deblurring module is used to train the deblurring network of the tension clamp to be trained using the deblurring data set to obtain a trained deblurring network for the tension clamp; the trained deblurring network for the tension clamp is used to deblur the blurred image of the tension clamp to obtain a clear image of the tension clamp.
[0027] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0028] Get a sample set of tension clamp images;
[0029] Selecting a preset number of tension clamp image samples from the tension clamp image sample set, preprocessing each tension clamp image sample, and obtaining a pre-classified data set;
[0030] Using the pre-classification data set to train the tension clamp pre-classification network to be trained, to obtain a trained tension clamp pre-classification network;
[0031] Using the trained tension clamp pre-classification network, classify each tension clamp image sample in the tension clamp image sample set to obtain a background image set and a target image set, and annotate each image in the target image set to obtain a deblurred data set;
[0032] The deblurring data set is used to train the deblurring network for the tension clamp to be trained, so as to obtain a trained deblurring network for the tension clamp; the trained deblurring network for the tension clamp is used to deblur the blurred image of the tension clamp, so as to obtain a clear image of the tension clamp.
[0033] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0034] Get a sample set of tension clamp images;
[0035] Selecting a preset number of tension clamp image samples from the tension clamp image sample set, preprocessing each tension clamp image sample, and obtaining a pre-classified data set;
[0036] Using the pre-classification data set to train the tension clamp pre-classification network to be trained, to obtain a trained tension clamp pre-classification network;
[0037] Using the trained tension clamp pre-classification network, classify each tension clamp image sample in the tension clamp image sample set to obtain a background image set and a target image set, and annotate each image in the target image set to obtain a deblurred data set;
[0038] The deblurring data set is used to train the deblurring network for the tension clamp to be trained, so as to obtain a trained deblurring network for the tension clamp; the trained deblurring network for the tension clamp is used to deblur the blurred image of the tension clamp, so as to obtain a clear image of the tension clamp.
[0039] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0040] Get a sample set of tension clamp images;
[0041] Selecting a preset number of tension clamp image samples from the tension clamp image sample set, preprocessing each tension clamp image sample, and obtaining a pre-classified data set;
[0042] Using the pre-classification data set to train the tension clamp pre-classification network to be trained, to obtain a trained tension clamp pre-classification network;
[0043] Using the trained tension clamp pre-classification network, classify each tension clamp image sample in the tension clamp image sample set to obtain a background image set and a target image set, and annotate each image in the target image set to obtain a deblurred data set;
[0044] The deblurring data set is used to train the deblurring network for the tension clamp to be trained, so as to obtain a trained deblurring network for the tension clamp; the trained deblurring network for the tension clamp is used to deblur the blurred image of the tension clamp, so as to obtain a clear image of the tension clamp.
[0045] The above-mentioned method, device, computer equipment, computer-readable storage medium and computer program product for deblurring images of tension wire clamps obtain a sample set of tension wire clamp images; select a preset number of tension wire clamp image samples from the sample set of tension wire clamp images, pre-process each tension wire clamp image sample to obtain a pre-classified data set; use the pre-classified data set to train the tension wire clamp pre-classification network to be trained to obtain a trained tension wire clamp pre-classification network; use the trained tension wire clamp pre-classification network to classify each tension wire clamp image sample in the sample set of tension wire clamp images to obtain a background image set and a target image set, annotate each image in the target image set to obtain a deblurred data set; use the deblurred data set to train the tension wire clamp deblurring network to be trained to obtain a trained tension wire clamp deblurring network; the trained tension wire clamp deblurring network is used to deblur the blurred image of the tension wire clamp to obtain a clear image of the tension wire clamp. By reducing the interference of the background image on the training of the demotion blurring network, the demotion blurring effect of the deblurring network on the main body of the tension wire clamp is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 A schematic diagram of a flow chart of a method for defuzzifying a tension clamp in one embodiment;
[0048] Figure 2 A schematic diagram of training and testing of a tension clamp defuzzification method in one embodiment;
[0049] Figure 3 It is a structural block diagram of a tension clamp defuzzification device in one embodiment;
[0050] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application 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 application and are not used to limit the present application.
[0052] In one embodiment, Figure 1 As shown, a method for deblurring a tension clamp image is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0053] Step 102, obtaining a sample set of images of tension clamps.
[0054] Among them, the picture of the tension clamp was taken by a drone.
[0055] Exemplarily, a large number of X-ray images of tension clamps are taken using drones as a sample set of tension clamp images.
[0056] Among them, the X-ray image of the tension clamp is taken by X-ray technology to show the internal structure of the tension clamp and its crimping quality.
[0057] Step 104 , selecting a preset number of tension clamp image samples from the tension clamp image sample set, and preprocessing each tension clamp image sample to obtain a pre-classified data set.
[0058] Optionally, the preset number may be 30% of the tension clamp image sample set.
[0059] Exemplarily, 30% of the tension clamp image samples are selected from the tension clamp image sample set, and each tension clamp image sample is preprocessed to obtain a pre-classified data set.
[0060] Step 106, using the pre-classification data set to train the tension clamp pre-classification network to be trained, to obtain a trained tension clamp pre-classification network.
[0061] Among them, the pre-classification network is used to identify whether the image belongs to the background category or the target category containing tension clamp information.
[0062] Optionally, the pre-classification network can be an image classification network based on a convolutional neural network, such as MobileNetV3.
[0063] Exemplarily, the pre-classification data set is used to train the image classification of the tension clamp pre-classification network to be trained, so as to obtain a trained tension clamp pre-classification network.
[0064] Step 108, using the trained tension clamp pre-classification network to classify each tension clamp image sample in the tension clamp image sample set to obtain a background image set and a target image set, and annotating each image in the target image set to obtain a deblurred data set.
[0065] Among them, a single tension clamp image sample will be cropped before classification to obtain multiple cropped images, and then the cropped images will be classified.
[0066] Exemplarily, each tension clamp image sample in the tension clamp image sample set is cropped to obtain multiple cropped images, and the multiple cropped images are then classified using a trained tension clamp pre-classification network to obtain a background image set and a target image set, and each image in the target image set is labeled to obtain a deblurred data set.
[0067] Step 110, using the deblurring data set to train the deblurring network for the tension clamp to be trained, to obtain a trained deblurring network for the tension clamp; the trained deblurring network for the tension clamp is used to deblur the blurred image of the tension clamp, to obtain a clear image of the tension clamp.
[0068] Among them, after obtaining the trained tension clamp deblurring network, when the tension clamp images need to be detected, the network will be used to restore those blurred tension clamp images to clear tension clamp images before detection.
[0069] Optionally, the tension clamp defuzzification network may be a NAF Net.
[0070] Exemplarily, a deblurring data set is used to train a deblurring network for a tension clamp to be trained, thereby obtaining a trained deblurring network for a tension clamp; the trained deblurring network for a tension clamp is used to deblur a blurred image of the tension clamp, thereby obtaining a clear image of the tension clamp.
[0071] The above-mentioned method, device, computer equipment, computer-readable storage medium and computer program product for deblurring images of tension wire clamps obtain a sample set of tension wire clamp images; select a preset number of tension wire clamp image samples from the sample set of tension wire clamp images, pre-process each tension wire clamp image sample to obtain a pre-classified data set; use the pre-classified data set to train the tension wire clamp pre-classification network to be trained to obtain a trained tension wire clamp pre-classification network; use the trained tension wire clamp pre-classification network to classify each tension wire clamp image sample in the sample set of tension wire clamp images to obtain a background image set and a target image set, annotate each image in the target image set to obtain a deblurred data set; use the deblurred data set to train the tension wire clamp deblurring network to be trained to obtain a trained tension wire clamp deblurring network; the trained tension wire clamp deblurring network is used to deblur the blurred image of the tension wire clamp to obtain a clear image of the tension wire clamp. By reducing the interference of the background image on the training of the demotion blurring network, the demotion blurring effect of the deblurring network on the main body of the tension wire clamp is improved.
[0072] In an exemplary embodiment, the preprocessing of each tension clamp image sample to obtain a preclassified data set includes:
[0073] Each tension clamp image sample is cropped to obtain a cropped image; the cropped image is labeled, images whose entire content is background are labeled as background labels, and images containing tension clamps are labeled as target labels to obtain a labeling set; the labeling set is divided into a training set and a test set according to a predetermined ratio to form a pre-classified data set.
[0074] Optionally, the predetermined ratio is: the ratio of the training set to the test set is 7 to 3.
[0075] Exemplarily, each tension clamp image sample is cropped to obtain multiple cropped images; the multiple cropped images are labeled, images with all content as background are labeled as background labels, images containing tension clamps are labeled as target labels, and all cropped images and corresponding labels are used as a labeling set; the labeling set is divided into a training set and a test set in a ratio of 7 to 3 to form a pre-classified data set.
[0076] In this embodiment, by processing the tension clamp image samples and dividing them according to proportion, a pre-classification data set is obtained, which facilitates the training of the pre-classification network.
[0077] In an exemplary embodiment, the method of using the pre-classified data set to train the tension clamp pre-classification network to be trained to obtain a trained tension clamp pre-classification network includes:
[0078] The training set in the pre-classification data set is input into the tension clamp pre-classification network to be trained, and the classification result of each picture is output; the classification result is a background picture or a target picture; a pre-set classification loss function is used to determine the classification result and label loss of each picture, and the parameters of the tension clamp pre-classification network are optimized through the loss; after all pictures are trained once, the current tension clamp pre-classification network is tested using the test set, and the accuracy of the current round and the loss of the current round are obtained and recorded to obtain the recorded result of the current round; when the accuracy of the current round no longer increases and the loss of the current round no longer decreases, the recorded results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recorded results are used as the trained parameters to obtain a trained tension clamp pre-classification network.
[0079] Optionally, the classification loss function may be a cross entropy loss function.
[0080] Exemplarily, the training set in the pre-classification data set is input into the tension clamp pre-classification network to be trained, and the classification result of each picture is output; the classification result is a background picture or a target picture; the cross entropy loss function is used to calculate the classification result and label loss of each picture, and the parameters of the tension clamp pre-classification network are optimized through the loss; after all pictures are trained once, the current tension clamp pre-classification network is tested using the test set, and the accuracy of the current round and the loss of the current round are obtained and recorded to obtain the recording result of the current round; after each recording, the recording result of the current round is compared with the recording result of the previous round. If the accuracy of the current round no longer increases and the loss of the current round no longer decreases, the recording results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recording results are used as the trained parameters to obtain a trained tension clamp pre-classification network.
[0081] In this embodiment, the network training situation is determined by the accuracy and loss, and a pre-classification network with the highest accuracy can be obtained.
[0082] In an exemplary embodiment, the method uses a trained tension clamp pre-classification network to classify each tension clamp image sample in the tension clamp image sample set to obtain a background image set and a target image set, and labels each image in the target image set to obtain a deblurred data set, including:
[0083] Crop each tension clamp image sample in the tension clamp image sample set to obtain a cropped image; input the cropped image into the trained tension clamp pre-classification network, classify the cropped image to obtain a background image set and a target image set; classify the target image set to obtain a clear image set and a fuzzy image set; for each fuzzy image in the fuzzy image set, calculate the similarity between the fuzzy image and each clear image in the clear image set, use the clear image with the highest similarity as the label image corresponding to the fuzzy image, and obtain the annotated fuzzy image set; divide the annotated fuzzy image set into a training set and a test set according to a predetermined ratio to form a defuzzified data set.
[0084] Among them, the target picture set is classified based on the manual method to obtain a clear picture set and a fuzzy picture set.
[0085] Optionally, the similarity calculation may adopt a method of calculating the Euclidean distance.
[0086] Optionally, the predetermined ratio is: the ratio of the training set to the test set is 7 to 3.
[0087] Exemplarily, each tension clamp image sample in the tension clamp image sample set is cropped to obtain multiple cropped images; all the cropped images are input into the trained tension clamp pre-classification network, and the cropped images are classified to obtain a background image set and a target image set; the target image set is manually classified to obtain a clear image set and a fuzzy image set; for each fuzzy image in the fuzzy image set, the similarity between the fuzzy image and each clear image in the clear image set is calculated, and the clear image with the highest similarity is used as the label image corresponding to the fuzzy image to obtain the annotated fuzzy image set; according to a predetermined ratio, the annotated fuzzy image set is divided into a training set and a test set in a ratio of 7 to 3 to form a deblurred data set.
[0088] In this embodiment, the target image is made into a deblurred data set by removing the background image, so as to eliminate the interference of the background image when subsequently training the deblurring network of the tension clamp.
[0089] In an exemplary embodiment, the method of using the defuzzification data set to train the tension clamp defuzzification network to be trained to obtain a trained tension clamp defuzzification network includes:
[0090] The training set in the fuzzy data set is input into the tension clamp defuzzification network to be trained to generate a defuzzified image; a pre-set defuzzification loss function is used to determine the loss of the defuzzified image and the corresponding label image, and the parameters of the tension clamp defuzzification network are optimized through the loss; after all images are trained once, the current tension clamp defuzzification network is tested using the test set to obtain the peak signal-to-noise ratio of the current round and the loss of the current round and record them to obtain the recording result of the current round; when the peak signal-to-noise ratio of the current round no longer increases and the loss of the current round no longer decreases, the recording results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recording results are used as the trained parameters to obtain a trained tension clamp defuzzification network.
[0091] Optionally, the pre-set deblurring loss function may be L1 LOSS (absolute value of the root mean square error).
[0092] Exemplarily, the training set in the fuzzy data set is input into the tension clamp defuzzification network to be trained to generate a defuzzified image; using L1 LOSS, the loss of the defuzzified image and the corresponding label image is calculated, and the parameters of the tension clamp defuzzification network are optimized through the loss; after all images are trained once, the current tension clamp defuzzification network is tested using the test set to obtain the peak signal-to-noise ratio of the current round and the loss of the current round and record them to obtain the recording result of the current round; the recording result of the current round is compared with the recording result of the previous round. If the peak signal-to-noise ratio of the current round no longer increases and the loss of the current round no longer decreases, the recording results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recording results are used as the trained parameters to obtain a trained tension clamp defuzzification network.
[0093] In this embodiment, a trained tension clamp deblurring network is obtained through training, and a blurred tension clamp image can be deblurred before detecting the tension clamp to restore it to a clear image, which is beneficial to improving the detection result.
[0094] In an exemplary embodiment, the trained deblurring network for the tension clamp is used to deblur the blurred image of the tension clamp to obtain a clear image of the tension clamp, including:
[0095] When it is necessary to deblur the blurred image of the tension clamp, the blurred image is input into the trained tension clamp deblurring network to generate a clear image of the tension clamp, and the clear image of the tension clamp is used for defect detection of the tension clamp image.
[0096] Exemplarily, when it is necessary to deblur the blurred image of the tension clamp, the blurred image is input into a trained tension clamp deblurring network to generate a clear image of the tension clamp, and the clear image of the tension clamp is used for subsequent defect detection of the tension clamp image.
[0097] In this embodiment, the detection and recognition results of the tension clamps can be effectively improved by restoring the blurred image of each tension clamp to a clear image.
[0098] In an exemplary embodiment, Figure 2As shown in the figure, a deblurring method for tension clamps is used, in which a large number of X-ray images of tension clamps are taken by drones as a sample set of tension clamp images. 30% of the tension clamp image samples are selected from the sample set of tension clamp images, and each tension clamp image sample is cropped to obtain multiple cropped images; the multiple cropped images are labeled, and the images with all contents as background are labeled as background labels, and the images containing tension clamps are labeled as target labels, and all cropped images and corresponding labels are used as a labeling set; the labeling set is divided into a training set and a test set in a ratio of 7 to 3 to form a pre-classified data set. The training set in the pre-classification data set is input into the tension clamp pre-classification network to be trained, and the classification result of each picture is output; the classification result is a background picture or a target picture; the cross entropy loss function is used to calculate the classification result and label loss of each picture, and the parameters of the tension clamp pre-classification network are optimized through the loss; after all pictures are trained once, the current tension clamp pre-classification network is tested using the test set, and the accuracy of the current round and the loss of the current round are obtained and recorded to obtain the recording result of the current round; after each recording, the recording result of the current round is compared with the recording result of the previous round. If the accuracy of the current round no longer increases and the loss of the current round no longer decreases, the recording results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recording results are used as the trained parameters to obtain a trained tension clamp pre-classification network. Each tension clamp image sample in the tension clamp image sample set is cropped to obtain multiple cropped images; all the cropped images are input into the trained tension clamp pre-classification network, and the cropped images are classified to obtain a background image set and a target image set; the target image set is manually classified to obtain a clear image set and a fuzzy image set; for each fuzzy image in the fuzzy image set, the similarity between the fuzzy image and each clear image in the clear image set is calculated, and the clear image with the highest similarity is used as the label image corresponding to the fuzzy image to obtain the annotated fuzzy image set; according to a predetermined ratio, the annotated fuzzy image set is divided into a training set and a test set in a ratio of 7 to 3 to form a defuzzified data set. The training set in the fuzzy data set is input into the tension clamp defuzzification network to be trained to generate a defuzzified image; the loss of the defuzzified image and the corresponding label image is calculated using L1 LOSS, and the parameters of the tension clamp defuzzification network are optimized through the loss; after all images are trained once, the current tension clamp defuzzification network is tested using the test set to obtain the peak signal-to-noise ratio of the current round and the loss of the current round and record them to obtain the recording result of the current round; the recording result of the current round is compared with the recording result of the previous round. If the peak signal-to-noise ratio of the current round no longer increases and the loss of the current round no longer decreases, the recording results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recording results are used as the trained parameters to obtain a trained tension clamp defuzzification network.When it is necessary to deblur the blurred image of the tension clamp, the blurred image is input into the trained tension clamp deblurring network to generate a clear image of the tension clamp. The clear image of the tension clamp is used for subsequent defect detection of the tension clamp image.
[0099] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0100] In an exemplary embodiment, Figure 3 As shown, a deblurring device for a tension clamp is provided, comprising: an acquisition module 301, a preprocessing module 302, a preclassification module 303, a labeling module 304 and a deblurring module 305, wherein:
[0101] An acquisition module is used to acquire a sample set of tension clamp images;
[0102] A preprocessing module, used for selecting a preset number of tension clamp image samples from the tension clamp image sample set, preprocessing each tension clamp image sample, and obtaining a pre-classified data set;
[0103] A pre-classification module, used for training the pre-classification network of the tension clamp to be trained using the pre-classification data set to obtain a trained pre-classification network of the tension clamp;
[0104] A labeling module is used to classify each tension clamp image sample in the tension clamp image sample set by using the trained tension clamp pre-classification network to obtain a background image set and a target image set, and label each image in the target image set to obtain a deblurred data set;
[0105] The deblurring module is used to train the deblurring network of the tension clamp to be trained using the deblurring data set to obtain a trained deblurring network for the tension clamp; the trained deblurring network for the tension clamp is used to deblur the blurred image of the tension clamp to obtain a clear image of the tension clamp.
[0106] In one embodiment, the preprocessing module is further used to:
[0107] Each tension clamp image sample is cropped to obtain a cropped image; the cropped image is labeled, images whose entire content is background are labeled as background labels, and images containing tension clamps are labeled as target labels to obtain a labeling set; the labeling set is divided into a training set and a test set according to a predetermined ratio to form a pre-classified data set.
[0108] In one embodiment, the pre-classification module is further configured to:
[0109] The training set in the pre-classification data set is input into the tension clamp pre-classification network to be trained, and the classification result of each picture is output; the classification result is a background picture or a target picture; a pre-set classification loss function is used to determine the classification result and label loss of each picture, and the parameters of the tension clamp pre-classification network are optimized through the loss; after all pictures are trained once, the current tension clamp pre-classification network is tested using the test set, and the accuracy of the current round and the loss of the current round are obtained and recorded to obtain the recorded result of the current round; when the accuracy of the current round no longer increases and the loss of the current round no longer decreases, the recorded results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recorded results are used as the trained parameters to obtain a trained tension clamp pre-classification network.
[0110] In one embodiment, the annotation module is further used to:
[0111] Crop each tension clamp image sample in the tension clamp image sample set to obtain a cropped image; input the cropped image into the trained tension clamp pre-classification network, classify the cropped image to obtain a background image set and a target image set; classify the target image set to obtain a clear image set and a fuzzy image set; for each fuzzy image in the fuzzy image set, calculate the similarity between the fuzzy image and each clear image in the clear image set, use the clear image with the highest similarity as the label image corresponding to the fuzzy image, and obtain the annotated fuzzy image set; divide the annotated fuzzy image set into a training set and a test set according to a predetermined ratio to form a defuzzified data set.
[0112] In one embodiment, the deblurring module is further configured to:
[0113] The training set in the fuzzy data set is input into the tension clamp defuzzification network to be trained to generate a defuzzified image; a pre-set defuzzification loss function is used to determine the loss of the defuzzified image and the corresponding label image, and the parameters of the tension clamp defuzzification network are optimized through the loss; after all images are trained once, the current tension clamp defuzzification network is tested using the test set to obtain the peak signal-to-noise ratio of the current round and the loss of the current round and record them to obtain the recording result of the current round; when the peak signal-to-noise ratio of the current round no longer increases and the loss of the current round no longer decreases, the recording results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recording results are used as the trained parameters to obtain a trained tension clamp defuzzification network.
[0114] In one embodiment, the deblurring module is further configured to:
[0115] When it is necessary to deblur the blurred image of the tension clamp, the blurred image is input into the trained tension clamp deblurring network to generate a clear image of the tension clamp, and the clear image of the tension clamp is used for defect detection of the tension clamp image.
[0116] Each module in the above-mentioned tension clamp defuzzification device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0117] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 4 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store clear pictures of tension clamps. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a deblurring method for tension clamps is implemented.
[0118] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0119] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0120] Get a sample set of tension clamp images;
[0121] Selecting a preset number of tension clamp image samples from the tension clamp image sample set, preprocessing each tension clamp image sample, and obtaining a pre-classified data set;
[0122] Using the pre-classification data set to train the tension clamp pre-classification network to be trained, to obtain a trained tension clamp pre-classification network;
[0123] Using the trained tension clamp pre-classification network, classify each tension clamp image sample in the tension clamp image sample set to obtain a background image set and a target image set, and annotate each image in the target image set to obtain a deblurred data set;
[0124] The deblurring data set is used to train the deblurring network for the tension clamp to be trained, so as to obtain a trained deblurring network for the tension clamp; the trained deblurring network for the tension clamp is used to deblur the blurred image of the tension clamp, so as to obtain a clear image of the tension clamp.
[0125] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0126] Each tension clamp image sample is cropped to obtain a cropped image; the cropped image is labeled, images whose entire content is background are labeled as background labels, and images containing tension clamps are labeled as target labels to obtain a labeling set; the labeling set is divided into a training set and a test set according to a predetermined ratio to form a pre-classified data set.
[0127] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0128] The training set in the pre-classification data set is input into the tension clamp pre-classification network to be trained, and the classification result of each picture is output; the classification result is a background picture or a target picture; a pre-set classification loss function is used to determine the classification result and label loss of each picture, and the parameters of the tension clamp pre-classification network are optimized through the loss; after all pictures are trained once, the current tension clamp pre-classification network is tested using the test set, and the accuracy of the current round and the loss of the current round are obtained and recorded to obtain the recorded result of the current round; when the accuracy of the current round no longer increases and the loss of the current round no longer decreases, the recorded results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recorded results are used as the trained parameters to obtain a trained tension clamp pre-classification network.
[0129] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0130] Crop each tension clamp image sample in the tension clamp image sample set to obtain a cropped image; input the cropped image into the trained tension clamp pre-classification network, classify the cropped image to obtain a background image set and a target image set; classify the target image set to obtain a clear image set and a fuzzy image set; for each fuzzy image in the fuzzy image set, calculate the similarity between the fuzzy image and each clear image in the clear image set, use the clear image with the highest similarity as the label image corresponding to the fuzzy image, and obtain the annotated fuzzy image set; divide the annotated fuzzy image set into a training set and a test set according to a predetermined ratio to form a defuzzified data set.
[0131] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0132] The training set in the fuzzy data set is input into the tension clamp defuzzification network to be trained to generate a defuzzified image; a pre-set defuzzification loss function is used to determine the loss of the defuzzified image and the corresponding label image, and the parameters of the tension clamp defuzzification network are optimized through the loss; after all images are trained once, the current tension clamp defuzzification network is tested using the test set to obtain the peak signal-to-noise ratio of the current round and the loss of the current round and record them to obtain the recording result of the current round; when the peak signal-to-noise ratio of the current round no longer increases and the loss of the current round no longer decreases, the recording results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recording results are used as the trained parameters to obtain a trained tension clamp defuzzification network.
[0133] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0134] When it is necessary to deblur the blurred image of the tension clamp, the blurred image is input into the trained tension clamp deblurring network to generate a clear image of the tension clamp, and the clear image of the tension clamp is used for defect detection of the tension clamp image.
[0135] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0136] Get a sample set of tension clamp images;
[0137] Selecting a preset number of tension clamp image samples from the tension clamp image sample set, preprocessing each tension clamp image sample, and obtaining a pre-classified data set;
[0138] Using the pre-classification data set to train the tension clamp pre-classification network to be trained, to obtain a trained tension clamp pre-classification network;
[0139] Using the trained tension clamp pre-classification network, classify each tension clamp image sample in the tension clamp image sample set to obtain a background image set and a target image set, and annotate each image in the target image set to obtain a deblurred data set;
[0140] The deblurring data set is used to train the deblurring network for the tension clamp to be trained, so as to obtain a trained deblurring network for the tension clamp; the trained deblurring network for the tension clamp is used to deblur the blurred image of the tension clamp, so as to obtain a clear image of the tension clamp.
[0141] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0142] Each tension clamp image sample is cropped to obtain a cropped image; the cropped image is labeled, images whose entire content is background are labeled as background labels, and images containing tension clamps are labeled as target labels to obtain a labeling set; the labeling set is divided into a training set and a test set according to a predetermined ratio to form a pre-classified data set.
[0143] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0144] The training set in the pre-classification data set is input into the tension clamp pre-classification network to be trained, and the classification result of each picture is output; the classification result is a background picture or a target picture; a pre-set classification loss function is used to determine the classification result and label loss of each picture, and the parameters of the tension clamp pre-classification network are optimized through the loss; after all pictures are trained once, the current tension clamp pre-classification network is tested using the test set, and the accuracy of the current round and the loss of the current round are obtained and recorded to obtain the recorded result of the current round; when the accuracy of the current round no longer increases and the loss of the current round no longer decreases, the recorded results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recorded results are used as the trained parameters to obtain a trained tension clamp pre-classification network.
[0145] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0146] Crop each tension clamp image sample in the tension clamp image sample set to obtain a cropped image; input the cropped image into the trained tension clamp pre-classification network, classify the cropped image to obtain a background image set and a target image set; classify the target image set to obtain a clear image set and a fuzzy image set; for each fuzzy image in the fuzzy image set, calculate the similarity between the fuzzy image and each clear image in the clear image set, use the clear image with the highest similarity as the label image corresponding to the fuzzy image, and obtain the annotated fuzzy image set; divide the annotated fuzzy image set into a training set and a test set according to a predetermined ratio to form a defuzzified data set.
[0147] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0148] The training set in the fuzzy data set is input into the tension clamp defuzzification network to be trained to generate a defuzzified image; a pre-set defuzzification loss function is used to determine the loss of the defuzzified image and the corresponding label image, and the parameters of the tension clamp defuzzification network are optimized through the loss; after all images are trained once, the current tension clamp defuzzification network is tested using the test set to obtain the peak signal-to-noise ratio of the current round and the loss of the current round and record them to obtain the recording result of the current round; when the peak signal-to-noise ratio of the current round no longer increases and the loss of the current round no longer decreases, the recording results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recording results are used as the trained parameters to obtain a trained tension clamp defuzzification network.
[0149] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0150] When it is necessary to deblur the blurred image of the tension clamp, the blurred image is input into the trained tension clamp deblurring network to generate a clear image of the tension clamp, and the clear image of the tension clamp is used for defect detection of the tension clamp image.
[0151] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0152] Get a sample set of tension clamp images;
[0153] Selecting a preset number of tension clamp image samples from the tension clamp image sample set, preprocessing each tension clamp image sample, and obtaining a pre-classified data set;
[0154] Using the pre-classification data set to train the tension clamp pre-classification network to be trained, to obtain a trained tension clamp pre-classification network;
[0155] Using the trained tension clamp pre-classification network, classify each tension clamp image sample in the tension clamp image sample set to obtain a background image set and a target image set, and annotate each image in the target image set to obtain a deblurred data set;
[0156] The deblurring data set is used to train the deblurring network for the tension clamp to be trained, so as to obtain a trained deblurring network for the tension clamp; the trained deblurring network for the tension clamp is used to deblur the blurred image of the tension clamp, so as to obtain a clear image of the tension clamp.
[0157] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0158] Each tension clamp image sample is cropped to obtain a cropped image; the cropped image is labeled, images whose entire content is background are labeled as background labels, and images containing tension clamps are labeled as target labels to obtain a labeling set; the labeling set is divided into a training set and a test set according to a predetermined ratio to form a pre-classified data set.
[0159] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0160] The training set in the pre-classification data set is input into the tension clamp pre-classification network to be trained, and the classification result of each picture is output; the classification result is a background picture or a target picture; a pre-set classification loss function is used to determine the classification result and label loss of each picture, and the parameters of the tension clamp pre-classification network are optimized through the loss; after all pictures are trained once, the current tension clamp pre-classification network is tested using the test set, and the accuracy of the current round and the loss of the current round are obtained and recorded to obtain the recorded result of the current round; when the accuracy of the current round no longer increases and the loss of the current round no longer decreases, the recorded results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recorded results are used as the trained parameters to obtain a trained tension clamp pre-classification network.
[0161] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0162] Crop each tension clamp image sample in the tension clamp image sample set to obtain a cropped image; input the cropped image into the trained tension clamp pre-classification network, classify the cropped image to obtain a background image set and a target image set; classify the target image set to obtain a clear image set and a fuzzy image set; for each fuzzy image in the fuzzy image set, calculate the similarity between the fuzzy image and each clear image in the clear image set, use the clear image with the highest similarity as the label image corresponding to the fuzzy image, and obtain the annotated fuzzy image set; divide the annotated fuzzy image set into a training set and a test set according to a predetermined ratio to form a defuzzified data set.
[0163] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0164] The training set in the fuzzy data set is input into the tension clamp defuzzification network to be trained to generate a defuzzified image; a pre-set defuzzification loss function is used to determine the loss of the defuzzified image and the corresponding label image, and the parameters of the tension clamp defuzzification network are optimized through the loss; after all images are trained once, the current tension clamp defuzzification network is tested using the test set to obtain the peak signal-to-noise ratio of the current round and the loss of the current round and record them to obtain the recording result of the current round; when the peak signal-to-noise ratio of the current round no longer increases and the loss of the current round no longer decreases, the recording results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recording results are used as the trained parameters to obtain a trained tension clamp defuzzification network.
[0165] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0166] When it is necessary to deblur the blurred image of the tension clamp, the blurred image is input into the trained tension clamp deblurring network to generate a clear image of the tension clamp, and the clear image of the tension clamp is used for defect detection of the tension clamp image.
[0167] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0168] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0169] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for deblurring a tension clamp image, characterized in that: The method comprises: Get a sample set of tension clamp images; Selecting a preset number of tension clamp image samples from the tension clamp image sample set, preprocessing each tension clamp image sample, and obtaining a pre-classified data set; Using the pre-classification data set to train the tension clamp pre-classification network to be trained, to obtain a trained tension clamp pre-classification network; Using the trained tension clamp pre-classification network, classify each tension clamp image sample in the tension clamp image sample set to obtain a background image set and a target image set, and annotate each image in the target image set to obtain a deblurred data set; The deblurring data set is used to train the deblurring network for the tension clamp to be trained, so as to obtain a trained deblurring network for the tension clamp; the trained deblurring network for the tension clamp is used to deblur the blurred image of the tension clamp, so as to obtain a clear image of the tension clamp.
2. The method according to claim 1, characterized in that: The preprocessing of each tension clamp image sample to obtain a pre-classified data set includes: Crop each tension clamp image sample to obtain a cropped image; The cropped images are labeled, images whose entire contents are backgrounds are labeled as background labels, and images containing tension clamps are labeled as target labels, to obtain a labeling set; The annotation set is divided into a training set and a test set according to a predetermined ratio to form a pre-classified data set.
3. The method according to claim 1, characterized in that The method of training the pre-classification network for the tension clamp to be trained by using the pre-classification data set to obtain a trained pre-classification network for the tension clamp includes: Inputting the training set in the pre-classification data set into the pre-classification network of the tension clamp to be trained, and outputting the classification result of each picture; the classification result is a background picture or a target picture; Using a pre-set classification loss function, the classification result and label loss of each image are determined, and the parameters of the tension clamp pre-classification network are optimized through the loss; after all images are trained once, the current tension clamp pre-classification network is tested using a test set, and the accuracy of the current round and the loss of the current round are obtained and recorded to obtain the recording result of the current round; When the accuracy of the current round no longer increases and the loss of the current round no longer decreases, analyze the recorded results of all rounds, take the model parameters corresponding to the round with the highest accuracy in the recorded results as the trained parameters, and obtain the trained tension clamp pre-classification network.
4. The method according to claim 1, characterized in that: The method uses the trained tension clamp pre-classification network to classify each tension clamp image sample in the tension clamp image sample set to obtain a background image set and a target image set, and labels each image in the target image set to obtain a deblurred data set, including: Cropping each tension clamp image sample in the tension clamp image sample set to obtain a cropped image; Inputting the cropped images into the trained tension clamp pre-classification network, classifying the cropped images to obtain a background image set and a target image set; Classifying the target picture set to obtain a clear picture set and a fuzzy picture set; For each blurred image in the blurred image set, calculating the similarity between the blurred image and each clear image in the clear image set, taking the clear image with the highest similarity as the label image corresponding to the blurred image, and obtaining the labeled blurred image set; According to a predetermined ratio, the annotated blurred image set is divided into a training set and a test set to form a deblurred data set.
5. The method according to claim 1, characterized in that The method of using the defuzzification data set to train the defuzzification network for the tension clamp to be trained to obtain the trained defuzzification network for the tension clamp includes: Inputting the training set in the fuzzy data set into the tension clamp deblurring network to be trained to generate a deblurred image; Using a pre-set deblurring loss function, the loss of the deblurred image and the corresponding label image is determined, and the parameters of the tension clamp deblurring network are optimized through the loss; after all images are trained once, the current tension clamp deblurring network is tested using a test set, and the peak signal-to-noise ratio of the current round and the loss of the current round are obtained and recorded to obtain the recording result of the current round; When the peak signal-to-noise ratio of the current round no longer increases and the loss of the current round no longer decreases, the recording results of all rounds are analyzed, and the model parameters corresponding to the round with the highest accuracy in the recording results are used as trained parameters to obtain a trained tension clamp defuzzification network.
6. The method according to claim 1, characterized in that The trained deblurring network for tension clamps is used to deblur the blurred image of the tension clamps to obtain a clear image of the tension clamps, including: When it is necessary to deblur the blurred image of the tension clamp, the blurred image is input into the trained tension clamp deblurring network to generate a clear image of the tension clamp, and the clear image of the tension clamp is used for defect detection of the tension clamp image.
7. A device for deblurring a tension clamp image, characterized in that: The device comprises: An acquisition module is used to acquire a sample set of tension clamp images; A preprocessing module, used for selecting a preset number of tension clamp image samples from the tension clamp image sample set, preprocessing each tension clamp image sample, and obtaining a pre-classified data set; A pre-classification module, used for training the pre-classification network of the tension clamp to be trained using the pre-classification data set to obtain a trained pre-classification network of the tension clamp; A labeling module is used to classify each tension clamp image sample in the tension clamp image sample set by using the trained tension clamp pre-classification network to obtain a background image set and a target image set, and label each image in the target image set to obtain a deblurred data set; The deblurring module is used to train the deblurring network of the tension clamp to be trained using the deblurring data set to obtain a trained deblurring network for the tension clamp; the trained deblurring network for the tension clamp is used to deblur the blurred image of the tension clamp to obtain a clear image of the tension clamp.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.