Small target detection method and device based on Gaussian process regression

By introducing custom loss functions of Gaussian process regression and target profile curve equations in small object detection, the YOLO series model is optimized, which solves the problems of insufficient detection accuracy and missed detection and missed detection, and achieves efficient detection of flexible materials.

CN118918338APending Publication Date: 2024-11-08CETHIK GRP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410936841.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

In the detection of small objects, the prior art has problems such as insufficient detection accuracy and frequent missed detection and missed detection. In particular, it is difficult to effectively deal with material deformation, lighting changes and occlusion problems in the detection of flexible materials.

Method used

A small object detection method based on Gaussian process regression is adopted, combined with the YOLO series model, and through Gaussian process regression fitting and target profile curve equations, a custom loss function is introduced, the detection results are optimized, and the missed detection and error detection rates are reduced.

Benefits of technology

It significantly improves the accuracy and efficiency of small object detection, and is suitable for small object detection of different models, materials and curvatures, especially in flexible materials such as eyelash detection, which reduces the missed detection and missed detection rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118918338A_ABST
    Figure CN118918338A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of small target detection, and discloses a small target detection method and device based on Gaussian process regression, and the method comprises the steps: obtaining a training data set; loading a YOLO series model to sample an image output detection frame and a center coordinate point of the detection frame; calculating a first loss according to the output of the small target detection model and the label; taking the center coordinate point of the detection frame as input, and performing curve fitting by using Gaussian process regression to obtain a regression function; extracting target contour points in the sample image by using a target contour detection method to obtain a target contour curvilinear equation; randomly selecting a plurality of test points on the target profile curve, and calculating a second loss according to the regression function and the output of the target profile curve equation; and carrying out weighted synthesis on the first loss and the second loss to obtain total loss, and carrying out training updating on the small target detection model according to the total loss until a training ending condition is met. The invention aims to reduce the false detection and omission ratio and improve the detection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of small target detection, and in particular relates to a small target detection method and device based on Gaussian process regression. Background Art

[0002] As a bridge between the physical world and the digital world, machine vision plays an increasingly important role. In particular, the demand for machine vision in the identification and detection of flexible materials is growing rapidly. Flexible materials, such as eyelashes in the beauty industry, pose great challenges to traditional machine vision recognition methods due to their varied shapes, textures and sizes. In particular, the eyelash root cleaning process requires extremely high accuracy and precision in recognition. Traditional machine vision recognition methods, such as template matching and edge detection, often fail to achieve ideal results in the detection of flexible materials. They cannot handle problems such as material deformation, lighting changes and occlusion well, resulting in frequent false detections and missed detections.

[0003] In recent years, deep learning-based object detection methods have made significant progress in the field of machine vision. Among them, the YOLO (You Only Look Once) series of algorithms have attracted widespread attention due to their high efficiency and accuracy. As the latest version of the YOLO series, YOLOv5 has significantly improved in speed and accuracy, but it still faces the problem of insufficient accuracy in detecting small objects.

[0004] Existing technologies, such as the patent with publication number CN114049572A, disclose a detection method for identifying small targets. This patent aims to solve the problem of difficulty in detecting small targets. It implements a real-time small target detection and recognition network based on an improved dual-head PANet. It uses a YOLO backbone structure network, a PANet that obtains multiple downsampled scale features as the network neck, and a network detection head that estimates target information. The three parts form a real-time small target detection and recognition network. However, this patent is limited by the application limitations of the YOLO backbone structure network in small target detection. It still has the defect of insufficient detection accuracy and limited application scenarios, which exacerbates its missed detection and false detection problems in the detection of small targets on flexible materials. Summary of the invention

[0005] One of the purposes of the present invention is to provide a small target detection method based on Gaussian process regression, aiming to reduce the false detection and missed detection rates and improve the detection efficiency.

[0006] To achieve the above object, the technical solution adopted by the present invention is:

[0007] A small target detection method based on Gaussian process regression, the small target detection method based on Gaussian process regression comprising:

