Grazing detection method and system based on double links
By introducing semantic links and map neural networks in the grassland grazing detection, the dual-link detection model DLG-GD is constructed, and the problems of difficulty identification of small and medium-sized targets and insufficient common characteristics of similar targets have been solved. Gemmother's grazing target detection.
Patent Information
- Application Number
- CN202411896190.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-12-23
AI Technical Summary
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.
Adopting a double-link belligence detection method, the characteristics of the semantic link guide gradient propagation and the characteristics of the neural network aggregate convergence semi-free, and build a dual-link detection model DLG-GD to identify the types and quantities of the target of grassland grazing.
有效减少了高点监控场景下误检和漏检的情况,增强了模型对小尺度目标的感知和识别能力,保证了违规放牧识别的准确性和鲁棒性。
Smart Images

Figure CN119379998A_ABST
Abstract
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: A dual-link based grazing detection method comprises the following steps: 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 },in represents the i-th labeled image in the grazing dataset; express The corresponding graph structure data, express The set of nodes whose target box pixels are less than the threshold, express The set of edges between the middle nodes; the labeled grazing dataset Divide into training data sets and validation set ; S3. Build a dual-link detection model DLG-GD and train the model for m rounds to obtain the weight of the optimal model.
[0005] Preferably, in step S2, a random connection mapping method is used to construct The specific steps of the table are as follows: S21. Dataset Classify according to the target C=(c1,c2,c3,...,c j ); S22. From From the c1 target node set, randomly select a node whose pixel is less than the threshold As a starting point; S23. From From the c1 target node set, randomly select a node whose pixel is smaller than the threshold and is not connected , and Connect, create undirected edges ; S24. Continue from 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, express Pixels smaller than the threshold The target node set, express middle The node edge set of the target; S25. Repeat steps S22-S24 to complete the graph structure data of all targets in C The construction of ; = .
[0006] Preferably, in step S3, a dual-link detection model DLG-GDB 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 feature , , ; 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.
[0007] 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: S32-1. For each image, the training data after scaling and normalization And scaled graph data , which is input 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 main 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 box The difference 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 Represents the weight of the classification loss.
[0008] 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 , whose semantic fusion updated node representation The calculation formula is as follows: ; ; represents the LeakyRelu activation function with a negative slope of 0.3, It is a MLP multi-layer perceptron; Represents the SE channel attention neural network in the SE-Net network; represents the dimensionality reduction hyperparameter 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 h-th graph attention head; represents the concatenation operation of the vector; H represents the number of graph attention heads; Represents the Relu activation function; 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. .
[0009] Preferably, the 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: .
[0010] Preferably, based on the loss value , use ADAM optimizer to train and optimize the DLG-GD model, and use Verify until The loss does not decrease for τ consecutive rounds, or the training ends and the optimal weight is obtained.
[0011] A dual-link based grazing detection system comprises 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.
[0012] 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; 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.
[0013] 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.
[0014] Compared with the prior art, the present invention has the following beneficial effects: 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
[0015] Figure 1 It is a flow chart of the present invention; Figure 2 This is the DLG-GD model architecture diagram; Figure 3 This is the G3M2 network architecture diagram. DETAILED DESCRIPTION
[0016] 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.
[0017] A dual-link based grazing detection method comprises the following steps: 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.
[0018] S2, for each collected image, use X-Anylabeling to assume that c1 represents "horse ", c2 means " ", c3 means " ”, annotate the “horse”, “cow” and “sheep” targets, and establish connections between target nodes of the same type through random connection mapping method to obtain the grazing data set ,in, represents the i-th labeled image in the grazing dataset; express The corresponding graph structure data, express The target box pixel is less than 32*32 and the node set with the center of the box as the coordinate point, express The set of edges between nodes in the middle. Random connection graph construction method The specific steps of the table are as follows: (1) From From the target node set of "horse", randomly select a node with a pixel size smaller than 32*32 As a starting point.
[0019] (2) From From the target node set of "horse", randomly select a node with a pixel size smaller than 32*32 and not connected , and Connect, create undirected edges .
[0020] (3) Continue from In the set of "horse" target nodes, randomly select a node with a pixel size 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 size smaller than 32*32 are connected by at least one edge, and obtain the "horse" target connected graph structure data ,in, express The target node set of "horse" with pixels smaller than 32*32, express The node-edge set of the “horse” target.
[0021] (4) From From the target node set of "cow", randomly select a node with a pixel size smaller than 32*32 As a starting point.
[0022] (5) From From the target node set of "cow", randomly select a node with a pixel size smaller than 32*32 and not connected , and Connect, create undirected edges .
[0023] (6) Continue from In the set of "cow" target nodes, randomly select a node with a pixel size 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 size smaller than 32*32 are connected by at least one edge, and obtain the "cow" target connectivity graph structure data ,in, express The target node set of "cow" with pixels smaller than 32*32, express The node edge set of the “cow” target in .
[0024] (7) From Randomly select a node with a pixel size smaller than 32*32 from the target node set of "sheep". As a starting point.
[0025] (8) From From the target node set of "sheep", randomly select a node with a pixel size smaller than 32*32 and not connected , and Connect, create undirected edges .
[0026] (9) Continue from In the set of "sheep" target nodes, randomly select a node with a pixel size smaller than 32*32 and not connected, and randomly connect it to any node in the connected "sheep" target node set, until all "sheep" target nodes with a pixel size smaller than 32*32 are connected by at least one edge, and obtain the "sheep" target connected graph structure data ,in, express The target node set of "sheep" with pixels smaller than 32*32, express The node edge set of the “sheep” target.
[0027] (10) Finally, graph structure data The middle node set 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" .
[0028] 3. The labeled “horse”, “cow” and “sheep” grazing data The installation ratio is 8:2 and the training data set is divided into and validation set .
[0029] 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: (1) Input into the main detection network to get the predicted box set , , and predicted classification set , , .in, express The 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: 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 feature , , Among them, 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. Furthermore, the downsampling module is composed of the MixConv convolutional block in the MixNets network, the purpose of which is to extract and fuse the spatial and channel information in the input features to generate more expressive features; further, the G3M2 module is composed of a residual structure consisting of 3 Ghsot modules, 2 MobileFormer modules and 1 feature concatenation layer, the purpose of which is to effectively extract, fuse and enhance the input features through the residual structure to obtain more expressive features, among which the Ghsot module Ghost module is composed of the Ghost convolutional block in the GhostNet network, and the MobileFormer module is composed of the Mobile-Former block in the Mobile-Former network; further, the SPPF module is composed of the SPPF module of the yolo11 network, the purpose of which 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 of which is to introduce a position-sensitive attention mechanism, which can better enhance the model's perception of the target position.
[0030] 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.
[0031] c) Finally, 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.
[0032] (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: a) First, for each image, the training data is scaled and normalized And scaled graph data , which is input 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 aims to adaptively recalibrate the channels of the feature graph to improve the performance of the model, and secondly, 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 , whose semantic fusion updated node representation The calculation formula is as follows: ; ; in, Represents the LeakyRelu activation function with a negative slope of 0.3; It is a MLP multi-layer perceptron; Represents the SE channel attention neural network in the SE-Net network; represents the dimension reduction hyperparameter, which is set to 32; 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 h-th 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; 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. .
[0033] 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 main 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.
[0034] (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 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 Represents the weight of the classification loss.
[0035] Furthermore, the 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. Furthermore, the classification loss Using BCELoss as the loss calculation method, the calculation formula is: .
[0036] (4) Based on loss value , use ADAM optimizer to train and optimize the DLG-GD model, and use Verify until The loss does not decrease for 5 consecutive rounds, or the optimal weight is obtained until the end of training.
[0037] A dual-link based grazing detection system comprises 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.
[0038] 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.
[0039] 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.
[0040] 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.
[0041] 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, it can also be implemented 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.
[0042] 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 },in represents the i-th labeled image in the grazing dataset; express The corresponding graph structure data, express The set of nodes whose target box pixels are less than the threshold, express The set of edges between mid-edge nodes; The labeled grazing dataset Divide into training data sets and validation set ; S3. Build a dual-link detection model DLG-GD and train the model for m rounds to obtain the weight of the optimal model.
2. The dual-link based grazing detection method according to claim 1, characterized in that: In step S2, the random connection mapping method is used to construct The specific steps of the table are as follows: S21. Dataset Classify according to the target C=(c1,c2,c3,...,c j ); S22. From From the c1 target node set, randomly select a node whose pixel is less than the threshold As a starting point; S23. From From the c1 target node set, randomly select a node whose pixel is smaller than the threshold and is not connected , and Connect, create undirected edges ; S24. Continue from 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, express Pixels smaller than the threshold The target node set, express middle The node edge set of the target; S25. Repeat steps S22-S24 to complete the graph structure data of all targets in C The construction of ; = .
3. The dual-link based grazing detection method according to claim 1, characterized in that: In step S3, a dual-link detection model DLG-GDB 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 feature , , ; 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: 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: S32-1. For each image, the training data after scaling and normalization And scaled graph data , which is input 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 main 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 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 Represents the weight of the classification loss.
5. The dual-link based grazing detection method according to claim 4, characterized in that: In step S32-1, 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 , whose semantic fusion updated node representation The calculation formula is as follows: ; ; represents the LeakyRelu activation function with a negative slope of 0.3, It is a MLP multi-layer perceptron; Represents the SE channel attention neural network in the SE-Net network; represents the dimensionality reduction hyperparameter 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 h-th graph attention head; represents the concatenation operation of the vector; H represents the number of graph attention heads; Represents the Relu activation function; 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. .
6. The dual-link based grazing detection method according to claim 4, 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: .
7. The dual-link based grazing detection method according to claim 4, characterized in that: Based on the loss value , use ADAM optimizer to train and optimize the DLG-GD model, and use Verify until The loss does not decrease for τ consecutive rounds, or the training ends and the optimal weight is obtained.
8. A dual-link based grazing detection system, using the dual-link based grazing detection method according to any one of claims 1 to 7, 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.
9. The dual-link based grazing detection system according to claim 8, 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.
10. The dual-link based grazing detection system according to claim 9, 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
Image detection method and system based on efficient bidirectional path aggregation attention network
CN113538347A
Double-flow SSD SAR image target detection method based on CFAR guidance
CN114764886A
Target detection method and system based on attention mechanism and feature cross fusion
CN115035361A
Dual-mode target detection model and method based on residual contraction attention network
CN116342953A
Plant seedling quality on-line monitoring method and system
CN117745628A