Mango insect pest detection method, device and equipment based on machine learning

Through a machine learning method combining SIFT algorithm and whale optimization algorithm, the problem of low recognition accuracy in mango tree pest detection is solved, automated detection is realized, cost is reduced, and agricultural monitoring efficiency is improved.

CN119131574AInactive Publication Date: 2024-12-13GUANGDONG ENG POLYTECHNIC COLLEGE
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411077252.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-12-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology is difficult to efficiently identify and classify pests on mango trees, resulting in difficult diagnostic accuracy of agricultural imaging, high labor costs and time costs, and serious economic losses.

Method used

The SIFT algorithm is used to extract image features, combined with whale optimization algorithm and support vector machine classifier, to realize the feature screening and classification of mango tree pest images, and improve the accuracy and efficiency of pest detection.

Benefits of technology

It realizes automated detection and identification of mango pests, reduces labor costs and time costs, improves crop quality, and reduces economic losses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119131574A_ABST
    Figure CN119131574A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of machine learning, provides a plant pest detection method based on machine learning, and particularly relates to a mango pest detection method, device and equipment based on machine learning. The feature extraction is performed on the original image by using the SIFT algorithm, then the feature optimization is performed on the mango tree pest image by using the whale algorithm based on the machine learning entropy, and the pest classification is realized by using the screened optimal feature through the classifier of the support vector machine. Compared with the prior art, the method improves the precision and efficiency of the classification model of the mango pests. In an actual agricultural automatic monitoring application scene, the implementation of the method helps overcome high labor cost and time cost on one hand, and can also reduce economic loss and improve crop quality on the other hand.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of machine learning technology, and is a plant pest detection method based on machine learning, and specifically is a mango pest detection method, device and equipment based on machine learning. Background Art

[0002] Mango, as an important fruit crop in life, is deeply loved by people. In my country, it is mainly distributed in Hainan, Fujian, Yunnan and Guizhou, Guangdong and Guangxi, Taiwan and other regions. In the process of growth, flowering, fruiting and maturation, mango trees are not only easily restricted by regional climate, greenhouse building effects, and crop monitoring and management methods, but are also often susceptible to pests and diseases. Whenever plants are photosynthesizing, the appearance of pests will cause crops to become sick or even die. If a large number of pests appear in the orchard, it can cause widespread damage to mango crops, resulting in serious economic losses for farmers, hindering the pace of rural revitalization and the development of agriculture.

[0003] During the growth and fruiting process of mango trees, the main diseases and pests are divided into two categories. One is caused by pathogens such as microorganisms, viruses, and bacteria, mainly leaf blight, leaf spot, anthracnose, and gummosis; the other is caused by pests, mainly thrips, small flies, female leaf weevils, longhorn beetles, and aphids. At present, many scholars have proposed some advanced identification methods for the pest problems encountered by crops such as eggplant, cucumber, and potato during their growth, and have accumulated rich experience. However, due to the influence of the color, position, area, and type of diseases on the leaves of different crops, the positioning and identification accuracy in the process of agricultural imaging diagnosis and identification are becoming increasingly difficult.

[0004] With the continuous development of digital image processing technology, it has been widely used in many fields, including imaging diagnosis technology in agricultural monitoring. As a fully automated technology, agricultural imaging diagnosis has the following main steps: collecting and preprocessing raw image data, training and testing models for collected data, optimizing and applying models, and using customized methods for feature retrieval and compression. Among them, monitoring and classifying mango pests and diseases is a key task. Summary of the invention

[0005] In order to solve the technical problems existing in the prior art, the embodiments of the present application provide a mango pest detection method, device and equipment based on machine learning, which can realize automatic detection and identification of mango pests.

[0006] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0007] In a first aspect, a mango pest detection method based on machine learning is provided, the method comprising: acquiring images of mango trees in a target area and extracting image features of the images; screening the image features to obtain optimal features; and classifying the optimal features based on a classifier to obtain classification results.

