Rice disease and insect pest automatic detection method based on deep learning and Internet of Things

By combining deep learning and Internet of Things technology, we automatically collect and analyze rice pest image data, real-time and accurate identification of rice pests and diseases is achieved, solving the problems of inefficiency and inaccuracy of traditional detection methods, and providing efficient pest monitoring and management solutions.

CN119942189APending Publication Date: 2025-05-06HEILONGJIANG BAYI AGRICULTURAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510002581.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

Traditional rice pest detection methods rely on manual experience and naked eye observation, and have problems of inefficiency and inaccuracy, making it difficult to achieve real-time monitoring and efficient detection.

Method used

The automatic detection method of rice pest and disease based on deep learning and the Internet of Things is adopted, and the image data of rice pest and disease are automatically collected and transmitted through IoT devices. Image features are extracted using ResNet50, and classified them in combination with integrated learning methods, and the detection results are uploaded to the cloud platform in real time.

Benefits of technology

Real-time and accurate identification of rice pests and diseases is achieved, with an accuracy rate of 99.25%, solving the problems of inefficiency and inaccuracy of traditional detection methods, and providing efficient pest monitoring and management solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119942189A_ABST
    Figure CN119942189A_ABST
Patent Text Reader

Abstract

The invention provides an automatic detection method for rice diseases and insect pests based on deep learning and Internet of Things. According to the method, deep learning is applied to disease and pest identification, and data acquisition, monitoring and storage are realized in combination with the Internet of Things. In model design, a ResNet50 network is adopted to extract rice field image features, and classification performance is optimized through an integrated classifier. Experimental results show that the method has good accuracy and robustness in pest and disease detection. The application of the data enhancement technology effectively relieves the problem of insufficient samples, and the generalization ability of the model is improved. On the hardware and architecture level, field real-time data collection and uploading are achieved through the Internet of Things equipment, safe and reliable support is provided for data storage and processing through the cloud platform, and the practicability and expansibility of the method are further enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pest and disease detection, and in particular to an automatic detection method for rice pests and diseases based on deep learning and the Internet of Things. Background Art

[0002] Rice, as one of the most important food crops in the world, is relied on as a staple food by about half of the population. It plays an important role in maintaining food security. The steady production of rice plays a vital role in maintaining world food security and stabilizing the agricultural economy. However, the problem of pests and diseases is particularly prominent in the rice production process, becoming a key factor restricting the improvement of rice yield and quality. Pests and diseases not only directly lead to a sharp drop in rice yields, but also affect the quality and market value of rice, indirectly exacerbating the challenges of food security. According to research by the International Rice Research Institute (IRRI), the average annual rice yield loss due to pests and diseases is as high as 37%, and in extreme cases even exceeds 41%. This data highlights the urgency of pest and disease prevention and control.

[0003] There are many types of rice pests and diseases, among which rice blast, bacterial leaf blight, rice planthoppers, and rice leaf rollers are particularly common. These pests and diseases not only directly affect rice yields by destroying the growth mechanism of rice, but also act as vectors for pathogens, further exacerbating rice losses. For example, rice planthoppers not only suck rice sap, but also carry and spread rice blast viruses, resulting in large-scale rice yield reductions and posing a serious threat to food production.

[0004] Traditional pest and disease detection methods mostly rely on the rich experience and visual observation of agricultural workers. Although this method has played a role to a certain extent, its inherent inefficiency and susceptibility to interference from human factors undoubtedly limit the accuracy and timeliness of the detection results, making the prevention and control of pests and diseases often fall into a passive situation. In recent years, with the breakthrough of deep learning technology and the substantial improvement of computing power, deep learning technology has provided new solutions for the automatic identification and real-time monitoring of pests and diseases. And with the deepening of research, Internet of Things (IoT) technology has also been introduced.

