A method and system for detecting target in image information based on YOLO

By performing top-down and bottom-up fusion processing of feature maps and non-maximum suppression in the YOLO network, the problem of insufficient target recognition accuracy of the YOLO target detection model is solved and higher intelligent recognition efficiency is achieved. and recognition, improving recognition accuracy and real-time performance.

CN118537543BActive Publication Date: 2024-10-18HANGZHOU FUTURE HAS COME TECH CO LTD

Patent Information

Application Number
CN202410977648.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-10-18
Estimated Expiration
2044-07-22

AI Technical Summary

Technical Problem

The existing YOLO target detection model has insufficient accuracy in identifying targets, making it difficult to achieve a balance between real-time performance and high accuracy.

Method used

The image information target detection method based on YOLO is used to obtain the target image information, extract the feature map and perform top-down and bottom-up fusion processing in the YOLO network to generate the target frame and determine the category and offset. Combined Non-maximum suppression removes overlapping anchor boxes and finally generates predictions of target location and category.

Benefits of technology

The intelligent recognition efficiency and recognition degree of target detection are improved, and the recognition accuracy and real-time performance are improved through meta-model combination weighted prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537543B_ABST
    Figure CN118537543B_ABST
Patent Text Reader

Abstract

The invention discloses a method and system for detecting a target in image information based on YOLO, wherein the method and system involve: S1. acquiring target image information and extracting a feature map in the image information; S2. inputting the extracted feature map into a YOLO network for training, and performing fusion processing at the output end of the YOLO network to obtain fused feature map information; S3. generating a target frame according to the fused feature map information, and determining the category and offset of the target in the image in the target frame to obtain a trained target detection model; S4. inputting a target image to be predicted into the target detection model, and the target detection model outputs the target position and category.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of target recognition, and in particular to an image information target detection method and system based on YOLO. Background Art

[0002] Deep learning has been applied to various fields, and the application scenarios can be roughly divided into three categories: target recognition, target detection, and natural language processing. Target detection can be understood as a combination of target recognition and target positioning. It is not only necessary to obtain the specific location of the target in the image, but more importantly, to identify and locate the subset of its own business. In order to complete this task, the target detection model is one-stage, and typical representatives are YOLO, SSD, YoloV2, YoloV3, etc. The above recognition models have a fast recognition speed and can meet the real-time requirements. The accuracy can basically reach the level of Faster R-CNN, but there is a problem of insufficient target recognition accuracy.

[0003] In view of the above technical problems, the present invention proposes an image information target detection method and system based on YOLO. Summary of the invention

[0004] The purpose of the present invention is to provide a method and system for image information target detection based on YOLO in view of the defects of the prior art.

[0005] In order to achieve the above purpose, the present invention adopts the following technical solutions:

[0006] A method for detecting an object using image information based on YOLO, comprising:

[0007] S1. Obtain target image information and extract feature maps from the image information;

[0008] S2. Input the extracted feature map into the YOLO network for training, and perform fusion processing at the output end of the YOLO network to obtain the fused feature map information;

[0009] S3. Generate a target frame based on the fused feature map information, and determine the category and offset of the target in the image in the target frame to obtain a trained target detection model;

[0010] S4. Input the target image to be predicted into the target detection model, and the target detection model outputs the target position and category.

[0011] Furthermore, the fusion process in step S2 is specifically: fusing the extracted feature maps from top to bottom and from bottom to top in sequence.

[0012] Furthermore, the step S3 is specifically as follows:

[0013] S31. Setting anchor frames of corresponding sizes according to target images of different sizes;

[0014] S32. Define a matrix corresponding to the anchor box according to the fused feature map information;

[0015] S33. Find the maximum value in the matrix, delete the column and row corresponding to the found maximum value, and obtain the remaining anchor boxes;

[0016] S34. Calculate the IoU value of the remaining anchor box and the true edge box, and filter out the maximum value of the IoU, and determine whether the filtered IoU maximum value is greater than a preset threshold. If so, assign the current true edge box to the anchor box;

