A grazing detection method and system based on dual links

By adopting the dual-link detection method in grassland grazing detection and using semantic links and graph neural network technology, the problems of difficulty in identifying small and medium-sized targets and insufficient utilization of common characteristics of similar targets in the existing technology are solved, and a more accurate and robust grassland grazing target detection is achieved.

CN119379998BActive Publication Date: 2025-04-25QINGDAO HAOHAI NETWORK TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411896190.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-25
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

The prior art is difficult to effectively identify the key detailed characteristics of small targets in grassland grazing detection, resulting in missed or missed targets, and the common characteristics between similar targets are ignored, resulting in poor detection.

Method used

Using a double-link grazing detection method, the double-link detection model DLG-GD is constructed through semantic link-guided gradient propagation and graph neural networks to aggregate inter-semantic features to achieve accurate identification of the types and quantities of grassland grazing targets.

Benefits of technology

It effectively reduces the situation of false detection and missed detection in high-point monitoring scenarios, enhances the model's perception and identification ability of small-scale targets, and ensures the accuracy and robustness of illegal grazing recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379998B_ABST
    Figure CN119379998B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of computer vision and target detection technology, and specifically relates to a dual-link based grazing detection method and system, which introduces a semantic link network to provide additional fine-grained feature information for the main branch, and reliably transmits gradient information to the main branch during training, helping the main branch to learn target features more effectively and enhancing the model's perception and recognition capabilities for small-scale targets. At the same time, by introducing a graph neural network to fuse semantic information between targets of the same type, richer feature information is provided for the learning of small targets, further solving problems such as gradient vanishing and insufficient feature learning in small target detection. The above features effectively reduce false detections and missed detections in high-point monitoring scenarios, and ensure the accuracy and robustness of illegal grazing identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of computer vision and target detection, and specifically relates to a dual-link based grazing detection method and system. Background Art

[0002] Grasslands play a vital role in the national economy and ecological environment. Grassland ecosystems not only provide habitats for a variety of plants, animals and microorganisms, supporting a rich variety of biological species, but also provide a variety of ecological services such as water conservation, soil protection and climate regulation. Sustainable management of grasslands is essential to maintain these ecological functions and promote economic development.

[0003] Since illegal grazing detection algorithms are mostly run under high-point monitoring systems, livestock often occupy a very small part of the image, which may even be only a few pixels in size. In addition, there are many types of vegetation in grassland areas, and grass, shrubs, weeds, and bare or gravel land in desertification may cover the surface, making it difficult to distinguish the boundary between the target and the background. Traditional target detection methods rely on manually designed feature extraction and classifiers, which often have limited performance in complex environments. With the rapid development of deep learning, target detection technology has also made significant breakthroughs and progress. In recent years, deep neural network architectures such as YOLO, Faster R-CNN, and SSD have demonstrated excellent performance in target detection tasks and can handle multi-target detection in complex scenes in real time, but they still face the following challenges. First, the deep structure of the network makes it impossible to effectively transmit gradient information. As the depth of the network increases, the loss of gradients continues to accumulate, which makes it even more difficult to effectively learn and update the key details of small targets that were originally difficult to identify, ultimately leading to missed or misdetected targets. Secondly, previous work mainly focused on the fusion of multi-scale features of the same target, ignoring the information that similar targets usually have similar features and failing to fully utilize the commonalities between similar targets, which also leads to poor detection results for small-sized targets. Summary of the invention

[0004] In view of the problems existing in the prior art, the present invention provides a grazing detection method based on dual links, which can accurately identify the types and quantities of grassland grazing targets by guiding gradient propagation through semantic links and aggregating semantic features through graph neural networks. The technical solution is:

[0005] A dual-link based grazing detection method comprises the following steps:

[0006] S1. Collect grazing image data;

[0007] S2. For each collected image, target annotation is performed and connections between target nodes of the same type are established through random connection mapping method to obtain the grazing dataset D = {(d1 ,g 1 (V 1 ,E 1 )),(d 2 ,g 2 (V 2 ,E 2 )),…,(d i ,g i (V i ,E i ))}, where d i represents the i-th labeled image in the grazing dataset; g i (V i , E i ) means d i The corresponding graph structure data, V i Indicates d i The node set whose target box pixels are less than the threshold, E i Indicates d i The set of edges between the middle nodes; divide the labeled grazing dataset D into the training dataset D train and validation set D val ;