[0008] Obtain a training data set, wherein the training data set includes a plurality of sample images, and the sample images are marked with small objects and small object position point labels;

[0009] Load the YOLO series model as a small target detection model, input the sample image into the small target detection model, and obtain the detection frame and the center coordinate point of the detection frame corresponding to the small target in the sample image output by the small target detection model;

[0010] Calculate a first loss based on the output and label of the small object detection model;

[0011] Taking the center coordinate point of the detection frame output by the small target detection model as input, using Gaussian process regression to perform curve fitting, and outputting a regression function of the small target in the sample image;

[0012] The target contour points in the sample image are extracted using the target contour detection method, and the target contour curve equation is obtained based on the target contour points;

[0013] Randomly select a number of test points on the target contour curve, and input the test points into the regression function and the target contour curve equation respectively, and calculate the second loss according to the outputs of the regression function and the target contour curve equation;

[0014] The first loss and the second loss are weighted to obtain a total loss, and the small target detection model is trained and updated according to the total loss until a training end condition is reached;

[0015] Take the trained small target detection model to complete small target detection.

[0016] Several optional methods are also provided below, but they are not intended to be additional limitations on the above-mentioned overall solution, but are merely further supplements or preferences. Under the premise that there are no technical or logical contradictions, each optional method can be combined with the above-mentioned overall solution separately, and multiple optional methods can also be combined.

[0017] Preferably, the first loss includes a bounding box loss, a confidence loss and a classification loss.

[0018] Preferably, the method of using Gaussian process regression to perform curve fitting and outputting a regression function of a small target in a sample image includes:

[0019] For a data set D = (X, y) of length n, where X is the input sample, i.e., the independent variable, and y is the output vector, i.e., the target variable, (X, y) = {(x1, y1), (x2, y2), …, (x n ,y n )},x n is the nth independent variable in the data set, y nFor the nth target variable in the data set, Gaussian process regression determines the relationship f(x) between the independent variable X and the target variable y based on prior knowledge to perform prediction, f(x) ~ GPR(m,k), f(x) is a Gaussian process with m as the mean function and k as the covariance function, then:

[0020] y=f(x)+ε

[0021] Among them, ε is random noise, which has a mean of 0 and a variance of σ n Gaussian distribution, that is:

[0022]

[0023] After processing the data, the mean function is set to 0, then the prior distribution of the output vector is:

[0024]

[0025] in, The mean is 0 and the standard deviation is Gaussian distribution, k(X,X) is the covariance matrix between input samples, and I is the identity matrix;

[0026] Take the sample to be tested as x, and its corresponding predicted value is f * , then the actual output vector y and the predicted value f * Obey the joint Gaussian distribution, that is:

[0027]

[0028] Among them, k(X,x * )=k(x * ,X) is the covariance matrix between the input sample and the sample to be tested, k(x * ,x * ) is the covariance matrix of the sample to be tested, and the predicted value of the sample to be tested is f * The posterior distribution P of is:

[0029] P(f * |X,y,x * )~N(μ * ,(σ * ) 2 )

[0030]

[0031] Among them, μ * is the predicted value f * The mean value, σ * is the predicted value f * The variance of .

[0032] Preferably, calculating the second loss according to the output of the regression function and the target contour curve equation comprises:

[0033]

[0034] Where, L GPR is the average standardized difference loss, i.e. the second loss, m is the number of test points, y i is the output value of the target contour curve equation corresponding to the i-th test point, μ i is the mean of the predicted values ​​output by the regression function corresponding to the i-th test point, ε i is the variance of the predicted value output by the regression function corresponding to the i-th test point.

[0035] Preferably, the weighted integration of the first loss and the second loss to obtain the total loss includes:

[0036] L CIoU_GPR =L CIoU +βL GPR

[0037] L Z =L CIoU_GPR +L OBj +L CLa

