Agricultural product hazards identification method and system imitating the working mode of early warning aircraft

By imitating the working mode of early warning machine, the spectral images of agricultural product samples are used to identify their appearance and spectral characteristics, the identification spatial domain is constructed, the hazardous species of the sample to be tested is identified and the corresponding model is called for early warning, which solves the problem that only a single detection can be achieved in the existing technology, and the simultaneous detection of multiple hazardous substances is realized, which reduces the detection cost.

CN119339246BActive Publication Date: 2025-03-25HEFEI UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411878723.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-03-25
Estimated Expiration
2044-12-19

AI Technical Summary

Technical Problem

The existing technology can only realize a single detection of agricultural product hazards, resulting in a high detection cost.

Method used

The agricultural product hazard identification method is adopted to imitate the working mode of the early warning machine. By obtaining the spectral images of healthy agricultural product samples, identifying appearance and spectral characteristics, building an identification spatial domain, identifying the hazardous species of the sample to be tested, and calling the corresponding identification model for early warning.

Benefits of technology

The simultaneous detection of multiple hazardous substances is achieved, and multiple hazardous species can be identified in just one test, reducing the cost of agricultural product testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119339246B_ABST
    Figure CN119339246B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of agricultural product safety detection, and in particular to a method and system for identifying agricultural product hazards in a simulated early warning machine working mode, wherein the method includes: obtaining a first spectral image of multiple healthy agricultural product samples; identifying the first spectral image to obtain the appearance characteristics and spectral characteristics of multiple healthy agricultural product samples; constructing a first identification space domain and a second identification space domain of agricultural product hazards according to the appearance characteristics and the spectral characteristics; identifying the type of hazard of the agricultural product sample to be tested according to the spatial information of the first identification space domain and the second identification space domain, calling the corresponding hazard identification model according to the type of hazard, and issuing an early warning according to the quantitative identification result of the hazard identification model. Thus, the problem that the existing technology can only realize a single detection of hazards, resulting in high detection costs, etc. is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of agricultural product safety detection, and in particular to a method and system for identifying agricultural product hazards in a manner that simulates the working mode of an early warning aircraft. Background Art

[0002] Agricultural products may be contaminated in different ways during the process of receiving, storing, transporting and processing, and may produce a variety of harmful substances. Traditional detection methods are time-consuming, cumbersome, and costly, and cannot achieve online non-destructive detection. In recent years, with the continuous development of artificial intelligence technology, deep learning technology has made good progress in various fields.

[0003] The current detection methods for agricultural products have a single detection object and cannot complete a single detection and the function of analyzing multiple hazards online at the same time. At the same time, for agricultural product samples, their individual differences are large, and it is difficult to use one model to apply to different hazards. That is, the best model obtained by a modeling method is generally only applicable to a certain hazard. For example, in a color sorter, due to different hazards, a machine may only be able to detect one target object, resulting in high detection costs. Summary of the invention

[0004] The present application provides a method and system for identifying agricultural product hazards in a simulated early warning aircraft working mode, so as to solve the problem that the prior art can only realize a single detection of hazards, resulting in high detection costs.

[0005] The first aspect of the present application provides a method for identifying agricultural product hazards in a simulated early warning aircraft working mode, comprising the following steps: obtaining a first spectral image of a plurality of healthy agricultural product samples; identifying the first spectral image to obtain appearance features and spectral features of the plurality of healthy agricultural product samples; determining a first coordinate origin of the healthy agricultural product in a first spatial domain according to the appearance features, and constructing a first identification spatial domain of agricultural product hazards according to an extraction range of the appearance features and the first coordinate origin; determining a second coordinate origin of the healthy agricultural product in a second spatial domain according to the spectral features, and constructing a second identification spatial domain of agricultural product hazards according to the extraction range and the second coordinate origin of the spectral features; identifying the type of hazard of the agricultural product sample to be tested according to spatial information of the first identification spatial domain and the second identification spatial domain, calling a corresponding hazard identification model according to the type of hazard, and issuing an early warning according to the quantitative identification result of the hazard identification model.

[0006] Optionally, the appearance features include color features, morphological features and texture features, and determining the first coordinate origin of the healthy agricultural products in the first spatial domain based on the appearance features includes: identifying each appearance feature element in the color features, morphological features and texture features; calculating the vector mean of the corresponding appearance feature element based on the feature vector of each appearance feature element, and determining the first coordinate origin of the healthy agricultural products in the first spatial domain based on the vector mean of each appearance feature element.

[0007] Optionally, a first identification spatial domain for agricultural product hazards is constructed based on the extraction range of appearance features and the first coordinate origin, including: identifying a first boundary point set and a second boundary point set for the extraction range of appearance features; calculating a first cosine distance between each point in the first boundary point set and the first coordinate origin, and calculating a second cosine distance between each point in the second boundary point set and the first coordinate origin; constructing a first healthy spatial domain based on the first cosine distance and the second cosine distance, and constructing a first identification spatial domain for agricultural product hazards based on the first healthy spatial domain.

[0008] Optionally, determining the second coordinate origin of the healthy agricultural products in the second spatial domain according to the spectral characteristics includes: identifying each spectral characteristic element in the spectral characteristics; calculating the vector mean of the corresponding spectral characteristic element according to the characteristic vector of each spectral characteristic element, and determining the second coordinate origin of the healthy agricultural products in the second spatial domain according to the vector mean of each spectral characteristic element.

[0009] Optionally, a second identification spatial domain for agricultural product hazards is constructed based on the extraction range of spectral features and the second coordinate origin, including: identifying a third boundary point set and a fourth boundary point set of the extraction range of spectral features; calculating the third cosine distance between each point in the third boundary point set and the second coordinate origin, and calculating the fourth cosine distance between each point in the fourth boundary point set and the second coordinate origin; constructing a second healthy spatial domain based on the third cosine distance and the fourth cosine distance, and constructing a second identification spatial domain for agricultural product hazards based on the second healthy spatial domain.

[0010] Optionally, the type of harmful substances in the agricultural product sample to be tested is identified based on the spatial information of the first identification spatial domain and the second identification spatial domain, including: obtaining a second spectral image of the agricultural product sample to be tested, identifying the second spectral image to obtain the appearance characteristics and spectral characteristics of the agricultural product sample to be tested; calculating the fifth cosine distance between the element vector corresponding to the appearance characteristic and the origin of the first coordinate, and calculating the sixth cosine distance between the element vector corresponding to the spectral characteristic and the origin of the second coordinate; identifying the type of harmful substances in the agricultural product sample to be tested based on the spatial information of the first identification spatial domain, the spatial information of the second identification spatial domain, the fifth cosine distance and the sixth cosine distance.

[0011] Optionally, calling a corresponding hazard identification model according to the type of hazard includes: determining a target hazard identification task according to the type of hazard; switching a variable subset in the feature space of the agricultural product sample to be tested according to the target hazard identification task, wherein the variable subset includes spectral feature elements corresponding to the identified hazard type; obtaining similar training samples of the variable subset, inputting the variable subset and the similar training samples into an error generator, and the error generator outputs a final generalized error, wherein the error generator includes a multi-level cognizer group, and each level of the cognizer group is used to calculate the generalized error of the variable subset and the similar training samples. If the output result of the current level of the cognizer group does not meet the output condition, the cognizer group is switched downward step by step. If the output result of the current level of the cognizer group meets the output condition, the output result of the current level of the cognizer group is used as the final generalized error, otherwise the final generalized error is determined according to the output results of the multi-level cognizer group; the final generalized error is input into a decision maker, and the decision maker outputs a model calling decision, and the corresponding hazard identification model is called from multiple different hazard identification models according to the model calling decision.