[0008] S3. Build a dual-link detection model DLG-GD and train the model for m rounds to obtain the weight of the optimal model.

[0009] Preferably, in step S2, random connection mapping is used to construct g i (V i , E i ) table as follows:

[0010] S21. Classify the data set D according to the target C = (c1, c2, c3, ..., c j );

[0011] S22. From d i From the c1 target node set, randomly select a node whose pixel is less than the threshold As a starting point;

[0012] S23. From d i From the c1 target node set, randomly select a node whose pixel is smaller than the threshold and is not connected Combine it with Connect, create undirected edges

[0013] S24. Continue from d iFrom the c1 target node set, randomly select a node whose pixel is less than the threshold and is not connected, and randomly connect it to any node in the connected c1 target node set until all c1 target nodes whose pixels are less than the threshold are connected by at least one edge, and obtain the c1 target connected graph structure data in, Indicates d i The c1 target node set whose pixels are less than the threshold, Indicates d i Medium 1 The node edge set of the target;

[0014] S25. Repeat steps S22-S24 to complete the graph structure data g of all targets in C i (V i , E i ) construction;

[0015]

[0016] Preferably, in step S3, a dual-link detection model DLG-GD is constructed, and the steps are as follows:

[0017] S31-1. For each image after scaling and normalization of the training data Input it into the backbone network module of the main detection network to obtain the features

[0018] S31-2. Coming Features Input into the feature fusion module of the main detection network to obtain features

[0019] S31-3. Coming Features They are respectively input into the P1-detection head, P2-detection head and P3-detection head of the target prediction module of the main detection network to obtain the prediction box set and predicted classification set Among them, P1-detection head, P2-detection head and P3-detection head are all composed of yolo11 detection heads.

[0020] Preferably, in step S3, and Input into the semantic guided detection network to get the predicted box set and predicted classification set in, Represents the scaled graph structure data; the semantic guided detection network consists of two parts: the semantic fusion module and the target detection module. The specific implementation steps are as follows:

[0021] S32-1. For each image, the training data after scaling and normalization And scaled graph data Input it into the semantic fusion module to obtain features S32-2. Features They are respectively input into the G1-detection head, G2-detection head and G3-detection head of the target prediction module of the semantic guided detection network to obtain the prediction box set and predicted classification set Among them, G1-detection head, G2-detection head and G3-detection head are all composed of yolo11 detection heads;

[0022] S32-3. Use formula Calculate the loss value between the predicted result and the true value; where, represents the total training loss of the i-th image; Represents the regression loss of the i-th image, which is used to calculate the set of predicted boxes With real box The difference between loc represents the weight of regression loss; Represents the classification loss of the i-th image, which is used to calculate the classification set and the true classification The difference between cls Represents the weight of the classification loss.

[0023] Preferably, the improved graph attention network GAT_SE module can adaptively recalibrate the channels of the feature map. The specific steps are: the input of the GAT_SE module is expressed as The kth node in the node set has the following characteristics The corresponding node representation is Its semantic fusion updated node representation v gs,k The calculation formula is as follows:

[0024]

[0025] δ represents the LeakyRelu activation function with a negative slope of 0.3, f(·) is the MLP multi-layer perceptron; SE(·) represents the SE channel attention neural network in the SE-Net network; ε represents the dimensionality reduction hyperparameter; V k Indicated in The first-order neighbor node set of node k in the node set of ; represents the attention weight coefficient of node k and node j in the hth graph attention head; || represents the concatenation operation of the vector; H represents the number of graph attention heads; σ represents the ReLU activation function; W (h) Represents the learnable projection parameter matrix of the h-th head; features after semantic fusion It is a feature All target nodes in represent the updated feature representation, i.e.

[0026] Preferably, the regression loss Using InnerIoU as the loss calculation method, the calculation formula is:

[0027]

[0028] in, Represents the area of ​​the overlap between the predicted box and the true box. Represents the area of ​​the prediction box, classification loss Using BCELoss as the loss calculation method, the calculation formula is:

[0029] Preferably, based on the loss value The DLG-GD model was trained and optimized using the ADAM optimizer. val Verify until The loss does not decrease for τ consecutive rounds, or the training ends and the optimal weight is obtained.