[0008] Furthermore, the image is feature extracted based on the SIFT algorithm to obtain image features; specifically, the method comprises: performing scale space decomposition on the image, identifying scale-invariant interest points and selecting them as candidate positions through Gaussian differential functions, determining the position scale of the candidate positions based on fitting interpolation functions, and screening multiple candidate positions based on the position scale to obtain the screened multiple candidate positions as key points; locating each key point by fitting a refined model to obtain intermediate key points; assigning a reference direction to each intermediate key point based on local image features, and finding the direction of the maximum value in the histogram as the main direction of the intermediate key point by calculating the direction histogram of the local area of ​​the key point; and obtaining a feature vector using the gradient information of 8 directions calculated in a 4*4 window in the key point scale space.

[0009] Furthermore, the screening of the image features includes: preliminarily screening multiple image features based on the entropy of the feature vector to obtain a preliminary feature vector that meets a preset entropy threshold; and obtaining the optimal feature through a whale optimization algorithm on the preliminary feature vector machine.

[0010] Furthermore, the preliminary screening of multiple image features based on the entropy of the feature vector includes: calculating the entropy value of the feature vector based on the following formula:

[0011] h1=h diff,1 +id(N)=h diff,1 +h 1,max ; Updating the preset threshold to obtain an updated entropy threshold; screening the entropy value of the feature vector and the updated entropy threshold to obtain the screened initial feature.

[0012] Furthermore, the screening of the image features to obtain the best features includes: screening the initial features based on the whale optimization algorithm to obtain the best features; specifically including the following steps: initializing the size of the whale population and the maximum number of iterations, and initializing the position of the whale population; calculating the corresponding fitness value of each whale, and sorting them according to the size of the fitness value, and selecting multiple initial populations that meet the requirements; calculating the fitness value of each individual in the multiple initial populations, and screening the individual position with the smallest fitness value as the optimal position; updating the position of the next generation, and repeating the above process iteratively until the termination condition is reached, and outputting the optimal individual.

[0013] Furthermore, the above process is repeated iteratively, including: determining the position relationship and iterative relationship of the food source to surround the prey, and updating the whale position to capture and search for prey.

[0014] Furthermore, the position relationship and iteration relationship of the food source are determined based on the following formula: D = |C·X*(T)-X(T)|, X(T+1) = X*(T)-A·D; wherein X*(T) is the best position vector of the food source searched by the whale so far, X(T) is the current position vector of the whale, C is a random factor, and D is the distance between the whale and the target object; wherein the values ​​of A and C are determined based on the following formula: A = 2a·rand1-rand1, C = 2·rand2; wherein A is the movement range used to control the whale to approach or move away from the selected target, parameter a changes linearly from 2 to 0, parameter rand1 is a random number in the range of [0,1], and parameter rand2 is a random number in the range of [0,1]; as parameter a changes to 0, the optimal solution is obtained.

[0015] Further, the updating of the whale position to capture prey includes: determining the distance between the prey position and the whale based on the following formula: X(T+1)=De bl .cos(2πl)+X*(T), where D=|X*(T)-X(T)| represents the distance between the whale and the prey, X*(T) represents the best position vector so far, b is a constant used to define the shape of the circular spiral, and l is a random number in (-1.1); iterate based on the following formula to obtain the updated position: Where p is a random number from 0 to 1; when the value of a decreases from 2 to 0 during the iteration process, A is a random value in [-a, a].

[0016] In a second aspect, a mango pest detection device based on machine learning is provided, the device comprising: a feature extraction module, used to obtain images of mango trees in a target area and extract image features of the images; a feature screening module, used to screen the image features to obtain optimal features; and a classification module, used to classify the optimal features based on a classifier to obtain a classification result.

[0017] In a third aspect, a terminal device is provided, comprising: a memory and a processor coupled to the memory, wherein the processor is configured to execute any one of the above-mentioned mango pest detection based on instructions stored in the memory.