[0012] Optionally, the plurality of healthy agricultural product samples are agricultural product samples that meet maturity conditions and agricultural product health conditions, wherein the maturity condition is that the maturity of the plurality of healthy agricultural product samples is consistent.

[0013] The second aspect of the present application provides an agricultural product hazard identification system that simulates the working mode of an early warning aircraft, including: an acquisition module, used to acquire a first spectral image of multiple healthy agricultural product samples; an identification module, used to identify the first spectral image to obtain the appearance characteristics and spectral characteristics of multiple healthy agricultural product samples; a first construction module, used to determine the first coordinate origin of the healthy agricultural product in the first spatial domain according to the appearance characteristics, and construct a first identification spatial domain of agricultural product hazards according to the extraction range of the appearance characteristics and the first coordinate origin; a second construction module, used to determine the second coordinate origin of the healthy agricultural product in the second spatial domain according to the spectral characteristics, and construct a second identification spatial domain of agricultural product hazards according to the extraction range and the second coordinate origin of the spectral characteristics; an early warning module, used to identify the type of hazards of the agricultural product samples to be tested according to the spatial information of the first identification spatial domain and the second identification spatial domain, call the corresponding hazard identification model according to the type of hazard, and issue an early warning according to the quantitative identification result of the hazard identification model.

[0014] Optionally, the appearance features include color features, morphological features and texture features, and the first construction module is further used to: identify each appearance feature element in the color features, morphological features and texture features; calculate the vector mean of the corresponding appearance feature element based on the feature vector of each appearance feature element, and determine the first coordinate origin of the healthy agricultural products in the first spatial domain based on the vector mean of each appearance feature element.

[0015] Optionally, the first construction module is further used to: identify a first boundary point set and a second boundary point set of the extraction range of appearance features; calculate a first cosine distance between each point in the first boundary point set and the first coordinate origin, and calculate a second cosine distance between each point in the second boundary point set and the first coordinate origin; construct a first healthy space domain based on the first cosine distance and the second cosine distance, and construct a first identification space domain of agricultural product hazards based on the first healthy space domain.

[0016] Optionally, the second construction module is further used to: identify each spectral characteristic element in the spectral feature; calculate the vector mean of the corresponding spectral characteristic element according to the characteristic vector of each spectral characteristic element, and determine the second coordinate origin of the healthy agricultural product in the second spatial domain according to the vector mean of each spectral characteristic element.

[0017] Optionally, the second construction module is further used to: identify a third boundary point set and a fourth boundary point set of the extraction range of spectral features; calculate the third cosine distance between each point in the third boundary point set and the second coordinate origin, and calculate the fourth cosine distance between each point in the fourth boundary point set and the second coordinate origin; construct a second healthy space domain based on the third cosine distance and the fourth cosine distance, and construct a second identification space domain of agricultural product hazards based on the second healthy space domain.

[0018] Optionally, the early warning module is further used to: obtain a second spectral image of the agricultural product sample to be tested, identify the second spectral image to obtain the appearance characteristics and spectral characteristics of the agricultural product sample to be tested; calculate the fifth cosine distance between the element vector corresponding to the appearance characteristics and the origin of the first coordinate system, and calculate the sixth cosine distance between the element vector corresponding to the spectral characteristics and the origin of the second coordinate system; identify the type of hazards of the agricultural product sample to be tested based on the spatial information of the first identification space domain, the spatial information of the second identification space domain, the fifth cosine distance and the sixth cosine distance.

[0019] Optionally, the early warning module is further used to: determine the target hazard identification task according to the type of hazard; switch the variable subset in the feature space of the agricultural product sample to be tested according to the target hazard identification task, wherein the variable subset includes the spectral feature elements corresponding to the identified hazard type; obtain similar training samples of the variable subset, input the variable subset and the similar training samples into the error generator, and the error generator outputs a final generalized error, wherein the error generator includes a multi-level cognitive group, and each level of cognitive group is used to calculate the generalized error of the variable subset and the similar training samples. If the output result of the current level cognitive group does not meet the output condition, the cognitive group is switched downward step by step. If the output result of the current level cognitive group meets the output condition, the output result of the current level cognitive group is used as the final generalized error, otherwise the final generalized error is determined according to the output results of the multi-level cognitive group; the final generalized error is input into the decision maker, and the decision maker outputs a model call decision, and the corresponding hazard identification model is called from multiple different hazard identification models according to the model call decision.

[0020] Optionally, the plurality of healthy agricultural product samples are agricultural product samples that meet maturity conditions and agricultural product health conditions, wherein the maturity condition is that the maturity of the plurality of healthy agricultural product samples is consistent.

[0021] The third aspect of the present application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a method for identifying agricultural product hazards in an early warning aircraft working mode as in the above-mentioned embodiment.

[0022] Therefore, this application includes the following beneficial effects:

[0023] The embodiment of the present application can identify the first spectral image of healthy agricultural products to obtain the appearance characteristics and spectral characteristics of multiple agricultural product samples, and construct the first spatial identification domain and the second spatial identification domain of agricultural product hazards according to the appearance characteristics and the spectral characteristics, and then identify the type of hazard of the agricultural product sample to be tested according to the spatial information of the first identification spatial domain and the second identification spatial domain, and call the corresponding hazard identification model according to the type of hazard, and issue an early warning according to the quantitative identification result of the hazard identification model, so as to realize the simultaneous detection of multiple hazards, and only need one detection to identify multiple types of hazards, thereby reducing the cost of agricultural product detection. Therefore, the technical problem that only a single detection of hazards can be realized in the prior art, resulting in high detection costs, etc. is solved.

[0024] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0026] Figure 1 A flowchart of a method for identifying agricultural product hazards in an early warning aircraft working mode according to an embodiment of the present application;

[0027] Figure 2 A flowchart of a command call identification model provided according to an embodiment of the present application;

[0028] Figure 3 The overall flow chart of the agricultural product hazard identification method in the simulated early warning aircraft working mode provided according to the embodiment of the present application;

[0029] Figure 4 A schematic diagram of constructing an identification domain and a detection model according to an embodiment of the present application;

[0030] Figure 5 It is a schematic diagram of the spectral values ​​of wheat vomitoxin and wheat zearalenone provided according to the examples of the present application;

[0031] Figure 6 It is a schematic diagram of the spectral values ​​of Fusarium graminearum and Aspergillus ochraceus of corn provided according to the embodiments of the present application;

[0032] Figure 7 This is an example diagram of an agricultural product hazard identification system that simulates an early warning aircraft working mode provided according to an embodiment of the present application;

[0033] Figure 8 It is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0034] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0035] The following describes the agricultural product hazard identification method and system of the simulated early warning machine working mode of the embodiment of the present application with reference to the accompanying drawings. In view of the problem that the current detection method mentioned in the above background technology has a single detection object and cannot complete one detection, and the function of simultaneously analyzing multiple hazards online leads to high detection costs, the present application provides an agricultural product hazard identification method of the simulated early warning machine working mode, in which the first spectral image of healthy agricultural products can be identified to obtain the appearance characteristics and spectral characteristics of multiple agricultural product samples, and the first spatial identification domain and the second spatial identification domain of agricultural product hazards are constructed according to the appearance characteristics and the spectral characteristics, respectively, and then the hazard type of the agricultural product sample to be tested is identified according to the first identification spatial domain and the second identification spatial domain, and the corresponding hazard identification model is called according to the hazard type, and an early warning is issued according to the quantitative identification result of the hazard identification model, so as to realize the simultaneous detection of multiple hazards, and only one detection is required, that is, multiple hazard types can be identified, and the detection cost of agricultural products is reduced. Thus, the problem that only a single detection of hazards can be realized in the prior art, resulting in high detection costs, is solved.