[0017] S35. Calculate the category and offset of the target in the image based on the current true edge box and the corresponding anchor box.

[0018] Furthermore, step S3 also includes removing overlapping anchor boxes in the target box by non-maximum suppression.

[0019] Furthermore, the step S4 is specifically as follows: the target detection model combines and weights the prediction results to generate a final prediction result, namely the target position and category.

[0020] Accordingly, a YOLO-based image information target detection system is also provided, including:

[0021] An acquisition module is used to acquire target image information and extract feature maps from the image information;

[0022] A fusion module is used to input the extracted feature map into the YOLO network for training and perform fusion processing at the output end of the YOLO network to obtain fused feature map information;

[0023] The training module is used to generate a target frame based on the fused feature map information, and determine the category and offset of the target in the image in the target frame to obtain a trained target detection model;

[0024] The detection module is used to input the target image to be predicted into the target detection model, and the target detection model outputs the target position and category.

[0025] Furthermore, the fusion processing in the fusion module is specifically: fusing the extracted feature maps from top to bottom and from bottom to top in sequence.

[0026] Furthermore, the training module specifically includes:

[0027] A setting module, used to set anchor frames of corresponding sizes according to target images of different sizes;

[0028] A definition module is used to define a matrix corresponding to the anchor box according to the fused feature map information;

[0029] The deletion module is used to find the maximum value in the matrix, delete the column and row corresponding to the maximum value found, and obtain the remaining anchor boxes;

[0030] A judgment module is used to calculate the IoU value between the remaining anchor boxes and the true edge boxes, and filter out the maximum IoU value, and determine whether the filtered IoU maximum value is greater than a preset threshold. If so, the current true edge box is assigned to the anchor box;

[0031] The calculation module is used to calculate the category and offset of the target in the image based on the current true edge box and the corresponding anchor box.

[0032] Furthermore, the training module also includes removing overlapping anchor boxes in the target box by non-maximum suppression.

[0033] Furthermore, the detection module calculates the category and offset of the target in the image specifically as follows: the target detection model combines and weights the prediction results to generate a final prediction result, namely, the target position and category.

[0034] Compared with the prior art, the present invention first locates the target offset, and then the control layer performs meta-model combination weighting on the trained data model (meta-model) to predict the final result, which has higher intelligent recognition efficiency and recognition degree. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is a flow chart of a method for detecting an object using image information based on YOLO provided in Example 1;

[0036] Figure 2 is a schematic diagram of the Gaussian pyramid structure provided in Example 1;

[0037] Figure 3 This is a model prediction flow chart provided in Example 1. DETAILED DESCRIPTION

[0038] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0039] The purpose of the present invention is to provide a method and system for image information target detection based on YOLO in view of the defects of the prior art.

[0040] Embodiment 1

[0041] This embodiment provides an image information target detection method based on YOLO, such as Figure 1 As shown, including:

[0042] S1. Obtain target image information and extract feature maps from the image information;

[0043] S2. Input the extracted feature map into the YOLO network for training, and perform fusion processing at the output end of the YOLO network to obtain the fused feature map information;

[0044] S3. Generate a target frame based on the fused feature map information, and determine the category and offset of the target in the image in the target frame to obtain a trained target detection model;

[0045] S4. Input the target image to be predicted into the target detection model, and the target detection model outputs the target position and category.

[0046] In step S1, target image information is acquired, and a feature map in the image information is extracted.

[0047] Obtain a target image dataset and divide it into a training target image dataset and a test target image dataset. Input the training target image dataset into the backbone network of YOLO for training. The backbone network of YOLO extracts feature maps of the original image. The extracted feature maps include multi-scale information. The extracted feature maps are then processed and fused through the neck network of YOLO to improve performance.

[0048] YOLO's backbone network is the basis of the entire target detection model and is responsible for extracting useful features from the input image. The backbone network uses the CSP-Darknet53 architecture, which is a deep learning model optimized specifically for target detection tasks.