[0038] Among them, L CIoU_GPR represents the initial stacking loss, L CIoU is the bounding box loss, L GPR is the second loss, β is the weight coefficient of the second loss, β∈[0,1], L Z is the total loss, L OBj represents the confidence loss, L CLa is the classification loss.

[0039] The invention provides a small target detection method based on Gaussian process regression. According to the inherent characteristics of the detected object, Gaussian process regression fitting and target contour curve equation are introduced, and a second loss is introduced based on the two. The second loss can be optimized according to the characteristics of the detected object, so that the detection result is more in line with the actual needs. In addition, the conventional positioning and classification loss is combined with network update optimization to significantly reduce the missed detection and false detection rates, and it is also applicable to various small target detections such as different models, different materials, and different curvatures.

[0040] A second object of the present invention is to provide a small target detection device based on Gaussian process regression, comprising a processor and a memory storing a plurality of computer instructions, wherein the computer instructions, when executed by the processor, implement the steps of the small target detection method based on Gaussian process regression. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A flowchart of a small target detection method based on Gaussian process regression of the present invention;

[0042] Figure 2 This is a schematic diagram of eyelash detection according to Embodiment 2 of the present invention;

[0043] Figure 3 This is a flow chart of the YOLOv5 model training phase in Example 2 of the present invention;

[0044] Figure 4 Schematic diagram of complete detection of eyelash roots;

[0045] Figure 5 This is a schematic diagram of missed detection in existing methods for detecting breakpoints at the root of eyelashes. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0048] Example 1

[0049] In order to overcome the defects of small target detection in the prior art, this embodiment provides a small target detection method based on Gaussian process regression, such as Figure 1 As shown, the following steps are included:

[0050] Step S1, obtaining a training data set, wherein the training data set includes a number of sample images, and the sample images are marked with small targets and small target position point labels.

[0051] Step S2: load the YOLO series model as a small target detection model, input the sample image into the small target detection model, and obtain the detection frame and the center coordinate point of the detection frame corresponding to the small target in the sample image output by the small target detection model.

[0052] In order to ensure flexibility of use and improve applicable scenarios, the method of this embodiment can be implemented based on any YOLO series model, such as YOLOv1 model, YOLOv2 model, YOLOv3 model, YOLOv4 model, YOLOv5 model, YOLOv6 model, etc., which can be selected according to actual needs.

[0053] Step S3: Calculate the first loss based on the output of the small object detection model and the label.

[0054] The specific function type of the first loss can be adjusted according to the target effect to be achieved. The first loss of this embodiment consists of three parts: bounding box loss (Box Loss), confidence loss (Confidence Loss / Objectness Loss) and classification loss (Classification Loss). These three losses are used to optimize the positioning ability, confidence prediction ability and classification ability of the model respectively. By combining these loss functions, the model can continuously learn and optimize during the training process, thereby improving the accuracy and efficiency of target detection.

[0055] Step S4: take the center coordinate point of the detection box output by the small target detection model as input, use Gaussian process regression to perform curve fitting, and output the regression function of the small target in the sample image.

[0056] Gaussian Process Regression (GPR) is a non-parametric regression method that models the relationship between data based on the Gaussian process model. For a data set of length n, D = (X, y), where X is the input sample, i.e., the independent variable, and y is the output vector, i.e., the target variable, (X, y) = {(x1, y1), (x2, y2), …, (x n ,y n )},x n is the nth independent variable in the data set, y n For the nth target variable in the data set, Gaussian process regression determines the relationship f(x) between the independent variable X and the target variable y based on prior knowledge to perform prediction, f(x) ~ GPR(m,k), f(x) is a Gaussian process with m as the mean function and k as the covariance function, then:

[0057] y=f(x)+ε

[0058] Among them, ε is random noise, which has a mean of 0 and a variance of σ n Gaussian distribution, that is:

[0059]

[0060] After processing the data, the mean function is set to 0, then the prior distribution of the output vector is:

[0061]

