Rice insect pest real-time detection framework construction method based on NVIDIA Jetson Nano
Through the combination of the improved YOLOv8 model and the DeepSeek big model, the problems of low efficiency and difficulty in small target recognition in rice pest detection are solved, and efficient, accurate detection and intelligent decision-making are achieved on NVIDIA Jetson Nano equipment, improving the accuracy of rice pest recognition and resource utilization efficiency.
Patent Information
- Application Number
- CN202510538107.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-08
AI Technical Summary
The prior art is inefficient and subjective in rice pest detection, making it difficult to accurately identify small-target pests in complex environments, and it is difficult to efficiently deploy deep learning models on resource-constrained devices.
The improved YOLOv8 model (GB-YOLOv8) combined with the DeepSeek big model is adopted to introduce the GAMA attention mechanism and BiFPN feature fusion network, and the optimized model is deployed on NVIDIA Jetson Nano devices to achieve efficient and accurate pest detection and intelligent decision-making.
In complex environments, a detection accuracy of 93.6% and a recall rate of 91.7% are achieved, and intelligent prevention and control suggestions are provided to meet the real-time detection needs of resource-constrained equipment.
Smart Images

Figure CN120451500A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image recognition technology, and in particular to a method for constructing a real-time rice pest detection framework based on NVIDIA Jetson Nano. Background Art
[0002] Pests and diseases are among the major factors affecting rice yield and quality, and in severe cases can even lead to crop failure. Therefore, timely identification and effective control of pests and diseases are crucial for improving rice yield and quality. The importance of a rice pest detection and identification system lies in its ability to quickly and accurately identify the different pest species that threaten rice plants. This is crucial for ensuring the healthy growth of crops and improving yield and quality. Pest infestations can cause pathological damage to rice plants, impacting plant growth and development, and even causing widespread yield reduction or crop failure. By promptly identifying pest species, farmers and agricultural technicians can implement targeted control measures, such as applying specific pesticides or employing environmentally friendly methods like biological control. This reduces the use of chemical pesticides, protects the ecological environment, and reduces agricultural production costs.
[0003] In practical applications, the rice pest detection and identification system can be widely used in real-time farmland monitoring, agricultural pest early warning systems, precision agriculture management platforms, agricultural consulting services, agricultural research and education, and other areas. For example, in a farmland monitoring system, by installing cameras and implementing a pest detection system based on GB-YOLOv8, field pest occurrences can be continuously monitored and real-time data feedback can be provided, enabling agricultural producers to respond quickly. In agricultural education and extension, this system can also serve as a powerful tool to educate farmers on the identification of different pests and enhance their prevention and control awareness and capabilities. Furthermore, researchers can use this system to collect pest data and analyze pest occurrence patterns and influencing factors, thereby providing a scientific basis for the development of agricultural pest management and control strategies.
[0004] Traditional methods for detecting rice pests and diseases rely primarily on manual observation and empirical judgment. While this approach has a certain degree of operability, it has many limitations. Manual detection is not only inefficient but also easily affected by the experience of the detector and environmental factors, leading to misjudgments or omissions. Furthermore, manual detection often fails to detect early symptoms of pests and diseases in a timely manner, potentially missing the optimal window for prevention and control. Furthermore, the demand for detection in large-scale rice-growing areas further highlights the shortcomings of manual detection methods in terms of efficiency and accuracy. These problems urgently need to be addressed with the help of advanced technologies; otherwise, they will hinder the timely and effective prevention and control of farmland pests and diseases, seriously threatening agricultural production safety.
[0005] With the rapid development of machine learning technology, more and more people have begun to study pest identification algorithms. For example, Li Tong et al. used support vector machines to design a remote intelligent integrated pest monitoring system, which achieved rapid and real-time identification and diagnosis of field pests and diseases. However, the data set was small and the detection effect needed to be improved. Preetha Raja et al. extracted the texture and color features of pests and used SVM for classification, achieving considerable improvements in the detection of crop pests. However, this method is not stable for pest identification in complex environments and has poor detection effect on small target pests. However, traditional machine learning methods rely on artificial feature engineering (such as texture, color, shape, etc.) for classification. The characteristics of pests vary greatly under different lighting, backgrounds, and angles, making it difficult for artificially designed features to fully adapt to complex scenarios.
[0006] With the development of intelligent agriculture, efficient and accurate rice pest detection technology has become an important means of ensuring food security. Traditional pest identification methods rely on manual experience, resulting in low efficiency and high subjectivity. In recent years, the development of deep learning technology has provided new solutions for agricultural pest monitoring, and AI-based pest detection methods have gradually become a research hotspot. Convolutional neural networks (CNNs) can automatically extract key features from images, enabling accurate classification and detection of pests and diseases, and have been widely used in agriculture. For example, Wei Yang et al. proposed a two-part agricultural pest detection method consisting of a candidate frame generation network and a Fast R-CNN. This method significantly improves recognition accuracy compared to traditional machine learning methods, but it still has certain limitations in detecting small objects and is difficult to effectively identify tiny pests in the field. Jiao et al. proposed a pest detection method based on an anchor-free region product neural network (AF-RCNN), achieving an average detection accuracy of 56.4% on 24 pest categories. Liu et al. developed an end-to-end deep learning method, PestNet, which incorporates a channel-wise attention mechanism to optimize feature extraction, improving the detection accuracy of multiple pest categories to 75.46%. In addition, Chen et al. used basic classifiers and ensemble classifiers to classify pest datasets and improved the classification accuracy through a majority voting mechanism.
[0007] To further improve the performance of small-target pest detection, the YOLO series of models has become a key research direction in pest detection in recent years due to its end-to-end detection architecture, efficient feature extraction capabilities, and optimization strategies for small targets. YOLO enhances its small-target detection capabilities through technologies such as multi-scale prediction, feature pyramids (FPN / PAFPN), and attention mechanisms, demonstrating superior performance and application value in pest detection tasks.
[0008] In summary, the current difficulties are to produce a dataset for small-target pest detection and to develop a network model that is better suited to detecting small-target pests. Therefore, the present invention proposes an improved YOLOv8 network for identifying small rice pest targets, which can deploy high-precision deep learning models on resource-constrained embedded devices. Summary of the Invention
[0009] The purpose of this invention is to solve the problems in the prior art and propose a method for constructing a real-time rice pest detection framework based on NVIDIA Jetson Nano.
[0010] The present invention is achieved through the following technical solutions. The present invention proposes a method for constructing a real-time rice pest detection framework based on NVIDIA Jetson Nano. The method is specifically as follows: the real-time detection framework is a rice pest detection framework based on a combination of an improved YOLOv8 model and a DeepSeek large model, which is deployed on a lightweight GPU device NVIDIA Jetson Nano;
[0011] The improved YOLOv8 model introduces the attention mechanism GAMA and the bidirectional feature pyramid network BiFPN to enhance the detection capability of small target pests and strengthen the robustness in complex environments.
[0012] The DeepSeek large-scale model conducts in-depth analysis of detection results and provides optimized prevention and control recommendations based on historical data;
[0013] To address the computing resource limitations of NVIDIA Jetson Nano, large models are pruned and quantized to ensure efficient inference on resource-constrained devices.
[0014] Furthermore, the YOLOv8 model is improved to the GB-YOLOv8 model. The GB-YOLOv8 model introduces the GAMA attention mechanism and BiFPN for feature enhancement and fusion. The GAMA attention mechanism is introduced after the C2f module of YOLOv8 and can focus on the key information in the input data; the BiFPN network is integrated in the Neck part to enhance the fusion ability of features at different levels.
[0015] Furthermore, the Neck part of YOLOv8 is responsible for extracting and fusing features of different scales; it utilizes the SPP structure and FPN technology; SPP can extract multi-scale contextual information, and FPN adopts a top-down structure to pass high-level semantic information to the lower layers, thereby achieving coarse-to-fine feature fusion.
[0016] Furthermore, the Head part of YOLOv8 adopts an adaptive label assignment strategy, allowing the model to automatically adjust labels according to the different characteristics of the target; thus, it can dynamically select the most appropriate anchor point based on the size, shape and contextual information of the target in the image.
[0017] Furthermore, YOLOv8 introduces AutoML technology to automatically find the optimal model parameters and structure during the framework design and optimization process.
[0018] Furthermore, the attention mechanism GAMA improves model performance by calculating the weight of each channel, emphasizing important features and suppressing unimportant features; at the same time, GAMA also improves model performance by reducing information approximation and amplifying global interaction representation.
[0019] Furthermore, the BiFPN network structure is a weighted fusion and bidirectional cross-scale connection, that is, a top-down and bottom-up structure. The bidirectional cross-scale connection is achieved by constructing a bidirectional channel, which directly fuses the features in the feature extraction network with the features of relative size in the bottom-up path, retaining shallow semantic information without losing too much deep semantic information.
[0020] Furthermore, the weighted fusion in the BiFPN network structure adopts fast normalized fusion to scale the weights to the range of 0 to 1.
[0021] The present invention also proposes an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method for constructing a real-time rice pest detection framework based on NVIDIA Jetson Nano are implemented.
[0022] The present invention also proposes a computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the steps of the method for constructing a real-time rice pest detection framework based on NVIDIA Jetson Nano.
[0023] Compared with the prior art, the present invention has the following beneficial effects:
[0024] This paper proposes a method for constructing a real-time rice pest detection framework based on NVIDIA Jetson Nano. The detection framework is developed around three core links: pest detection based on GB-YOLOv8, intelligent decision-making based on the DeepSeek large model, and lightweight deployment for NVIDIA Jetson Nano. Through the collaborative work of improved deep learning target detection technology (GB-YOLOv8), large language model reasoning capabilities (DeepSeek), and edge computing optimization technology, it achieves real-time, efficient, and accurate identification of rice field pests and generates intelligent prevention and control recommendations. The framework also ensures the model's small target detection performance in complex environments and efficient reasoning on resource-constrained platforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0026] Figure 1 This is a diagram showing some images and their annotations in the Pest dataset.
[0027] Figure 2 This is a diagram of the pest location distribution in the dataset.
[0028] Figure 3 It is a schematic diagram of the original data image.
[0029] Figure 4 It is a schematic diagram of the standardized data image.
[0030] Figure 5 This is a diagram of the real-time rice pest detection framework based on NVIDIA Jetson Nano.
[0031] Figure 6 This is a schematic diagram of the YOLOv8 network structure.
[0032] Figure 7 This is the GAMA network structure diagram.
[0033] Figure 8 This is the FPN network structure diagram.
[0034] Figure 9 This is the BIFPN network structure diagram.
[0035] Figure 10 This is the GB-YOLOv8 network structure diagram.
[0036] Figure 11 This is a diagram of the key features of NVIDIA Jetson Nano.
[0037] Figure 12 It is a diagram of the training process.
[0038] Figure 13 It is a diagram of recognition accuracy.
[0039] Figure 14 It is a diagram of recognition recall rate.
[0040] Figure 15 is the loss graph. DETAILED DESCRIPTION
[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0042] Combine Figures 1-15 The present invention proposes a method for constructing a real-time rice pest detection framework based on NVIDIA Jetson Nano. The method is specifically as follows: the real-time detection framework is a rice pest detection framework based on the combination of an improved YOLOv8 model (GB-YOLOv8) and a DeepSeek large model. The framework is deployed on a lightweight GPU device NVIDIA Jetson Nano to achieve real-time and efficient pest detection and decision support.
[0043] The improved YOLOv8 model improves the detection capability of small-target pests and enhances robustness in complex environments by introducing the attention mechanism GAMA (Global Average Max Attention) and the bidirectional feature pyramid network BiFPN.
[0044] DeepSeek large-scale model-assisted decision-making: Leveraging DeepSeek's powerful reasoning capabilities, we conduct in-depth analysis of detection results and provide optimized prevention and control recommendations based on historical data.
[0045] Lightweight deployment optimization: Targeting the computing resource limitations of NVIDIA Jetson Nano, large models are pruned and quantized to ensure efficient inference on resource-constrained devices.
[0046] The rice pest and disease detection framework uses the open-source Pest dataset. Data collection methods include on-site acquisition using drones and ground-based equipment, fixed surveillance cameras, smartphones, and manual camera capture. Historical records and public datasets are used, and expert image annotation using specialized annotation tools is performed. These methods contribute to a diverse, high-quality pest and disease image dataset, improving the performance of object detection algorithms.
[0047] In the rice pest control detection framework, data annotation and processing are key steps in data preparation. The LabelMe annotation tool is used to add bounding boxes and corresponding category labels to the targets in each image of the collected pest images. The training set consists of 4,200 images, the validation set consists of 546 images, and the test set consists of 505 images. The ratio of training set, validation set, and test set is 8:1:1. There are 14 types of rice pests, namely 'rice leaf roller', 'rice leafhopper', 'rice stem fly', 'Asian rice borer', 'yellow rice borer', 'rice gall midge', 'rice borer', 'brown planthopper', 'white-backed planthopper', 'small brown planthopper', 'rice water weevil', 'rice leafhopper', 'grain powdery fly', and 'rice husk insect'. The resolution of each image is adjusted to 640*640. Figure 1 Examples of some images and their annotations are shown.
[0048] By deeply analyzing the location distribution of pests in the dataset, we noticed that a large number of pest instances tend to appear in the center of the image, e.g. Figure 2 The data shows the location of pests. This feature is crucial for the design of the algorithm, as it is necessary to ensure that the model can not only identify targets in the center, but also pay sufficient attention to pests in the edge areas of the image. In addition, the size distribution analysis of the bounding boxes reveals an important phenomenon: most pest targets are relatively small, which may pose a challenge to the recognition algorithm, especially when the contrast between the pests and the background is not high. It was also noted that there is a certain degree of bounding box overlap in the dataset, which may cause pests in the same area to be repeatedly identified. This requires the inclusion of appropriate processing mechanisms in the algorithm design to distinguish and accurately identify multiple targets in overlapping areas. At the same time, this also suggests that in future data collection and annotation work, this issue needs to be handled more carefully to avoid dataset bias.
[0049] During the image preprocessing phase, standardization operations are performed to ensure that the images fed into the model remain consistent in size and scale. Figure 3 Original data image, Figure 4The standardized data image is shown. To address the unique characteristics of rice paddy environments, the present invention also performs detailed dataset enhancement processing, including random rotation, scaling, cropping, and color conversion, to fully simulate the changing natural conditions. These steps not only increase the diversity of the dataset but also strengthen the model's adaptability to actual field conditions, thereby improving the model's generalization and accuracy in practical applications.
[0050] The overall framework revolves around three core links: pest detection based on GB-YOLOv8, intelligent decision-making based on the DeepSeek large model, and lightweight deployment for NVIDIA Jetson Nano. Through the collaborative work of improved deep learning target detection technology (GB-YOLOv8), large language model reasoning capabilities (DeepSeek), and edge computing optimization technology, it achieves real-time, efficient, and accurate identification of pests in rice fields and generates intelligent prevention and control recommendations, while ensuring the model's small target detection performance in complex environments and efficient reasoning on resource-constrained platforms. The framework structure is as follows: Figure 5 shown.
[0051] YOLOv8 (You Only Look Once version 8) is an advanced object detection and image segmentation algorithm. It belongs to the YOLO (You Only Look Once) series. The YOLO series of algorithms is known for its real-time and high efficiency and is suitable for various computer vision tasks. YOLOv8 inherits and improves the advantages of previous versions, with higher accuracy and speed. YOLOv8 mainly includes a new backbone network, a new Ancher-Free detection head and a new loss function. The YOLOv8 network structure is as follows: Figure 6 As shown, it can run on various hardware platforms from CPU to GPU.
[0052] The Neck part of YOLOv8 is responsible for extracting and fusing features at different scales. It utilizes the SPP (Spatial Pyramid Pooling) structure and FPN (Feature Pyramid Networks) technology. SPP can extract multi-scale contextual information, which is crucial for detecting objects of different sizes. FPN adopts a top-down structure, transferring high-level semantic information to lower layers, thereby achieving coarse-to-fine feature fusion.
[0053] The head part of YOLOv8 adopts an adaptive label assignment strategy, which is a more flexible label assignment method that allows the model to automatically adjust labels according to the different characteristics of the target. It can dynamically select the most appropriate anchor point based on the size, shape and context of the target in the image. This strategy can effectively reduce label assignment errors and improve model performance.
[0054] YOLOv8 also introduces AutoML technology to automatically find the optimal model parameters and structure during the design and optimization of the framework. This technology can reduce the workload of manual parameter adjustment and ensure that YOLOv8 can achieve optimal performance in different detection scenarios. In addition, YOLOv8 also supports cloud training and edge computing, allowing the algorithm to be trained and inferred on resource-constrained devices, while also taking advantage of the powerful computing power of the cloud for large-scale training tasks. The YOLOv8 network structure is as follows: Figure 6 shown.
[0055] GAMA (channel attention mechanism) improves model performance by calculating the weight of each channel, emphasizing important features and suppressing unimportant features. GAMA improves the performance of deep neural networks by reducing information approximation and amplifying global interaction representations. Its steps include global pooling, feature fusion, fully connected network weight calculation and weight application. GAMA is simple and efficient, suitable for tasks such as image classification, target detection and image segmentation, and significantly enhances feature extraction capabilities and model robustness. By introducing the GAMA attention mechanism, the detection network's ability to recognize targets can be improved, especially in complex backgrounds. The GAMA network structure is as follows: Figure 7 shown.
[0056] BiFPN is an improved version of the FPN network architecture, mainly used for target detection tasks. The FPN network structure diagram is as follows Figure 8 As shown. The BiFPN network structure is a weighted fusion and bidirectional cross-scale connection, that is, a top-down and bottom-up structure. The bidirectional cross-scale connection is achieved by building a bidirectional channel. The BiFPN network structure is shown in the figure Figure 9As shown in the figure, features from the feature extraction network are directly fused with relatively large features from the bottom-up pathway, preserving shallow semantic information without losing too much deep semantic information. Traditional feature fusion is achieved by weighting feature maps of different scales using the same features. However, when the resolutions of input feature maps differ, weighting with the same weights results in unequal output feature maps. The weighted fusion in the BiFPN structure uses fast normalized fusion. This fusion method addresses the problem of slow training speed by scaling the weights to a range of 0 to 1. Furthermore, since the Softmax method is not used, training speed is faster. Cross-scale connections achieve weighted fusion and bidirectional cross-scale connections by adding skip connections and bidirectional pathways.
[0057] The improved YOLOv8 model is the GB-YOLOv8 model, which is optimized based on the traditional YOLOv8 model to improve the accuracy and recall rate of small target pest detection. The GB-YOLOv8 network structure is shown in the figure. Figure 10 As shown in the figure, the GB-YOLOv8 model introduces the GAMA attention mechanism and BiFPN for feature enhancement and fusion. The GAMA attention mechanism is introduced after the C2f module of YOLOv8 and can focus on key information in the input data, improving the model's detection performance. The BiFPN network performs fusion in the Neck portion, enhancing the ability to integrate features at different levels, thereby improving the detection of small objects.
[0058] Through these improvements, GB-YOLOv8 excels in detecting small pests in complex backgrounds, effectively reducing the interference of background noise and significantly improving detection accuracy and recall. This design not only improves the model's ability to detect small pests but also enhances its adaptability in complex agricultural environments.
[0059] DeepSeek is an advanced large language model (LLM) with powerful natural language processing (NLP) and reasoning capabilities. In the real-time rice pest detection framework, DeepSeek is used to assist in decision-making. It generates intelligent prevention and control recommendations by deeply analyzing GB-YOLOv8 detection results and combining historical data with an agricultural knowledge base. Its core functions include:
[0060] 1. Result Analysis and Interpretation: DeepSeek can parse pest detection results output by GB-YOLOv8 (such as pest species, quantity, and distribution location) and generate detailed reports in natural language. For example, when a large concentration of brown planthoppers is identified, the model will combine their life cycle and damage characteristics to explain the severity and potential impact of the current pest.
[0061] 2. Generate control recommendations: Based on detection results and an agricultural knowledge base, DeepSeek can recommend targeted control measures, including chemical pesticides (such as recommending low-toxic, high-efficiency pesticides), biological control (such as introducing natural enemies), or agricultural management recommendations (such as adjusting irrigation frequency). The large-scale model also considers environmental protection and cost-effectiveness to provide the optimal solution.
[0062] 3. Historical data integration and trend prediction: DeepSeek can correlate historical detection data, analyze the dynamic trends of pest populations, predict the types and time windows of possible future pest outbreaks, and help farmers formulate prevention and control plans in advance.
[0063] 4. Multimodal interaction support: Supports multiple interaction methods such as text and voice. Farmers can ask questions in natural language (such as "How to prevent and control rice water weevils?"), and the large model will return answers in real time, lowering the threshold for technology use.
[0064] 5. Technical Advantages: Lightweight Adaptation: To address the computing power limitations of the NVIDIA Jetson Nano, DeepSeek large models are quantized (INT8) and pruned to ensure inference efficiency. Domain Knowledge Fusion: Professional agricultural pest and disease data is injected into pre-training to improve the accuracy of recommendations.
[0065] NVIDIA Jetson Nano is a lightweight GPU device designed for edge computing. It has low power consumption and high performance, making it suitable for deploying real-time agricultural detection systems. Its key features include Figure 11 shown.
[0066] Model training and result analysis
[0067] 1. Experimental environment and parameter settings
[0068] The hardware environment of the experiment is shown in Table 1.
[0069] Table 1: Experimental environment
[0070]
[0071] The training parameters of the network model are shown in Table 2.
[0072] Table 2: Network training parameters
[0073]
[0074] 2. Model Evaluation Metrics
[0075] In the rice pest and disease control framework, evaluating the performance of target detection models is crucial. Key evaluation metrics include accuracy, recall, detection rate (DR), and mAP (mean average precision). Furthermore, this paper uses a loss function curve to monitor model training progress, focusing on three main loss categories: localization loss (box_loss), classification loss (cls_loss), and dynamic feature loss (dfl_loss). These metrics provide a comprehensive assessment of the model's accuracy, sensitivity, and overall performance.
[0076] Accuracy refers to the proportion of samples predicted by the model as positive that are actually positive. Accuracy measures the accuracy of the model's predictions. A high accuracy indicates fewer false positives. Recall refers to the proportion of samples that are actually positive that are correctly predicted by the model as positive. In target detection, detection rate is the same as recall, which refers to the proportion of targets detected by the model to the number of targets that actually exist. mAP is the average precision of all categories, or average accuracy, which calculates the average accuracy of the model at different thresholds, where N is the number of categories and AP is the average accuracy of the model at different thresholds. i is the average precision of category i. Average precision AP i It is usually obtained by calculating the area under the precision-recall curve.
[0077]
[0078] Positioning loss box_loss: The error between the predicted box and the calibrated box (GIoU). The smaller the error, the more accurate the positioning. Classification loss cls_loss: Calculates whether the anchor box and the corresponding calibrated classification are correct. The smaller the error, the more accurate the classification. Dynamic feature loss (dfl_loss): DFLLoss is a loss function used to regress the distance between the predicted box and the target box. When calculating the loss, the target box needs to be scaled to the feature map scale, that is, divided by the corresponding stride, and the Ciou Loss is calculated with the predicted bounding box. At the same time, the regression DFLLoss is calculated with the distance from the predicted anchor center point to each edge. This process is part of the CB-YOLOv8 training process. By calculating DFLLoss, the position of the predicted box can be adjusted more accurately, improving the accuracy of target detection.
[0079] Through these evaluation indicators, we can scientifically evaluate the effectiveness of the model, guide the improvement and optimization of the model, and enhance the practicality and accuracy of the rice disease and insect control system.
[0080] 3. Experimental results and analysis
[0081] By training pest pictures in batches under different complex backgrounds, part of the training process is as follows Figure 12As shown in the training process, the GB-YOLOv8 algorithm detection model has a recognition accuracy of 92.5%, a recall rate of 91.7%, and an average precision of 93.6% for 5251 images. In order to verify the effectiveness of the established method, the performance of the algorithm is compared on the test data sets of the three models YOLOv5, YOLOv8, and GB-YOLOv8. The results are shown in Table 3. From the recognition results, compared with YOLOv5 and YOLOv8, GB-YOLOv8 has improved in accuracy, recall, and average precision. Figure 13 The recognition accuracy is shown as follows: Figure 14 Recognition recall rate is shown.
[0082] Table 3 Comparison of performance evaluation indicators of different models
[0083]
[0084] As shown in Table 3, the improved algorithm achieves the highest recall and mAP. Compared with YOLOv5, the recall rate increases by 1.8% and the mAP increases by 1.4%. Compared with YOLOv8, the precision rate increases by 1.3% and the recall rate increases by 0.6%. Through comprehensive experimental comparisons, it is confirmed that GB-YOLOv8 can effectively improve the detection ability of small-target pests.
[0085] In addition, the PR curve of the training result of the present invention is as follows Figure 15 As shown in the loss graph, mAP represents the area enclosed by plotting Precision and Recall as the two axes. m represents the average, and the number after @ represents the threshold for determining whether an iou is a positive or negative sample. mAP@.5 represents the average mAP for a threshold greater than 0.5. As can be seen, the average mAP@0.5 for our model for 14 object detection categories is 0.8, which is a very good result.
[0086] Experimental results show that the proposed framework achieves 93.6% detection accuracy and 91.7% recall in complex rice paddy environments, significantly outperforming traditional YOLOv8 and other methods. The framework efficiently detects rice pests in real time and, combined with the DeepSeek model, provides intelligent prevention and control recommendations, providing reliable technical support for intelligent agricultural management.
[0087] This paper proposes a real-time rice pest detection framework based on the NVIDIA Jetson Nano. It integrates the GB-YOLOv8 object detection model with the DeepSeek large language model, enabling efficient and accurate pest identification and intelligent pest control decision-making. By introducing the GAMA attention mechanism and the BiFPN feature fusion network, GB-YOLOv8 significantly improves the detection of small-target pests, achieving 93.6% accuracy and 91.7% recall in complex farmland environments. Furthermore, the DeepSeek large model, combined with an agricultural knowledge base, provides farmers with actionable pest control recommendations, enhancing the framework's practicality.
[0088] In terms of edge computing deployment, with the help of model quantization (INT8) and TensorRT acceleration, the optimized algorithm can achieve 20FPS real-time inference on NVIDIA Jetson Nano, meeting the needs of low-power, high-efficiency farmland monitoring. In the future, this framework can further combine multimodal sensor data and long-term pest trend analysis to provide more comprehensive decision-making support for smart agriculture. This invention provides a feasible solution for the application of lightweight AI in agricultural pest control, combining theoretical innovation with engineering practice value, and is of great significance to promoting the development of precision agriculture.
[0089] The present invention also proposes an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method for constructing a real-time rice pest detection framework based on NVIDIA Jetson Nano are implemented.
[0090] The present invention also proposes a computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the steps of the method for constructing a real-time rice pest detection framework based on NVIDIA Jetson Nano.
[0091] The memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DRRAM). It should be noted that the memory of the methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0092] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a high-density digital video disc (DVD)), or a semiconductor medium (eg, a solid state disc (SSD)).
[0093] During implementation, each step of the above method can be completed by an integrated logic circuit of the hardware in the processor or by instructions in the form of software. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it will not be described in detail here.
[0094] It should be noted that the processor in the embodiments of the present application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiment can be completed by an integrated logic circuit of the hardware in the processor or by instructions in the form of software. The above processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0095] The above describes in detail the method for constructing a real-time rice pest detection framework based on NVIDIA Jetson Nano proposed in the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only intended to help understand the method and core concept of the present invention. At the same time, those skilled in the art will appreciate that the specific implementation methods and application scopes may vary based on the concepts of the present invention. In summary, the contents of this specification should not be construed as limiting the present invention.
Claims
1. A method for constructing a real-time rice pest detection framework based on NVIDIA Jetson Nano, characterized by: The method is specifically as follows: the real-time detection framework is a rice pest detection framework based on the combination of an improved YOLOv8 model and a DeepSeek large model, which is deployed on a lightweight GPU device NVIDIA JetsonNano; The improved YOLOv8 model introduces the attention mechanism GAMA and the bidirectional feature pyramid network BiFPN to enhance the detection capability of small target pests and strengthen the robustness in complex environments. The DeepSeek large-scale model conducts in-depth analysis of detection results and provides optimized prevention and control recommendations based on historical data; To address the computing resource limitations of NVIDIA Jetson Nano, large models are pruned and quantized to ensure efficient inference on resource-constrained devices.
2. The method according to claim 1, characterized in that The YOLOv8 model is improved to the GB-YOLOv8 model. The GB-YOLOv8 model introduces the GAMA attention mechanism and BiFPN for feature enhancement and fusion. The GAMA attention mechanism is introduced after the C2f module of YOLOv8 and can focus on the key information in the input data. The BiFPN network is integrated in the Neck part to enhance the fusion ability of features at different levels.
3. The method according to claim 2, characterized in that The Neck part of YOLOv8 is responsible for extracting and fusing features at different scales. It utilizes the SPP structure and the feature pyramid network (FPN). SPP can extract multi-scale contextual information, and FPN adopts a top-down structure to pass high-level semantic information to low-level layers, thereby achieving coarse-to-fine feature fusion.
4. The method according to claim 3, characterized in that The Head part of YOLOv8 adopts an adaptive label assignment strategy, allowing the model to automatically adjust labels according to the different characteristics of the target; thus, it can dynamically select the most appropriate anchor point based on the size, shape and contextual information of the target in the image.
5. The method according to claim 4, characterized in that YOLOv8 introduces AutoML technology to automatically find the optimal model parameters and structure during the framework design and optimization process.
6. The method according to claim 5, characterized in that The attention mechanism GAMA improves model performance by calculating the weight of each channel, emphasizing important features and suppressing unimportant features. At the same time, GAMA also improves model performance by reducing information approximation and amplifying global interaction representation.
7. The method according to claim 6, characterized in that The BiFPN network structure is a weighted fusion and bidirectional cross-scale connection, that is, a top-down and bottom-up structure. The bidirectional cross-scale connection is achieved by constructing a bidirectional channel, which directly fuses the features in the feature extraction network with the features of relative size in the bottom-up path, retaining shallow semantic information without losing too much deep semantic information.
8. The method according to claim 7, characterized in that The weighted fusion in the BiFPN network structure uses fast normalized fusion to scale the weights to the range of 0 to 1.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium for storing computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.