[0018] In the technical solution provided in the embodiment of the present application, the SIFT algorithm is used to extract features from the original image, and then the whale algorithm based on machine learning entropy is used to optimize the features of the mango tree pest image, and the selected optimal features are used to classify the pests through the classifier of the support vector machine. Compared with the prior art, the present invention improves the accuracy and efficiency of the classification model of mango pests. In the actual application scenario of agricultural automatic monitoring, the implementation of this method helps to overcome the expensive labor cost and time cost on the one hand, and can also reduce economic losses and improve crop quality on the other hand. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0020] The methods, systems and / or programs in the accompanying drawings will be further described according to exemplary embodiments. These exemplary embodiments will be described in detail with reference to the drawings. These exemplary embodiments are non-limiting exemplary embodiments, wherein example numbers represent similar mechanisms in the various views of the accompanying drawings.

[0021] Figure 1 It is a flow chart of a mango pest detection method based on machine learning provided in an embodiment of the present application.

[0022] Figure 2 It is a schematic diagram of the structure of a mango pest detection device provided in an embodiment of the present application.

[0023] Figure 3 It is a schematic diagram of the terminal device structure provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In order to better understand the above technical scheme, the technical scheme of the present application is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical scheme of the present application, rather than limitations on the technical scheme of the present application. In the absence of conflict, the embodiments of the present application and the technical features in the embodiments can be combined with each other.

[0025] In the following detailed description, numerous specific details are set forth by way of example in order to provide a comprehensive understanding of the relevant guidance. However, it will be apparent to those skilled in the art that the present application may be practiced without these details. In other cases, well-known methods, procedures, systems, compositions and / or circuits have been described at a relatively high level, without detail, in order to avoid unnecessarily obscuring aspects of the present application.

[0026] Flowcharts are used in the present application to illustrate the execution process performed by the system according to the embodiment of the present application. It should be clearly understood that the execution process of the flowchart may not be performed in order. On the contrary, these execution processes may be performed in reverse order or simultaneously. In addition, at least one other execution process may be added to the flowchart. One or more execution processes may be deleted from the flowchart.

[0027] Before further describing the embodiments of the present invention in detail, the nouns and terms involved in the embodiments of the present invention are described. The nouns and terms involved in the embodiments of the present invention are subject to the following interpretations.

[0028] (1) In response, it is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed may be in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations executed are executed.

[0029] (2) Based on is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed may be in real time or have a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations executed are executed.

[0030] Crop diseases, as one of the common phenomena in the agricultural production process, seriously affect the yield and quality of crops and damage the economic benefits of farmers' production.

[0031] During the growth and fruiting process of mango trees, its main diseases and pests can be divided into two categories. One is caused by pathogens such as microorganisms, viruses, and bacteria, mainly leaf blight, leaf spot, anthracnose and gummosis; the other is caused by pests, mainly thrips, small flies, female leaf weevils, longhorn beetles, and aphids.

[0032] Among them, the common pests of mango trees are introduced separately:

[0033] (1) Leaf blight is a crop disease caused by bacteria that can cause normal leaves to wilt, disrupt photosynthesis, and affect the growth of buds, stems, branches and trunks, as well as fruit development. Effectively preventing the occurrence of leaf blight in the initial stage of mango growth is one of the issues of agricultural monitoring;

[0034] (2) Leaf spot disease is also one of the pests that affect the growth and development of mangoes. It mainly harms the leaves of mango trees, causing small light brown round spots on the leaves, with dark brown or water-soaked edges. In the later stage, small black particles grow in the center of the spots, which are the conidiophores of the pathogen. These diseases not only affect the health of mango trees, but also affect the yield and quality of the fruit;

[0035] (3) The most common dangerous infection affecting mango trees is anthracnose. The pathogen is mainly caused by a fungus and is spread through water droplets. The infection is characterized by direct transmission of the fungus to seeds and to other crops through agricultural waste in the ground. It is more common in hot and humid climates. The main manifestation of this fungus is the appearance of darker, flatter patches or lesions on the leaves.