[0062] in, The mean is 0 and the standard deviation is Gaussian distribution, k(X,X) is the covariance matrix between input samples, and I is the identity matrix;

[0063] Take the sample to be tested as x * , and its corresponding predicted value is f * , then the actual output vector y and the predicted value f * Obey the joint Gaussian distribution, that is:

[0064]

[0065] Among them, k(X,x * )=k(x * ,X) is the covariance matrix between the input sample and the sample to be tested, k(x * ,x * ) is the covariance matrix of the sample to be tested, and the predicted value of the sample to be tested is f * The posterior distribution P of is:

[0066] P(f * |X,y,x * )~N(μ * ,(σ * ) 2 )

[0067]

[0068] Where μ is the predicted value f * The mean value, σ * is the predicted value f * The variance of .

[0069] Step S5: extract target contour points in the sample image using a target contour detection method, and obtain a target contour curve equation based on the target contour points.

[0070] Target contour detection methods can be divided into two categories: methods based on traditional edge detection operators (such as Sobel operator, Prewitt operator, Canny operator, etc.) and methods based on human visual perception models (such as DoG (Difference of Gaussians) model, Gabor filter model, etc.). The purpose of this embodiment is to obtain target contour points, and there is no restriction on the conventional method used. For example, target contour points can also be extracted by comparing pixel values ​​in a round-robin manner.

[0071] When obtaining the target contour curve equation according to the target contour points, it can be achieved through fitting or interpolation methods, such as least squares method, polynomial fitting, spline interpolation, etc., which is not limited in this embodiment.

[0072] Step S6: randomly select a number of test points on the target contour curve, and input the test points into the regression function and the target contour curve equation respectively, and calculate the second loss according to the output of the regression function and the target contour curve equation.

[0073] The target contour curve here is the curve corresponding to the target contour curve equation, which can be represented by a series of point coordinates (x, y). When selecting the test point, the point coordinates that meet the target contour curve equation are selected. The output of the target contour curve equation is the y value in the point coordinates, and the output of the regression function based on the point coordinates is the mean and variance of the point coordinates. The second loss is calculated as follows:

[0074]

[0075] Where, L GPR is the average standardized difference loss, i.e. the second loss, m is the number of test points, y i is the output value of the target contour curve equation corresponding to the i-th test point, μ i is the mean of the predicted values ​​output by the regression function corresponding to the i-th test point, ε i is the variance of the predicted value output by the regression function corresponding to the i-th test point.

[0076] Step S7: weightedly combine the first loss and the second loss to obtain a total loss, and train and update the small target detection model according to the total loss until the training end condition is met.

[0077] In order to improve the accuracy of small target detection, this embodiment combines conventional loss and custom loss to obtain the following comprehensive loss:

[0078] L CIoU_GPR =L CIoU +βL GPR

[0079] L Z =L CIoU_GPR +L OBj +L CLa

[0080] Among them, L CIoU_GPR represents the initial stacking loss, L CIoU is the bounding box loss, L GPR is the second loss, β is the weight coefficient of the second loss, β∈[0,1], L Zis the total loss, L OBj represents the confidence loss, L CLa is the classification loss.

[0081] This embodiment combines the techniques of target detection and Gaussian process regression, and introduces this custom loss in addition to conventional classification and positioning losses. The model parameters are optimized by the back propagation algorithm, making the detected breakpoint coordinates more accurate.

[0082] Step S8: Take the trained small target detection model to complete small target detection.

[0083] Example 2

[0084] In order to further illustrate that the small target detection method proposed in the present invention is not only applicable to conventional small target detection scenarios, but also has good application effects on small target detection of flexible materials, this embodiment is as follows Figure 2 The eyelashes shown are used as an example for description. Based on the YOLOv5 algorithm, by adding Gaussian process regression (GPR) fitting at the head end, the loss function is customized by fusing the curve fitted at the root of the eyelashes and the variance and mean obtained by Gaussian process regression, which solves the problems of false detection and missed detection of small targets in the original YOLOv5 algorithm.