[0005] As a representative model of deep learning, Convolutional Neural Network (CNN) extracts local features of images through convolution operations, extracts more abstract and complex features layer by layer, and has superior performance in image processing and feature extraction. At present, it has been widely used in disease detection and classification in the agricultural field. Surya et al. used CNN to detect cassava leaf diseases, highlighting the efficiency of CNN models in classifying different types of plant diseases based on image data. Ghosal et al. proposed a method based on VGG16 and transfer learning to detect rice leaf diseases with an accuracy of 92.46%. Similarly, Shrivastava et al. studied the performance of ten pre-trained deep CNN models in rice plant disease classification and proved that the VGG16 model had the highest accuracy of 93.11%. Islam et al. proposed a method based on local threshold segmentation and CNN, using three CNN architectures (VGG16, ResNet50 and DenseNet121) to train and test three different data sets to evaluate their classification performance, among which the DenseNet121 model had the best average accuracy of 88.99%. Bari et al. adopted the Faster R-CNN model with the RPN architecture. The improved model had an accuracy of 98.09%, 98.85% and 99.17% for rice blast, brown spot and rice blast, respectively, and the recognition accuracy of healthy rice leaves reached 99.25%. Chen et al. used the pre-trained MobileNet-V2 and added an attention mechanism, reaching 98.48% for rice disease detection. Wan Junjie et al. used a method combining transfer learning technology with the GoogLeNet model to identify and grade the degree of damage of 25 types of pests and diseases of 6 orchard crops. The recognition accuracy of pests and diseases can reach 99.35%, and the accuracy of grading the degree of damage can reach 92.78%. Latif et al. proposed an improved VGG19-based transfer learning method that can detect and diagnose six types of diseases, including healthy rice leaves, with an average accuracy of 94.76%, higher than GoogleNet's 86.9%. Zeng Weihui et al. introduced CMAM into capsule networks for rice pest identification, aiming to focus on important features and suppress unnecessary features. The recognition rate of rice pests in small samples reached 99.19%.

[0006] Although the application of deep learning technology in the agricultural field has achieved remarkable results, in large-scale agricultural applications, data often relies on manual collection and it is difficult to achieve real-time monitoring. Therefore, combining the Internet of Things (IoT) technology has become a natural and effective development direction. Liu Pingzeng et al. designed a precision agricultural information perception system for precise variable sowing, fertilization, pesticide application and automatic irrigation. The system is based on the concept of thorough perception, reliable transmission and intelligent processing of the Internet of Things. The whole system consists of wireless perception network, transmission node, GPRS and host computer management system. Gondchawa et al. proposed to make agriculture intelligent through automation and Internet of Things technology. The system is divided into three nodes: a remotely controlled mobile robot, an intelligent warehouse, and an intelligent irrigation node. All nodes are connected to the central server through a wireless communication module. Caio KGAlbuquerque et al. used an improved MaskR-CNN model to detect water mist in videos taken by drones, realizing rapid detection of irrigation system failures and demonstrating the potential of IoT technology in agricultural automation. Saba et al. proposed a decentralized agricultural Internet of Things (IoAT) system based on blockchain and machine learning, using a variety of IoT devices to collect data, and applied machine learning (ML) algorithms based on the acquired data to formulate appropriate decision plans. At the same time, the blockchain security system is used to ensure reliable data transmission. Hossain et al. combined the Internet of Things, machine learning and blockchain technology to propose an intelligent agricultural management platform, which remotely monitors and controls irrigation through the Internet of Things and uses machine learning methods to make intelligent decisions to control fertilization. The model used for water control management achieved an accuracy rate of 89.5%. At the same time, cloud service technology was also introduced. Zhongfu et al. looked forward to the application of blockchain. The study mentioned that blockchain itself is a data system, and agricultural big data has problems such as complex cycles and long periods. Blockchain helps the storage and security management of agricultural data. Liu Wenkun et al. built a set of smart agricultural management and traceability systems based on the Internet of Things and cloud services. The system integrates wireless sensor networks, intelligent front-end APPs, databases, and QR codes to achieve full traceability of agricultural products from fields to tables. Compared with traditional traceability systems, it improves privacy, shortens single-link data storage time by 6.64%, and shortens information traceability query time by 16.44%. Wang Jian et al. selected the NASNet-mobile model with small model parameters and high accuracy and deployed it on the cloud service. They used Gin to build model interaction to identify weeds and return identification information, providing technical support for field weed information detection and investigation. Lv Xiangbin and others built a smart agricultural greenhouse based on cloud services, realizing real-time monitoring and management of agricultural greenhouses and providing environmental protection for the growth of crops.