[0036] The present application embodiment provides a detection method for the above-mentioned insect pests, see Figure 1 , specifically including the following steps:

[0037] Step S110: Acquire images of mango trees in a target area, and extract image features of the images.

[0038] In this embodiment, the image acquisition of the mango tree is achieved through the SIFT algorithm.

[0039] The image feature extraction process of the SIFT algorithm mainly includes: extreme value detection in scale space, key point positioning, direction positioning and key point descriptors.

[0040] For the extreme value detection in scale space, the image is first decomposed in scale space, and the interest points that are invariant to the scale are identified and selected as candidate positions through Gaussian differential function. Then, the position scale of the candidate position is determined according to the fitted interpolation function, and multiple candidate positions are screened based on the position scale to obtain the screened multiple candidate positions as key points.

[0041] Then, a fine fitting model is used to locate each key point obtained, and the key points located on the edge and susceptible to noise interference are eliminated to obtain the intermediate key points.

[0042] Then, a reference direction is assigned to each key point using local image features, and the direction histogram of the local area of ​​the key point is calculated to find the direction of the maximum value in the histogram as the main direction of the intermediate key point. At this time, the intermediate key point has position, scale and direction.

[0043] In order to ensure the invariance of key points in movement, scaling and rotation, a descriptor vector is established for the key points so that they can remain unchanged under different light and viewing angles. The image area around the key points is divided into blocks, and the gradient histogram in the blocks is calculated to generate a unique vector. This vector is unique for the image information in the area. In this embodiment, the gradient information of 8 directions calculated in a 4*4 window in the key point scale space is used, and a total of 4*4*8=128-dimensional feature vectors are used.

[0044] Step S120. Screen the image features to obtain the best features.

[0045] In this embodiment, the image features acquired in step S120 are initial image features, and the above features need to be optimized during classification to obtain the best features that meet the requirements of the classifier.

[0046] For this process, this embodiment proposes a method for entropy element life cycle management based on entropy value cycle management, and its main process is: calculate the entropy of the input feature vector; according to the value of the input vector, apply the threshold function to return two parameters, namely, the parameters that meet the threshold level and the parameters that do not meet the threshold level; use the extreme learning machine as the optimization process, and use the selected threshold as input.

[0047] Among them, the optimization algorithm in the extreme learning machine adopts the whale optimization algorithm in this embodiment, thereby improving the accuracy and classification speed of the machine learning model, reducing unnecessary feature loss, and improving the efficiency of the machine algorithm.

[0048] Specifically, this process includes two parts. The first part is to preliminarily screen multiple image features based on the entropy of the feature vector to obtain a preliminary feature vector that meets the preset entropy threshold. The second part is to obtain the optimal feature by using the whale optimization algorithm for the preliminary feature vector.

[0049] In order to preliminarily screen multiple image features based on the entropy of the feature vector, the entropy of the feature vector obtained in step S110 is first calculated based on the following formula:

[0050]

[0051] h1=h diff,1 +id(N)=h diff,1 +h 1,max .

[0052] Then, the preset screening threshold is updated to obtain an updated entropy threshold, and then the entropy value of the feature vector is screened with the updated entropy threshold to obtain the screened initial feature.

[0053] The update of the entropy threshold is based on the following formula:

[0054]

[0055] According to the above process, the image features can be preliminarily screened, and then the initial features after screening need to be screened for the second time to obtain the best features. The process is carried out by an extreme learning machine based on the whale optimization algorithm.

[0056] Among them, the whale optimization algorithm is a simulation algorithm based on whale behavior, which is used to solve optimization problems. He simulates the hunting behavior of humpback whale groups in nature, and achieves the purpose of optimal search through the process of whale group search, encirclement, pursuit and attack on prey. The working principle of the whale optimization algorithm is as follows: 1. Initialization: First, at the beginning of the algorithm, it is necessary to set an initial position for each whale and generate an initial population. 2. Search: Each whale will explore the space according to certain rules. This process can simulate the process of whale encirclement, pursuit and attack on prey. 3. Evaluation: Whenever a whale moves, the fitness value of the current whale population is calculated. If the current fitness value is better than the previous fitness value, the current fitness value is set as the optimal solution. 4. Update: When all whales have completed the movement and evaluation, the algorithm will update the positions of all whales and repeat the above steps. 5. Iteration: The whale optimization algorithm can be iterated multiple times until the optimal solution is found.