[0085] The small target detection method of this embodiment is described by taking soft false eyelashes as an example, and at least comprises the following steps:

[0086] (1) Establish an eyelash breakpoint target dataset, which includes the coordinates of the breakpoints at both ends of each cluster of eyelashes in the sample image.

[0087] (2) Build a network structure consisting of Input, Backbone, Neck and Head layers (prediction end); the Input layer includes Mosaic data enhancement, adaptive anchor box calculation and adaptive image scaling; the Backbone layer includes at least Focus structure and CSPDarknet53; the Head layer is used to generate the final prediction of target detection, including at least position prediction, category prediction and confidence prediction.

[0088] Mosaic data enhancement uses 4 photos to splice in a random scaling, random cropping, and random arrangement manner, which greatly improves the algorithm's detection effect on small target groups, enhances the robustness of the network, and also reduces the model's memory requirements. Adaptive anchor box calculation and adaptive image scaling set the input image size to 608×608. The traditional size scaling and black edge filling methods are used in the training phase to unify the image size. The adaptive black edge filling algorithm is used in the test phase. The scaling ratio and scaling factor are calculated according to different image input sizes and filled to the standard size, which can greatly improve the model reasoning speed. The Focus structure slices the image before it enters the feature extraction network, that is, every other pixel in each image is taken to obtain four groups of images with similar morphology and no information loss and send them to the input channel, so that the image width and height information in the channel information is expanded by 4 times, which becomes 12 channels compared to the previous RGB three-channel mode. Finally, the convolution operation is performed to increase the model's perception field of view and obtain a double-downsampled feature map with more sufficient feature extraction. The CSPDarknet53 is divided into CSP1 structure and CSP2 structure. The CSP1 structure is applied to the Backbone layer, and the other CSP2 structure is applied to the Neck layer. CSPNet first divides the feature map of the base layer into two parts, and then merges them through a cross-stage hierarchy. This solves the problem of network optimization gradient information duplication in other convolutional neural networks, integrates gradient changes into feature maps, and enhances the learning ability of convolutional neural networks. It can ensure lightweight without losing accuracy, while also reducing computing bottlenecks and saving memory costs.

[0089] When using YOLOv5 to handle target detection tasks, the image is first input into the backbone network to extract features, and then the features extracted by the backbone network are input into the Neck network for processing. Finally, the Head layer outputs the target category and corrects the position of the candidate box according to the position offset, thereby obtaining a more accurate detection result. The Head layer includes at least a loss function and NMS non-maximum suppression. The loss function consists of three parts: bounding box loss, confidence loss, and classification loss. The bounding box regression loss is calculated using CIoU_Loss, which combines the overlapping area, center point distance, and aspect ratio information of the (detection box) prediction box and the target box, thereby improving the regression speed and accuracy of the detection box.

[0090] Among them, the calculation method of CIoU_Loss is as follows:

[0091]

[0092] Among them, IoU represents the intersection over union ratio, B is the detection box Bounding Box, and B gtis the ground truth, ν represents the difference in aspect ratio between the detection frame and the ground truth. If the two are consistent, ν = 0, and the greater the difference, the greater ν; w gt Indicates the width of the real box, h gt represents the height of the real box, w represents the width of the detection box, h represents the height of the detection box, α represents the weight parameter, and L CIoU represents CIoU_Loss, ρ 2 (B,B gt ) represents the distance between the center point of the detection box and the real box, and c represents the diagonal length of the minimum circumscribed rectangle of the predicted box and the real box.

[0093] In the object detection task, the network will output a large number of detection boxes, and many detection boxes contain the same object, but only one detection result is needed for one object. Usually, in the post-processing process, the NMS algorithm is used to filter out the best result from multiple prediction boxes.

[0094] (3) The present invention makes improvements at the Head end, such as Figure 3 As shown, during the training phase, through model reasoning, several detected eyelash breakpoint targets and the center coordinate points of the detection box are obtained on the picture.