[0007] The above research proves the feasibility of deep learning and IoT technology in agriculture, but the overall framework is not systematic enough, lacking a complete process and an automated solution for the entire process, especially in the detection of pests and diseases. Based on this, the present invention will combine deep learning and the Internet of Things to build an automatic detection framework for rice pests and diseases, and use cloud technology to ensure data security at all stages. Summary of the invention

[0008] The purpose of the present invention is to solve the problems in the prior art and propose an automatic detection method for rice diseases and insect pests based on deep learning and the Internet of Things.

[0009] The present invention is implemented by the following technical scheme. The present invention proposes an automatic detection method for rice pests and diseases based on deep learning and the Internet of Things, and the method comprises the following steps:

[0010] Step 1: Automatically collect and transmit rice pest and disease image data through Internet of Things devices, form a data set with the collected image data, and pre-process the image data in the data set;

[0011] Step 2: ResNet50 is used to extract image features from the preprocessed image, and the extracted image features are classified using an integrated learning method to output the classification detection results;

[0012] Step 3: The pest alarm system in the IoT device will automatically notify the user of the discovery of pests and diseases based on the detection results. At the same time, all image data and detection results are uploaded to the cloud platform in real time. The cloud platform is used to store data and support remote access to data. Users can verify and access it through the cloud platform.

[0013] Furthermore, in step 1, the preprocessing includes converting the image format, standardizing the image size, and enhancing the data.

[0014] Furthermore, the Internet of Things includes:

[0015] The perception layer provides sensors and devices for data collection;

[0016] The network layer is responsible for the communication protocols and infrastructure for data transmission;

[0017] The processing layer is used for image processing and automatic identification of pests and diseases;

[0018] The application layer provides user interfaces and management tools.

[0019] Furthermore, the ResNet50 extracts image features by extracting spatial features of the image through a convolution operation; the ResNet50 includes a convolution layer, an activation layer, a pooling layer, and a fully connected layer;

[0020] Convolution layer: Use the convolution kernel to slide on the input image to perform local connection and weight sharing operations on the image to extract local features;

[0021] Activation layer: introduces nonlinear transformation to the output of the convolution layer, enabling the model to learn and represent complex mappings, improving the model's expressiveness and classification performance;

[0022] Pooling layer: also called sampling layer, which downsamples the feature map to reduce the dimension of the data, reduce the complexity of the entire calculation, and enhance the robustness of the model;

[0023] Fully connected layer: Located at the end of the network, it is the classifier in the convolutional neural network, which integrates the extracted features and maps them to the final classification results through the softmax function.

[0024] Furthermore, the ensemble learning method uses an ensemble classifier to classify the extracted features through a voting algorithm.

[0025] Furthermore, the voting algorithm includes two methods: hard voting and soft voting. Hard voting is based on majority voting of the classification results of each model, while soft voting is based on weighted average of the confidence scores of each model for samples belonging to each category.

[0026] Furthermore, in the soft voting mode, it is assumed that the confidence of each model output sample x belonging to each category is p i (j)(j=1,2,3,4,…,k), the soft voting prediction result is expressed as:

[0027]

[0028] where ω i The weights for each model.

[0029] Furthermore, during the data collection and transmission process, the Raspberry Pi in the IoT device will upload the collected field images, pest and disease detection results and equipment-related information to the cloud platform in real time via the network. The cloud platform adopts a distributed storage architecture to ensure the storage and management of massive field images and video data, and ensure the security and reliability of data through redundant backup and encrypted transmission technology.

[0030] 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 automatic detection method of rice diseases and pests based on deep learning and the Internet of Things are implemented.

[0031] 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 automatic detection method for rice diseases and insect pests based on deep learning and the Internet of Things.

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