[0030] A dual-link based grazing detection system comprises a data acquisition module, a data processing module and a data output module; the data acquisition module collects grazing image data;

[0031] Data processing module: mark the target for each collected image and process the data using the dual-link detection model DLG-GD;

[0032] Data output module: data visualization output, monitoring video frame when the total number of targets exceeds 3 and provide alarm service.

[0033] Preferably, the dual-link detection model DLG-GD includes a main detection network and a semantic guided detection network; the main detection network includes a backbone network module, a feature fusion module and a target prediction module;

[0034] The backbone network module is composed of a downsampling module, a downsampling module, a G3M2 module, a downsampling module, a G3M2 module, a downsampling module, a G3M2 module, a downsampling module, a G3M2 module, a SPPF module and a C2PSA module in sequence;

[0035] The downsampling module is composed of MixConv convolution blocks in the MixNets network, which aims to extract and fuse the spatial and channel information in the input features to generate more expressive features;

[0036] The G3M2 module is composed of a residual structure consisting of three Ghsot modules, two MobileFormer modules and one feature concatenation layer. The purpose is to effectively extract, fuse and enhance the input features through the residual structure to obtain more expressive features. The Ghsot module Ghost module is composed of the Ghost convolution block in the GhostNet network, and the MobileFormer module is composed of the Mobile-Former block in the Mobile-Former network.

[0037] The SPPF module is composed of the SPPF module of the yolo11 network. Its purpose is to enhance the multi-scale information extraction capability of the feature map and improve the adaptability of the target detection model to objects of different sizes.

[0038] The C2PSA module is composed of the C2PSA module of the yolo11 network. The purpose is to introduce a position-sensitive attention mechanism to better enhance the model's ability to perceive the target position;

[0039] The feature fusion module is composed of an upsampling layer, a feature splicing layer, a G3M2 module, an upsampling layer, a feature splicing layer, a G3M2 module, a downsampling module, a feature splicing layer, a G3M2 module, a downsampling module, a feature splicing layer and a G3M2 module.

[0040] Preferably, the semantic guided detection network is composed of a downsampling module, a downsampling module, a G3M2 module, a downsampling module, a feature splicing layer, a downsampling module, a feature splicing layer, a downsampling module, a feature splicing layer and a GAT_SE module in sequence; the downsampling module is composed of a MixConv convolution block in a MixNets network.

[0041] Compared with the prior art, the present invention has the following beneficial effects:

[0042] By introducing a semantic link network, additional fine-grained feature information is provided to the main branch, and the gradient information is reliably transmitted to the main branch during the training process, which helps the main branch learn the target features more effectively and enhances the model's perception and recognition capabilities for small-scale targets. At the same time, by introducing a graph neural network to fuse semantic information between targets of the same type, richer feature information is provided for the learning of small targets, further solving the problems of gradient disappearance and insufficient feature learning in small target detection. The above features effectively reduce false detections and missed detections in high-point monitoring scenarios, and ensure the accuracy and robustness of illegal grazing identification. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a flow chart of the present invention;

[0044] Figure 2 This is the DLG-GD model architecture diagram;

[0045] Figure 3 This is the G3M2 network architecture diagram. DETAILED DESCRIPTION

[0046] The technical solution of the present application is described in detail below through specific embodiments and drawings. It should be understood that the embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations on the technical solution of the present application, and the specific technical features may be combined with each other.

[0047] A dual-link based grazing detection method comprises the following steps:

[0048] S1. Collect grazing image data: Collect grazing videos containing targets such as "horses", "cows" and "sheep" under high-point monitoring under lighting conditions in the morning, noon and evening. Then, a total of 20,000 grazing image data are collected from the videos through key frame extraction. The key frame extraction method is to extract one frame every 5 seconds.

[0049] S2. For each collected image, use X-Anylabeling to assume that c1 represents "horse", c2 represents "cattle", and c3 represents "sheep", label the "horse", "cattle", and "sheep" targets, and establish connections between target nodes of the same type through random connection mapping method to obtain the grazing data set D = {(d 1 , g 1 (V 1 , E 1 )), (d 2 , g 2 (V 2 , E 2 )),…(d 20000 , g 20000 (V 20000 , E 20000 ))}, where d i represents the i-th labeled image in the grazing dataset; g i (V i , E i ) means d i The corresponding graph structure data, V i Indicates d i The target box pixel is less than 32*32 and the node set with the box center as the coordinate point, E i Indicates d i The set of edges between nodes in the middle. Random connection graph construction method constructs g i (V i , E i ) table as follows:

[0050] (1) From di From the target node set of "horse", randomly select a node with a pixel size smaller than 32*32 As a starting point.

[0051] (2) From d i From the target node set of "horse", randomly select a node with a pixel size less than 32*32 and not connected Combine it with Connect, create undirected edges

[0052] (3) Continue from d i From the set of "horse" target nodes, randomly select a node with a pixel smaller than 32*32 and not connected, and randomly connect it to any node in the connected "horse" target node set, until all "horse" target nodes with a pixel smaller than 32*32 are connected by at least one edge, and obtain the "horse" target connected graph structure data in, Indicates d i The target node set of "horse" with pixels less than 32*32 in the middle. Indicates d i The node-edge set of the “horse” target.

[0053] (4) From d i From the target node set of "cow", randomly select a node with a pixel smaller than 32*32 As a starting point.

[0054] (5) From d i From the target node set of "cow", randomly select a node with a pixel size less than 32*32 and not connected Combine it with Connect, create undirected edges

[0055] (6) Continue from d i In the set of "cow" target nodes, randomly select a node with a pixel smaller than 32*32 and not connected, and randomly connect it to any node in the connected "cow" target node set, until all "cow" target nodes with a pixel smaller than 32*32 are connected by at least one edge, and obtain the "cow" target connected graph structure data in, Indicates d i The target node set of "cow" with pixels less than 32*32, Indicates d i The node edge set of the “cow” target in .

[0056] (7) From d iFrom the target node set of "sheep", randomly select a node with a pixel smaller than 32*32 As a starting point.

[0057] (8) From d i From the target node set of "sheep", randomly select a node with a pixel size smaller than 32*32 and not connected Combine it with Connect, create undirected edges

[0058] (9) Continue from d i Randomly select a node with a pixel smaller than 32*32 and not connected from the set of "sheep" target nodes, and randomly connect it to any node in the set of connected "sheep" target nodes, until all "sheep" target nodes with a pixel smaller than 32*32 are connected by at least one edge, and obtain the "sheep" target connected graph structure data in, Indicates d i The target node set of "sheep" with pixels smaller than 32*32, Indicates d i The node edge set of the “sheep” target.

[0059] (10) Finally, the graph structure data g i (V i , E i ) is the union of the target node sets of "horse", "cow", and "sheep" The edge set is the union of the edge sets of the target nodes "horse", "cow", and "sheep"

[0060] 3. Divide the labeled “horse”, “cow” and “sheep” grazing data D into training data set D in a ratio of 8:2. train and validation set D val .

[0061] S3. Use pytorch to build a dual-link and semantic-guided detection model DLG-GD, and train the model for m rounds to obtain the weight file DLG-GD-best.pt of the optimal model. Among them, m is set to 300. The specific steps of DLG-GD model training are as follows:

[0062] (1) Input into the main detection network to get the predicted box set and predicted classification set in, Indicates D trainThe i-th image in the training data is scaled and normalized, and the image scaling size is 640*640; the main detection network includes three parts: backbone network module, feature fusion module and target prediction module. The specific implementation steps are as follows:

[0063] a) First, for each image, the training data is scaled and normalized Input it into the backbone network module of the main detection network to obtain the features Among them, the backbone network module is composed of downsampling module, downsampling module, G3M2 module, downsampling module, G3M2 module, downsampling module, G3M2 module, downsampling module, G3M2 module, SPPF module and C2PSA module in sequence. Further, the downsampling module is composed of MixConv convolution blocks in MixNets network, the purpose of which is to extract and fuse spatial and channel information in input features to generate more expressive features; further, the G3M2 module is composed of a residual structure composed of 3 Ghsot modules, 2 MobileFormer modules and 1 feature concatenation layer, the purpose of which is to effectively extract, fuse and enhance input features through the residual structure to obtain more expressive features, among which the Ghsot module Ghost module is composed of Ghost convolution blocks in GhostNet network, and the MobileFormer module is composed of Mobile-Former block blocks in Mobile-Former network; further, the SPPF module is composed of the SPPF module of yolo11 network, the purpose of which is to improve the multi-scale information extraction capability of feature maps and improve the adaptability of target detection models to objects of different sizes. The C2PSA module is composed of the C2PSA module of the yolo11 network. The purpose is to introduce a position-sensitive attention mechanism to better enhance the model's perception of the target position.