[0049] CSP-Darknet53 includes CSP structure, Darknet architecture, Focus structure, pre-trained weights, efficient activation function, and multi-scale feature fusion.

[0050] CSP structure: Backbone uses the Cross Stage Partial Network (CSPNet) structure, which is a technology to reduce the amount of computation. CSP reduces the number of model parameters and computation by sharing weights between convolutional layers while maintaining the efficiency of feature extraction.

[0051] Darknet architecture: Darknet is a deep learning framework optimized for the YOLO series, which is known for its fast speed and low resource consumption. Darknet53 is a variant in the Darknet series with a depth of 53 layers. It gradually extracts deep features of the image by stacking multiple convolutional layers and pooling layers.

[0052] Focus structure: The Focus structure is used at the beginning of Backbone, which is an effective feature fusion technology. The Focus structure improves the model's ability to detect small targets by dividing the input image into small blocks, extracting features separately, and finally merging these features.

[0053] Pre-trained weights: Backbone is usually initialized with weights pre-trained on large datasets such as ImageNet. This allows the model to leverage common features learned on large-scale datasets, accelerate convergence, and improve detection performance.

[0054] Efficient activation function: The Mish activation function is used, which is a smoother activation function than the traditional ReLU activation function, which helps to provide a more stable gradient flow during training.

[0055] Multi-scale feature fusion: Backbone implements multi-scale feature fusion through the SPPF (Spatial Pyramid Pooling with Feature map Fusion) module, which enables the model to detect objects of different sizes simultaneously.

[0056] Through these designs, Backbone can efficiently extract rich features from the input image, providing a solid foundation for subsequent detection tasks. These features are then passed to the Neck and Head parts for more refined object detection and positioning.

[0057] In this embodiment, the number of channels is continuously increased and the size is continuously reduced during the feature extraction process.

[0058] In step S2, the extracted feature map is input into the YOLO network for training, and fused at the output of the YOLO network to obtain fused feature map information.

[0059] The feature map in step S1 is extracted to the control layer for fusion processing. Specifically, the control layer inputs the feature map into the head output end of the YOLO network, first performs top-down fusion, and then performs bottom-up fusion to obtain the fused feature map.

[0060] The main tasks of the control layer (Controller) are as follows:

[0061] Receive requests and parse parameters; call Service to execute specific business code (may include parameter verification) to capture business logic exceptions and provide feedback; respond when business logic is successfully executed; its functions are mentioned in the article. Specifically, it processes the parameters of the request. The logic is that it processes requests with fixed parameters, including feature map fusion processing, detection, parameter anomaly verification, etc.

[0062] The process of controlling layer fusion:

[0063] (1) First, build a Gaussian pyramid for the two images, and then build a Laplacian pyramid with a certain number of layers. The higher the number of layers in the Laplacian pyramid, the better the fusion effect. The number of layers N is used as a parameter.

[0064] (2) Pass in a mask, which represents the fusion position. For example, if you want to fuse the two images in the middle, then the left half of the mask image is 255 and the right half is 0, and vice versa. Based on this mask, a Gaussian pyramid is built for subsequent fusion, with N+1 layers.

[0065] leftlmageWeight*leftlmage+rightlmageWeight*rightlmage=Outputlmage

[0066] Among them, leftlmageWeight+rightlmageWeight=1

[0067] (3) For each layer of the pyramid, the following formula is applied to fuse them to obtain a new pyramid:

[0068]

[0069] (4) The final image is reconstructed based on this new pyramid. The reconstruction process is the same as that of a general Laplacian pyramid. Figure 2 As shown in the figure, the first layer image IMG1 is first upsampled and then added to the top layer of the new pyramid to obtain the second layer image IMG2. The second layer image IMG2 is upsampled and added to the next layer to obtain the third layer image IMG3. Repeating this process, the final result is the result of the Laplacian pyramid fusion algorithm.