[0036] Specifically, Figure 1 A flow chart of a method for identifying agricultural product hazards in an early warning aircraft working mode simulating the present application embodiment is provided.

[0037] like Figure 1 As shown, the agricultural product hazard identification method imitating the early warning aircraft working mode includes the following steps:

[0038] In step S101, first spectral images of a plurality of healthy agricultural product samples are acquired.

[0039] Among them, multiple healthy agricultural product samples are agricultural product samples that meet maturity conditions and agricultural product health conditions, among which the maturity condition is that the maturity of multiple healthy agricultural product samples is consistent, and the method for determining healthy agricultural products is conventional technical means.

[0040] It can be understood that the embodiment of the present application can obtain the first spectral images of multiple healthy agricultural product samples in order to subsequently construct a spatial recognition domain, wherein the first spectral image can be obtained by a spectral imaging device.

[0041] In step S102, the first spectral image is identified to obtain appearance features and spectral features of a plurality of healthy agricultural product samples.

[0042] Among them, appearance features include color features, morphological features and texture features. Color features may include brightness L, red-green a, yellow-blue b, etc. Morphological features may include roundness r, area s, length c and width w, etc. Texture features may include contrast g c , correlation r Energy g eand homogeneity g h wait.

[0043] It can be understood that the embodiment of the present application can identify the first spectral image to obtain the appearance characteristics and spectral characteristics of multiple agricultural product samples, so as to subsequently construct the spatial domain.

[0044] In step S103, the first coordinate origin of the healthy agricultural product in the first spatial domain is determined according to the appearance features, and the first identification spatial domain of agricultural product hazards is constructed according to the extraction range of the appearance features and the first coordinate origin.

[0045] Among them, the first spatial domain is the appearance spatial domain.

[0046] It can be understood that the embodiment of the present application can determine the first coordinate origin in the first spatial domain according to the appearance features, and construct the first identification spatial domain of agricultural product hazards according to the extraction range of the appearance features and the first coordinate origin.

[0047] In an embodiment of the present application, determining the first coordinate origin of healthy agricultural products in the first spatial domain based on appearance features includes: identifying each appearance feature element in color features, morphological features, and texture features; calculating the vector mean of the corresponding appearance feature element based on the feature vector of each appearance feature element, and determining the first coordinate origin of the healthy agricultural products in the first spatial domain based on the vector mean of each appearance feature element.

[0048] It can be understood that the embodiments of the present application can identify each appearance feature element in color features, morphological features and texture features, and calculate the vector mean of the corresponding appearance feature element based on the feature vector of each feature element, and then determine the first coordinate origin of healthy agricultural products in the first spatial domain based on the vector mean of each appearance feature element.

[0049] For example, the color features extracted from the spectral image I are [L, a, b]; the morphological features are [r, s, c, w], which represent roundness, area, length, and width respectively; and the texture features are [g c , g r , g e , g h ] represent contrast, correlation, energy, and homogeneity respectively.

[0050] By analyzing the spectral images of N samples, the relevant eigenvalues ​​are extracted, and the spatial coordinates are established, namely brightness (L), red-green saturation (a), yellow-blue saturation (b), roundness (r), area (s), length (c), width (w) and gray-level co-occurrence matrix (g c , g r , g e , g h)’s spatial domain, with 12 features as 12-dimensional coordinate axes, to construct a high-dimensional feature space.

[0051] The spatial coordinate origin (first coordinate origin) of healthy agricultural products in the S1 spatial domain (first spatial domain) is obtained by taking the average value of the characteristic vector elements related to external defects, that is:

[0052] .

[0053] In an embodiment of the present application, a first identification space domain for agricultural product hazards is constructed based on an extraction range of appearance features and a first coordinate origin, including: identifying a first boundary point set and a second boundary point set for the extraction range of appearance features; calculating a first cosine distance between each point in the first boundary point set and the first coordinate origin, and calculating a second cosine distance between each point in the second boundary point set and the first coordinate origin; constructing a first healthy space domain based on the first cosine distance and the second cosine distance, and constructing a first identification space domain for agricultural product hazards based on the first healthy space domain.

[0054] It can be understood that the embodiments of the present application can identify the first boundary point set and the second boundary point set of the extraction range of the appearance features, and calculate the first cosine distance between each point in the first boundary point set and the first coordinate origin, calculate the second cosine distance between each point in the second boundary point set and the first coordinate origin, construct a first healthy space domain based on the first cosine distance and the second cosine distance, and construct a first identification space domain of agricultural product hazards based on the first healthy space domain.

[0055] For example, in N samples, the range of image features extracted from spectral images is [L-e1 L +e2], [a-e3a+e4], [b-e5b+e6]…, then the boundary point (first boundary point) of the minimum eigenvalue in the high-dimensional space is defined as O e1 ( L -e1, a-e3, b-e5, ..., -e 23 ) is recorded as , the maximum eigenvalue at the boundary point (second boundary point) of the high-dimensional space is O e2 ( L +e2, a+e4, b+e6, ..., +e 24 ), denoted as ,but (the first coordinate origin) and O e1 , With O e2 The cosine distances are respectively the first cosine distance D1 and the second cosine distance D2.

[0056] The cosine distance is:

[0057] D1= , D2= .

[0058] Any point in the 12-dimensional first space domain high-dimensional space ,if and The cosine distance D n satisfy , then the area formed by all relevant points is the first health space domain, and Defined as the spatial domain to be identified (the first identified spatial domain).

[0059] In step S104, the second coordinate origin of the healthy agricultural product in the second spatial domain is determined according to the spectral feature, and the second identification spatial domain of agricultural product hazards is constructed according to the extraction range of the spectral feature and the second coordinate origin.

[0060] The second spatial domain is composed of spectral signals.

[0061] It can be understood that the embodiment of the present application can determine the second coordinate origin in the second spatial domain according to the spectral characteristics, and construct a second identification spatial domain for agricultural product hazards according to the extraction range of the spectral characteristics and the second coordinate origin.

[0062] In the embodiment of the present application, the spectral characteristics of agricultural products can be extracted by preprocessing technology (filtering, denoising, normalization, etc.). For example, m typical spectral characteristic bands of agricultural products extracted by preprocessing technology are [l1, l2, l3, ..., l m ], which respectively represent the reflectivity of the target in m bands from 405nm to 1700nm.

[0063] In an embodiment of the present application, determining the second coordinate origin of healthy agricultural products in the second spatial domain based on spectral features includes: identifying each spectral characteristic element in the spectral features; calculating the vector mean of the corresponding spectral characteristic element based on the characteristic vector of each spectral characteristic element, and determining the second coordinate origin of the healthy agricultural products in the second spatial domain based on the vector mean of each spectral characteristic element.

[0064] It can be understood that the embodiments of the present application can identify each spectral characteristic element in the spectral characteristics, and calculate the vector mean of the corresponding spectral characteristic element based on the characteristic vector of each spectral characteristic element, and then determine the second coordinate origin of healthy agricultural products in the second spatial domain based on the vector mean of each spectral characteristic element.

[0065] For example, extracting spectral feature elements [l1,l2,l3,…,l m ], the second coordinate origin is:

[0066] is the coordinate origin of the m-dimensional space.