[0095] ① Gaussian process regression (GPR) fitting:

[0096] Gaussian Process Regression (GPR) is a non-parametric regression method that models the relationship between data based on the Gaussian process model. For a data set D = (x, y) of length n, where x is the input sample, i.e., the independent variable, and y is the output vector, i.e., the target variable, (X, y) = {(x1, y1), (x2, y2), …, (x n ,y n )},x n is the nth independent variable in the data set, y n For the nth target variable in the data set, Gaussian process regression determines the relationship f(x) between the independent variable X and the target variable y based on prior knowledge to perform prediction, f(x) ~ GPR(m,k), f(x) is a Gaussian process with m as the mean function and k as the covariance function, then:

[0097] y=f(x)+ε

[0098] Among them, ε is random noise, which has a mean of 0 and a variance of σ n Gaussian distribution, that is:

[0099]

[0100] To simplify the solution of the posterior probability distribution, the mean function is set to 0 after processing the data, then the prior distribution of the output vector is:

[0101]

[0102] in, The mean is 0 and the standard deviation is Gaussian distribution, k(X,X) is the covariance matrix between input samples, and the value of the corresponding element of the matrix can be calculated by the covariance function, and I is the unit matrix;

[0103] Take the sample to be tested as x * , and its corresponding predicted value is f * , then the actual output vector y and the predicted value f * Obey the joint Gaussian distribution, that is:

[0104]

[0105] Among them, k(X,x * )=k(x * ,X) is the covariance matrix between the input sample and the sample to be tested, k(x * ,x * ) is the covariance matrix of the sample to be tested, and the predicted value of the sample to be tested is f * The posterior distribution P of is:

[0106] P(f * |X,y,x * )~N(μ * ,(σ * ) 2 )

[0107]

[0108]

[0109] Among them, μ * is the predicted value f * The mean value, σ * is the predicted value f * The variance of .

[0110] Using the detected breakpoint center coordinates as input, Gaussian process regression is used for curve fitting. GPR will output the mean and variance of y corresponding to each sample point x.

[0111] ② Extraction of eyelash root curve:

[0112] Since the eyelashes are collected on a laboratory bench or equipment operating table, the background is white or a color with a strong contrast with the eyelashes. The same eyelash image is binarized, and the pixels of the eyelashes are distinguished from the background or other non-eyelash pixels by setting a suitable threshold. After binarization, the pixels in the eyelash area are presented as a single brightness value (such as black), while the background and other non-eyelash areas are presented as another brightness value (such as white).

[0113] Next, by scanning each column in the image, find the eyelash pixel at the bottom of each column. (These points correspond to the position of the eyelash root because they are the first eyelash pixels in each column to encounter the non-eyelash area.) Connect these points to form a curve that describes the position of the eyelash root. Mathematically, this curve can be represented by a series of point coordinates (x, y), where x represents the index of the column and y represents the position of the bottom eyelash pixel in the column. Through fitting or interpolation methods, these points can be further converted into a continuous mathematical equation, namely the curve equation of the eyelash root.

[0114] ③Calculate custom loss GPR_Loss:

[0115] Randomly select m points on the extracted eyelash root curve as test points. For each point, calculate the difference between its y coordinate on the curve equation and the mean of the corresponding point after GPR fitting.

[0116] Divide the square of this difference by the square of the variance of the corresponding point after GPR fitting to get the standardized difference. Sum the standardized differences of all points and divide them by m to get an average standardized difference. This average standardized difference GPR_Loss is used as part of the custom loss function in the YOLOv5 training process. The calculation process is as follows, β is the weight coefficient of GPR_Loss.

[0117]

[0118] L cIoU_GPR =L CIoU +βL GPR

[0119] L Z =L CIoU_GPR +L OBj +L CLa

[0120] ④Optimize YOLOv5 training:

