Crop phenotype image recognition method and system based on attention mechanism optimization
Through the crop phenotype image recognition method based on the attention mechanism, combined with planting area data and crop resistance, the detection and prevention of root-knot nematode disease are optimized, solving the problems of resource waste and low efficiency in traditional methods, and achieving a more efficient crop protection.
Patent Information
- Application Number
- CN202410797769.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-09-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The traditional attention mechanism fails to consider the soil type and crop resistance in the planting area when detecting root-knot nematode disease in crops, resulting in long detection time, waste of prevention and control resources, and inability to meet the needs of different crops.
The crop phenotype image recognition method optimized based on the attention mechanism collects planting area data, builds a quality assessment model, screens crops with high and low infection risks, and carries out key or basic prevention and control based on the quality of the planting area and crop category.
It improves the efficiency of root-knot nematode control, avoids waste of resources, meets the public's demand for crop yields, and achieves more precise control measures.
Smart Images

Figure CN118658074A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of disease identification, and more specifically, to a crop phenotype image recognition method and system based on attention mechanism optimization. Background Art
[0002] Attention mechanism is a method that mimics human visual or auditory attention mechanism and is widely used in deep learning models, especially in natural language processing and computer vision tasks. Applying attention mechanism to detect whether crops have root-knot nematode disease can improve the model's attention to key areas, thereby enhancing the accuracy and reliability of detection.
[0003] The prior art has the following deficiencies:
[0004] When farmers grow barley and sugar beets, they are less likely to be infected by root-knot nematodes because these plants have a certain resistance to them. However, when farmers change the same planting area to plants such as legumes and potatoes that are easily infected by root-knot nematodes, large-scale infection and death of the plants will occur. The traditional attention mechanism only performs image detection based on the root-knot nematode density and damage level in the predicted area, without considering the plant species and resistance, resulting in long detection time and waste of prevention and control resources. The prevention and control efficiency cannot meet the requirements and cannot meet the public's demand for various crops.
[0005] In view of the above problems, the present invention proposes a solution. Summary of the invention
[0006] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a crop phenotype image recognition method and system based on attention mechanism optimization to solve the problems raised in the above-mentioned background technology.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] The crop phenotype image recognition method and system based on attention mechanism optimization include the following steps:
[0009] Step S1, collecting planting area data, the planting area data including soil data of the planting area, root-knot nematode egg density of the planting area and crop replacement situation of the planting area;
[0010] Step S2, constructing a prediction planting area quality assessment model by analyzing planting area data to predict soil data of the planting area, predict root-knot nematode egg density of the planting area, and predict crop replacement conditions of the planting area;
[0011] Step S3, predicting the quality of the planting area by analyzing the predicted planting area quality assessment model, screening out low-quality planting areas and collecting data on currently replanted crops in the low-quality planting areas to analyze the risk of infection with root nematodes, and classifying the currently replanted crops into high-risk crops and low-risk crops;
[0012] Step S4, based on the classification results, focusing on the prevention and control of root-knot nematodes for crops with high infection risks, and basically preventing and controlling root-knot nematodes for crops in high-quality planting areas or with low infection risks.
[0013] In a preferred embodiment, in step S2, the planting base is divided into multiple planting areas according to the same proportion, and the nitrogen, phosphorus and potassium contents of each planting area are obtained by a spectral sensor; the nitrogen, phosphorus and potassium contents of each planting area are accumulated and the average value is taken as the standard soil data; the nitrogen, phosphorus and potassium contents of the predicted planting area obtained by the spectral sensor are compared with the standard soil data to obtain the soil data ratio coefficient T; the root-knot nematode egg density in the planting area is obtained by a distillation method; the specific implementation steps are as follows:
[0014] Select to collect multiple samples at different locations and depths; process the collected soil samples into a fine state by sieving, measure the area of the soil samples and mark it as S, add a sufficient amount of extract to the soil samples to completely immerse the samples; place the soil samples and extract in a distillation device; count the number of root-knot nematode eggs L in the soil sample under a microscope using the distilled material in another container; obtain the root-knot nematode egg density ρ by dividing the number of root-knot nematode eggs L in the soil sample by the area of the soil sample S; repeat the operation, and merge the root-knot nematode egg density of each planting area obtained by calculation into an egg data set Cρ; use the MAD algorithm to further screen the root-knot nematode egg density in the egg data set Cρ; the specific steps are as follows:
[0015] Calculate the median: Calculate the median of the root-knot nematode egg density in the egg data set and record it as Median(Cρ). Arrange the root-knot nematode egg density in ascending order and find the root-knot nematode egg density in the middle position.
[0016] Calculate the absolute deviation: For each root-knot nematode egg density, calculate the absolute difference between each root-knot nematode egg density and the median root-knot nematode egg density;
[0017] Calculate the median absolute deviation: take the median of the absolute difference between all root-knot nematode egg densities and the median of root-knot nematode egg densities to obtain the median absolute deviation MAD. The calculation formula of MAD is as follows: MAD = Median (|Cρ i -Median(Cρ)|), where Cρ iis the i-th data point in the egg data set, i is 1, 2, 3, etc.; Median(Cρ) is the median density of root-knot nematode eggs;
[0018] The root-knot nematode egg density threshold ρ is set according to the calculated median absolute deviation MAD x =ρ+MAD;
[0019] Calculate the root-knot nematode egg density ρ in the predicted planting area y , the root-knot nematode egg density ρ in the planting area will be predicted y and the root-knot nematode egg density threshold ρ x The egg ratio coefficient C is obtained by comparison. When the root-knot nematode egg density threshold ρ x The larger the egg ratio coefficient C is, the greater the root-knot nematode egg density ρ in the planting area is predicted. y The larger the egg ratio coefficient C is, the smaller the root-knot nematode egg density ρ in the planting area is predicted. y The smaller.
[0020] In a preferred embodiment, in step S2, the planting plan and schedule are obtained to obtain the harvest time and replanting time of the crops; and the predicted replanting time of the planting area is subtracted from the harvest time to obtain the idle time T of the predicted planting area. q , the idle time T of the planting area will be predicted q The idle time ratio coefficient K is obtained by comparing with the preset standard idle time; the quality assessment model of the predicted planting area is constructed by using the calculated soil data ratio coefficient T, the insect egg ratio coefficient C and the idle time ratio coefficient K; the multi-head attention method in the attention mechanism is used to calculate the quality degree of the predicted planting area; the specific calculation process is as follows:
[0021] Linear transformation: The soil data ratio coefficient T, the egg ratio coefficient C and the idle time ratio coefficient K are used as three inputs and are respectively transformed through multiple different linear transformation matrices. and Get multiple sets of queries Q i , key K i Sum value V i ;
[0022] Attention calculation: In each subspace, calculate the attention weight α i : Among them, d k is the dimension of the key; softmax is the activation function that indexes each element in the vector and then normalizes the indexed result to obtain the probability value corresponding to each element;
[0023] Weighted summation: for each value V in the subspace i Apply attention weight αi :Head i =α i V i ;
[0024] Multi-Head Splicing: Splice all heads together: MultiHead i (Q, K, V) = Concat (Head1, Head2, Head3); The results of each of the above inputs are concatenated as a head;
[0025] Final linear transformation: The concatenated result is passed through a linear transformation matrix W again O :MultiHead i (Q, K, V) = Concat (Head1, Head2, Head3)W O ;
[0026] Get the output sequence MultiHead i (Q, K, V), where Q is the query vector, K is the key vector, and V is the output value vector; the output value vector is modulo as the predicted planting area quality assessment index, and the predicted planting area quality assessment index is compared with the standard quality index threshold. When the predicted planting area quality assessment index is greater than or equal to the standard quality index threshold, the predicted planting area is a high-quality planting area. When the predicted planting area quality assessment index is less than the standard quality index threshold, the predicted planting area is a low-quality planting area.
[0027] In a preferred embodiment, in step S3, the replanted crop data is divided into the root-knot nematode infection degree of the replanted crops in the predicted planting area and the flavonoid content data of the current replanted crops; the predicted planting area is evaluated by comparing the output value vector modulus of the multi-head attention as the predicted planting area quality evaluation index and the standard quality index threshold; if the predicted planting area is a low-quality planting area, the current replanted crops are screened by accessing the planting history of the predicted planting area; if the planting history of the predicted planting area has a planting record for the current replanted crops, the root-knot nematode infection degree of the current replanted crops is analyzed and classified by the planting history of the predicted planting area;
[0028] Risk judgment is made by predicting the root knot nematode disease image of the current replanted crop in the planting history of the planting area and analyzing the root nodule size of the current replanted crop. If the root nodule of the current replanted crop after being infected with the root knot nematode is greater than or equal to the root nodule threshold, the current replanted crop is judged to be a crop with high infection risk. If the root nodule of the current replanted crop after being infected with the root knot nematode is less than the root nodule threshold, the current replanted crop is judged to be a crop with low infection risk.
[0029] If the predicted planting history of the planting area has no planting record for the currently replanted crop, the resistance of the currently replanted crop to root nematodes is judged by detecting the content of flavonoids in the currently replanted crop, and the content of flavonoids in the plant is determined; if the flavonoids generated by the currently replanted crop are higher than or equal to the content threshold, the currently replanted crop is judged to be a crop with low infection risk; if the flavonoids generated by the currently replanted crop are lower than the content threshold, the currently replanted crop is judged to be a crop with high infection risk.
[0030] In a preferred embodiment, in step S4, the crops with high infection risk are subjected to key control of root-knot nematodes, and the high-quality planting areas or the crops with low infection risk are subjected to basic control of root-knot nematodes.
[0031] A crop phenotype image recognition system based on attention mechanism optimization, which is used to implement the above-mentioned crop phenotype image recognition system based on attention mechanism optimization, including a data acquisition module, a data analysis module and a data storage module;
[0032] The data acquisition module is used to acquire and collect planting area data and send it to the data analysis module;
[0033] The data analysis module determines the high quality of the planting area based on the planting area data and determines whether the crop should be planted;
[0034] The data storage module is used to store all data in the data processing process of the crop phenotype image recognition system optimized based on the attention mechanism.
[0035] The technical effects and advantages of the crop phenotype image recognition method and system based on attention mechanism optimization of the present invention are as follows:
[0036] The present invention detects the quality of the crop planting area and the crop category, evaluates and predicts the quality of the planting area, and after confirming the quality category of the planting area, determines the category of the planted crops according to the crop information analysis, and determines whether the predicted planting area needs key prevention and control or basic prevention and control according to the different categories of crops. When the risk of planted crops being infected by root-knot nematodes is high, the planting area will be subject to key prevention and control, and when the risk of planted crops being infected by root-knot nematodes is low, the planting area will be subject to basic prevention and control. It avoids the waste of resources caused by the prevention and control of root-knot nematodes, and also avoids the problems of excessive control of root-knot nematodes causing damage to the quality of the planting area. It improves the efficiency of preventing and controlling root-knot nematodes and meets the public's demand for the yield of planted crops. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 This is a logical schematic diagram of the crop phenotype image recognition system optimized based on the attention mechanism of the present invention;
[0038] Figure 2This is a flow chart of the crop phenotype image recognition method optimized based on the attention mechanism of the present invention. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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.
[0040] The present invention identifies and analyzes the root-knot nematode infection of crops based on the attention mechanism. By detecting the quality of the crop planting area and the crop category, the quality of the planting area is evaluated and predicted. After confirming the quality category of the planting area, the category of the planted crops is determined according to the crop information analysis. According to the different categories of crops, it is determined whether the predicted planting area needs key prevention and control or basic prevention and control. When the risk of the planted crops being infected by root-knot nematodes is high, the planting area is subject to key prevention and control. When the risk of the planted crops being infected by root-knot nematodes is low, the planting area is subject to basic prevention and control. It avoids the waste of resources caused by the prevention and control of root-knot nematodes, and also avoids the problems of excessive control of root-knot nematodes causing damage to the quality of the planting area. It improves the efficiency of preventing and controlling root-knot nematodes and meets the public's demand for the yield of planted crops.
[0041] Example 1, the present invention discloses a crop phenotype image recognition method based on attention mechanism optimization, such as Figure 1 , Figure 2 As shown, the following steps are included:
[0042] Step S1, collecting planting area data, the planting area data includes soil data of the planting area, root-knot nematode egg density of the planting area and crop change situation of the planting area.
[0043] Step S2, constructing a prediction planting area quality assessment model by analyzing planting area data to predict planting area soil data, predicting root-knot nematode egg density in the planting area and predicting planting area crop replacement conditions.
[0044] Step S3, predicting the quality of the planting area through the predicted planting area quality assessment model analysis, screening out low-quality planting areas and collecting data on current replanted crops in low-quality planting areas to analyze the risk of infection with root nematodes, and classifying the current replanted crops into high-infection risk crops and low-infection risk crops.
[0045] Step S4, based on the classification results, focusing on the prevention and control of root-knot nematodes for crops with high infection risks, and basically preventing and controlling root-knot nematodes for crops in high-quality planting areas or with low infection risks.
[0046] It should be noted that crop phenotypic image information mainly refers to the data on the external morphology and characteristics of crops obtained through imaging technology, such as leaf area, leaf color, plant height, etc.; however, in modern precision agriculture, in order to more comprehensively understand and manage crop growth, phenotypic image information is usually combined with other agriculture-related data for comprehensive analysis.
[0047] For example, soil data in the planting area has a significant impact on crop growth due to different soil types. Phenotypic image analysis can be used to observe differences in crop growth under different soil types; the root-knot nematode egg density in the planting area will affect the root health of the plant due to high density of root-knot nematode eggs, leading to poor plant growth. Root damage can be directly observed through 3D imaging of the roots or underground imaging technology. The crop replacement situation in the planting area can be evaluated by analyzing historical phenotypic image data and crop replacement records to evaluate the soil improvement effect and pest and disease inhibition effect of different crops.
[0048] The specific implementation is as follows:
[0049] In step S1, the location of the planting base where the planting area is located is first determined, and the location of the planting base can be obtained by the GPS system. The soil conditions of each planting area in the planting base, such as the nutrient content of nitrogen, phosphorus, potassium, etc., are obtained through spectral sensors. The root-knot nematode egg density in the planting area is obtained by collecting and analyzing soil samples in the planting area. The harvest time and replanting time of the crops are obtained by accessing the planting plan and schedule on the planting base website.
[0050] It should be noted that the GPS system is a satellite navigation system that provides global positioning, navigation and clock synchronization services through a group of satellites and ground equipment. It can be used to obtain the location of the planting base. A spectral sensor is a sensor that uses spectral characteristics to obtain information about the composition or properties of a material. In the agricultural field, spectral sensors are usually used to measure the spectral reflectance characteristics of soil, vegetation and crops, so as to obtain various information about soil, vegetation and crops, including nutrient content such as nitrogen, phosphorus, potassium, etc. The planting base website will publish the planting plan and crop planting schedule of the planting base, including information such as planting time, sowing time, harvesting time and replanting time for different seasons and different crops.
[0051] In step S2, the planting base is divided into multiple planting areas according to the same proportion. The proportion of the division here is not unique, and the planting base can be divided into 10 planting areas according to the same proportion. The contents of nitrogen, phosphorus and potassium in each planting area are obtained by the spectral sensor. The nitrogen, phosphorus and potassium contents of each planting area are accumulated and the average value is taken as the standard soil data. The nitrogen, phosphorus and potassium contents of the predicted planting area obtained by the spectral sensor are compared with the standard soil data to obtain the soil data proportion coefficient T. The root-knot nematode egg density in the planting area can be obtained by distillation. The specific implementation steps are as follows:
[0052] First, soil samples need to be collected in each planting area. In order to obtain representative samples, multiple samples can be collected at different locations and depths. It is usually recommended to collect soil samples between planting rows or near the root system, with a depth of 15 to 30 cm. The collected soil samples are processed into a fine state by sieving to increase the extraction efficiency. The area of the soil sample is measured and marked as S, and an appropriate extract, such as saline or acetic acid, is selected to destroy the cell wall and release the root-knot nematode eggs. A sufficient amount of extract is added to the soil sample so that the sample is completely immersed in it. The soil sample and the extract are placed in a distillation device. During the distillation process, the root-knot nematode eggs in the soil sample will evaporate with the water vapor in the extract and be collected into another container through the distillation tube. The distilled material in another container is counted on a microscope to count the number of root-knot nematode eggs in the soil sample L. The root-knot nematode egg density ρ is obtained by dividing the number of root-knot nematode eggs in the soil sample L by the area of the soil sample S. Repeat the operation, and the root-knot nematode egg density obtained by calculation in each planting area is merged into the egg data set Cρ. The root-knot nematode egg density in the egg dataset Cρ can be further screened using the MAD algorithm. The specific steps are as follows:
[0053] Calculate the median: First, calculate the median of the root-knot nematode egg density in the egg dataset and record it as Median(Cρ), sort the root-knot nematode egg density in ascending order, and find the root-knot nematode egg density in the middle. If the egg dataset contains an odd number of digits, the median is the middle value; if the egg dataset contains an even number of values, the median is the average of the two middle values.
[0054] Calculate the absolute deviation: For each root-knot nematode egg density, calculate the absolute difference between each root-knot nematode egg density and the median root-knot nematode egg density, that is, take the absolute value of the difference between each root-knot nematode egg density and the median root-knot nematode egg density.
[0055] Calculate the median absolute deviation: take the median of the absolute difference between all root-knot nematode egg densities and the median of root-knot nematode egg densities to obtain the median absolute deviation MAD. The calculation formula of MAD is as follows: MAD = Median (|Cρi -Median(Cρ)|), where Cρ i is the i-th data point in the egg data set, i can be 1, 2, 3, etc. Median(Cρ) is the median density of root-knot nematode eggs.
[0056] The root-knot nematode egg density threshold ρ can be set based on the calculated median absolute deviation MAD x =ρ+MAD.
[0057] The root-knot nematode egg density ρ mentioned above is obtained by dividing the number of root-knot nematode eggs L in the soil sample by the area of the soil sample S. When the area of the soil sample is determined, the larger the root-knot nematode egg density ρ, the larger the number of root-knot nematode eggs L in the soil sample, the larger the number of root-knot nematode eggs in the corresponding planting area, and the larger the root-knot nematode density in the corresponding planting area. The smaller the root-knot nematode egg density ρ, the smaller the number of root-knot nematode eggs L in the soil sample, the smaller the number of root-knot nematode eggs in the corresponding planting area, and the smaller the root-knot nematode density in the corresponding planting area.
[0058] Calculate the root-knot nematode egg density ρ in the predicted planting area according to the above method y , the root-knot nematode egg density ρ in the planting area will be predicted y and the root-knot nematode egg density threshold ρ x The egg ratio coefficient C is obtained by comparison. When the root-knot nematode egg density threshold ρ x The larger the egg ratio coefficient C is, the greater the root-knot nematode egg density ρ in the planting area is predicted. y The larger the egg ratio coefficient C is, the smaller the root-knot nematode egg density ρ in the planting area is predicted. y The smaller.
[0059] Visit the planting base website to find the planting plan and schedule to obtain the harvest time and replanting time of the crops. Divide the predicted replanting time and harvest time of the planting area to obtain the predicted idle time T of the planting area. q , because the root-knot nematode is a parasite. When there is no host in the planting area, the root-knot nematode eggs will lose nutrients over time and die naturally. q The idle time ratio coefficient K is obtained by comparing it with the preset standard idle time. The standard idle time is set by technicians in this field according to the actual situation. Therefore, when the standard idle time is determined, the larger the idle time ratio coefficient K is, the longer the idle time T of the predicted planting area will be. q The larger the value is, the greater the number of root-knot nematode eggs that die and the smaller the root-knot nematode egg density is. The smaller the idle time ratio coefficient K is, the more likely it is that the idle time T of the planting area will be predicted. q The smaller it is, the smaller the number of root-knot nematode eggs that die and the greater the density of root-knot nematode eggs.
[0060] The quality assessment model of the predicted planting area is constructed by using the calculated soil data ratio coefficient T, insect egg ratio coefficient C and idle time ratio coefficient K. The multi-head attention method in the attention mechanism can be used to calculate the quality of the predicted planting area. The specific calculation process is as follows:
[0061] Linear transformation: The soil data ratio coefficient T, the egg ratio coefficient C and the idle time ratio coefficient K are used as three inputs and are respectively transformed through multiple different linear transformation matrices. and Get multiple sets of queries Q i , key K i Sum value V i .
[0062] Attention calculation: In each subspace, calculate the attention weight α i : Among them, d k is the dimension of the key. Softmax is an activation function that exponentializes each element in the vector and then normalizes the exponential result to obtain the probability value corresponding to each element. Here, the softmax function can be used to calculate the weight α i .
[0063] Weighted summation: for each value V in the subspace i Apply attention weight α i :Head i =α i V i .
[0064] Multi-Head Splicing: Splice all heads together: MultiHead i (Q, K, V) = Concat (Head1, Head2, Head3). The results of each of the above inputs are concatenated as a head.
[0065] Final linear transformation: The concatenated result is passed through a linear transformation matrix W again O :MultiHead i (Q, K, V) = Concat (Head1, Head2, Head3)W O .
[0066] The output sequence MultiHead is obtained by the above method i(Q, K, V), where Q is the query vector, K is the key vector, and V is the output value vector. The output value vector is modulo taken as the predicted planting area quality assessment index, and the predicted planting area quality assessment index is compared with the standard quality index threshold. When the predicted planting area quality assessment index is greater than or equal to the standard quality index threshold, the predicted planting area quality is good and is a high-quality planting area. When the predicted planting area quality assessment index is less than the standard quality index threshold, the predicted planting area quality is poor and is a low-quality planting area. The standard quality index threshold can be set according to actual conditions, which will not be elaborated here.
[0067] It should be noted that distillation is a common extraction technique that can be used to extract substances from samples. In the process of extracting root-knot nematode eggs, distillation can be used to separate root-knot nematode eggs from samples. Screening method is a commonly used soil sample processing method, which is used to remove impurities, large particles and roots in soil samples for subsequent experiments or analysis. The MAD algorithm is a statistic that measures the degree of discreteness of data. It is calculated with the median density of root-knot nematode eggs as the center point. Compared with the standard deviation, the MAD algorithm is more reliable when there are extreme values or skewness in the egg data set. Multi-head attention is an extended form of the attention mechanism.
[0068] By introducing multiple attention heads, multi-head attention can learn multiple feature representations in parallel, thereby improving the model's expressiveness and learning ability, and is very effective for processing complex sequence data or image data. The query is usually a vector used to measure the relevance of the key to the current element. In the attention mechanism, each query vector is compared with all key vectors to calculate the attention weight. The key is a vector used to represent other elements. The keys in the above steps refer to the soil data scale coefficient T vector, the insect egg scale coefficient C vector, and the idle time scale coefficient K vector. The value is the output vector obtained by weighted combination according to the attention weight. In the attention mechanism, each value vector is multiplied by the corresponding attention weight, and then the result is weighted summed to form the final output.
[0069] In step S3, the crop data can be divided into the root-knot nematode infection degree of the crop in the predicted planting area and the flavonoid content data of the current crop. By comparing the output value vector modulus of the multi-head attention as the predicted planting area quality evaluation index and the standard quality index threshold, the predicted planting area is evaluated. If the predicted planting area is a low-quality planting area, the planting plan of the planting base website can be accessed to obtain the idle time T of the predicted planting area. q The name of the crop that was later changed.
[0070] The current crop to be replanted is screened by accessing the planting history of the predicted planting area. If the planting history of the predicted planting area has a planting record for the current crop to be replanted, the degree of infection of the current crop with root-knot nematodes is analyzed and classified through the planting history of the predicted planting area. Here is a method: the risk is judged by analyzing the size of the root nodules of the current crop to be replanted through the image of the disease of the current crop to be infected with root-knot nematodes in the planting history of the predicted planting area. If the root nodules of the current crop to be replanted are greater than or equal to the root nodule threshold after being infected with root-knot nematodes, the current crop to be replanted is judged to be a crop with high infection risk. If the root nodules of the current crop to be replanted are less than the root nodule threshold after being infected with root-knot nematodes, the current crop to be replanted is judged to be a crop with low infection risk.
[0071] If the planting history of the predicted planting area does not have a planting record for the current crop, the resistance of the current crop to root-knot nematodes can be determined by detecting the content of flavonoids in the current crop, because flavonoids can inhibit root-knot nematodes by interfering with the metabolic activities of root-knot nematodes or affecting internal physiological processes. Infrared spectroscopy can be used to measure the infrared radiation absorbed or scattered by the current crop to analyze its chemical composition. By comparing with known standards, the content of flavonoids in plants can be determined without destructive treatment of samples. If the flavonoids generated by the current crop are higher than or equal to the content threshold, the current crop is judged to be a crop with low infection risk. If the flavonoids generated by the current crop are lower than the content threshold, the current crop is judged to be a crop with high infection risk.
[0072] It should be noted that the planting history of the predicted planting area records the planting of crops in the predicted planting area in the past period of time, including a lot of important information, such as crop types, planting cycles, pests and diseases, etc. The planting history of the predicted planting area can be accessed to analyze the degree of infection of root nematodes in the current crops. Infrared spectroscopy is a commonly used analytical technique that analyzes the chemical composition and structure of a sample by detecting its absorption or scattering of infrared radiation. In the fields of botany and agriculture, infrared spectroscopy can be used to detect and analyze the chemical components in plants, including flavonoids. The nodule threshold and content threshold involved in the above steps are set according to actual conditions.
[0073] In step S4, based on the above judgment results, the crops with high infection risk are given priority control of root-knot nematodes, and the high-quality planting areas or crops with low infection risk are given basic control of root-knot nematodes.
[0074] Basic control of root nematodes can be achieved by heat treatment of the seeds and seedlings of the crops being planted, and the placement of appropriate amounts of pathogenic microorganisms, such as parasitic nematodes, in the planting area.
[0075] The specific steps for the prevention and control of root-knot nematodes are as follows: first manage the soil, keep the soil ventilated and well-drained, and avoid waterlogging. Then add an appropriate amount of organic matter, such as organic fertilizers. Then heat-treat the seeds and seedlings of the crops to be planted, which can kill the root-knot nematodes in the soil.
[0076] It should be noted that the main principle of heat treatment is to destroy the cell structure and physiological functions of root-knot nematodes through high temperature, thereby killing root-knot nematodes. The release of an appropriate amount of pathogenic microorganisms can control the number of root-knot nematodes. Parasitic nematodes can survive by absorbing the nutrients of root-knot nematodes, which inhibits the growth of root-knot nematodes. Avoiding stagnant water can help reduce the occurrence and spread of root-knot nematodes and reduce the accumulation of pests. Adding organic matter can improve the biological activity and structure of the soil, improve the health of the soil, and thus reduce the occurrence of root-knot nematodes.
[0077] This design classifies the planting areas and analyzes the infection risk of the replanted crops to determine what kind of prevention and control measures are needed to control the root-knot nematodes. The planting areas are screened based on the comparison of actual values and various thresholds. For high-quality planting areas, a large number of tests are not required, and basic prevention and control of root-knot nematodes is carried out. For low-quality planting areas, the replanted crops are analyzed based on whether they have a planting history. For replanted crops with a planting history, the infection risk level is determined by analyzing the root nodule pictures of historical root-knot nematode infection. For replanted crops without a planting history, the infection risk level is determined by detecting the resistance to root-knot nematodes in the body. Different crops are controlled separately. This reduces the waste of resources in unified management and greatly improves the planting efficiency of farmers. While being convenient, it can also classify the planting areas more accurately, adding new options for farmers to divide and manage planting bases.
[0078] Example 2
[0079] The present invention also discloses a crop phenotype image recognition system based on attention mechanism optimization, including a data acquisition module, a data analysis module and a data storage module;
[0080] The data acquisition module is used to acquire and collect planting area data and send it to the data analysis module;
[0081] The data analysis module determines the high quality of the planting area based on the planting area data and determines whether the crop should be planted;
[0082] The data storage module is used to store all data in the data processing process of the crop phenotype image recognition system optimized based on the attention mechanism.
[0083] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.
[0084] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product.
[0085] Those of ordinary skill in the art will appreciate that the modules 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.
[0086] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0087] 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.
[0088] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A crop phenotype image recognition method based on attention mechanism optimization, characterized in that: The steps include: Step S1, collecting planting area data, the planting area data including soil data of the planting area, root-knot nematode egg density of the planting area and crop replacement situation of the planting area; Step S2, constructing a prediction planting area quality assessment model by analyzing planting area data to predict soil data of the planting area, predict root-knot nematode egg density of the planting area, and predict crop replacement conditions of the planting area; Step S3, predicting the quality of the planting area by analyzing the predicted planting area quality assessment model, screening out low-quality planting areas and collecting data on currently replanted crops in the low-quality planting areas to analyze the risk of infection with root nematodes, and classifying the currently replanted crops into high-risk crops and low-risk crops; Step S4, based on the classification results, focusing on the prevention and control of root-knot nematodes for crops with high infection risks, and basically preventing and controlling root-knot nematodes for crops in high-quality planting areas or with low infection risks.
2. The crop phenotype image recognition method based on attention mechanism optimization according to claim 1, characterized in that: In step S2, the planting base is divided into multiple planting areas according to the same proportion, and the nitrogen, phosphorus and potassium contents of each planting area are obtained by spectral sensors; the nitrogen, phosphorus and potassium contents of each planting area are accumulated and the average value is taken as the standard soil data; the nitrogen, phosphorus and potassium contents of the predicted planting area obtained by the spectral sensor are compared with the standard soil data to obtain the soil data ratio coefficient T; the root-knot nematode egg density in the planting area is obtained by distillation method; the specific implementation steps are as follows: Select to collect multiple samples at different locations and depths; process the collected soil samples into a fine state by sieving, measure the area of the soil samples and mark it as S, add a sufficient amount of extract to the soil samples to completely immerse the samples; place the soil samples and extract in a distillation device; count the number of root-knot nematode eggs L in the soil sample under a microscope using the distilled material in another container; obtain the root-knot nematode egg density ρ by dividing the number of root-knot nematode eggs L in the soil sample by the area of the soil sample S; repeat the operation, and merge the root-knot nematode egg density of each planting area obtained by calculation into an egg data set Cρ; use the MAD algorithm to further screen the root-knot nematode egg density in the egg data set Cρ; the specific steps are as follows: Calculate the median: Calculate the median of the root-knot nematode egg density in the egg data set and record it as Median(Cρ). Arrange the root-knot nematode egg density in ascending order and find the root-knot nematode egg density in the middle position. Calculate the absolute deviation: For each root-knot nematode egg density, calculate the absolute difference between each root-knot nematode egg density and the median root-knot nematode egg density; Calculate the median absolute deviation: take the median of the absolute difference between all root-knot nematode egg densities and the median of root-knot nematode egg densities to obtain the median absolute deviation MAD. The calculation formula of MAD is as follows: MAD = Median (|Cρ i -Median(Cρ)|), where Cρ i is the i-th data point in the egg data set, i is 1, 2, 3, etc.; Median(Cρ) is the median density of root-knot nematode eggs; The root-knot nematode egg density threshold ρ is set according to the calculated median absolute deviation MAD x =ρ+MAD; Calculate the root-knot nematode egg density ρ in the predicted planting area y , the root-knot nematode egg density ρ in the planting area will be predicted y and the root-knot nematode egg density threshold ρ x The egg ratio coefficient C is obtained by comparison. When the root-knot nematode egg density threshold ρ x The larger the egg ratio coefficient C is, the greater the root-knot nematode egg density ρ in the planting area is predicted. y The larger the egg ratio coefficient C is, the smaller the root-knot nematode egg density ρ in the planting area is predicted. y The smaller.
3. The crop phenotype image recognition method based on attention mechanism optimization according to claim 2, characterized in that: In step S2, the planting plan and schedule are obtained to obtain the harvest time and replanting time of the crops; and the predicted replanting time of the planting area is subtracted from the harvest time to obtain the idle time T of the predicted planting area. q , the idle time T of the planting area will be predicted q The idle time ratio coefficient K is obtained by comparing with the preset standard idle time; the quality assessment model of the predicted planting area is constructed by using the calculated soil data ratio coefficient T, the insect egg ratio coefficient C and the idle time ratio coefficient K; the multi-head attention method in the attention mechanism is used to calculate the quality degree of the predicted planting area; the specific calculation process is as follows: Linear transformation: The soil data ratio coefficient T, the egg ratio coefficient C and the idle time ratio coefficient K are used as three inputs and are respectively transformed through multiple different linear transformation matrices. and Get multiple sets of queries Q i , key K i Sum value V i ; Attention calculation: In each subspace, calculate the attention weight α i : Among them, d k is the dimension of the key; softmax is the activation function that indexes each element in the vector and then normalizes the indexed result to obtain the probability value corresponding to each element; Weighted summation: for each value V in the subspace i Apply attention weight α i :Head i =α i V i ; Multi-Head Splicing: Splice all heads together: MultiHead i (Q, K, V) = Concat (Head1, Head2, Head3); The results of each of the above inputs are concatenated as a head; Final linear transformation: The concatenated result is passed through a linear transformation matrix W again O :MultiHead i (Q, K, V) = Concat (Head1, Head2, Head3)W O ; Get the output sequence MultiHead i (Q, K, V), where Q is the query vector, K is the key vector, and V is the output value vector; the output value vector is modulo as the predicted planting area quality assessment index, and the predicted planting area quality assessment index is compared with the standard quality index threshold. When the predicted planting area quality assessment index is greater than or equal to the standard quality index threshold, the predicted planting area is a high-quality planting area. When the predicted planting area quality assessment index is less than the standard quality index threshold, the predicted planting area is a low-quality planting area.
4. The crop phenotype image recognition method based on attention mechanism optimization according to claim 3, characterized in that: In step S3, the replanted crop data is divided into the root-knot nematode infection degree of the replanted crops in the predicted planting area and the flavonoid content data of the current replanted crops; the predicted planting area is evaluated by comparing the output value vector modulus of the multi-head attention as the predicted planting area quality evaluation index and the standard quality index threshold; if the predicted planting area is a low-quality planting area, the current replanted crops are screened by accessing the planting history of the predicted planting area; if the planting history of the predicted planting area has a planting record for the current replanted crops, the root-knot nematode infection degree of the current replanted crops is analyzed and classified by the planting history of the predicted planting area; Risk judgment is made by predicting the root knot nematode disease image of the current replanted crop in the planting history of the planting area and analyzing the root nodule size of the current replanted crop. If the root nodule of the current replanted crop after being infected with the root knot nematode is greater than or equal to the root nodule threshold, the current replanted crop is judged to be a crop with high infection risk. If the root nodule of the current replanted crop after being infected with the root knot nematode is less than the root nodule threshold, the current replanted crop is judged to be a crop with low infection risk. If the predicted planting history of the planting area has no planting record for the currently replanted crop, the resistance of the currently replanted crop to root nematodes is judged by detecting the content of flavonoids in the currently replanted crop, and the content of flavonoids in the plant is determined; if the flavonoids generated by the currently replanted crop are higher than or equal to the content threshold, the currently replanted crop is judged to be a crop with low infection risk; if the flavonoids generated by the currently replanted crop are lower than the content threshold, the currently replanted crop is judged to be a crop with high infection risk.
5. The crop phenotype image recognition method based on attention mechanism optimization according to claim 4, characterized in that: In step S4, the crops with high infection risk are given priority control of root-knot nematodes, and the crops in high-quality planting areas or with low infection risk are given basic control of root-knot nematodes.
6. A crop phenotype image recognition system based on attention mechanism optimization, used to implement the crop phenotype image recognition system based on attention mechanism optimization according to any one of claims 1 to 5, characterized in that: It includes a data acquisition module, a data analysis module and a data storage module; The data acquisition module is used to acquire and collect planting area data and send it to the data analysis module; The data analysis module determines the high quality of the planting area based on the planting area data and determines whether the crop should be planted; The data storage module is used to store all data in the data processing process of the crop phenotype image recognition system optimized based on the attention mechanism.