[0067] In an embodiment of the present application, a second identification space domain for agricultural product hazards is constructed based on the extraction range of spectral features and the second coordinate origin, including: identifying a third boundary point set and a fourth boundary point set of the extraction range of spectral features; calculating a third cosine distance between each point in the third boundary point set and the second coordinate origin, and calculating a fourth cosine distance between each point in the fourth boundary point set and the second coordinate origin; constructing a second healthy space domain based on the third cosine distance and the fourth cosine distance, and constructing a second identification space domain for agricultural product hazards based on the second healthy space domain.

[0068] It can be understood that the embodiments of the present application can use a third boundary point set and a fourth boundary point set of the extraction range of spectral features, and calculate the first cosine distance between each point in the third boundary point set and the second coordinate origin, calculate the second cosine distance between each point in the fourth boundary point set and the second coordinate origin, construct a second healthy space domain based on the third cosine distance and the fourth cosine distance, and construct a second identification space domain for agricultural product hazards based on the second healthy space domain.

[0069] For example, in N samples, the range of each feature extracted from the spectral image is [ l 1-e1 l 1+e2],[ l 2-e3 l 2+e4],[ l 3-e5 l 3+e6]…, then the boundary point (third boundary point) of the minimum eigenvalue in the high-dimensional space is defined as O e3 ( l 1-e 1’ , l 2-e 3’ , l 3-e 5’ , …, l m –e m’ ) is recorded as , the maximum eigenvalue at the boundary point (the fourth boundary point) of the high-dimensional space is O e4 ( l +e2,a+e4,b+e6,…, +e 24 ), denoted as .but (second coordinate origin) and O e3 , With O e4 The cosine distances are respectively the third cosine distance D3 and the fourth cosine distance D4.

[0070] D3= , D4= .

[0071] Any point in m-dimensional high-dimensional space ,if and The cosine distance D n satisfy , then the area formed by all relevant points is the second health space domain, and Defined as the spatial domain to be identified (the second identification spatial domain).

[0072] In step S105, the types of hazards in the agricultural product sample to be tested are identified based on the spatial information of the first identification space domain and the second identification space domain, the corresponding hazard identification model is called according to the hazard type, and an early warning is issued according to the quantitative identification result of the hazard identification model.

[0073] It can be understood that the embodiments of the present application can identify the types of hazards in the agricultural product samples to be tested based on the spatial information of the first identification space domain and the second identification space domain, call the corresponding hazard identification model according to the type of hazard, and then issue an early warning based on the quantitative identification results of the hazard identification model to achieve simultaneous detection of multiple hazards. Only one test is needed to identify multiple types of hazards, thereby reducing the cost of agricultural product testing.

[0074] In an embodiment of the present application, the type of harmful substances in the agricultural product sample to be tested is identified based on the spatial information of the first identification space domain and the second identification space domain, including: obtaining a second spectral image of the agricultural product sample to be tested, identifying the second spectral image to obtain the appearance characteristics and spectral characteristics of the agricultural product sample to be tested; calculating the fifth cosine distance between the element vector corresponding to the appearance characteristic and the origin of the first coordinate, and calculating the sixth cosine distance between the element vector corresponding to the spectral characteristic and the origin of the second coordinate; identifying the type of harmful substances in the agricultural product sample to be tested based on the spatial information of the first identification space domain, the spatial information of the second identification space domain, the fifth cosine distance and the sixth cosine distance.

[0075] It can be understood that the embodiment of the present application can obtain the second spectral image of the agricultural product to be tested, identify the second spectral image to obtain the appearance characteristics and spectral characteristics of the agricultural product sample to be tested, and calculate the fifth cosine vector of the element vector corresponding to the appearance characteristics and the first coordinate origin, calculate the sixth cosine distance between the element vector corresponding to the spectral characteristics and the second coordinate origin, and identify the type of hazard of the agricultural product sample to be tested based on the spatial information of the first identification space domain, the spatial information of the second identification space domain, the fifth cosine distance and the sixth cosine distance.

[0076] Specifically: Get the i-th sample S to be tested ti The spectral image is analyzed to extract the spectrum and image features of the sample to be tested, and the external defect feature vector is formed as Ti = [L, a, b, r, s, c, w, g c , g r , g e , g h ], spectral feature vector U i = By calculating the external quality cosine distance (fifth cosine distance) and the cosine distance of the spectral space (sixth cosine distance), it is determined whether the sample is within the identification space domain, and the type of hazard present in the sample to be tested is identified by distance. If it is within the identification space domain, the subsequent hazard identification model is called.

[0077] In an embodiment of the present application, a corresponding hazard identification model is called according to the type of hazard, including: determining a target hazard identification task according to the type of hazard; switching a variable subset in the feature space of the agricultural product sample to be tested according to the target hazard identification task, wherein the variable subset includes spectral feature elements corresponding to the hazard type identified; obtaining similar training samples of the variable subset, inputting the variable subset and the similar training samples into an error generator, and the error generator outputs a final generalized error, wherein the error generator includes a multi-level cognitive device group, and each level of cognitive device group is used to calculate the generalized error of the variable subset and the similar training samples. If the output result of the current level cognitive device group does not meet the output condition, the cognitive device group is switched downward step by step. If the output result of the current level cognitive device group meets the output condition, the output result of the current level cognitive device group is used as the final generalized error, otherwise the final generalized error is determined according to the output results of the multi-level cognitive device group; the final generalized error is input into a decision maker, and the decision maker outputs a model call decision, and the corresponding hazard identification model is called from multiple different hazard identification models according to the model call decision.

[0078] It is understandable that the embodiment of the present application calls the corresponding hazard identification model according to the type of hazard, including:

[0079] Determine the target hazard identification task according to the type of hazard, and switch the variable subset in the feature space of the agricultural product sample to be tested according to the target hazard identification task, that is, select different feature space variables for recognition;

[0080] Obtain similar training samples of the variable itself, input the variable subset and the similar training samples into the error generator, and the error generator outputs the final generalized error generator including a multi-level cognitive group, each level of cognitive group is used to calculate the generalized error of the variable subset and the similar training samples, if the output result of the current level cognitive group does not meet the output condition, then switch the cognitive group down step by step, if the output result of the current level cognitive group meets the output condition, then use the output result of the current level cognitive group as the final generalized error, otherwise determine the final generalized error according to the output results of the multi-level cognitive group;

[0081] The final generalized error is input into the decision maker, and the decision maker outputs a model calling decision. According to the model calling decision, a corresponding hazard identification model is called from a plurality of different hazard identification models.

[0082] Specifically, the embodiments of the present application switch different feature space variable subsets selected in the feature space for recognition according to different hazard identification tasks; the feedback layer realizes the calculation and feedback correction of cognitive errors by defining generalized errors. The generalized error is generated by the statistical error results of the N most similar training sample data and the features of the data to be recognized that are recognized. Each level of the cognitive device group constructs a corresponding generalized error in the feedback layer, which is judged by the output judgment module according to the preset reasoning decision criteria together with the quality recognition results. If the previous level of the cognitive device group does not meet the output conditions, it switches downward step by step. The generalized error is also generated based on the statistical error results of the N most similar training sample data and the features of the data to be recognized that are recognized.