[0121] During the training process of YOLOv5, the target detection and Gaussian process regression techniques are combined. In addition to the conventional classification and positioning losses, this custom loss is also introduced. The model parameters are optimized through the back propagation algorithm, making the detected breakpoint coordinates more accurate.

[0122] (4) Use the optimized YOLOv5 model to perform root detection on the input eyelash image.

[0123] This embodiment aims to solve the problems of false detection and missed detection in the process of detecting small targets of flexible materials. Specifically, it solves the problems of low efficiency and difficulty in ensuring accuracy caused by manual operation in the root cleaning process of traditional false eyelash manufacturing process. Gaussian process regression is introduced and the YOLOv5 loss function is optimized to reduce the false detection and missed detection rates and improve the detection efficiency.

[0124] Most of the existing methods for detecting the breakpoints at the root of eyelashes are based on traditional image processing, which is not suitable for detecting eyelashes of various shapes. They have high requirements for the uniformity of eyelashes and do not provide an effective solution to the problem of missed detection of small targets at the breakpoints of eyelashes. This limitation greatly limits the breadth and reliability of traditional methods for detecting the breakpoints of eyelashes in practical applications. Figure 4 The figure shows a schematic diagram of complete detection of the eyelash root, where the origin is the detected eyelash root. Figure 5 As shown, it is demonstrated that existing methods for detecting breakpoints at the root of eyelashes often miss detections.

[0125] This application introduces a Gaussian process regression (GPR) fitting method: using the detected target coordinate points as input data, GPR fits the output curve, mean and variance. Introducing flexible material curve extraction technology: through image binarization processing, scanning each column to find the material pixel point at the bottom, and connecting these points to form a curve describing the position of the flexible material. Introducing a custom loss function GPR_Loss: randomly select m points on the flexible material curve. Calculate the difference between the y coordinate of each point on the curve equation and the mean of the corresponding point after GPR fitting. Standardize the difference and sum it to obtain the average standardized difference GPR_Loss. Through the fusion of the above technical points, the situation of missed detection and false detection can be effectively reduced.

[0126] Traditional image processing technology often has problems of missed detection and false detection, which is more obvious when processing the details of the eyelash root. The present invention introduces methods such as eyelash root curve equation extraction, Gaussian process regression fitting, and custom loss function based on the inherent characteristics of semi-finished eyelashes to reduce missed detection and false detection rates, and is suitable for various false eyelashes of different models, different materials, and different curvatures. The custom loss function can be optimized according to the characteristics of semi-finished false eyelashes, so that the detection results are more in line with actual needs.

[0127] This embodiment is described using eyelashes, a typical flexible material, as an example, but the application scope of the present invention is not limited thereto, but covers all materials with similar characteristics (i.e., high-precision target detection is required on slender and flexible materials, including but not limited to other types of beauty product components, textile fibers, plastic or rubber filaments, etc.) and small target detection with conventional characteristics.

[0128] Example 3

[0129] This embodiment also provides a small target detection device based on Gaussian process regression, including a processor and a memory storing a plurality of computer instructions. When the computer instructions are executed by the processor, the steps of the small target detection method based on Gaussian process regression are implemented.

[0130] For the specific limitations of the small target detection device based on Gaussian process regression, please refer to the limitations of the small target detection method based on Gaussian process regression above, which will not be repeated here.

[0131] The memory and the processor are electrically connected directly or indirectly to achieve data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The memory stores a computer program that can be run on the processor, and the processor implements the method of the present invention by running the computer program stored in the memory.

[0132] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory is used to store a program, and the processor executes the program after receiving an execution instruction.

[0133] The processor may be an integrated circuit chip with data processing capabilities. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0134] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described 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 specification.

[0135] The above-mentioned embodiments only express several implementation modes of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.

Claims