[0033] Global rice production faces severe challenges, and traditional manual monitoring methods can no longer meet the needs of efficient and accurate pest and disease detection. In order to address this problem, the present invention proposes an automatic detection method for rice pests and diseases based on deep learning and the Internet of Things (IoT). The method first realizes the automatic collection and transmission of rice pest and disease data through IoT devices, ensuring the timeliness and accuracy of the data source. Then, ResNet50 is used to extract image features, and the extracted features are efficiently classified in combination with an integrated learning method, thereby realizing real-time and accurate identification of rice pests and diseases. At the same time, a cloud platform is used to manage and store data to ensure data security and reliability. The experimental results show that the automatic detection method proposed in the present invention has a final accuracy rate of 99.25% for rice pest and disease identification, providing an effective technical solution for automatic monitoring of pests and diseases in smart agriculture. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0035] Figure 1 This is a schematic diagram of normal rice.

[0036] Figure 2 This is a schematic diagram of rice diseases and insect pests.

[0037] Figure 3 It is a schematic diagram of rice image enhancement.

[0038] Figure 4 This is the overall framework diagram of the automatic detection method for rice diseases and insect pests based on deep learning and the Internet of Things described in the present invention.

[0039] Figure 5 It is a schematic diagram of the component architecture based on the Internet of Things.

[0040] Figure 6 It is a schematic diagram of the convolutional neural network structure.

[0041] Figure 7 This is a schematic diagram of the ResNet50 network structure.

[0042] Figure 8 It is a schematic diagram of the ensemble learning soft voting prediction process.

[0043] Fig. 9 It is a schematic diagram of the cloud platform architecture. DETAILED DESCRIPTION

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

[0045] Combination Figure 1-Figure 9 The present invention proposes an automatic detection method for rice pests and diseases based on deep learning and the Internet of Things, and the method comprises the following steps:

[0046] Step 1: Automatically collect and transmit rice pest and disease image data through devices in the Internet of Things, form a data set with the collected image data, and pre-process the image data in the data set;

[0047] Step 2: ResNet50 is used to extract image features from the preprocessed image, and the extracted image features are classified using an integrated learning method to output the classification detection results;

[0048] Step 3: The pest alarm system in the IoT device will automatically notify the user of the discovery of pests and diseases based on the detection results. At the same time, all image data and detection results are uploaded to the cloud platform in real time. The cloud platform is used to store data and support remote access to data. Users can verify and access it through the cloud platform.

[0049] Data collection

[0050] The present invention is based on a public dataset from the Kaggle website. The dataset mainly contains three types of images: normal rice, insect-infested rice, and diseased rice. The dataset contains a total of 1924 images, stored in jpg and png formats, including 1276 images of diseased rice, 135 images of insect-infested rice, and 513 images of normal rice. The image of normal rice is as follows: Figure 1 As shown, the images of pests and diseases are as follows Figure 2 shown.

[0051] Data preprocessing

[0052] Pixel inconsistencies in the images in the acquired dataset may cause model training to consume more time and computing resources; an unbalanced ratio between the two categories may cause model training to be biased towards learning normal rice characteristics; and too few overall samples may lead to model overfitting, affecting generalization ability and accuracy.

[0053] In order to solve the above problems, we first convert png format images to jpg to ensure that all images are in jpg format, reducing the problems that may be caused by different formats in the future. Then the image size is standardized to 224×224. The specific process is to maintain the aspect ratio of the image for standardization to avoid distortion. For larger images, if the long side exceeds 224 pixels, the long side is first scaled to 224 pixels, and then the padding method is used to ensure that the output image meets the standard size of 224×224, which can retain the main features of the image while ensuring the uniformity of the input data. Finally, some images are selected from the data set for a series of data enhancement processing: by randomly rotating the image (0° to 360°) and randomly translating, the changes in different observation angles and positions are simulated; horizontal and vertical flipping is implemented to enhance the model's learning of features; random scaling of images helps the model adapt to different observation distances; in addition, the brightness and contrast of the image are adjusted to cope with various lighting conditions, and Gaussian noise is added to improve anti-interference ability. Through these enhancement operations, the diversity of training data is effectively increased to prevent the problem of model overfitting. Figure 3 For selection Figure 2 A picture of rice infested with insects is enhanced.

[0054] Through enhancement, 785 normal rice images, 749 insect-infested rice images and 2288 diseased rice images were obtained, and the final data set of the present invention was formed by combining the original data. The specific composition is shown in Table 1.

[0055] Table 1 Dataset

[0056]