[0057] The processing process of this embodiment includes:

[0058] Initialize the size of the whale population and the maximum number of iterations, as well as the location of the whale population;

[0059] Calculate the fitness value of each whale, sort them according to the fitness value, and select multiple initial populations that meet the requirements;

[0060] Calculating the fitness value of each individual in the multiple initial populations, and selecting the individual position with the smallest fitness value as the optimal position;

[0061] Update the position of the next generation and repeat the above process iteratively until the termination condition is reached and the optimal individual is output.

[0062] Among them, the position relationship and iteration relationship of the whale's search for food sources in space are determined based on the following formula: D = |C·X*(T)-X(T)|, X(T+1) = X*(T)-A·D; wherein, X*(T) is the best position vector of the food source searched by the whale so far, X(T) is the current position vector of the whale, C is a random factor, and D is the distance between the whale and the target object; wherein the values ​​of A and C are determined based on the following formula: A = 2a·rand1-rand1, C = 2·rand2; wherein A is used to control the movement range of the whale to approach or move away from the selected target, parameter a changes linearly from 2 to 0, parameter rand1 is a random number in the range of [0,1], and parameter rand2 is a random number in the range of [0,1]; as parameter a changes to 0, the optimal solution is obtained.

[0063] When a whale hunts, it swims toward its prey in a spiral motion, that is, the distance between the prey and the whale is determined based on the following formula: X(T+1)=De bl .cos(2πl)+X*(T), where D=|X*(T)-X(T)| represents the distance between the whale and its prey, X*(T) represents the best position vector so far, b is a constant that defines the shape of the circular spiral, and l is a random number in (-1.1).

[0064] It is worth noting that the whale swims towards the prey in a spiral shape while shrinking the encirclement. Therefore, in this synchronous behavior model, the new position is obtained through continuous iteration, based on the following formula: Where p is a random number from 0 to 1. During the iteration, when the value of a decreases from 2 to 0, A is a random value in [-a, a]. When the value of A is in [-1, 1], the next position of the whale can be any position between its current position and the position of the prey. The algorithm sets that when A<1, the whale attacks the prey.

[0065] In addition to using the above method, a random prey hunting process is also performed, and the repetition of the prey search is represented based on the following formula: X(T+1)=X rand —BD, D=FX rand —X.

[0066] Step S130: Classify the optimal features based on the classifier to obtain a classification result.

[0067] In this embodiment, a support vector machine is used for the classifier, wherein a certain hyperplane is first defined for the support vector machine: wTx+b=0, when w∈Rn, b∈Rn represents a constant, it means that it is orthogonal to the hyperplane, and a point trajectory is obtained, as shown in the following formula: Among them, Xi is the input vector class, Yi represents the actual number of columns in m-dimension, which is -1 or +1. The support vector machine attempts to find a maximum margin between multiple sample pairs to minimize the actual risk of multiple sample pairs, based on the following expression: X i (w T Y+b)≥1.

[0068] The goal of the support vector machine is to make the gap between the two hyperplanes larger. The true separation of the two hyperplanes can be calculated using 1 / ||w||. The quadratic optimization problem is used to solve the support vector machine training in the inseparable case, as shown in the following formula: Y(w,φ(X)+b)≥1—ξ i ,ξ i ≥0.

[0069] The above method is compared with the existing algorithm based on precision, recall rate and F-measure. The comparison results are shown in Table 1.

[0070]

[0071] Table 1. Algorithm comparison table

[0072] For the classification results of the above methods, please refer to Table 2.

[0073]

[0074] Table 2. Classification results