[0064] b) Then, the feature Input into the feature fusion module of the main detection network to obtain features Among them, the feature fusion module is composed of an upsampling layer, a feature splicing layer, a G3M2 module, an upsampling layer, a feature splicing layer, a G3M2 module, a downsampling module, a feature splicing layer, a G3M2 module, a downsampling module, a feature splicing layer and a G3M2 module.

[0065] c) Finally, we will get the feature They are respectively input into the P1-detection head, P2-detection head and P3-detection head of the target prediction module of the main detection network to obtain the prediction box set and predicted classification set Among them, P1-detection head, P2-detection head and P3-detection head are all composed of yolo11 detection heads.

[0066] (2) and Input into the semantic guided detection network to get the predicted box set and predicted classification set in, Represents the scaled graph structure data; the semantic guided detection network consists of two parts: the semantic fusion module and the target detection module. The specific implementation steps are as follows:

[0067] a) First, for each image, the training data is scaled and normalized And scaled graph data Input it into the semantic fusion module to obtain features Among them, the semantic fusion module is composed of a downsampling module, a downsampling module, a G3M2 module, a downsampling module, a feature splicing layer, a downsampling module, a feature splicing layer, a downsampling module, a feature splicing layer and a GAT_SE module in sequence. Furthermore, the downsampling module is composed of the MixConv convolution block in the MixNets network, and its purpose is to extract and fuse the spatial and channel information in the input features to generate more expressive features; further, the improved graph attention network GAT_SE module of the present invention has the following purposes: first, to adaptively recalibrate the channels of the feature graph, thereby improving the performance of the model, and second, to perform semantic fusion through effective information propagation and node feature aggregation on the graph structure data through the graph attention network. Specifically, the input of the GAT_SE module is represented as The kth node in the node set has the following characteristics The corresponding node representation is Its semantic fusion updated node representation v gs,k The calculation formula is as follows:

[0068]

[0069] Where δ represents the LeakyRelu activation function with a negative slope of 0.3; f(·) is the MLP multi-layer perceptron; SE(·) represents the SE channel attention neural network in the SE-Net network; ε represents the dimensionality reduction hyperparameter, which is set to 32; V k Indicated in The first-order neighbor node set of node k in the node set of ; represents the attention weight coefficient of node k and node j in the hth graph attention head; || represents the concatenation operation of the vector; H represents the number of graph attention heads, which is set to 8; σ represents the ReLU activation function; W (h)Represents the learnable projection parameter matrix of the h-th head. Features after semantic fusion It is a feature All target nodes in represent the updated feature representation, i.e.

[0070] b) Finally, the features They are respectively input into the G1-detection head, G2-detection head and G3-detection head of the target prediction module of the semantic guided detection network to obtain the prediction box set and predicted classification set Among them, G1-detection head, G2-detection head and G3-detection head are all composed of yolo11 detection heads.

[0071] (3) Use the formula Calculate the loss between the predicted result and the true value. represents the total training loss of the i-th image; Represents the regression loss of the i-th image, which is used to calculate the set of predicted boxes With real box The difference between loc represents the weight of regression loss; Represents the classification loss of the i-th image, which is used to calculate the classification set and the true classification The difference between cls Represents the weight of the classification loss.

[0072] Furthermore, the regression loss Using InnerIoU as the loss calculation method, the calculation formula is:

[0073]

[0074] in, Represents the area of ​​the overlap between the predicted box and the true box. Represents the area of ​​the prediction box. Furthermore, the classification loss Using BCELoss as the loss calculation method, the calculation formula is:

[0075] (4) Based on loss value The DLG-GD model was trained and optimized using the ADAM optimizer. val Verify until The loss does not decrease for 5 consecutive rounds, or the optimal weight is obtained until the end of training.