[0057] The method of the present invention realizes automatic detection of harmful insects in agriculture and automated management of farms by combining the collaborative work of ResNet50, Internet of Things (IoT) and cloud service technology, and ensures the security and reliability of data. The overall framework of the method is as follows Figure 4 shown.

[0058] For the part of rice field data acquisition, the present invention uses an Internet of Things camera to capture rice images. Raspberry Pi, as a miniature and powerful computer, receives images captured by the camera and performs image processing. In this link, pests and diseases are detected through a neural network. After the pests are detected, a set of Internet of Things-based devices, including a microcontroller for cloud communication and a pest alarm system (including an alarm buzzer), is used to realize the automation of farm facilities. The pest alarm system will automatically send a notification of the discovery of pests and diseases to the user or system based on the detection results of the neural network. At the same time, cloud technology is used for data storage and processing. All image data and test results will be uploaded to the cloud platform in real time to ensure the security, accessibility and efficient management of the data. The cloud platform not only supports remote access to data, but also can store historical data, providing convenient data analysis and backtracking functions. The method tracks the operating status of the Internet of Things device, monitors in real time and uploads relevant data to the cloud, and users can verify and access it through the cloud platform to ensure the reliability and timeliness of the information.

[0059] Field detection based on the Internet of Things

[0060] Internet of Things (IoT) technology refers to a network that connects various physical devices, sensors, software and other technologies through communication technologies (such as Wi-Fi, 4g / 5g, Bluetooth, Zigbee, etc.) to achieve intelligent management and automated operation. Its core lies in the interconnection between devices, so that data in the physical world can be collected, transmitted and analyzed in real time, thereby providing users with smarter services and solutions. The Internet of Things technology system can be divided into four layers, including the perception layer (sensors and devices for data collection), the network layer (communication protocols and infrastructure responsible for data transmission), the processing layer (edge ​​computing and cloud computing for data storage and analysis), and the application layer (providing user interfaces and management tools). These layers jointly realize the interconnection and automated management of intelligent devices. The present invention realizes real-time data collection, transmission and analysis through components such as cameras, microprocessors and cloud storage. Figure 5 The components corresponding to the described methods are shown.

[0061] The method uses an 8-megapixel camera for real-time field monitoring, which can produce 4K high-resolution images. When the camera captures the real-time image, it is transmitted to the microprocessor via a wireless network. The microprocessor is responsible for analyzing the image and using image processing algorithms and machine learning models to identify pests in the image. If the presence of pests is detected, an automated response will be quickly carried out, triggering the alarm system to issue an alarm to notify the manager to check and deal with the area. In addition, managers can also check the status of the field at any time through real-time monitoring, so as to deal with problems more promptly. All data in the entire process will be stored in the cloud database.

[0062] Pest and disease identification based on deep learning

[0063] In order to accurately and efficiently detect pests in rice fields, the present invention designs and implements a pest identification method based on deep learning. It mainly consists of two parts: one is to use convolutional neural networks to extract image features; the other is to use an integrated classifier model to classify the extracted features.

[0064] Feature extraction based on deep learning

[0065] Convolutional neural network is a classic deep learning model. Its core principle is to extract the feature information of the image through convolution operation. CNN usually consists of multiple layers, such as Figure 6 As shown, it mainly includes convolutional layer, activation layer, pooling layer and fully connected layer:

[0066] (1) The convolutional layer is the core component of CNN. It uses the convolution kernel to slide on the input image to perform local connection and weight sharing operations on the image to extract local features.

[0067] (2) The activation layer introduces nonlinear transformation to the output of the convolutional layer, enabling the model to learn and represent complex mappings, improving the model's expressiveness and classification performance. Common activation functions include ReLU, Sigmoid, etc.

[0068] (3) Pooling layer, also called sampling layer, downsamples the feature map to reduce the dimension of the data, reduce the complexity of the entire calculation, and enhance the robustness of the model. The pooling operation effectively reduces the number of network parameters and reduces the risk of overfitting of the model.

[0069] (4) The fully connected layer is usually located at the end of the network. It is the classifier in the CNN, which integrates the extracted features and maps them to the final classification results through functions such as softmax.