[0075] It can be seen from Table 1 and Table 2 that the method provided in this embodiment can realize the identification of different pest lesions of mangoes, and has higher accuracy than the prior art.

[0076] See also Figure 2 Based on step S110-step S130, a virtual device for execution is also provided, which is a mango pest detection device 200 based on machine learning. This device can be configured in any software product to execute the process of step S110-step S130. This device can be a separate plug-in module or a complete computer product. This device includes:

[0077] A feature extraction module 210 is used to obtain images of mango trees in a target area and extract image features of the images;

[0078] A feature screening module 220 is used to screen the image features to obtain the best features;

[0079] The classification module 230 is used to classify the optimal features based on the classifier to obtain the classification result.

[0080] See also Figure 3, the above method can also be integrated into the provided terminal device 300, and the device may have relatively large differences due to different configurations or performances, and may include one or more processors 301 and memory 302, and the memory 302 may store one or more storage applications or data. Among them, the memory 302 can be a temporary storage or a permanent storage. The application stored in the memory 302 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the terminal device. Furthermore, the processor 301 can be configured to communicate with the memory 302, and the terminal device executes a series of computer executable instructions in the memory 302. The terminal device may also include one or more power supplies 303, one or more wired or wireless network interfaces 304, one or more input or output interfaces 305, one or more keyboards 306, etc.

[0081] In a specific embodiment, the terminal device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions in the terminal device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:

[0082] Acquire images of mango trees in a target area, and extract image features of the images;

[0083] and screening the image features to obtain the best features;

[0084] The optimal features are classified based on the classifier to obtain a classification result.

[0085] The following is a detailed introduction to the various components of the processor:

[0086] In this embodiment, the processor is an application specific integrated circuit (ASIC), or is configured to implement one or more integrated circuits of the embodiments of the present application, such as one or more microprocessors (digital signal processor, DSP), or one or more field programmable gate arrays (field programmable gate array, FPGA).

[0087] Optionally, the processor may execute various functions by running or executing a software program stored in the memory and calling data stored in the memory, such as executing the above-mentioned Figure 1The method shown.

[0088] In a specific implementation, as an embodiment, the processor may include one or more microprocessors.

[0089] Among them, the memory is used to store the software program that executes the solution of the present application, and the execution is controlled by the processor. The specific implementation method can refer to the above method embodiment and will not be repeated here.

[0090] Optionally, the memory may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may be integrated with the processor, or may exist independently and be coupled to the processing unit through the interface circuit of the processor, which is not specifically limited in the embodiments of the present application.

[0091] It should be noted that the structure of the processor shown in this embodiment does not constitute a limitation on the device, and the actual device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0092] In addition, the technical effects of the processor can refer to the technical effects of the method described in the above method embodiment, which will not be repeated here.

[0093] It should be understood that the processor in the embodiments of the present application may be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0094] It should also be understood that 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 random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0095] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented using software, the above embodiments 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 or computer programs. When the computer instructions or computer programs are loaded or 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 can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can 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 can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0096] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0097] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0098] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0099] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0100] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0101] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0102] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0103] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.

[0104] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A mango pest detection method based on machine learning, It is characterized in that The method comprises: Acquire images of mango trees in a target area, and extract image features of the images; and screening the image features to obtain the best features; The optimal features are classified based on the classifier to obtain a classification result.

2. The mango pest detection method based on machine learning according to claim 1, It is characterized in that The extracting the image features of the image comprises: Performing feature extraction on the image based on the SIFT algorithm to obtain image features; Specifically, the method comprises: performing scale space decomposition on the image, identifying scale-invariant interest points as candidate positions according to a Gaussian differential function, determining the position scale of the candidate positions based on a fitting interpolation function, and screening multiple candidate positions based on the position scale to obtain the screened multiple candidate positions as key points; The key points are positioned by fitting a fine model to obtain intermediate key points; Based on the local features of the image, a reference direction is assigned to each intermediate key point, and the direction of the maximum value in the histogram is found as the main direction of the intermediate key point by calculating the direction histogram of the local area of ​​the key point; The feature vector is obtained using the gradient information in 8 directions calculated in a 4*4 window in the key point scale space.