[0083] According to the information analysis and the results of the hazard type identification, the corresponding recognition models are called. The command calling process includes training set construction, data preprocessing, extraction and selection of spectral image features and spectral wavelength features based on supervised learning, cognitive design, generalized error generator design, decision maker strategy design and output judgment strategy design. The process of command calling recognition model is as follows: Figure 2 As shown, the mapping from data space to feature space is realized according to the optimal feature extraction parameters obtained in the training part. The recognition model is a different recognition model obtained by the training layer through a supervised learning method for the training samples, and is selected according to the generalized error of the feedback; the decision call layer decision maker is mainly used to preset the default decision rule, and according to different hazard identification tasks, to switch the different feature space variable subsets selected in the feature space for cognition; the feedback layer realizes the calculation and feedback correction of cognitive errors by defining the generalized error. The generalized error is generated by the statistical error results of the most similar N training sample data and the features of the data to be recognized obtained from the cognition of the data to be recognized. Each level of cognitive device group constructs the corresponding generalized error in the feedback layer, and together with the quality recognition results, it is judged by the output judgment module according to the preset reasoning decision criteria. If the previous level cognitive device group does not meet the output conditions, it will switch down step by step. The generalized error is also generated according to the statistical error results of the most similar N training sample data and the features of the data to be recognized obtained from the cognition of the data to be recognized. If none of the above 4 levels of cognitive device groups can meet the output conditions, then according to the statistical error results of error generators 1 to 4. The stability of the model can be judged by taking the error trend constructed by the error generator as a feature, and the calculation of the error trend is sent to the output judgment module to judge the final result of the output hazard cognition while realizing the stability monitoring of the intelligent cognitive model.

[0084] According to the agricultural product hazard identification method that simulates the early warning aircraft working mode proposed in the embodiment of the present application, the first spectral image of healthy agricultural products can be identified to obtain the appearance characteristics and spectral characteristics of multiple agricultural product samples, and the first spatial identification domain and the second spatial identification domain of agricultural product hazards are constructed according to the appearance characteristics and the spectral characteristics respectively. Then, the type of hazard in the agricultural product sample to be tested is identified according to the spatial information of the first identification spatial domain and the second identification spatial domain, and the corresponding hazard identification model is called according to the type of hazard, and an early warning is issued according to the quantitative identification result of the hazard identification model, so as to realize the simultaneous detection of multiple hazards. Only one detection is needed to identify multiple types of hazards, thereby reducing the cost of agricultural product detection.

[0085] The following is a specific example to describe the agricultural product hazard identification method that simulates the early warning aircraft working mode of the embodiment of the present application, which includes two levels: offline modeling and online detection. The offline modeling includes two detection indicators: external quality and internal quality of crops. The online identification is divided into four steps: data collection, discrimination and warning, model command, and warning release.

[0086] 1. Offline Modeling

[0087] The main tasks are to collect feature information, i.e., obtain crop spectral images, machine learning modeling, construct feature database, and set warning thresholds for harmful substances. Offline model construction includes the selection of training algorithms and model parameters. Different supervised learning algorithms are used in the offline training process, such as support vector machines, BP neural networks, random forests, etc., to obtain different detection models.

[0088] 2. Online Identification

[0089] 1. The main tasks are to complete early warning work, namely, acquisition of crop spectral images, determination of hazard thresholds, determination of hazard categories, and quantitative analysis of hazards.

[0090] 2. The color, morphology, surface smoothness, and full-band spectral reflectance extracted from the spectral images of healthy crops are used as features, and the threshold range of healthy agricultural products is constructed through information entropy.

[0091] 3. Realize online real-time quality detection, including cognitive output layer, decision layer and feedback layer.

[0092] The cognitive output layer preprocesses the spectral data and images of the multispectral images to be recognized, and uses the Savitzky2Golay convolution derivative method and the Gabor filter method to extract quality-related features, and then realizes the mapping from data space to feature space based on the optimal feature extraction parameters obtained in the training part. The cognitive model is the cognitive model obtained by the training layer through a supervised learning method for the training samples, and it can be selected here based on the generalized error of the feedback;

[0093] The decision layer decision maker is mainly used to pre-set default decision rules and switch different feature space variable subsets selected in the feature space for cognition according to different quality recognition tasks;

[0094] The feedback layer realizes the calculation and feedback correction of cognitive errors by defining generalized errors. The generalized error is generated by the statistical error results of the N most similar training sample data and the features of the data to be recognized. Each level of cognitive device group constructs the corresponding generalized error in the feedback layer, and together with the quality recognition results, it is judged by the output judgment module according to the preset reasoning decision criteria. If the previous level cognitive device group does not meet the output conditions, it switches down step by step, and the generalized error is also generated according to the statistical error results of the N most similar training sample data and the features of the data to be recognized. If none of the above 4 levels of cognitive device groups can meet the output conditions, the statistical error results of error generators 1 to 4 are used. The stability judgment of the model can be judged by the error trend constructed by the error generator as a feature, and the calculation of the error trend is sent to the output judgment module, so as to judge and output the final result of crop quality recognition while realizing the stability monitoring of the intelligent cognitive model.

[0095] The overall process is as follows Figure 3 As shown, the following steps are included:

[0096] S100: Identification domain establishment, constructing the agricultural product hazard identification space domain based on the characteristics of agricultural product spectral images in the cloud: Obtain N healthy agricultural product samples with consistent maturity, extract the color, morphology, texture, and spectral information of the samples, and construct a healthy high-dimensional spatial domain of agricultural product spectral images based on the Euclidean norm. Suppose the spectral image of the agricultural product is I, the color feature is [L, a, b]; the morphological feature is [r, a, c, w], which represent roundness, area, length, and width respectively; the texture feature is [g c , g r , g e , g h ] represent contrast, correlation, energy, and homogeneity respectively; the m typical spectral characteristic bands of agricultural products extracted by preprocessing technology are [l1,l2,l3,…,l m ], which respectively represent the reflectivity of the target in m bands from 405nm to 1700nm.

[0097] Establish the recognition domain, the construction of the recognition domain and the detection model is as follows Figure 4 As shown:

[0098] S1 is the first spatial domain used for external defect recognition, that is, the sample feature points do not fall on the healthy points in the first spatial domain. By analyzing the spectral images of N samples, the relevant eigenvalues ​​are extracted and the spatial coordinates are established, which are brightness (L), red-green saturation (a), yellow-blue saturation (b), roundness (r), area (s), length (c), width (w) and gray-level co-occurrence matrix (g c , g r , g e , g h )’s spatial domain, with 12 features as 12-dimensional coordinate axes, to construct a high-dimensional feature space.

[0099] The spatial coordinate origin of healthy agricultural products in the S1 space domain is obtained by taking the average value of the characteristic vector elements related to external defects, that is:

[0100]

[0101] In N samples, the range of image features extracted from spectral images is [L-e1 L +e2], [a-e3a+e4], [b-e5b+e6]…[g h -e 23 g h +e 24 ], then the boundary point of the minimum eigenvalue in the high-dimensional space is defined as O e1 ( L -e1, a-e3, b-e5, ..., -e 23 ) is recorded as , the maximum eigenvalue is at the boundary point of the high-dimensional space. e2 ( L +e2,a+e4,b+e6,…, +e 24 ), denoted as .but With O e1 , With O e2 The cosine distances are D1 and D2 respectively.

[0102] The cosine distance is:

[0103] D1= , D2= .

[0104] Any point in 12-dimensional high-dimensional space ,if and The cosine distance D n satisfy , then the area formed by all relevant points is the healthy space domain used to detect the appearance of agricultural products. Defined as the spatial domain to be identified (the first identified spatial domain).

[0105] Similarly, for spectral information, a high-dimensional space is constructed as the second spatial domain of internal quality, where the second spatial domain is composed of spectral signals. is the coordinate origin of the m-dimensional second space domain space. In N samples, the range of each feature extracted from the spectral signal is [ l 1-e1 l 1+e2],[ l 2-e3 l 2+e4],[ l 3-e5 l 3+e6]…, then the boundary point of the minimum eigenvalue in the high-dimensional space is defined as O e3 ( l 1-e 1’ , l 2-e 3’ , l 3-e 5’ , …, l m –e m’ ) is recorded as , the maximum eigenvalue is at the boundary point of the high-dimensional space. e4 ( l +e2,a+e4,b+e6,…, +e 24 ), denoted as .but With O e3 , With O e4 The cosine distances are D3 and D4 respectively.