[0070] The local connection and weight sharing mechanism of CNN not only reduces the number of parameters and improves the generalization ability, but also enables the model to automatically learn feature representation and has a certain robustness to translation, rotation and scale changes of data.

[0071] Therefore, in order to better analyze the images obtained by the IoT camera, CNN was used as the feature extractor, and the classifier part of CNN was removed. In the specific implementation, a variety of pre-trained CNN models were studied and compared, including VGG16, VGG19, ResNet50, densenet121, googlenet, etc., and Resnet50 was finally selected as the feature extractor. ResNet50 is a deep CNN model, such as Figure 7 As shown in the figure, it has 49 convolutional layers and 1 fully connected layer. By introducing the residual network structure, information can be propagated across layers in the network, thus effectively alleviating the gradient vanishing problem in the deep network. After ResNet50 processes the 224×224×3 rice field image, it can obtain a 2048-dimensional feature vector. These features play a vital role in the subsequent classification tasks and provide rich representation information for pest and disease identification.

[0072] Ensemble learning methods

[0073] Ensemble learning is a widely respected method in the field of machine learning. It improves the generalization and robustness of the model by integrating the prediction results of multiple different models. The core concept of ensemble learning is "collecting the wisdom of the crowd", that is, using multiple models to analyze problems from different perspectives in order to obtain more comprehensive and accurate solutions. In the process of ensemble learning, each learner may have differences in bias and variance, and they may produce different prediction outputs on their respective training sets. However, when these prediction results are cleverly integrated, it can be expected that their biases and variances can offset or complement each other, resulting in more stable and accurate prediction results. Ensemble learning covers a variety of methods, such as bagging, boosting, stacking and voting, each of which has its own unique advantages and applicable scenarios.

[0074] In the pest and disease identification model, in order to improve the accuracy of pest and disease identification, the present invention adopts an integrated classifier, including support vector machine (SVM), decision tree (DT), k nearest neighbor (KNN) and logistic regression (LR), and classifies the extracted features through the voting algorithm. Voting includes two methods: hard voting (Hard Voting) and soft voting (Soft Voting). By combining the prediction results of multiple models, better classification performance is obtained, and the implementation is relatively simple. Hard voting is based on majority voting based on the classification results of each model, while soft voting is based on the weighted average of the confidence scores of each model for the sample belonging to each category. In the soft voting mode, it is assumed that the confidence that each model outputs the sample x belonging to each category is p i(j)(j=1,2,3,4,…,k), the soft voting prediction result can be expressed as:

[0075]

[0076] where ω i For the weight of each model, we can usually take the average Or adjust based on the performance of the model. Figure 8 The study of the prediction process based on soft voting is presented.

[0077] Data storage and management module based on cloud platform

[0078] Cloud service technology is a technology that does not require local hardware and runs on the Internet to provide computing storage and application services. In order to achieve centralized storage and secure management of field data, the present invention chooses to use cloud service technology.

[0079] The cloud platform enables real-time data upload, distributed storage and intelligent management to ensure data security, accessibility and efficient processing capabilities. During the data collection and transmission process, the Raspberry Pi uploads the field images, pest and disease detection results and equipment-related information collected by the IoT devices to the cloud platform in real time through the network. The cloud platform adopts a distributed storage architecture to ensure the efficient storage and management of massive field images and video data, and ensures the security and reliability of data through redundant backup and encrypted transmission technology. After the data is transmitted to the cloud platform in real time, if pests and diseases are detected, detailed alarm information will be pushed to the manager immediately to help the manager take timely measures. Managers can also view the farm status in real time through the client, including real-time images and videos from IoT cameras, pest and disease detection results and equipment operating status. At the same time, the cloud platform can perform permission management functions to ensure that different users can only access data within their authorized scope, further improving data security. The cloud service architecture is as follows: Fig. 9 shown.

[0080] Data storage and management based on cloud services ensures real-time upload, storage and accessibility of data, while providing flexible permission management to help farm managers take timely measures. It is an important part of the automation framework and improves farm management efficiency and security.

[0081] Model Training

[0082] This experiment was conducted in Windows 11 operating system (64-bit), the CPU was AMD Ryzen 75800H 3.20GHz, the GPU was NVIDIA GeForce RTX3060 Laptop 6GB, the memory was 40GB, the code was written in Python, and the neural network was built on keras. The parameters involved in the training process are shown in Table 2.