[0076] A dual-link based grazing detection system comprises a data acquisition module, a data processing module and a data output module; the data acquisition module collects grazing image data;

[0077] Data processing module: mark the target for each collected image and process the data using the dual-link detection model DLG-GD;

[0078] Data output module: data visualization output, monitoring video frame when the total number of targets exceeds 3 and provide alarm service.

[0079] Use the onnx tool to convert the pytorch format weight file DLG-GD-best.pt into the onnx format weight file DLG-GD-best.pt, and then use the onnx-graphsurgeon tool to trim the guided branch network in the calculation graph to obtain the final weight file DLG-GD-final.onnx.

[0080] The final weight file DLG-GD-final.onnx is deployed to the server in the grazing ban area to provide horse, cattle and sheep grazing detection algorithm recognition services. The intersection-over-union ratio threshold and confidence threshold are set to 0.6 during deployment. When the total number of horses, cattle and sheep identified in the high-point monitoring video frame exceeds 3, an alarm service is performed.

[0081] The method embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0082] The system is constructed to run the method of the present application. Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0083] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A grazing detection method based on dual links, characterized in that: The following steps are involved: S1. Collect grazing image data; S2. For each collected image, target annotation is performed and connections between target nodes of the same type are established through random connection mapping method to obtain the grazing dataset D = {(d 1 , g 1 (V 1 , E 1 )), (d 2 , g 2 (V 2 , E 2 )),…,(d i , g i (V i , E i ))}, where d i represents the i-th labeled image in the grazing dataset; g i (V i , E i ) means d i The corresponding graph structure data, V i Indicates d i The node set whose target box pixels are less than the threshold, E i Indicates d i The set of edges between mid-edge nodes; Divide the labeled grazing dataset D into training dataset D train and validation set D val ; S3. Build a dual-link detection model DLG-GD and train the model for m rounds to obtain the weight of the optimal model; Will and Input into the semantic guided detection network to get the predicted box set and predicted classification set in, Represents the scaled graph structure data; The semantic guided detection network consists of two parts: semantic fusion module and target detection module. The specific implementation steps are as follows: S32-1. For each image, the training data after scaling and normalization And scaled graph data Input it into the semantic fusion module to obtain features S32-2. Features They are respectively input into the G1-detection head, G2-detection head and G3-detection head of the target prediction module of the semantic guided detection network to obtain the prediction box set and predicted classification set Among them, G1-detection head, G2-detection head and G3-detection head are all composed of yolo11 detection heads; S32-3. Use formula Calculate the loss value between the predicted result and the true value; where, represents the total training loss of the i-th image; Represents the regression loss of the i-th image, which is used to calculate the set of predicted boxes With real frame The difference, λ loc represents the weight of regression loss; Represents the classification loss of the i-th image, which is used to calculate the classification set and the true classification The difference, λ cls Represents the weight of classification loss; The improved graph attention network GAT_SE module can adaptively recalibrate the channels of the feature map. The specific steps are: the input of the GAT_SE module is expressed as The kth node in the node set has the following characteristics The corresponding node representation is Its semantic fusion updated node representation v gs,k The calculation formula is as follows: δ represents the LeakyRelu activation function with a negative slope of 0.3, f(·) is the MLP multi-layer perceptron; SE(·) represents the SE channel attention neural network in the SE-Net network; ε represents the dimensionality reduction hyperparameter; V k Indicated in The first-order neighbor node set of node k in the node set of ; represents the attention weight coefficient of node k and node j in the hth graph attention head; || represents the concatenation operation of the vector; H represents the number of graph attention heads; σ represents the ReLU activation function; W (h) Represents the learnable projection parameter matrix of the h-th head; features after semantic fusion It is a feature All target nodes in represent the updated feature representation, i.e.