[0106] D3= , D4= .

[0107] Any point in the m-dimensional high-dimensional second space domain space ,if and The cosine distance D n satisfy , then the area formed by all relevant points is the healthy space domain used to detect the internal quality of agricultural products. Defined as the spatial domain to be identified (the second identification spatial domain).

[0108] S110: Information collection, i.e., spectral image acquisition and feature extraction of the agricultural products to be tested: mainly including visible-near infrared composite light source and imaging unit, light source control unit, image processing unit, etc. The present application adopts a conveyor belt structure device, preferably m typical wavelength LED combination composite light sources, and adopts PWM drive to realize time-sharing control, lighting up the LEDs in turn. For example, for the detection of vomitoxin in wheat seeds, an adjustable bandwidth PWM drive LED digital visual light source dimming dedicated 4-channel controller can be used, and the LED light source is selected as four of each of 405nm, 550nm, 580nm, 680nm, 730nm, and 980nm in the visible to near infrared band, arranged in a square.

[0109] S120: Discrimination and warning: mainly includes distinguishing the types of hazards at points in the high-dimensional recognition space domain of the sample to be tested. First, obtain the i-th sample S to be tested. ti The spectral image is analyzed to extract the spectrum and image features of the sample to be tested, and the external defect feature vector is formed as T i = [L, a, b, r, a, c, w, g c , g r , g e , g h ],U i = , by calculating the cosine distance D of the first spatial domain of the external quality 1ti and the cosine distance D of the second space of internal quality 2ti , determine whether the sample is within the identification space domain, and identify the type of hazards present in the sample by distance. For external quality hazards, For internal quality hazards, the sample mycotoxin hazards are classified according to the cosine distance from the sample to the origin of the coordinates of the second space domain, and the identification model is called in the identification space domain.

[0110] S130: Model command, process as Figure 2 As shown in the figure: According to different hazard identification tasks, different feature space variable subsets selected in the feature space are switched for cognition; the feedback layer realizes the calculation and feedback correction of cognitive errors by defining the generalized error entropy. ti In the The latent semantic entropy of the quality prediction error in the sub-feedback recognition process can be defined as:

[0111] ;

[0112] is the latent semantic entropy, is the sample quality indicator, for A business set,u is the dimension of the training sample, The same cognitive category is randomly sampled to expand the error semantic domain of the training data set, is the number of training samples, The smaller the value, the smaller the detection error. The generalized error is generated by the statistical error results of the N most similar training sample data and the features of the data to be recognized. Each level of cognitive group constructs the corresponding generalized error in the feedback layer, and together with the quality recognition results, it is judged by the output judgment module according to the preset reasoning decision criteria. If the cognitive group of the previous level does not meet the output conditions, it switches down step by step. The generalized error is also generated based on the statistical error results of the N most similar training sample data and the features of the data to be recognized.

[0113] According to the information analysis and the results of the hazard type identification, the corresponding recognition models are called. The command calling process includes training set construction, data preprocessing, extraction and selection of spectral image features and spectral wavelength features based on supervised learning, cognitive design, generalized error generator design, decision maker strategy design and output judgment strategy design. Figure 2 As shown, the mapping from data space to feature space is realized according to the optimal feature extraction parameters obtained in the training part. The recognition model is a different recognition model obtained by the training layer through a supervised learning method for the training samples, and is selected according to the generalized error of the feedback; the decision call layer decision maker is mainly used to preset the default decision rule, and according to different hazard identification tasks, to switch the different feature space variable subsets selected in the feature space for cognition; the feedback layer realizes the calculation and feedback correction of cognitive errors by defining the generalized error. The generalized error is generated by the statistical error results of the most similar N training sample data and the features of the data to be recognized obtained from the cognition of the data to be recognized. Each level of cognitive device group constructs the corresponding generalized error in the feedback layer, and together with the quality recognition results, it is judged by the output judgment module according to the preset reasoning decision criteria. If the previous level cognitive device group does not meet the output conditions, it will switch down step by step. The generalized error is also generated according to the statistical error results of the most similar N training sample data and the features of the data to be recognized obtained from the cognition of the data to be recognized. If none of the above 4 levels of cognitive device groups can meet the output conditions, then according to the statistical error results of error generators 1 to 4. The stability of the model can be judged by taking the error trend constructed by the error generator as a feature, and the calculation of the error trend is sent to the output judgment module to judge the final result of the output hazard cognition while realizing the stability monitoring of the intelligent cognitive model.

[0114] S140: Warning release: The results of cloud model recognition are transmitted to the terminal, which determines the warning level based on the identified types of hazards and the quantitative values ​​of the hazards. For fungal toxins exceeding the standard by less than 20%, it is a fourth-level warning; 20% to 50% is a third-level warning, 50% to 100% is a second-level warning, and more than 100% is a first-level warning.

[0115] Furthermore, model building parameters need to include environmental parameters such as temperature and humidity.

[0116] Furthermore, preprocessing the spectral image data includes: filtering, denoising, and normalizing the spectral image data.

[0117] In summary, the agricultural product hazard identification method of the embodiment of the present application that simulates the early warning aircraft mode constructs information collection, target locking, and command decision-making. The hazard identification system of the early warning output constructs the identification area of ​​the target to be detected through the extracted feature vector and establishes a command decision-making system, which mainly includes: spectral image preprocessing, definition of high-dimensional recognition domain, feedback-based recognition model construction, and command decision-making framework construction.

[0118] It can imitate the working mode of early warning aircraft. First, it constructs the recognition space domain based on the high-dimensional feature space constructed by the sample images and spectra of agricultural product samples at different wavelengths. The category of the sample is determined according to the coordinate points and positions of the sample to be identified in the high-dimensional space. The relevant recognition model is called according to the sample category, and finally the recognition result is quantified and output.

[0119] It can solve the problem that the current detection method has a single detection object and cannot complete a single detection, and realize the function of simultaneous online analysis of multiple hazards. It can also solve the problem that many current optical detection equipment models can only target one hazard, resulting in high costs and inability to promote. Hazards can be classified according to the feedback correction function, achieving the purpose of selecting the best model for different hazards, and improving the efficiency and accuracy of model recognition.

[0120] The following embodiment takes wheat hazard identification as an example to describe the agricultural product hazard identification method of the present application that simulates the early warning aircraft working mode.

[0121] 1. Establish a high-dimensional spatial recognition domain of spectral images of healthy wheat offline, and use multispectral imaging and deep learning algorithms to establish a prediction model for different wheat hazards.

[0122] 2. Obtain the wheat sample to be tested, and use the integrating sphere light source imaging system to send the wheat sample to the multispectral imaging system through a conveyor belt. Perform multispectral imaging on the wheat sample to be tested, and determine whether the sample is within the feature space recognition domain through the cosine distance function definition.

[0123] 3. Construct identification models for different hazards of various agricultural products, and establish the best identification model on the server cloud through offline deep learning training. For example, for wheat samples, it can include vomitoxin identification model Mo, aflatoxin identification model Mh, zearalenone identification model Mc, etc. Among them, the spectral values ​​of wheat vomitoxin and wheat zearalenone are as follows Figure 5 As shown in Figure 2, the spectral values ​​of Fusarium graminearum and Aspergillus ochraceus of wheat and corn are as follows: Figure 6 shown.