[0083] Table 2 Model parameters

[0084]

[0085] In this paper, four key evaluation indicators are used to comprehensively measure the performance of the model in the rice pest and disease identification task: Accuracy, Precision, Recall and F1-score. These indicators reveal the advantages and disadvantages of the model from different angles, helping users to more accurately evaluate its actual performance.

[0086] Accuracy is the most intuitive evaluation indicator, which indicates the proportion of samples correctly predicted by the model to the total number of samples.

[0087]

[0088] Precision measures the proportion of samples that are actually positive among all samples predicted to be positive.

[0089]

[0090] The recall rate reflects the proportion of all actual positive samples that the model recognizes. A high recall rate means that the model can identify more pest and disease images and avoid missed detections.

[0091] The F1 value is the harmonic mean of precision and recall, and is a key indicator that comprehensively considers the accuracy and comprehensiveness of the model.

[0092]

[0093] Among them, TP (True Positive) indicates the number of samples correctly identified as positive by the model. TN (True Negative) indicates the number of samples correctly identified as negative. FP (False Positive) indicates the number of negative samples incorrectly predicted as positive, and FN (False Negative) indicates the number of positive samples incorrectly predicted as negative.

[0094] Results and Analysis

[0095] In order to extract effective features from rice field images, this experiment selected a variety of pre-trained CNN models, including VGG16, VGG19, ResNet50, DenseNet121, and GoogLeNet, and trained and tested them on the constructed dataset to evaluate the performance of the model in extracting features. The following are the evaluation results of different feature extraction models, as shown in Table 3.

[0096] Table 3 CNN feature extraction

[0097]

[0098] As can be seen from Table 3, ResNet50 performs best among all models, with an accuracy of 98.32%, while other models such as VGG16 (96.94%), VGG19 (97.74%), DenseNet121 (97.24%) and GoogleNet (96.50%) have relatively low accuracy. This shows that ResNet50 can more effectively extract important features from rice field pest and disease images and exhibit stronger generalization ability. Specifically, ResNet50 alleviates the gradient vanishing problem in deep networks through its unique residual structure, allowing the model to maintain high accuracy when processing complex images. Although the VGG series model has a simple structure, it has a large number of parameters and is prone to gradient vanishing or overfitting problems in deep networks, resulting in slightly weaker performance. Therefore, the study finally selected ResNet50 as the feature extraction model.

[0099] After the feature extraction part is completed, in order to improve the accuracy of classification, the extracted features are input into the ensemble classifier for classification. Here, two ensemble methods, hard voting and soft voting, are used, integrating four common classifiers: support vector machine (SVM), decision tree (DT), K nearest neighbor (KNN), and logistic regression (LR). The ensemble classifier is compared with the four basic classifiers. The results are shown in Table 4.

[0100] Table 4 Machine learning classifiers

[0101]

[0102] As can be seen from Table 4, the accuracy of the ensemble learning method (99.25%, 98.83%) is higher than that of the non-ensemble learning method (98.32%), which can improve the overall performance of the model. In the hard voting mode, the accuracy of the model is improved by voting on the prediction results of each classifier. However, its performance is not as good as soft voting when processing complex data. The soft voting strategy uses the prediction probability of each base classifier and obtains the final result by weighted average, so it can better integrate the advantages of different classifiers, thereby improving the classification accuracy. The accuracy of the soft voting ensemble method is increased to 99.25%, the precision reaches 98.54%, and the F1 value is 98.00%, which are significantly improved compared with the single ResNet50 and hard voting methods, and are better than single classifiers. Selecting the soft voting ensemble learning method can effectively avoid the misclassification or missed detection of a single model on certain types of pests and diseases by weighted averaging the outputs of different models, thereby improving the overall classification performance.

[0103] The present invention proposes an intelligent rice pest and disease detection method based on deep learning and Internet of Things technology. Deep learning is used for pest and disease identification, and data collection, monitoring and storage are realized in combination with the Internet of Things. In the model part, the ResNet50 network is used to extract the features of rice field images, and the classification performance is optimized by integrating the classifier. The experimental results show that this method performs well in terms of accuracy and robustness in pest and disease detection. The application of data enhancement technology effectively alleviates the problem of insufficient samples and improves the generalization ability of the model. At the hardware and architecture level, the Internet of Things devices realize real-time field data collection and upload, and the cloud platform provides safe and reliable support for data storage and processing, further improving the practicality and scalability of the method.