2. The dual-link based grazing detection method according to claim 1, characterized in that: In step S2, random connection mapping is used to construct g i (V i , E i ) table as follows: S21. Classify the data set D according to the target C = (c1, c2, c3, ..., c j ); S22. From d i From the c1 target node set, randomly select a node whose pixel is less than the threshold As a starting point; S23. From d i From the c1 target node set, randomly select a node whose pixel is smaller than the threshold and is not connected Combine it with Connect, create undirected edges S24. Continue from d i From the c1 target node set, randomly select a node whose pixel is less than the threshold and is not connected, and randomly connect it to any node in the connected c1 target node set until all c1 target nodes whose pixels are less than the threshold are connected by at least one edge, and obtain the c1 target connected graph structure data in, Indicates d i The c1 target node set whose pixels are less than the threshold, Indicates d i The node edge set of the c1 target; S25. Repeat steps S22-S24 to complete the graph structure data g of all targets in C i (V i , E i ) construction; 3. The dual-link based grazing detection method according to claim 1, characterized in that: In step S3, a dual-link detection model DLG-GD is constructed, and the steps are as follows: S31-1. For each image after scaling and normalization of training data Input it into the backbone network module of the main detection network to obtain the features S31-2. Coming Features Input into the feature fusion module of the main detection network to obtain features S31-3. Coming Features They are respectively input into the P1-detection head, P2-detection head and P3-detection head of the target prediction module of the main detection network to obtain the prediction box set and predicted classification set Among them, P1-detection head, P2-detection head and P3-detection head are all composed of yolo11 detection heads.

4. The dual-link based grazing detection method according to claim 1, characterized in that: Regression Loss Using InnerIoU as the loss calculation method, the calculation formula is: in, Represents the area of ​​the overlap between the predicted box and the true box. Represents the area of ​​the prediction box, classification loss Using BCELoss as the loss calculation method, the calculation formula is:

5. The dual-link based grazing detection method according to claim 1, characterized in that: Based on the loss value The DLG-GD model was trained and optimized using the ADAM optimizer. val Verify until The loss does not decrease for τ consecutive rounds, or the training ends and the optimal weight is obtained.

6. A dual-link based grazing detection system, using the dual-link based grazing detection method according to any one of claims 1 to 5, characterized in that: It includes a data acquisition module, a data processing module and a data output module; Data acquisition module: collect grazing image data; Data processing module: mark the target for each collected image and process the data using the dual-link detection model DLG-GD; Data output module: data visualization output, monitoring video frame when the total number of targets exceeds 3 and provide alarm service.

7. The dual-link based grazing detection system according to claim 6, characterized in that: The dual-link detection model DLG-GD includes a main detection network and a semantic-guided detection network; the main detection network includes a backbone network module, a feature fusion module, and a target prediction module; The backbone network module is composed of a downsampling module, a downsampling module, a G3M2 module, a downsampling module, a G3M2 module, a downsampling module, a G3M2 module, a downsampling module, a G3M2 module, a SPPF module and a C2PSA module in sequence; The downsampling module is composed of MixConv convolution blocks in the MixNets network, which aims to extract and fuse the spatial and channel information in the input features to generate more expressive features; The G3M2 module is composed of a residual structure consisting of three Ghsot modules, two MobileFormer modules and one feature concatenation layer. The purpose is to effectively extract, fuse and enhance the input features through the residual structure to obtain more expressive features. The Ghsot module Ghost module is composed of the Ghost convolution block in the GhostNet network, and the MobileFormer module is composed of the Mobile-Former block in the Mobile-Former network. The SPPF module is composed of the SPPF module of the yolo11 network. Its purpose is to enhance the multi-scale information extraction capability of the feature map and improve the adaptability of the target detection model to objects of different sizes. The C2PSA module is composed of the C2PSA module of the yolo11 network. The purpose is to introduce a position-sensitive attention mechanism to better enhance the model's ability to perceive the target position; The feature fusion module is composed of an upsampling layer, a feature splicing layer, a G3M2 module, an upsampling layer, a feature splicing layer, a G3M2 module, a downsampling module, a feature splicing layer, a G3M2 module, a downsampling module, a feature splicing layer and a G3M2 module.

8. The dual-link based grazing detection system according to claim 7, characterized in that: The semantic-guided detection network is composed of a downsampling module, a downsampling module, a G3M2 module, a downsampling module, a feature splicing layer, a downsampling module, a feature splicing layer, a downsampling module, a feature splicing layer and a GAT_SE module in sequence; the downsampling module is composed of the MixConv convolution block in the MixNets network.

Citation Information

Patent Citations

  • Double-flow SSD SAR image target detection method based on CFAR guidance

    CN114764886A

  • Intelligent pasture ecological monitoring and early warning platform and method

    CN118036883A