[0124] In general, first obtain the spectral image of the wheat sample to be identified, and then extract the 12-dimensional image morphological feature vector and spectral feature vector from the wheat sample spectral image. According to the knowledge learned offline, the spectral feature vector can be defined as 19 bands from 405nm to 980nm. Calculate the position of the image morphological feature vector and spectral feature vector of the sample to be tested in the feature space, and analyze its cosine distance to the origin of the coordinate system to determine whether it is within the identification domain. Within the identification domain, analyze which hazard is closer to the distance, call the identification model of the hazard, perform quantitative analysis, and output its identification result.

[0125] Next, the agricultural product hazard identification system imitating the early warning aircraft working mode proposed in the embodiment of the present application is described with reference to the accompanying drawings.

[0126] Figure 7 It is a block diagram of a system for identifying agricultural product hazards in an early warning aircraft-like working mode according to an embodiment of the present application.

[0127] like Figure 7 As shown, the agricultural product hazard identification system 10 simulating the early warning aircraft working mode includes: an acquisition module 100 , an identification module 200 , a first construction module 300 , a second construction module 400 and an early warning module 500 .

[0128] Among them, the acquisition module 100 is used to obtain the first spectral image of multiple healthy agricultural product samples; the identification module 200 is used to identify the first spectral image to obtain the appearance characteristics and spectral characteristics of multiple healthy agricultural product samples; the first construction module 300 is used to determine the first coordinate origin of the healthy agricultural products in the first spatial domain according to the appearance characteristics, and construct the first identification spatial domain of agricultural product hazards according to the extraction range of the appearance characteristics and the first coordinate origin; the second construction module 400 is used to determine the second coordinate origin of the healthy agricultural products in the second spatial domain according to the spectral characteristics, and construct the second identification spatial domain of agricultural product hazards according to the extraction range of the spectral characteristics and the second coordinate origin; the early warning module 500 is used to identify the type of hazards of the agricultural product samples to be tested according to the spatial information of the first identification spatial domain and the second identification spatial domain, call the corresponding hazard identification model according to the type of hazard, and issue an early warning based on the quantitative identification result of the hazard identification model.

[0129] In the embodiment of the present application, the appearance features include color features, morphological features and texture features, and the first construction module 300 is further used to: identify each appearance feature element in the color features, morphological features and texture features; calculate the vector mean of the corresponding appearance feature element according to the feature vector of each appearance feature element, and determine the first coordinate origin of the healthy agricultural products in the first spatial domain according to the vector mean of each appearance feature element.

[0130] In an embodiment of the present application, the first construction module 300 is further used to: identify a first boundary point set and a second boundary point set of the extraction range of appearance features; calculate a first cosine distance between each point in the first boundary point set and the first coordinate origin, and calculate a second cosine distance between each point in the second boundary point set and the first coordinate origin; construct a first healthy space domain based on the first cosine distance and the second cosine distance, and construct a first identification space domain of agricultural product hazards based on the first healthy space domain.

[0131] In an embodiment of the present application, the second construction module 400 is further used to: identify each spectral characteristic element in the spectral feature; calculate the vector mean of the corresponding spectral characteristic element based on the characteristic vector of each spectral characteristic element, and determine the second coordinate origin of the healthy agricultural product in the second spatial domain based on the vector mean of each spectral characteristic element.

[0132] In an embodiment of the present application, the second construction module 400 is further used to: identify a third boundary point set and a fourth boundary point set of the extraction range of spectral features; calculate the third cosine distance between each point in the third boundary point set and the second coordinate origin, and calculate the fourth cosine distance between each point in the fourth boundary point set and the second coordinate origin; construct a second healthy space domain based on the third cosine distance and the fourth cosine distance, and construct a second identification space domain for agricultural product hazards based on the second healthy space domain.

[0133] In an embodiment of the present application, the early warning module 500 is further used to: obtain a second spectral image of the agricultural product sample to be tested, identify the second spectral image to obtain the appearance characteristics and spectral characteristics of the agricultural product sample to be tested; calculate the fifth cosine distance between the element vector corresponding to the appearance characteristics and the origin of the first coordinate system, and calculate the sixth cosine distance between the element vector corresponding to the spectral characteristics and the origin of the second coordinate system; identify the type of harmful substances in the agricultural product sample to be tested based on the spatial information of the first identification space domain, the spatial information of the second identification space domain, the fifth cosine distance and the sixth cosine distance.

[0134] In an embodiment of the present application, the early warning module 500 is further used to: determine a target hazard identification task according to the type of hazard; switch a variable subset in the feature space of the agricultural product sample to be tested according to the target hazard identification task, wherein the variable subset includes spectral feature elements corresponding to the identified hazard type; obtain similar training samples of the variable subset, input the variable subset and the similar training samples into an error generator, and the error generator outputs a final generalized error, wherein the error generator includes a multi-level cognitive group, and each level of cognitive group is used to calculate the generalized error of the variable subset and the similar training samples. If the output result of the current level cognitive group does not meet the output condition, the cognitive group is switched downward step by step. If the output result of the current level cognitive group meets the output condition, the output result of the current level cognitive group is used as the final generalized error, otherwise the final generalized error is determined according to the output results of the multi-level cognitive group; the final generalized error is input into a decision maker, and the decision maker outputs a model call decision, and the corresponding hazard identification model is called from multiple different hazard identification models according to the model call decision.

[0135] In an embodiment of the present application, the plurality of healthy agricultural product samples are agricultural product samples that meet maturity conditions and agricultural product health conditions, wherein the maturity condition is that the maturity of the plurality of healthy agricultural product samples is consistent.

[0136] It should be noted that the aforementioned explanation of the embodiment of the method for identifying agricultural product hazards in an early warning aircraft working mode is also applicable to the agricultural product hazard identification system in an early warning aircraft working mode of this embodiment, and will not be repeated here.

[0137] According to the agricultural product hazard identification system that simulates the early warning aircraft working mode proposed in the embodiment of the present application, the first spectral image of healthy agricultural products can be identified to obtain the appearance characteristics and spectral characteristics of multiple agricultural product samples, and the first spatial identification domain and the second spatial identification domain of agricultural product hazards are constructed according to the appearance characteristics and the spectral characteristics respectively. Then, the type of hazard in the agricultural product sample to be tested is identified according to the spatial information of the first identification spatial domain and the second identification spatial domain, and the corresponding hazard identification model is called according to the type of hazard, and an early warning is issued according to the quantitative identification result of the hazard identification model, so as to realize the simultaneous detection of multiple hazards. Only one detection is needed to identify multiple types of hazards, thereby reducing the cost of agricultural product detection.

[0138] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:

[0139] A memory 801 , a processor 802 , and a computer program stored in the memory 801 and executable on the processor 802 .

[0140] When the processor 802 executes the program, the agricultural product hazard identification method simulating the early warning aircraft working mode provided in the above embodiment is implemented.

[0141] Furthermore, the electronic device further comprises:

[0142] The communication interface 803 is used for communication between the memory 801 and the processor 802 .

[0143] The memory 801 is used to store computer programs that can be executed on the processor 802 .

[0144] The memory 801 may include a high-speed RAM (Random Access Memory) memory, and may also include a non-volatile memory, such as at least one disk memory.

[0145] If the memory 801, the processor 802 and the communication interface 803 are implemented independently, the communication interface 803, the memory 801 and the processor 802 can be connected to each other through a bus and communicate with each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0146] Optionally, in a specific implementation, if the memory 801, the processor 802 and the communication interface 803 are integrated on a chip, the memory 801, the processor 802 and the communication interface 803 can communicate with each other through an internal interface.

