Target sheet surface defect detection method, device, equipment and medium
By collecting and processing the surface defects of the radioactive target sheet and training the detection network model, efficient detection of the surface defects of the target sheet is achieved, solving the problem that cannot be detected in the prior art.
Patent Information
- Application Number
- CN202411650184.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-02-28
AI Technical Summary
The prior art cannot effectively detect surface defects of radioactive target sheets. The direct observation method is greatly affected by the external environment and is not suitable for radioactive target sheets. Ultrasonic detection mainly targets internal defects and cannot detect surface defects.
By obtaining the image set of surface defects of the target sheet, a training data set is generated, and the detection network is trained based on this to obtain the detection model. The image of the target sheet to be detected is input to the detection model, feature extraction and loss value calculation are performed, and the detection network parameters are updated until the preset threshold is reached to obtain the model for detection.
Accurate detection of surface defects of radioactive target sheets is achieved, which avoids the uncertainty of direct observation of human eyes and overcomes the limitation that ultrasonic detection cannot detect surface defects.
Smart Images

Figure CN119540195A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of defect detection, and specifically provides a target surface defect detection method, device, equipment and medium. Background Art
[0002] In an accelerator system, particles are accelerated by the accelerator and collide directly with the target. Due to the specific physical and chemical properties of the target, the particles interact with the target after collision to produce secondary particles, radiation or chemical reactions.
[0003] If there are defects on the surface of the target, the beam quality and stability will be reduced, and the acceleration efficiency of the accelerator will be reduced and the energy consumption will increase. What's more, it will threaten the safe operation of the accelerator. On the one hand, the defective target will suddenly break or splash out fragments when it is hit by particles. These fragments may hit other components or equipment casings inside the accelerator at extremely high speeds, causing serious damage to the accelerator. On the other hand, it may also trigger a series of chain reactions, such as circuit short circuits and cooling system failures. These faults may further aggravate the damage to the accelerator and increase the difficulty and cost of maintenance. Therefore, it is necessary to accurately detect defects on the surface of the target.
[0004] In the prior art, the methods for detecting surface defects of target pieces mainly include direct observation and ultrasonic testing. Direct observation is easily affected by external environmental factors and has great uncertainty. In addition, the tritium-coated target piece is radioactive and not suitable for direct observation by the human eye. Ultrasonic testing mainly targets crack defects and is good at detecting internal defects of objects, but cannot detect surface defects such as oxidation and stains. This is the technical problem that direct observation and ultrasonic testing cannot efficiently detect defects on the surface of target pieces.
[0005] Accordingly, the art needs a new target surface defect detection method to solve the above problems. Summary of the invention
[0006] In order to overcome the above-mentioned defects, the present application is proposed to provide a solution or at least partially solve the technical problem that the prior art cannot detect surface defects of radioactive target sheets.
[0007] In a first aspect, the present application provides a target surface defect detection method, comprising:
[0008] Acquire a target surface defect image set;
[0009] Obtaining a training data set according to the target surface defect image set;
[0010] Based on the training data set, the detection network is trained to obtain a detection model;
[0011] Inputting the image of the target piece to be detected into the detection model to obtain the detection result;
[0012] Determining that the detection result is defective, sending the detection result to a user terminal;
[0013] The step of training the detection network based on the training data set to obtain the detection model includes:
[0014] Inputting the training data set into a focusing network to obtain a first down-sampled feature map;
[0015] Inputting the first down-sampled feature map into a first convolutional neural network to obtain a feature map;
[0016] Normalizing the feature maps to obtain feature maps of the same scale;
[0017] Obtaining a fused feature map according to the first downsampled feature map, the feature map, and the feature map of the same scale;
[0018] Performing feature extraction on the fused feature map to obtain a detection feature map;
[0019] According to the loss function, a loss value is obtained, and the parameters of the detection network are updated according to the loss value;
[0020] When it is determined that the loss value is less than a preset threshold, the current parameter data is used as a detection model.
[0021] In a technical solution of the above-mentioned target surface defect detection method, the inputting of the training data set into the focusing network to obtain the first down-sampled feature map includes:
[0022] Obtain pixel values of the training data set at intervals to obtain multiple pixel value sets;
[0023] Combining the multiple pixel value sets to obtain multiple feature maps;
[0024] The multiple feature maps are input into a second convolutional neural network to obtain a first down-sampled feature map.
[0025] In a technical solution of the above-mentioned target surface defect detection method, the step of inputting the first down-sampled feature map into a first convolutional neural network to obtain a feature map includes:
[0026] Inputting the first down-sampled feature map into a first convolutional neural network to obtain a second down-sampled feature map;
[0027] Inputting the second down-sampled feature map into a third convolutional neural network to obtain an up-sampled feature map;
[0028] The first down-sampled feature map and the up-sampled feature map are fused to obtain a feature map.
[0029] In a technical solution of the above-mentioned target surface defect detection method, obtaining a fused feature map according to the first down-sampled feature map, the feature map and the feature map of the same scale includes:
[0030] Downsampling the first downsampled feature map, the feature map, and the feature map of the same scale to obtain a third downsampled feature map;
[0031] Upsampling the third downsampled feature map to obtain an upsampled feature map;
[0032] The downsampled feature map, the feature map, the feature map of the same scale and the upsampled feature map are fused to obtain a fused feature map.
[0033] In a technical solution of the above-mentioned target surface defect detection method, the loss value is obtained according to the loss function, and the parameters of the detection network are updated according to the loss value, including:
[0034] According to the predicted box and the true box, the first loss value is obtained;
[0035] The second loss value is obtained according to the angle cost, distance cost, shape cost, and intersection-over-union cost between the predicted box and the true box;
[0036] Obtaining a loss value according to the first loss value and the second loss value;
[0037] According to the loss value, the parameters of the detection network are updated.
[0038] In a technical solution of the above-mentioned target surface defect detection method, the feature extraction of the fused feature map to obtain the detection feature map includes:
[0039] According to the fused feature map, feature maps of different scales are obtained;
[0040] Feature extraction is performed on the feature maps of different scales to obtain detection feature maps.
[0041] In a technical solution of the above-mentioned target sheet surface defect detection method, obtaining a training data set according to the target sheet surface defect image set includes:
[0042] Annotating the target sheet defect image set to obtain annotated data;
[0043] Perform data enhancement processing on the labeled data to obtain a training data set.
[0044] In a second aspect, the present application provides a defect detection device, comprising:
[0045] An acquisition module is used to acquire a target surface defect image set;
[0046] A data processing module, used to obtain a training data set based on the target sheet surface defect image set;
[0047] A training module, used to train the detection network based on the training data set to obtain a detection model;
[0048] An analysis module, used for inputting the image of the target piece to be detected into the detection model to obtain the detection result;
[0049] A processing module, configured to determine that the detection result is defective, and then send the detection result to a user terminal;
[0050] The step of training the detection network based on the training data set to obtain the detection model includes:
[0051] Inputting the training data set into a focusing network to obtain a first down-sampled feature map;
[0052] Inputting the first down-sampled feature map into a first convolutional neural network to obtain a feature map;
[0053] Normalizing the feature maps to obtain feature maps of the same scale;
[0054] Obtaining a fused feature map according to the first downsampled feature map, the feature map, and the feature map of the same scale;
[0055] Performing feature extraction on the fused feature map to obtain a detection feature map;
[0056] According to the loss function, a loss value is obtained, and the parameters of the detection network are updated according to the loss value;
[0057] When it is determined that the loss value is less than a preset threshold, the current parameter data is used as a detection model.
[0058] In a third aspect, the present application provides a defect detection device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute any one of the methods in the first aspect through the computer program.
[0059] In a fourth aspect, the present application provides a computer-readable storage medium storing a plurality of program codes, wherein the program codes are suitable for being loaded and executed by a processor to execute any one of the methods in the first aspect.
[0060] The present application provides a method, device, equipment and medium for detecting surface defects of a target sheet. The method specifically comprises: obtaining a set of target sheet surface defect images; obtaining a training data set based on the target sheet surface defect image set; training a detection network based on the training data set to obtain a detection model; inputting an image of a target sheet to be detected into the detection model to obtain a detection result; and if the detection result is determined to be defective, sending the detection result to a user terminal to realize the detection of surface defects of a radiation target sheet. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The disclosure of the present application will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present application. In addition, similar numbers in the drawings are used to represent similar components, among which:
[0062] Figure 1 It is a structural schematic diagram of a target surface defect system embodiment 1 provided in an embodiment of the present application;
[0063] Figure 2 It is a flow chart of a first embodiment of a target sheet surface defect detection method provided in an embodiment of the present application;
[0064] Figure 3 It is a flow chart of a second embodiment of a target sheet surface defect detection method provided in an embodiment of the present application;
[0065] Figure 4 It is a flow chart of a third embodiment of a target sheet surface defect detection method provided in an embodiment of the present application;
[0066] Figure 5 It is a flow chart of a fourth embodiment of a target sheet surface defect detection method provided in an embodiment of the present application;
[0067] Figure 6 It is a flow chart of a fifth embodiment of a target sheet surface defect detection method provided in an embodiment of the present application;
[0068] Figure 7 It is a flow chart of a sixth embodiment of a target sheet surface defect detection method provided in an embodiment of the present application;
[0069] Figure 8 It is a flow chart of a seventh embodiment of a target sheet surface defect detection method provided in an embodiment of the present application;
[0070] Fig. 9 It is a flow chart of an eighth embodiment of a target sheet surface defect detection method provided in an embodiment of the present application;
[0071] Fig.10It is a structural schematic diagram of a target surface defect detection device provided in an embodiment of the present application;
[0072] Fig.11 A schematic diagram of the structure of a target surface defect detection device provided in an embodiment of the present application.
[0073] Reference numerals list :
[0074] 11: cloud server; 12: image acquisition device; 13: target piece replacement device; 21: acquisition module; 22: data processing module; 23: training module; 24: analysis module; 25: processing module; 31: processor; 32: memory. DETAILED DESCRIPTION
[0075] Some embodiments of the present application are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present application and are not intended to limit the protection scope of the present application.
[0076] In the description of the present application, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, memory, and may also include software parts, such as program code, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware or a combination of the two. Non-temporary computer-readable storage media include any suitable medium that can store program code, such as a disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as only A, only B or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and / or B" and may include only A, only B or A and B. The singular terms "one" and "the" may also include plural forms.
[0077] Here we first explain some terms involved in this application.
[0078] Convolutional neural network: It is a type of feedforward neural network with deep structure and convolution calculation. It is one of the representative algorithms of deep learning. Convolutional neural network has the ability of representation learning and can classify input information in a translation-invariant manner according to its hierarchical structure. Therefore, it is also called "translation-invariant artificial neural network."
[0079] Label box: In the training data set, objects are labeled with rectangular boxes.
[0080] Prediction box: After detecting the target image through the detection model, a rectangular box of the defect area is obtained.
[0081] At present, the traditional method of detecting target surface defects is mainly through direct observation, that is, directly observing with the naked eye whether there are scratches, cracks, corrosion and other defects on the target surface. However, radioactive targets are not suitable for direct observation by the human eye, which results in the technical problem that the existing technology cannot detect the surface defects of radioactive targets.
[0082] Based on this, in order to solve the above technical problems, the technical concept of the present application is to provide a new target surface defect detection method to achieve accurate detection of surface defects of radioactive target sheets.
[0083] Figure 1 Schematic diagram of the structure of the target surface defect system embodiment 1 provided in the present application. Figure 1 As shown, the target sheet surface defect system includes: a cloud server 11, an image acquisition device 12, and a target sheet replacement device 13. The image acquisition device 12 acquires a target sheet surface defect image set, and sends the target sheet surface defect image set to the cloud server 11. The cloud server 11 obtains a training data set based on the target sheet surface defect image set, and trains a detection network based on the training data set to obtain a detection model. Then the image acquisition device 12 acquires an image of the target sheet to be detected, and inputs the image into the detection model to obtain a detection result. When it is determined that the detection result is defective, the detection result is sent to the user terminal so that the user can replace the target sheet to be detected through the target sheet replacement device 13.
[0084] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0085] Figure 2 1 is a flow chart of a target surface defect detection method according to an embodiment of the present application. Figure 2 As shown, specifically, the method includes:
[0086] Step S201: Acquire a target surface defect image set.
[0087] In this embodiment, a target sheet with surface defects is obtained manually, and an image of the surface of the target sheet is captured by an industrial camera.
[0088] Step S202: obtaining a training data set based on a target surface defect image set.
[0089] In this embodiment, a training data set is obtained by labeling a target sheet surface defect image set according to defect types and processing the data.
[0090] In this embodiment, the defect types include scratches, cracks, pores, pits, corrosion, and oxidation.
[0091] Step S203: Based on the training data set, the detection network is trained to obtain a detection model.
[0092] In this embodiment, a detection network is preset in the cloud server, a training data set is input into the detection network for training, and a detection model is obtained at the end of the training.
[0093] Step S204: input the image of the target piece to be detected into the detection model to obtain the detection result.
[0094] In this embodiment, the camera collects images of the target piece to be inspected at fixed intervals, and sends the images to the inspection model of the cloud server through the network, and the inspection model inspects the images to obtain inspection results, wherein the inspection results are defective or non-defective.
[0095] Step S205: If the detection result is determined to be defective, the detection result is sent to the user terminal.
[0096] In this embodiment, if the detection result is defective, the cloud server will send the detection result to the user terminal, and the user can start the target piece replacement device, which will remove the target piece to be detected and install a new target piece.
[0097] In this embodiment, a target sheet surface defect image set is obtained; a training data set is obtained based on the target sheet surface defect image set; a detection network is trained based on the training data set to obtain a detection model; the image of the target sheet to be detected is input into the detection model to obtain a detection result; if the detection result is determined to be defective, the detection result is sent to a user terminal. Compared with the prior art, in which defects of radioactive target sheets cannot be detected by naked eyes, the present application obtains a training data set based on the target sheet surface defect image set, and trains a detection network based on the training data set to obtain a training model, and then the image of the target sheet to be detected is input into the detection model to obtain a detection result. When the detection result is determined to be defective, the detection result is sent to the user terminal to realize automatic detection of target sheet surface defects.
[0098] Figure 3 FIG. 1 is a flow chart of a second embodiment of a target surface defect detection method provided in an embodiment of the present application. Based on the above embodiment, Figure 3 As shown, specifically, one implementation of step S203 is:
[0099] Step S301: Input the training data set into the focusing network to obtain a first down-sampled feature map.
[0100] In this embodiment, the images in the training data set are three-channel color images. After the training data is input into the focusing network, the three-channel color images are subjected to dimensionality reduction processing to obtain a first down-sampled feature map.
[0101] Step S302: Input the first down-sampled feature map into the first convolutional neural network to obtain a feature map.
[0102] In this embodiment, the first down-sampled feature map is input into the first convolutional neural network, and while the first convolutional neural network is used to extract features, feature fusion is performed on the feature map generated by the feature extraction to obtain a feature map.
[0103] Step S303: normalize the feature map to obtain feature maps of the same scale.
[0104] In this embodiment, the feature maps have different sizes, and feature maps of the same scale are obtained by normalizing the feature maps of different sizes.
[0105] In this embodiment, according to the preset size, up-sampling processing is performed on the feature map smaller than the preset size, and down-sampling processing is performed on the feature map larger than the preset size, so as to obtain feature maps of the same scale.
[0106] Step S304: Obtain a fused feature map according to the first down-sampled feature map, the feature map, and the feature map of the same scale.
[0107] Step S305: extract features from the fused feature map to obtain a detection feature map.
[0108] In this embodiment, the detection feature graphs have different scales to detect surface defects of different sizes.
[0109] Step S306: According to the loss function, a loss value is obtained, and the parameters of the detection network are updated according to the loss value.
[0110] In this embodiment, if the loss value is greater than a preset threshold, the parameters of the detection network are updated according to the back propagation algorithm.
[0111] Step S307: When it is determined that the loss value is less than the preset threshold, the current parameter data is used as a detection model.
[0112] In this embodiment, when it is determined that the loss value is less than a preset threshold, the training is determined to be completed, and the current parameters are used as the detection model.
[0113] In this embodiment, the training data set is input into the focusing network to obtain a first down-sampled feature map; the first down-sampled feature map is input into the first convolutional neural network to obtain a feature map; the feature map is normalized to obtain a feature map of the same scale; a fused feature map is obtained based on the first down-sampled feature map, the feature map and the feature map of the same scale; features are extracted from the fused feature map to obtain a detection feature map; a loss value is obtained based on the loss function, and the parameters of the detection network are updated based on the loss value; when it is determined that the loss value is less than a preset threshold, the current parameter data is used as a detection model to obtain a detection model.
[0114] Figure 4 FIG. 1 is a flow chart of a target surface defect detection method according to an embodiment of the present application. Based on the above embodiment, Figure 4 As shown, specifically, one implementation of step S301 is:
[0115] Step S401: Obtain pixel values of a training data set at intervals to obtain multiple pixel value sets.
[0116] In this embodiment, starting from the first pixel in the upper left corner of the image data, pixel values are obtained after a fixed number of pixel data are spaced from left to right and from top to bottom. The above process is repeated, and the obtained pixel values are combined to obtain multiple pixel value sets.
[0117] In this embodiment, for example, the fixed data may be 1.
[0118] Step S402: Combine multiple pixel value sets to obtain multiple feature maps.
[0119] In this embodiment, multiple pixel value sets are combined according to the order and the rows and columns to obtain multiple feature maps.
[0120] In this embodiment, pixel values of the same row are grouped in order, and pixel values of multiple rows are combined in order of row numbers.
[0121] Step S403: Input the multiple feature maps into the second convolutional neural network to obtain a first down-sampled feature map.
[0122] In this embodiment, multiple feature maps are respectively input into the second convolutional neural network to obtain a first downsampled feature map, and the scale of the downsampled feature map is smaller than the scale of the training data set.
[0123] In this embodiment, pixel values of a training data set are acquired at intervals to obtain multiple pixel value sets; the multiple pixel value sets are combined and processed to obtain multiple feature maps; the multiple feature maps are input into a second convolutional neural network to obtain a first down-sampled feature map, so as to reduce the data dimension and increase the training speed without losing information.
[0124] Figure 5 FIG. 1 is a flow chart of a fourth embodiment of a target surface defect detection method provided in an embodiment of the present application. Based on the above embodiment, Figure 5 As shown, specifically, one implementation of step S302 is:
[0125] Step S501: Input the first down-sampled feature map into the first convolutional neural network to obtain a second down-sampled feature map.
[0126] In this embodiment, the first down-sampled feature map is input into the first convolutional neural network, and a dimensionality reduction operation is performed while extracting features from the first down-sampled feature map. The scale of the second down-sampled feature map is smaller than the scale of the first down-sampled feature map.
[0127] In this embodiment, dimensionality reduction processing of the first down-sampled feature map is achieved by setting the step size in the convolution layer in the convolutional neural network and the size of the receptive field in the pooling layer.
[0128] Step S502: Input the second down-sampled feature map into the third convolutional neural network to obtain an up-sampled feature map.
[0129] In this embodiment, the second down-sampled feature map is input into the third convolutional neural network to perform deconvolution processing on the second down-sampled feature map, so as to perform dimension upscaling processing on the second down-sampled feature map, wherein the scale of the up-sampled feature map is greater than the scale of the second down-sampled feature map.
[0130] Step S503: Fusing the first down-sampled feature map and the up-sampled feature map to obtain a feature map.
[0131] In this embodiment, the first down-sampled feature map and the up-sampled feature map are superimposed to obtain a feature map, wherein the scale of the first down-sampled feature map is the same as the scale of the up-sampled feature map.
[0132] Optionally, feature points at the same position in the first down-sampled feature map and the up-sampled feature map may be added together to obtain a feature map.
[0133] In this embodiment, the first down-sampled feature map is input into the first convolutional neural network to obtain the second down-sampled feature map; the second down-sampled feature map is input into the third convolutional neural network to obtain the up-sampled feature map; the first down-sampled feature map and the up-sampled feature map are fused to obtain a feature map, so as to obtain the characteristic information of the surface defects.
[0134] Figure 6 FIG. 1 is a flow chart of a fifth embodiment of a target surface defect detection method provided in an embodiment of the present application. Based on the above embodiment, Figure 6 As shown, specifically, one implementation of step S304 is:
[0135] Step S601: down-sample the first down-sampled feature map, the feature map, and the feature map of the same scale to obtain a third down-sampled feature map.
[0136] In this embodiment, the first downsampled feature map, the feature map, and the feature map of the same scale are downsampled according to a convolutional neural network to obtain a third downsampled feature map corresponding to the first downsampled feature map, the feature map, and the feature map of the same scale, respectively.
[0137] Step S602: up-sample the third down-sampled feature map to obtain an up-sampled feature map.
[0138] In this embodiment, the third down-sampled feature map is up-sampled by deconvolution to obtain an up-sampled feature map.
[0139] Step S603: Fusing the downsampled feature map, the feature map, the feature map of the same scale, and the upsampled feature map to obtain a fused feature map.
[0140] In this embodiment, the downsampled feature maps, feature maps, and feature maps of the same scale have the same scale as their corresponding upsampled feature maps.
[0141] In this embodiment, for example, the downsampled feature map, the feature map, and the feature map of the same scale are stacked with the upsampled feature map.
[0142] Optionally, the downsampled feature map, the feature map, and the feature points at the same position of the feature map and the upsampled feature map at the same scale may be added together.
[0143] In this embodiment, the first downsampled feature map, the feature map and the feature map of the same scale are downsampled to obtain a third downsampled feature map; the third downsampled feature map is upsampled to obtain an upsampled feature map; the downsampled feature map, the feature map and the feature map of the same scale are fused with the upsampled feature map to obtain a fused feature map, so as to obtain a fused feature.
[0144] Figure 7 FIG. 6 is a flow chart of a sixth embodiment of a target surface defect detection method provided in an embodiment of the present application. Based on the above embodiment, Figure 7 As shown, specifically, one implementation of step S306 is:
[0145] Step S701: Obtain a first loss value based on the predicted box and the true box.
[0146] In this embodiment, according to Formula 1:
[0147]
[0148] Get the first loss value, where A is the real box, B is the predicted box, c is the diagonal of the rectangle formed by the real box and the predicted box, d is the length of the line connecting the center of the real box and the center of the predicted box, and w A is the width of the real frame, h A is the height of the real frame, w B is the width of the prediction box, h B is the height of the prediction box.
[0149] Step S702: Obtain a second loss value according to the angle loss, distance loss, shape loss, and intersection-over-union loss between the predicted frame and the real frame.
[0150] In this embodiment, according to Formula 2, an SIoU loss value is obtained, and the SIoU loss value is the second loss value.
[0151] Loss2=a+d+s+i (2)
[0152] Among them, a is the angle loss, d is the distance loss, s is the shape loss, and i is the intersection-over-union loss.
[0153] Step S703: Obtain a loss value according to the first loss value and the second loss value.
[0154] In this embodiment, the loss value is obtained according to the first loss value, the second loss value, the first preset weight, and the second preset weight.
[0155] In this embodiment, for example, the first preset weight is 0.3 and the second preset weight is 0.7, then according to Formula 3:
[0156] Loss=0.3*Loss1+0.7*Loss2 (3)
[0157] Get the loss value LOSS.
[0158] Step S704: Update the parameters of the detection network according to the loss value.
[0159] In this embodiment, the gradient descent algorithm updates the parameters of the detection network according to the loss value.
[0160] In this embodiment, a second loss value is obtained according to the angle cost, distance cost, shape cost, and intersection-over-union cost between the predicted box and the real box; a second loss value is obtained according to the angle loss, distance loss, shape loss, and intersection-over-union loss between the predicted box and the real box; a loss value is obtained according to the first loss value and the second loss value; and according to the loss value, the parameters of the detection network are updated to achieve updating of the parameters of the detection network.
[0161] Figure 8 : is a flow chart of a target surface defect detection method embodiment 7 provided in the present application. Based on the above embodiment, Figure 8 As shown, specifically, one implementation of step S305 is:
[0162] Step S801: Obtain feature maps of different scales based on the fused feature map.
[0163] In this embodiment, the fused feature map is upsampled or downsampled to obtain feature maps of different scales.
[0164] Step S802: extract features from feature maps of different scales to obtain detection feature maps.
[0165] In this embodiment, feature maps of different scales are input into a convolutional neural network to obtain multiple detection feature maps of different scales.
[0166] In this embodiment, feature maps of different scales are obtained based on the fused feature maps; feature extraction is performed on the feature maps of different scales respectively to obtain detection feature maps, so as to realize the detection of surface defects of different sizes.
[0167] Fig. 9 FIG. 8 is a flow chart of an eighth embodiment of a target surface defect detection method provided in an embodiment of the present application. Based on the above embodiment, Fig. 9 As shown, specifically, one implementation of step S202 is:
[0168] Step S901: annotate the target film defect image set to obtain annotated data.
[0169] In this embodiment, the annotation data is obtained according to the position information and defect type of the defect part in the target sheet defect image data.
[0170] Step S902: Perform data enhancement processing on the labeled data to obtain a training data set.
[0171] In this embodiment, the amount of data for each defect type is different. In order to ensure the balance of the data amount for each defect type, it is necessary to perform data enhancement processing on the labeled data by flipping, adding Gaussian noise, rotating and oversampling, so as to obtain a training data set.
[0172] In this embodiment, the target sheet defect image set is annotated to obtain annotated data; and the annotated data is enhanced to obtain a training data set.
[0173] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effect of the present application, different steps do not have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present application.
[0174] Furthermore, the present application also provides a target surface defect detection device.
[0175] Fig.10 Schematic diagram of the structure of a target surface defect detection device provided in an embodiment of the present application. Fig.10 As shown, the target sheet surface defect detection device in the embodiment of the present application mainly includes an acquisition module 21, a data processing module 22, a training module 23, an analysis module 24 and a processing module 25. In some embodiments, one or more of the acquisition module 21, the data processing module 22, the training module 23, the analysis module 24 and the processing module 25 can be combined into one module. In some embodiments, the acquisition module 21 can be configured to acquire a target sheet surface defect image set. The data processing module 22 can be configured to obtain a training data set based on the target sheet surface defect image set. The training module 23 can be configured to train the detection network based on the training data set to obtain a detection model. Among them, based on the training data set, the detection network is trained to obtain the detection model, including: inputting the training data set into the focusing network to obtain the first down-sampled feature map; inputting the first down-sampled feature map into the first convolutional neural network to obtain the feature map; normalizing the feature map to obtain the feature map of the same scale; obtaining the fused feature map according to the first down-sampled feature map, the feature map and the feature map of the same scale; extracting features from the fused feature map to obtain the detection feature map; obtaining the loss value according to the loss function, and updating the parameters of the detection network according to the loss value; when it is determined that the loss value is less than the preset threshold, the current parameter data is used as the detection model. The analysis module 24 can be configured to input the image of the target piece to be detected into the detection model to obtain the detection result. The processing module 25 can be configured to determine that the detection result is defective, and then send the detection result to the user terminal.
[0176] The target surface defect detection device is used to perform Figure 2 and Figure 3 The target surface defect detection method embodiment shown in the figure has similar technical principles, technical problems solved and technical effects produced. Technicians in this technical field can clearly understand that for the convenience and conciseness of description, the specific working process and related instructions of the target surface defect detection device can refer to the contents described in the embodiment of the target surface defect detection method, which will not be repeated here.
[0177] It is understood by those skilled in the art that all or part of the processes in the method for implementing the above-mentioned embodiment of the present application can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.
[0178] Furthermore, the present application also provides a defect detection device. In an embodiment of a defect detection device according to the present application, the defect detection device includes a processor 31 and a memory 32. The memory 32 can be configured to store a program for executing the target surface defect detection method of the above method embodiment, and the processor 31 can be configured to execute the program in the memory, which includes but is not limited to the program for executing the target surface defect detection method of the above method embodiment. For ease of explanation, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application. The defect detection device can be a control device device formed by various electronic devices.
[0179] Furthermore, the present application also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present application, the computer-readable storage medium can be configured to store a program for executing the target surface defect detection method of the above-mentioned method embodiment, and the program can be loaded and run by the processor to implement the above-mentioned target surface defect detection method. For ease of explanation, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application. The computer-readable storage medium can be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present application is a non-temporary computer-readable storage medium.
[0180] Further, it should be understood that since the setting of each module is only for illustrating the functional units of the device of the present application, the physical devices corresponding to these modules may be the processor itself, or a part of the software in the processor, a part of the hardware, or a part of the combination of software and hardware. Therefore, the number of each module in the figure is only schematic.
[0181] It is understood by those skilled in the art that each module in the device can be adaptively split or merged. Such splitting or merging of specific modules will not cause the technical solution to deviate from the principle of the present application, and therefore, the technical solutions after splitting or merging will fall within the protection scope of the present application.
[0182] So far, the technical solutions of the present application have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments. Without departing from the principles of the present application, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present application.
Claims
1. A target surface defect detection method, characterized in that: include: Acquire a target surface defect image set; Obtaining a training data set according to the target surface defect image set; Based on the training data set, the detection network is trained to obtain a detection model; Inputting the image of the target piece to be detected into the detection model to obtain the detection result; Determining that the detection result is defective, sending the detection result to a user terminal; The step of training the detection network based on the training data set to obtain the detection model includes: Inputting the training data set into a focusing network to obtain a first down-sampled feature map; Inputting the first down-sampled feature map into a first convolutional neural network to obtain a feature map; Normalizing the feature maps to obtain feature maps of the same scale; Obtaining a fused feature map according to the first downsampled feature map, the feature map, and the feature map of the same scale; Performing feature extraction on the fused feature map to obtain a detection feature map; According to the loss function, a loss value is obtained, and the parameters of the detection network are updated according to the loss value; When it is determined that the loss value is less than a preset threshold, the current parameter data is used as a detection model.
2. The method according to claim 1, characterized in that The step of inputting the training data set into a focusing network to obtain a first down-sampled feature map comprises: Obtain pixel values of the training data set at intervals to obtain multiple pixel value sets; Combining the multiple pixel value sets to obtain multiple feature maps; The multiple feature maps are input into a second convolutional neural network to obtain a first down-sampled feature map.
3. The method according to claim 1, characterized in that The step of inputting the first down-sampled feature map into a first convolutional neural network to obtain a feature map comprises: Inputting the first down-sampled feature map into a first convolutional neural network to obtain a second down-sampled feature map; Inputting the second down-sampled feature map into a third convolutional neural network to obtain an up-sampled feature map; The first down-sampled feature map and the up-sampled feature map are fused to obtain a feature map.
4. The method according to claim 1, characterized in that The step of obtaining a fused feature map according to the first down-sampled feature map, the feature map and the feature map of the same scale comprises: Downsampling the first downsampled feature map, the feature map, and the feature map of the same scale to obtain a third downsampled feature map; Upsampling the third downsampled feature map to obtain an upsampled feature map; The downsampled feature map, the feature map, the feature map of the same scale and the upsampled feature map are fused to obtain a fused feature map.
5. The method according to claim 1, characterized in that The step of obtaining a loss value according to the loss function and updating the parameters of the detection network according to the loss value includes: According to the predicted box and the true box, the first loss value is obtained; The second loss value is obtained according to the angle loss, distance loss, shape loss, and intersection-over-union loss between the predicted box and the real box; Obtaining a loss value according to the first loss value and the second loss value; According to the loss value, the parameters of the detection network are updated.
6. The method according to claim 1, characterized in that The step of extracting features from the fused feature map to obtain a detection feature map includes: According to the fused feature map, feature maps of different scales are obtained; Feature extraction is performed on the feature maps of different scales to obtain detection feature maps.
7. The method according to claim 1, characterized in that The step of obtaining a training data set based on the target surface defect image set includes: Annotating the target sheet defect image set to obtain annotated data; Perform data enhancement processing on the labeled data to obtain a training data set.
8. A defect detection device, characterized in that: include: An acquisition module is used to acquire a target surface defect image set; A data processing module, used to obtain a training data set based on the target sheet surface defect image set; A training module, used to train the detection network based on the training data set to obtain a detection model; An analysis module, used for inputting the image of the target piece to be detected into the detection model to obtain the detection result; A processing module, configured to determine that the detection result is defective, and then send the detection result to a user terminal; The step of training the detection network based on the training data set to obtain the detection model includes: Inputting the training data set into a focusing network to obtain a first down-sampled feature map; Inputting the first down-sampled feature map into a first convolutional neural network to obtain a feature map; Normalizing the feature maps to obtain feature maps of the same scale; Obtaining a fused feature map according to the first downsampled feature map, the feature map, and the feature map of the same scale; Performing feature extraction on the fused feature map to obtain a detection feature map; According to the loss function, a loss value is obtained, and the parameters of the detection network are updated according to the loss value; When it is determined that the loss value is less than a preset threshold, the current parameter data is used as a detection model.
9. A defect detection device, comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.
10. A computer-readable storage medium storing a plurality of program codes, characterized in that: The program code is suitable for being loaded and executed by a processor to execute the method according to any one of claims 1 to 7.