[0070] It should be noted that the essence of pyramid fusion is to obtain the fusion of different layers of images (images in different frequency bands) by different rules from the calculation on the Laplacian pyramid (the Laplacian operator can extract the high-frequency information of the image. In the Laplacian pyramid, the higher the image layer, the higher the frequency). Taking Gaussian blur as an example, the large-scale image on the Gaussian pyramid contains more high-frequency features, so a smaller Gaussian kernel feature is used, and vice versa, a larger Gaussian kernel feature is used.

[0071] Then the control layer will take the image of the feature layer for detection and prediction whether there is an anchor target in each anchor box. Specifically, anchor boxes of different sizes will be set to predict targets of different sizes respectively, and then by predicting whether each anchor box contains the target of interest, if so, the IoU intersection-over-union ratio is used to calculate the similarity between the two boxes, IoU = intersection area of ​​two boxes / combination area of ​​two boxes.

[0072] It should be noted that the method of detecting the images of several feature layers is the same as that in step S3.

[0073] In step S3, a target frame is generated according to the fused feature map information, and the category and offset of the target in the image are determined in the target frame to obtain a trained target detection model, specifically:

[0074] S31. Setting anchor frames of corresponding sizes according to target images of different sizes;

[0075] S32. Define a matrix corresponding to the anchor box according to the fused feature map information;

[0076] According to the feature map information, a matrix is ​​defined as Fn(x) = {1} / {n}∑j = ln I{xj≤x}, where the element in the i-th row and j-th column is the anchor box (A i ) and the true bounding box (B j ) between the two.

[0077] In this embodiment, the anchor box of the element is defined as A, the real border is defined as B, and the value of the two-dimensional array between the anchor box and the real border is the IoU value.

[0078] S33. Find the maximum value in the matrix, delete the column and row corresponding to the found maximum value, and obtain the remaining anchor boxes;

[0079] Use the max() function in the program to continuously search for the maximum value of all element dimensions in the matrix. Once found, delete the corresponding column and row to get a reduced matrix. This is done until all columns corresponding to the maximum value are deleted, that is, each true edge box has a corresponding anchor box with the maximum IoU, and finally (n a -n b ) anchor boxes.

[0080] For example, for the matrix [-1 2 -9], the elements in the matrix are compared based on their absolute values ​​and the maximum value is -9.

[0081] S34. Calculate the IoU value of the remaining anchor box and the true edge box, and filter out the maximum value of the IoU, and determine whether the filtered IoU maximum value is greater than a preset threshold. If so, assign the current true edge box to the anchor box;

[0082] For the remaining (n a -n b ) anchor boxes (A i ), calculate (n a -n b ) anchor boxes (A i ) and the true bounding box (B j ) to obtain the maximum IoU value. If the maximum IoU value found is greater than the preset threshold, the real edge box can be assigned to the current anchor box (A i ).

[0083] According to the above content, it can be known that in the obtained anchor frame, there may still be one real edge frame corresponding to multiple anchor frames, so these anchor frames may be very similar. Therefore, this embodiment uses non-maximum suppression NMS to process these multiple anchor frames corresponding to the same real edge frame, and then removes the overlapping anchor frames and retains the most credible target anchor frame).

[0084] S35. Calculate the category and offset of the target in the image based on the current true edge box and the corresponding anchor box.

[0085] Assume that the anchor box (A i ) and its assigned ground-truth edge box (B j ), the center coordinates are ((x a ,y a )、(x b ,y b )), the widths are (w a 、w b ), and the heights are (h a 、h b ), then the anchor box (A i ) are marked with the following offsets:

[0086] [(\frac{\frac{x b -x a}{w a}-\mu x}{\sigma x},\frac{\frac{y b -y a}{ha}-\mu y}{\sigma y},\frac{\log\frac{w b}{w a}-\mu w}{\sigma w},\frac{\log\frac{h b}{h a}-\mu h}{\sigma h})\]; where (\mu and \sigma\) take common values.

