A method for detecting and locating burst beads in high-speed moving filter rods
Through high-speed cameras, images are acquired and combined with edge detection, clustering and deep convolutional neural network methods, the problem in high-speed moving object detection is solved, and high-precision filter rod burst bead detection and positioning is achieved.
Patent Information
- Application Number
- CN202211180591.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2042-09-27
AI Technical Summary
The prior art is difficult to effectively detect and locate high-speed moving objects, especially in the case of image distortion and difficulty in labeling, resulting in insufficient detection accuracy and generalization capabilities.
High-speed cameras are used to collect filter rod burst bead RGB images, and target detection and positioning are carried out through preprocessing, edge detection, clustering and deep convolutional neural networks (especially combining spatial pyramid pooling structure and compression excitation module).
The accurate detection and positioning of the high-speed motion filter rod burst beads is achieved, the detection rate and accuracy are improved, and the shortcomings of traditional methods in high-speed object detection are overcome.
Smart Images

Figure CN115526908B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of target detection, and in particular relates to a method for detecting and locating burst beads in a high-speed moving filter rod. Background Art
[0002] The task of target detection is to find all the targets (objects) of interest in an image and determine their categories or locations. It is one of the core issues in the field of computer vision. Since various objects have different appearances, shapes, and postures, and are interfered by factors such as illumination and occlusion during imaging, target detection has always been the most challenging problem in the field of computer vision. In target detection, the research on detection algorithms for ordinary objects has been relatively mature. However, the target detection method for high-speed moving objects has low accuracy in artificially extracted features due to its imaging smear and difficulty in labeling, which brings difficulties to conventional image recognition methods and has become a difficult problem that needs to be overcome in the field of target detection.
[0003] Traditional target detection algorithms are mainly based on image processing. Although traditional target detection algorithms have good performance in specific scenarios, their detection speed, detection accuracy and generalization ability cannot meet the requirements of modern target detection. Therefore, target detection algorithms based on deep learning have become the mainstream algorithms for target detection. In recent years, target detection algorithms have expanded from the widely used two-stage networks to one-stage networks. Among them, the representative RCNN and YOLO series networks have played a vital role in the development of target detection, providing effective algorithms and directions for the detection and positioning of high-speed objects.
[0004] The paper "Chen Z, Wang R, Zhang Z, et al. Background-Foreground Interaction for Moving Object Detection in Dynamic Scenes. Information Sciences, 2019, 4972" proposes a new mechanism to support the interaction between long-term background and short-term foreground. The interaction includes weight transfer and fusion between long-term background and short-term foreground models. This interactive method improves the detection effect of moving object detection and prevents deadlock and degradation in the model. However, it does not consider the moving speed of the target and is only applicable to specific object motion scenes.
[0005] The paper "Wan W, Tang S, Zhang H. Moving object detection based on high-speed video sequence images, 2019 IEEE 8th Joint International Information Technology and Artificial Intelligence Conference (ITAIC), Chongqing, China, 2019, 906-910" studied the problem of moving target detection based on high-speed video sequence images, proposed an improved hybrid detection method combining background subtraction and frame difference, and used threshold area denoising and morphological filtering to post-process moving objects. This method can effectively detect moving objects in high-speed video sequence images. However, there is no data cleaning and preprocessing, so that more effective target features cannot be extracted, and the target's expression ability is not fully utilized. Summary of the invention
[0006] In order to solve the above technical problems, the present invention proposes a method for detecting and locating burst beads in a high-speed moving filter rod.
[0007] The technical solution adopted by the present invention is: a method for detecting and locating burst beads in a high-speed moving filter rod, and the specific steps are as follows:
[0008] S1, collect the image of the high-speed moving filter rod bursting beads;
[0009] S2, preprocessing the high-speed motion filter rod bursting bead image collected in step S1;
[0010] S3, performing edge detection on the image obtained in step S2 to obtain a preliminary pixel point area of the target;
[0011] S4, clustering the image collected in step S1, and combining it with the result of step S3 to obtain the accurate pixel point area of the target;
[0012] S5, annotating the images processed in step S4, and reasonably generating sample training sets, verification sets, and test sets;
[0013] S6. Combine the spatial pyramid pooling structure (SPP) and the squeeze-and-excitation module (SE) to build a deep convolutional neural network.
[0014] S7. Train deep neural networks.
[0015] Furthermore, in step S1, a high-speed camera is used to capture an RGB image of the high-speed moving filter rod bursting beads.
[0016] Furthermore, in step S2, the RGB image collected in step S1 is grayed using a maximum value method.
[0017] Furthermore, in step S3, the grayscale image obtained in step S2 and the Sobel operator are used to perform edge detection, separate pixels with large grayscale value changes, and then determine the edge to obtain a preliminary pixel area of the target. The specific steps are as follows:
[0018] The expression of the Sobel edge detection operator is as follows:
[0019]
[0020] The Sobel edge detection operator consists of two 3×3 convolution factors Gu and Gv, which are used for horizontal and vertical gradient calculations respectively. By performing a planar convolution with the grayscale image, the horizontal and vertical grayscale difference approximations can be obtained respectively. The calculation expressions are as follows:
[0021]
[0022] Among them, f(x,y) represents the gray value at the image point (x,y), Gx(x,y) and Gy(x,y) represent the horizontal and vertical gray gradient values at the image point (x,y) respectively. The horizontal and vertical gray gradient values of each pixel in the image are combined by the following formula to calculate the total value of the gray change at the point:
[0023]
[0024] If the gradient G of a point is greater than a certain threshold, the point is considered to be an edge point. After using the Sobel edge detection operator to calculate the total grayscale gradient value of all points, the position of all edge points can be obtained according to the threshold, thereby obtaining the preliminary target and background areas.
[0025] Furthermore, in step S4, the high-speed motion filter rod bursting bead image collected in step S1 is clustered using an iterative self-organizing data analysis techniques algorithm (ISODATA), and the obtained clustering result is divided into a foreground class and a background class, and then an intersection operation is performed with the target area obtained in step S3 to obtain the accurate pixel point area of the target.
[0026] Furthermore, in step S5, the image obtained in step S4 is annotated, and a training set, a validation set and a test set are constructed in a reasonable proportion for training and performance testing.
[0027] Furthermore, in step S6, the deep convolutional neural network is mainly composed of convolutional layers, and an SPP structure and an SE module are introduced. After the input image is subjected to feature extraction through several convolutional layers, it is input into the SPP module for fusion of feature maps of different sizes, and then passed through the SE module to assign adaptive weights to each channel of the feature map, and then passed through the convolutional layer to obtain the final feature map and output.
[0028] Furthermore, in step S7, the training set obtained in step S5 is input into the deep convolutional neural network constructed in step S6 for forward propagation, the cost function value is calculated, and the parameters of the multi-input parallel deep convolutional neural network are updated using a backward propagation algorithm based on gradient descent, and forward and backward propagation are iteratively performed until the cost function converges. The specific steps are as follows:
[0029] S71, forward propagation,
[0030] by represents the tth feature map of the lth layer (l≥2). If the lth layer is a convolutional layer, then:
[0031]
[0032] in, represents the convolution kernel connecting the s-th input feature map and the t-th output feature map, represents the bias term, σ(·) represents the nonlinear activation function, and the symbol “*” represents the convolution operation.
[0033] If the lth layer is the maximum pooling layer, then:
[0034]
[0035] in, represents the coordinate value of the position (x′, y′) in the t-th feature map of the l-th layer (l≥2), r 1 、r 2 It represents the size of the pooling window, and u and v represent the variables pre-set in the pooling window.
[0036] If the lth layer is an average pooling layer, then:
[0037]
[0038] Among them, r 1 、r 2 Indicates the size of the pooling window.
[0039] If the lth layer is a fully connected layer, then:
[0040] a (l) =σ(w (l) a (l-1) +b (l) ) (7)
[0041] Among them, a (l) represents the feature map of layer l, w (l) represents the weight of the lth layer, b (l) is the bias term for this layer.
[0042] S72, calculating the cost function value,
[0043] Taking the cross entropy function as the cost function, its calculation formula is:
[0044]
[0045] Among them, the first two terms of formula (8) represent the regression bounding box loss, and the third and fourth terms represent the confidence loss. The confidence losses of positive samples (there are objects in the unit grid) and negative samples (there are no objects in the unit grid, which is the background) are calculated. The final feature map is divided into S×S grids, and each grid unit can predict B bounding boxes. (x i ,y i ) represents the coordinates of the center of the target bounding box in the i-th unit grid, (w i ,h i ) represents the width and height of the target bounding box in the i-th unit grid, then the actual position coordinates are available (x i ,y i ,w i ,h i )express, Represents the predicted position coordinates; C i Indicates whether there is a real target in the grid cell. If so, it is 1, and if not, it is 0. Represents the prediction result within the grid cell, if there is a target, it is 1, if not, it is 0; represents the cell grid i with objects, represents the jth bounding box in grid cell i that is responsible for predicting the object, represents the jth bounding box in grid cell i that is responsible for predicting no object, and λ coord , obj , noobj Represent the weights of each loss respectively.
[0046] S73, the network parameters are updated based on the back propagation algorithm of gradient descent, as shown in the following formula:
[0047]
[0048]
[0049] Among them, α is the learning rate, L represents the loss function, and w and b represent the sets of weights and bias terms in the network respectively.
[0050] Furthermore, the detection and positioning method also includes step S8, performing a detection performance test on the network trained in step S7, inputting the images in the test set into the network trained in step S7 for forward propagation, and using two evaluation indicators, precision and recall, to describe the results of target detection and positioning.
[0051] The beneficial effects of the present invention are as follows: the method of the present invention first collects a high-speed motion filter rod bursting bead image, pre-processes the image, uses an edge detection method to obtain a preliminary pixel point area of the target, and then uses a clustering algorithm to obtain a foreground class and a background class area, performs an intersection operation with the previously obtained target area to determine the accurate pixel point area of the target, and then annotates the image, reasonably generates a sample training set, a verification set and a test set, builds a deep convolutional neural network including an SPP structure and an SE module, completes the fusion of feature maps of different sizes, assigns an adaptive weight to each channel, and realizes accurate detection and positioning of the target. The method of the present invention combines edge detection and image clustering to accurately locate the target area, remove interference and facilitate annotation, and adjusts the method for obtaining the target area and the network structure according to different sample types. After the sample is trained, the detection rate can be highly guaranteed to achieve accurate positioning of the target. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 The present invention is a flow chart of a method for detecting and locating burst beads in a high-speed moving filter rod.
[0053] Figure 2 A schematic diagram of the flow of the ISODATA clustering algorithm provided in an embodiment of the present invention.
[0054] Figure 3 A schematic diagram of a neural network structure provided by an embodiment of the present invention.
[0055] Figure 4 A schematic diagram of the SPP structure provided in an embodiment of the present invention.
[0056] Figure 5 A schematic diagram of the SE module structure provided in an embodiment of the present invention.
[0057] Figure 6 A schematic diagram of target detection and positioning results provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The method of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0059] like Figure 1 As shown, a flow chart of a method for detecting and locating burst beads in a high-speed moving filter rod of the present invention is shown, and the specific steps are as follows:
[0060] S1, collect the image of the high-speed moving filter rod bursting beads;
[0061] S2, preprocessing the high-speed motion filter rod bursting bead image collected in step S1;
[0062] S3, performing edge detection on the image obtained in step S2 to obtain a preliminary pixel point area of the target;
[0063] S4, clustering the image collected in step S1, and combining it with the result of step S3 to obtain the accurate pixel point area of the target;
[0064] S5, annotating the images processed in step S4, and reasonably generating sample training sets, verification sets, and test sets;
[0065] S6. Combine the SPP structure and SE module to build a deep convolutional neural network;
[0066] S7. Train deep neural networks.
[0067] In this embodiment, in step S1, a high-speed camera is used to capture the RGB image of the high-speed moving filter rod bursting beads.
[0068] In this embodiment, in step S2, the RGB image collected in step S1 is grayed using a maximum value method, and the three-channel image is converted into a one-channel image to facilitate subsequent edge detection.
[0069] In this embodiment, in step S3, edge detection is performed using the grayscale image obtained in step S2 and the Sobel operator to separate pixels with large grayscale value changes, and then determine the edge to obtain a preliminary pixel area of the target.
[0070] Edge detection is a basic problem in image processing and computer vision. The so-called edge refers to the collection of pixels whose surrounding pixels have a sharp change in grayscale. It is the most basic feature of an image. The edge exists between the target, background and region, so it is the most important basis for image segmentation. Edge detection can achieve the task of identifying the points where the grayscale changes significantly in the digital image, so it can be used to separate the target and the background.
[0071] Because edge points are points in an image where the grayscale changes dramatically, edge detection operations often use the grayscale gradient of the image to search for peaks to determine the locations of different areas. There are many commonly used edge operators, including: Roberts Cross operator, Prewitt operator, Sobel operator, etc.
[0072] Among them, the Sobel operator is relatively simple to use for edge detection, has high efficiency in practical applications, and can effectively complete the task of edge detection. The expression of the Sobel edge detection operator is as follows:
[0073]
[0074] The Sobel edge detection operator consists of two 3×3 convolution factors Gu and Gv, which are used for horizontal and vertical gradient calculations respectively. By performing a planar convolution with the grayscale image, the horizontal and vertical grayscale difference approximations can be obtained respectively. The calculation expressions are as follows:
[0075]
[0076] Among them, f(x,y) represents the gray value at the image point (x,y), Gx(x,y) and Gy(x,y) represent the horizontal and vertical gray gradient values at the image point (x,y) respectively. The horizontal and vertical gray gradient values of each pixel in the image are combined by the following formula to calculate the total value of the gray change at the point:
[0077]
[0078] If the gradient G of a point is greater than a certain threshold, the point is considered to be an edge point. In this embodiment, the threshold is set to 125. After the total grayscale gradient value of all points is calculated using the Sobel edge detection operator, the positions of all edge points can be obtained according to the threshold, thereby obtaining a preliminary target and background area.
[0079] In this embodiment, in step S4, the image collected in step S1 is divided into two types of pixels, foreground and background, using the ISODATA clustering algorithm, and then an intersection operation is performed with the target area obtained in step S3 to obtain the accurate target pixel area of the target.
[0080] ISODATA is an unsupervised classification method. On the basis of general clustering algorithms, it adds two operations, merging and splitting, to the clustering results. When the number of samples in a certain class of the clustering results is too small, or the distance between two classes is too close, or the sample category is far greater than the set number of categories, merging is performed; when the number of samples in a certain class of the clustering results is too large, or the variance within a class is too large, or the sample category is far less than the set number of categories, splitting is performed. ISODATA uses the sum of squared errors as the basic clustering criterion, sets indicator parameters to decide whether to "merge" or "split", and sets algorithm control parameters to decide the number of algorithm operations. It has the ability to automatically adjust the optimal number of categories. The algorithm rules are clear and easy to implement by computer. The specific algorithms are as follows: Figure 2 shown.
[0081] The expected number of cluster centers set in this embodiment is 2, the minimum number of samples in each cluster center is 1, and if the number is less than this, it will not be regarded as an independent cluster. The standard deviation of the sample distance distribution in a cluster is 1, and the minimum distance between two cluster centers is 0.1. If it is less than this number, the two clusters will be merged. The maximum number of pairs of cluster centers that can be merged in one iterative operation is 1, and the maximum number of iterative operations is 10.
[0082] By taking the intersection of the pixels of the foreground as the clustering result and the preliminary target pixel area obtained in step S3, an accurate target pixel area can be obtained to improve the detection effect and facilitate subsequent labeling.
[0083] In this embodiment, in step S5, the image obtained in step S4 is annotated, and a training set, a validation set, and a test set are constructed in a reasonable proportion for training and performance testing.
[0084] In this embodiment, in step S6, the deep neural network is mainly composed of convolutional layers, and the SPP structure and SE module are introduced into the network. After the input image is subjected to feature extraction through several convolutional layers, it is input into the SPP module for fusion of feature maps of different sizes, and then the fused feature map is input into the SE module. The SE module assigns an adaptive weight to each channel in the feature map, and then obtains the final feature map and output through the convolutional layer.
[0085] like Figure 3 As shown, the specific network structure of this embodiment, wherein the convolution layer representation method is “Conv.(number of feature maps)@(convolution kernel size)”, the global pooling layer representation method is “Max-Pool@(pooling kernel size)”; the average pooling layer representation method is “Avg-Pool”, and the fully connected layer representation method is “FC”.
[0086] In this embodiment, the image processed in step S4 is used as input, and after a series of convolutional layers and pooling layers, it is successively input into the SPP structure and the SE module. The output of the SE module is further subjected to two layers of convolution operations to obtain the results of target detection and positioning. Figure 4 The specific structure diagram of SPP is to fuse input features of different sizes. The SPP structure uses pooling blocks of different sizes to extract features from the output feature map. The output of SPP consists of the input features and the output of three maximum pooling downsamplings with pooling kernel sizes of 5×5, 7×7, and 14×14. The output of the SPP module is used as the input of the SE module. The specific network structure diagram of the SE module is shown in Figure 5 As shown in the figure, the purpose is to solve the loss problem caused by the different importance of different channels in the feature map during the convolution pooling process. The SE module consists of two parts: compression and excitation. The compression operation is a global average pooling. After the compression operation, the feature map is compressed into a 1×1×C vector, where C represents the number of channels of the input image. The excitation part consists of two fully connected layers. After the excitation operation, the number of channels can be reduced, thereby reducing the amount of calculation.
[0087] In this embodiment, in step S7, the training set obtained in step S5 is input into the deep convolutional neural network constructed in step S6 for forward propagation, the cost function value is calculated, and the parameters of the multi-input parallel deep convolutional neural network are updated using a backward propagation algorithm based on gradient descent, and forward and backward propagation are iteratively performed until the cost function converges. The specific steps are as follows:
[0088] S71, forward propagation,
[0089] by represents the tth feature map of the lth layer (l≥2). If the lth layer is a convolutional layer, then:
[0090]
[0091] in, represents the convolution kernel connecting the s-th input feature map and the t-th output feature map, represents the bias term, σ(·) represents the nonlinear activation function, and the symbol “*” represents the convolution operation.
[0092] If the lth layer is the maximum pooling layer, then:
[0093]
[0094] in, represents the coordinate value of the position (x′, y′) in the t-th feature map of the l-th layer (l≥2); r 1 、r 2 It represents the size of the pooling window, and u and v represent the variables pre-set in the pooling window.
[0095] If the lth layer is an average pooling layer, then:
[0096]
[0097] Among them, r 1 、r 2 Indicates the size of the pooling window.
[0098] If the lth layer is a fully connected layer, then:
[0099] a (l) =σ(w (l) a (l-1) +b (l) ) (7)
[0100] Among them, a (l) represents the feature map of layer l, w (l) represents the weight of the lth layer, b (l) is the bias term for this layer.
[0101] S72, calculating the cost function value,
[0102] In this embodiment, Figure 3 As shown, the cross entropy function is used as the cost function, and its calculation formula is:
[0103]
[0104] Among them, the first two terms of formula (8) represent the regression bounding box loss, and the third and fourth terms represent the confidence loss. The confidence losses of positive samples (there are objects in the unit grid) and negative samples (there are no objects in the unit grid, which is the background) are calculated. The final feature map is divided into S×S grids, and each grid unit can predict B bounding boxes. (x i ,y i ) represents the coordinates of the center of the target bounding box in the i-th unit grid, (w i ,h i ) represents the width and height of the target bounding box in the i-th unit grid, then the actual position coordinates are available (x i ,y i ,w i ,h i )express, Represents the predicted position coordinates; C i Indicates whether there is a real target in the grid cell. If so, it is 1, and if not, it is 0. Represents the prediction result within the grid cell, if there is a target, it is 1, if not, it is 0; represents the cell grid i with objects, represents the jth bounding box in grid cell i that is responsible for predicting the object, represents the jth bounding box in grid cell i that is responsible for predicting no object, and λ coord , obj , noobj Represent the weights of each loss respectively.
[0105] S73, the network parameters are updated based on the back propagation algorithm of gradient descent, as shown in the following formula:
[0106]
[0107]
[0108] Among them, α is the learning rate, L represents the loss function, and w and b represent the sets of weights and bias terms in the network respectively.
[0109] In this example, the detection and positioning method also includes step S8, performing a detection performance test on the network trained in step S7, inputting the images in the test set into the network trained in S7 for forward propagation, and using two evaluation indicators, precision and recall, to describe the results of target detection and positioning.
[0110] Table 1 shows the number of images used for network training, verification and testing in this embodiment, and Table 2 shows the detection results obtained in this embodiment. Figure 6 The figure is a schematic diagram of the target detection and positioning results of this example. From the numerical results, it can be seen that the method of the present invention can achieve the target detection and positioning tasks, and the target detection accuracy can reach 97.55%. From the result picture, it can be seen that the positioning of this method is accurate and the effect is good.
[0111] Table 1
[0112] category Training set Validation set Test Set Picture (piece) 500 200 200
[0113] Table 2
[0114] Category / Indicator Accuracy Recall Validation set 97.90% 98.36% Test Set 97.55% 97.80%
[0115] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the scope of protection of the present invention is not limited to such specific statements and embodiments. For those skilled in the art, the present invention may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A method for detecting and locating burst beads in a high-speed moving filter rod, the specific steps are as follows: S1, collect the image of the high-speed moving filter rod bursting beads; S2, preprocessing the high-speed motion filter rod bursting bead image collected in step S1; S3, performing edge detection on the image obtained in step S2 to obtain a preliminary pixel point area of the target; S4, clustering the image collected in step S1, and combining it with the result of step S3 to obtain the accurate pixel point area of the target; S5, annotating the images processed in step S4, and reasonably generating sample training sets, verification sets, and test sets; S6. Combine the SPP structure and SE module to build a deep convolutional neural network; S7, training deep neural network; In the step S1, a high-speed camera is used to collect an RGB image of the filter rod bursting beads in high-speed motion; In the step S2, the RGB image collected in the step S1 is grayed using the maximum value method; In step S3, edge detection is performed using the grayscale image obtained in step S2 and the Sobel operator to separate pixels with large grayscale value changes, and then determine the edge to obtain a preliminary pixel area of the target; In step S3, the specific steps are as follows: The expression of the Sobel edge detection operator is as follows: The Sobel edge detection operator consists of two 3×3 convolution factors Gu and Gv, which are used for horizontal and vertical gradient calculations respectively. They are convolved with the grayscale image to obtain the horizontal and vertical grayscale difference approximations respectively. The expressions are as follows: Among them, f(x,y) represents the gray value at the image point (x,y), Gx(x,y) and Gy(x,y) represent the horizontal and vertical gray gradient values at the image point (x,y), respectively. The horizontal and vertical gray gradient values of each pixel of the image are combined by the following formula to calculate the total value of the gray change at the point: If the gradient G of a point is greater than a certain threshold, the point is considered to be an edge point. After using the Sobel edge detection operator to calculate the total grayscale gradient value of all points, the positions of all edge points are obtained according to the threshold, thereby obtaining the preliminary target and background areas; In step S4, the specific steps are as follows: The high-speed motion filter rod bursting bead image collected in step S1 is clustered using the ISODATA algorithm, and the obtained clustering result is divided into a foreground class and a background class, and then an intersection operation is performed with the target area obtained in step S3 to obtain the accurate pixel point area of the target; In the step S5, the images obtained in the step S4 are annotated to construct a training set, a validation set and a test set for training and performance testing; In step S6, after the input image is subjected to several convolutional layers to extract features, it is input into the SPP module to fuse feature maps of different sizes, and then passes through the SE module to assign adaptive weights to each channel of the feature map, and then passes through the convolutional layer to obtain the final feature map and output; In step S7, the specific steps are as follows: Input the training set obtained in step S5 into the deep convolutional neural network constructed in step S6 for forward propagation, calculate the cost function value, use the gradient descent-based backward propagation algorithm to update the parameters of the multi-input parallel deep convolutional neural network, and iterate forward and backward propagation until the cost function converges; In step S7, the specific steps are as follows: S71, forward propagation, by represents the tth feature map of the lth layer (l≥2). If the lth layer is a convolutional layer, then: in, represents the convolution kernel connecting the s-th input feature map and the t-th output feature map, represents the bias term, σ(·) represents the nonlinear activation function, and "*" represents the convolution operation; If the lth layer is the maximum pooling layer, then: in, represents the coordinate value of the position (x′, y′) in the t-th feature map of the l-th layer (l≥2), r1 and r2 represent the size of the pooling window, and u and v represent the variables pre-set in the pooling window; If the lth layer is an average pooling layer, then: Among them, r1 and r2 represent the size of the pooling window; If the lth layer is a fully connected layer, then: a (l) =σ(w (l) a (l-1) +b (l) ) (7) Among them, a (l) represents the feature map of layer l, w (l) represents the weight of the lth layer, b (l) is the bias term of this layer; S72, calculating the cost function value, Taking the cross entropy function as the cost function, the calculation formula is: Among them, the first two terms of formula (8) represent the regression bounding box loss, and the third and fourth terms represent the confidence loss. The confidence losses of positive samples (there are objects in the unit grid) and negative samples (there are no objects in the unit grid, which is the background) are calculated. The final feature map is divided into S×S grids, and each grid unit predicts B bounding boxes; (x i ,y i ) represents the coordinates of the center of the target bounding box in the i-th unit grid, (w i ,h i ) represents the width and height of the target bounding box in the i-th unit grid, then the actual position coordinates are (x i ,y i ,w i ,h i )express, Represents the predicted position coordinates; C i Indicates whether there is a real target in the grid cell. If so, it is 1, and if not, it is 0. Represents the prediction result within the grid cell, if there is a target, it is 1, if not, it is 0; represents the cell grid i with objects, represents the jth bounding box in grid cell i that is responsible for predicting the object, represents the jth bounding box in grid cell i that is responsible for predicting no object, and λ coord , obj , noobj Respectively represent the weight of each loss; S73. Update the network parameters based on the back propagation algorithm of gradient descent, as shown in the following formula: Among them, α is the learning rate, L represents the loss function, and w and b represent the sets of weights and bias items in the network respectively.
2. A method for detecting and locating burst beads in a high-speed moving filter rod according to claim 1, characterized in that: The method further includes step S8, wherein the network trained in step S7 is subjected to a detection performance test. The specific steps are as follows: The images in the test set are input into the network trained in step S7 for forward propagation, and the results of target detection and positioning are described using two evaluation indicators: precision and recall.
Citation Information
Patent Citations
Hot-pressing light guide plate defect visual detection method based on improved YOLOv5
CN114881987A