[0147] The processor 802 may be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application.

[0148] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0149] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0150] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0151] It should be understood that the various parts of the present application can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, the steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array, a field programmable gate array, etc.

[0152] A person of ordinary skill in the art may understand that all or part of the steps carried by the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the above-mentioned program may be stored in a computer-readable storage medium, which, when executed, includes one of the steps of the method embodiment or a combination thereof.

[0153] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A method for identifying agricultural product hazards in an AWACS-like working mode, characterized in that: The following steps are involved: acquiring first spectral images of a plurality of healthy agricultural product samples; Recognize the first spectral image to obtain appearance characteristics and spectral characteristics of the plurality of healthy agricultural product samples; Determine the first coordinate origin of the healthy agricultural product in the first spatial domain according to the appearance feature, and construct a first identification spatial domain of agricultural product hazards according to the extraction range of the appearance feature and the first coordinate origin; Determine a second coordinate origin of the healthy agricultural product in the second spatial domain according to the spectral feature, and construct a second identification spatial domain of agricultural product hazards according to the extraction range of the spectral feature and the second coordinate origin; Identify the types of hazards of the agricultural product sample to be tested according to the spatial information of the first identification space domain and the second identification space domain, call a corresponding hazard identification model according to the types of hazards, and issue an early warning according to the quantitative identification results of the hazard identification model; The identifying the type of harmful substance of the agricultural product sample to be tested according to the spatial information of the first identification spatial domain and the second identification spatial domain comprises: acquiring a second spectral image of the agricultural product sample to be tested, identifying the second spectral image to obtain the appearance characteristics and spectral characteristics of the agricultural product sample to be tested; Calculate the fifth cosine distance between the element vector corresponding to the appearance feature and the first coordinate origin, and calculate the sixth cosine distance between the element vector corresponding to the spectral feature and the second coordinate origin; identify the type of harmful substances in the agricultural product sample to be tested based on the spatial information of the first identification space domain, the spatial information of the second identification space domain, the fifth cosine distance and the sixth cosine distance.

2. The agricultural product hazard identification method simulating the early warning aircraft working mode according to claim 1 is characterized in that: The appearance features include color features, morphological features, and texture features, and determining the first coordinate origin of the healthy agricultural product in the first spatial domain according to the appearance features includes: Identify each appearance feature element in color features, morphological features, and texture features; A vector mean of a corresponding appearance feature element is calculated according to the feature vector of each appearance feature element, and a first coordinate origin of the healthy agricultural product in the first spatial domain is determined according to the vector mean of each appearance feature element.

3. The agricultural product hazard identification method in the simulated early warning aircraft working mode according to claim 1 or 2 is characterized in that: The step of constructing a first identification space domain of agricultural product hazards according to the extraction range of the appearance features and the first coordinate origin includes: Identifying a first boundary point set and a second boundary point set of an extraction range of the appearance feature; Calculate a first cosine distance between each point in the first boundary point set and the first coordinate origin, and calculate a second cosine distance between each point in the second boundary point set and the first coordinate origin; A first healthy space domain is constructed according to the first cosine distance and the second cosine distance, and a first identification space domain of agricultural product hazards is constructed according to the first healthy space domain.

4. The agricultural product hazards identification method simulating the early warning aircraft working mode according to claim 1 is characterized in that: Determining the second coordinate origin of the healthy agricultural product in the second spatial domain according to the spectral feature includes: identifying each spectral signature element in the spectral signature; A vector mean of a corresponding spectral characteristic element is calculated according to the characteristic vector of each spectral characteristic element, and a second coordinate origin of the healthy agricultural product in the second spatial domain is determined according to the vector mean of each spectral characteristic element.

5. The agricultural product hazard identification method in the simulated early warning aircraft working mode according to claim 1 or 4 is characterized in that: The step of constructing a second identification space domain for agricultural product hazards according to the extraction range of the spectral features and the second coordinate origin includes: Identifying a third boundary point set and a fourth boundary point set of an extraction range of the spectral feature; Calculate the third cosine distance between each point in the third boundary point set and the second coordinate origin, and calculate the fourth cosine distance between each point in the fourth boundary point set and the second coordinate origin; A second healthy space domain is constructed according to the third cosine distance and the fourth cosine distance, and a second identification space domain of agricultural product hazards is constructed according to the second healthy space domain.

6. The agricultural product hazards identification method simulating the early warning aircraft working mode according to claim 1 is characterized in that: The calling of a corresponding hazard identification model according to the hazard type includes: Determining a target hazard identification task according to the hazard type; Switching a variable subset in the feature space of the agricultural product sample to be tested according to the target hazard identification task, wherein the variable subset includes spectral feature elements corresponding to the identified hazard type; Obtain similar training samples of the variable subset, input the variable subset and the similar training samples into an error generator, and the error generator outputs a final generalized error, wherein the error generator includes a multi-level cognitive group, and each level of cognitive group is used to calculate the generalized error of the variable subset and the similar training samples. If the output result of the cognitive group of the current level does not meet the output condition, the cognitive group is switched down step by step. If the output result of the cognitive group of the current level meets the output condition, the output result of the cognitive group of the current level is used as the final generalized error, otherwise the final generalized error is determined according to the output results of the multi-level cognitive group. The final generalized error is input into a decision maker, and the decision maker outputs a model calling decision. A corresponding hazard identification model is called from a plurality of different hazard identification models according to the model calling decision.

7. The agricultural product hazard identification method simulating the early warning aircraft working mode according to claim 1 is characterized in that: The plurality of healthy agricultural product samples are agricultural product samples that meet maturity conditions and agricultural product health conditions, wherein the maturity condition is that the maturity of the plurality of healthy agricultural product samples is consistent.

8. A system for identifying agricultural product hazards that imitates the working mode of an early warning aircraft, comprising: An acquisition module, used for acquiring first spectral images of a plurality of healthy agricultural product samples; A recognition module, used for recognizing the first spectral image to obtain appearance characteristics and spectral characteristics of the plurality of healthy agricultural product samples; A first construction module is used to determine a first coordinate origin of the healthy agricultural product in a first spatial domain according to the appearance feature, and to construct a first identification spatial domain of agricultural product hazards according to an extraction range of the appearance feature and the first coordinate origin; A second construction module is used to determine a second coordinate origin of the healthy agricultural product in a second spatial domain according to the spectral feature, and to construct a second identification spatial domain of agricultural product hazards according to an extraction range of the spectral feature and the second coordinate origin; An early warning module, used to identify the type of hazard of the agricultural product sample to be tested according to the spatial information of the first identification space domain and the second identification space domain, call the corresponding hazard identification model according to the type of hazard, and issue an early warning according to the quantitative identification result of the hazard identification model; The early warning module is further used to: obtain a second spectral image of the agricultural product sample to be tested, identify the second spectral image to obtain the appearance characteristics and spectral characteristics of the agricultural product sample to be tested; calculate the fifth cosine distance between the element vector corresponding to the appearance characteristics and the first coordinate origin, and calculate the sixth cosine distance between the element vector corresponding to the spectral characteristics and the second coordinate origin; identify the type of harmful substances in the agricultural product sample to be tested based on the spatial information of the first identification space domain, the spatial information of the second identification space domain, the fifth cosine distance and the sixth cosine distance.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the agricultural product hazard identification method in the simulated early warning aircraft working mode as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Plant disease recognition and early warning method and device

    CN107742290A

  • Recognition and early warning method and system for spodoptera frugiperda

    CN114550108A