[0104] 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 automatic detection method of rice diseases and pests based on deep learning and the Internet of Things are implemented.

[0105] 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 automatic detection method for rice diseases and insect pests based on deep learning and the Internet of Things.

[0106] 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. Among them, 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 SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DRRAM). It should be noted that the memory of the method described in the present invention is intended to include, but is not limited to, these and any other suitable types of memory.

[0107] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part 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, the process or function described in the embodiment of the present application is generated in whole or in part. 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 a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. 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. 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)).

[0108] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. The steps of the method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in a processor for execution. 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 a 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 is not described in detail here.

[0109] It should be noted that the processor in the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by an integrated logic circuit of hardware in the processor or an instruction 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 devices, discrete gates or transistor logic devices, discrete hardware components. The 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, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor can be combined and performed. The software module can be located in a mature storage medium in the field 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 a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0110] The above is a detailed introduction to the automatic detection method for rice diseases and pests based on deep learning and the Internet of Things proposed in the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. An automatic detection method for rice pests and diseases based on deep learning and the Internet of Things, characterized in that: The method comprises the following steps: Step 1: Automatically collect and transmit rice pest and disease image data through Internet of Things devices, form a data set with the collected image data, and pre-process the image data in the data set; Step 2: ResNet50 is used to extract image features from the preprocessed image, and the extracted image features are classified using an integrated learning method to output the classification detection results; Step 3: The pest alarm system in the IoT device will automatically notify the user of the discovery of pests and diseases based on the detection results. At the same time, all image data and detection results are uploaded to the cloud platform in real time. The cloud platform is used to store data and support remote access to data. Users can verify and access it through the cloud platform.

2. The method according to claim 1, characterized in that In step 1, the preprocessing includes converting the image format, standardizing the image size, and enhancing the data.

3. The method according to claim 1, characterized in that The Internet of Things includes: The perception layer provides sensors and devices for data collection; The network layer is responsible for the communication protocols and infrastructure for data transmission; The processing layer is used for image processing and automatic identification of pests and diseases; The application layer provides user interfaces and management tools.

4. The method according to claim 1, characterized in that: The ResNet50 extracts image features by extracting spatial features of the image through convolution operations; the ResNet50 includes a convolution layer, an activation layer, a pooling layer, and a fully connected layer; Convolution layer: Use the convolution kernel to slide on the input image to perform local connection and weight sharing operations on the image to extract local features; Activation layer: introduces nonlinear transformation to the output of the convolution layer, enabling the model to learn and represent complex mappings, improving the model's expressiveness and classification performance; Pooling layer: also called sampling layer, which downsamples the feature map to reduce the dimension of the data, reduce the complexity of the entire calculation, and enhance the robustness of the model; Fully connected layer: Located at the end of the network, it is the classifier in the convolutional neural network, which integrates the extracted features and maps them to the final classification results through the softmax function.

5. The method according to claim 1, characterized in that The ensemble learning method adopts an ensemble classifier to classify the extracted features through a voting algorithm.

6. The method according to claim 5, characterized in that The voting algorithm includes two methods: hard voting and soft voting. Hard voting is based on majority voting based on the classification results of each model, while soft voting is based on weighted average of the confidence scores of each model for samples belonging to each category.

7. The method according to claim 6, characterized in that In the soft voting mode, it is assumed that the confidence that each model output sample x belongs to each category is p i (j)(j=1,2,3,4,…,k), the soft voting prediction result is expressed as: where ω i The weights for each model.

8. The method according to claim 1, characterized in that During the data collection and transmission process, the Raspberry Pi in the IoT device will upload the collected field images, pest and disease detection results and equipment-related information to the cloud platform in real time via the network. The cloud platform adopts a distributed storage architecture to ensure the storage and management of massive field images and video data, and ensures the security and reliability of data through redundant backup and encrypted transmission technology.

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.