[0087] In step S4, the target image to be predicted is input into the target detection model, and the target detection model outputs the target position and category.

[0088] like Figure 3 As shown in the figure, the control layer uses the trained primary model to predict the test target image dataset and generate a new feature vector. Then, the trained meta-learner is used to train a meta-model on the dataset. The meta-model uses the machine learning algorithm logistic regression. The goal of the meta-model is to learn how to combine the prediction results of the basic model to maximize the accuracy of the overall model. Finally, the trained meta-model is used to predict the test target image dataset. The meta-model combines and weights the prediction results of the basic model to generate the final prediction result, that is, the position and category of the detected target are output.

[0089] The primary model is a trained target detection model. Specifically, a target box is generated based on the fused feature map information, and the category and offset of the target in the image are determined in the target box to obtain a trained target detection model. This is the primary model.

[0090] The primary model is stored in the feature vector database. Afterwards, the meta-learner is used to learn again to obtain the final object detection model.

[0091] The mathematical model of meta-learning can be expressed as:

[0092] $$\begin{aligned}\mathcal{M}&=\mathcal{F}(\theta)\\theta&=\mathcal{A}(\phi)\\phi&=\mathcal{A}{\text{meta}}(\phi0)\end{aligned}$$

[0093] Among them, $\mathcal{M}$ represents the learning strategy, $\mathcal{F}$ represents the model training process, $\theta$ represents the model parameters, $\mathcal{A}$ represents the optimization algorithm, $\phi$ represents the learning strategy parameters, $\mathcal{A}{\text{meta}}$ represents the meta-learning algorithm, and $\phi0$ represents the initial learning strategy parameters.

[0094] This embodiment uses a linear weighted method to generate the final prediction result. In linear regression, a loss function is defined, which is expressed as:

[0095] J(θ)=1 2 ∑i=1m(h(x(i))-y(i)) 2

[0096] h(x)=θ0x0+θ1x1+θ2x2+…+θnxn=θTx

[0097] Among them, h(x) is the estimate of sample x, which represents the predicted value, and x(i) is the feature vector of the i-th training sample.

[0098] This embodiment has high requirements for the real-time detection speed, so the network structure cannot be too complex, the parameters cannot be too many, and the convolution levels cannot be too many.

[0099] Embodiment 2

[0100] This embodiment provides an image information target detection system based on YOLO, including:

[0101] An acquisition module is used to acquire target image information and extract feature maps from the image information;

[0102] A fusion module is used to input the extracted feature map into the YOLO network for training and perform fusion processing at the output end of the YOLO network to obtain fused feature map information;

[0103] The training module is used to generate a target frame based on the fused feature map information, and determine the category and offset of the target in the image in the target frame to obtain a trained target detection model;

[0104] The detection module is used to input the target image to be predicted into the target detection model, and the target detection model outputs the target position and category.

[0105] Furthermore, the fusion processing in the fusion module is specifically: fusing the extracted feature maps from top to bottom and from bottom to top in sequence.

[0106] Furthermore, the training module also includes removing overlapping anchor boxes in the target box by non-maximum suppression.

[0107] Furthermore, the training module specifically includes:

[0108] A setting module, used to set anchor frames of corresponding sizes according to target images of different sizes;

[0109] A definition module is used to define a matrix corresponding to the anchor box according to the fused feature map information;

[0110] The deletion module is used to find the maximum value in the matrix, delete the column and row corresponding to the maximum value found, and obtain the remaining anchor boxes;

[0111] A judgment module is used to calculate the IoU value between the remaining anchor boxes and the true edge boxes, and filter out the maximum IoU value, and determine whether the filtered IoU maximum value is greater than a preset threshold. If so, the current true edge box is assigned to the anchor box;

[0112] The calculation module is used to calculate the category and offset of the target in the image based on the current true edge box and the corresponding anchor box.