1. A small target detection method based on Gaussian process regression, It is characterized in that The small target detection method based on Gaussian process regression includes: Obtain a training data set, wherein the training data set includes a plurality of sample images, and the sample images are marked with small objects and small object position point labels; Load the YOLO series model as a small target detection model, input the sample image into the small target detection model, and obtain the detection frame and the center coordinate point of the detection frame corresponding to the small target in the sample image output by the small target detection model; Calculate a first loss based on the output and label of the small object detection model; Taking the center coordinate point of the detection frame output by the small target detection model as input, using Gaussian process regression to perform curve fitting, and outputting a regression function of the small target in the sample image; The target contour points in the sample image are extracted using the target contour detection method, and the target contour curve equation is obtained based on the target contour points; Randomly select a number of test points on the target contour curve, and input the test points into the regression function and the target contour curve equation respectively, and calculate the second loss according to the outputs of the regression function and the target contour curve equation; The first loss and the second loss are weighted to obtain a total loss, and the small target detection model is trained and updated according to the total loss until a training end condition is reached; Take the trained small target detection model to complete small target detection.

2. The small target detection method based on Gaussian process regression according to claim 1, It is characterized in that The first loss includes a bounding box loss, a confidence loss, and a classification loss.

3. The small target detection method based on Gaussian process regression according to claim 1, It is characterized in that The method of using Gaussian process regression to perform curve fitting and outputting a regression function of a small target in a sample image includes: For a data set D = (X, y) with a length of n, where X is the input sample, i.e., the independent variable, and y is the output vector, i.e., the target variable, (X, y) = {(x 1 ,y 1 ),(x 2 ,y 2 ),…,(x n ,y n )},x n is the nth independent variable in the data set, y n For the nth target variable in the data set, Gaussian process regression determines the relationship f(x) between the independent variable X and the target variable y based on prior knowledge to perform prediction, f(x) ~ GPR(m,k), f(x) is a Gaussian process with m as the mean function and k as the covariance function, then: y=f(x)+ε Among them, ε is random noise, which has a mean of 0 and a variance of σ n Gaussian distribution, that is: After processing the data, the mean function is set to 0, then the prior distribution of the output vector is: in, The mean is 0 and the standard deviation is Gaussian distribution, k(X,X) is the covariance matrix between input samples, and I is the identity matrix; Take the sample to be tested as x * , and its corresponding predicted value is f * , then the actual output vector y and the predicted value f * Obey the joint Gaussian distribution, that is: Among them, k(X,x * )=k(x * ,X) is the covariance matrix between the input sample and the sample to be tested, k(x * ,x * ) is the covariance matrix of the sample to be tested, and the predicted value of the sample to be tested is f * The posterior distribution P of is: P(f * |X,y,x * )~N(μ * ,(s * ) 2 ) Among them, μ * is the predicted value f * The mean value, σ * is the predicted value f * The variance of .

4. The small target detection method based on Gaussian process regression according to claim 1, It is characterized in that Calculating a second loss according to the output of the regression function and the target contour curve equation includes: Where, L GPR is the average standardized difference loss, i.e. the second loss, m is the number of test points, y i is the output value of the target contour curve equation corresponding to the i-th test point, μ i is the mean of the predicted values ​​output by the regression function corresponding to the i-th test point, ε i is the variance of the predicted value output by the regression function corresponding to the i-th test point.

5. The small target detection method based on Gaussian process regression according to claim 2, It is characterized in that The weighted comprehensive first loss and second loss obtain a total loss, including: L CIoU_GPR =L CIoU +βL GPR L Z =L CIoU_GPR +L OBj +L CLa Among them, L CIoU_GPR represents the initial stacking loss, L CIoU is the bounding box loss, L GPT is the second loss, β is the weight coefficient of the second loss, β∈[0,1], L Z is the total loss, L OBj represents the confidence loss, L CLa is the classification loss.

6. A small target detection device based on Gaussian process regression, comprising a processor and a memory storing a plurality of computer instructions, It is characterized in that When the computer instructions are executed by the processor, the steps of the small target detection method based on Gaussian process regression described in any one of claims 1 to 5 are implemented.