3. The mango pest detection method based on machine learning according to claim 2, It is characterized in that The screening of the image features includes: Preliminarily screening multiple image features based on the entropy of feature vectors to obtain preliminary feature vectors that meet a preset entropy threshold; The preliminary feature vector is subjected to the whale optimization algorithm to obtain the optimal feature.

4. The mango pest detection method based on machine learning according to claim 3, It is characterized in that The entropy of the feature vector is used to preliminarily screen multiple image features, including: The entropy value of the feature vector is calculated based on the following formula: h1=hdiff,1+id(N)=hdiff,1+h1,max; Updating the preset threshold to obtain an updated entropy threshold; The entropy value of the feature vector is screened with the updated entropy threshold to obtain the screened initial feature.

5. The mango pest detection method based on machine learning according to claim 4, It is characterized in that The step of screening the image features to obtain the best features includes: Screening the initial features based on the whale optimization algorithm to obtain the best features; The specific steps include: Initialize the size of the whale population and the maximum number of iterations, as well as the location of the whale population; Calculate the fitness value of each whale, sort them according to the fitness value, and select multiple initial populations that meet the requirements; Calculating the fitness value of each individual in the multiple initial populations, and selecting the individual position with the smallest fitness value as the optimal position; Update the position of the next generation and repeat the above process iteratively until the termination condition is reached and the optimal individual is output.

6. The mango pest detection method based on machine learning according to claim 5, It is characterized in that The above process is repeated iteratively, including: determining the position relationship and iterative relationship of the food source to surround the prey, and updating the whale position to capture and search for prey.

7. The mango pest detection method based on machine learning according to claim 6, It is characterized in that The food source location relationship and iteration relationship are determined based on the following formula: D = C·X*(T)-X(T), X(T+1) = X*(T)-A·D; where X*(T) is the best position vector of the food source that the whale has searched so far, X(T) is the current position vector of the whale, C is a random factor, and D is the distance between the whale and the target object; The values ​​of A and C are determined based on the following formula: A=2a·rand 1 -rand 1 , C = 2 rand 2 ; A is used to control the movement range of the whale towards or away from the selected target, parameter a changes linearly from 2 to 0, parameter rand1 is a random number in the range of [0,1], and parameter rand2 is a random number in the range of [0,1]; As the parameter a changes to 0, the optimal solution is obtained.

8. The mango pest detection method based on machine learning according to claim 6, It is characterized in that The updating of the whale position for prey capture comprises: The distance between the prey location and the whale is determined based on the following formula: X(T+1)=De bl .cos(2πl)+X*(T), where D=|X*(T)-X(T)| represents the distance between the whale and the prey, X*(T) represents the best position vector so far, b is a constant used to define the shape of the circular spiral, and l is a random number in (-1.1); Iterate based on the following formula to get the updated position: Where p is a random number from 0 to 1; During the iteration process, when the value of a decreases from 2 to 0, A is a random value in [-a, a].

9. A mango pest detection device based on machine learning, It is characterized in that The device comprises: A feature extraction module, used to obtain images of mango trees in a target area and extract image features of the images; A feature screening module, used for screening the image features to obtain the best features; The classification module is used to classify the optimal features based on a classifier to obtain a classification result.

10. A terminal device, include: A memory and a processor coupled to the memory, wherein the processor is configured to execute the mango pest detection method according to any one of claims 1 to 8 based on instructions stored in the memory.

Citation Information

Patent Citations

  • Fruit and vegetable quality detection method based on multispectral image information and TLMD-WOA-SIFT

    CN112069911A

  • Rolling bearing fault diagnosis method based on improved LSSVM

    CN112560914A

  • Image processing method and device

    CN113177954A

  • Pest identification method, device, equipment and medium

    CN116468962A

  • Fruit tree skeleton extraction method based on three-dimensional reconstruction

    CN118379454A