[0113] Furthermore, the detection module calculates the category and offset of the target in the image specifically as follows: the target detection model combines and weights the prediction results to generate a final prediction result, namely, the target position and category.

[0114] It should be noted that the image information target detection system based on YOLO provided in this embodiment is similar to that in Embodiment 1, and will not be described in detail in this embodiment.

[0115] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for detecting target objects in image information based on YOLO, characterized in that: include: S1. Obtain target image information and extract feature maps from the image information; S2. Input the extracted feature map into the YOLO network for training, and perform fusion processing at the output end of the YOLO network to obtain the fused feature map information; S3. Generate a target frame based on the fused feature map information, and determine the category and offset of the target in the image in the target frame to obtain a trained target detection model; S4. Input the target image to be predicted into the target detection model, and the target detection model outputs the target position and category; The step S3 is specifically as follows: S31. Setting anchor frames of corresponding sizes according to target images of different sizes; S32. Define a matrix corresponding to the anchor box according to the fused feature map information; S33. Find the maximum value in the matrix, delete the column and row corresponding to the found maximum value, and obtain the remaining anchor boxes; S34. Calculate the IoU value of the remaining anchor box and the true edge box, and filter out the maximum value of the IoU, and determine whether the filtered maximum value of the IoU is greater than a preset threshold. If so, assign the current true edge box to the anchor box; S35. Calculate the category and offset of the target in the image based on the current true edge box and the corresponding anchor box.

2. The image information target detection method based on YOLO according to claim 1, characterized in that: The fusion process in step S2 is specifically: fusing the extracted feature maps from top to bottom and from bottom to top in sequence.

3. The image information target detection method based on YOLO according to claim 2, characterized in that: The step S3 also includes removing overlapping anchor frames in the target frame by non-maximum suppression.

4. The image information target detection method based on YOLO according to claim 3, characterized in that: The step S4 is specifically as follows: the target detection model combines and weights the prediction results to generate the final prediction results, namely the target position and category.

5. A YOLO-based image information target detection system, characterized in that: include: An acquisition module is used to acquire target image information and extract feature maps from the image information; A fusion module is used to input the extracted feature map into the YOLO network for training and perform fusion processing at the output end of the YOLO network to obtain fused feature map information; The training module is used to generate a target frame based on the fused feature map information, and determine the category and offset of the target in the image in the target frame to obtain a trained target detection model; The detection module is used to input the target image to be predicted into the target detection model, and the target detection model outputs the target position and category; The training module specifically includes: A setting module, used to set anchor frames of corresponding sizes according to target images of different sizes; A definition module is used to define a matrix corresponding to the anchor box according to the fused feature map information; The deletion module is used to find the maximum value in the matrix, delete the column and row corresponding to the maximum value found, and obtain the remaining anchor boxes; A judgment module is used to calculate the IoU value between the remaining anchor boxes and the true edge boxes, and filter out the maximum IoU value, and determine whether the filtered IoU maximum value is greater than a preset threshold. If so, the current true edge box is assigned to the anchor box; The calculation module is used to calculate the category and offset of the target in the image based on the current true edge box and the corresponding anchor box.

6. The image information target detection system based on YOLO according to claim 5, characterized in that: The fusion processing in the fusion module is specifically: fusing the extracted feature maps from top to bottom and from bottom to top in sequence.

7. The image information target detection system based on YOLO according to claim 6, characterized in that: The training module also includes removing overlapping anchor boxes in the target box by non-maximum suppression.

8. The image information target detection system based on YOLO according to claim 7, characterized in that: The detection module calculates the category and offset of the target in the image specifically as follows: the target detection model combines and weights the prediction results to generate the final prediction result, namely the target position and category.

Citation Information

Patent Citations

  • Insulator defect detection method based on improved YOLOv7

    CN115731164A

  • Measurement method and measurement apparatus based on deep learning of tight box mark

    WO2023060637A1

Cited By

  • A method and system for intelligent detection of abandoned items

    CN123119336A