CN113848289A - Aquatic vegetable quality evaluation method and system based on production place environment data - Google Patents

Aquatic vegetable quality evaluation method and system based on production place environment data Download PDF

Info

Publication number
CN113848289A
CN113848289A CN202111446281.XA CN202111446281A CN113848289A CN 113848289 A CN113848289 A CN 113848289A CN 202111446281 A CN202111446281 A CN 202111446281A CN 113848289 A CN113848289 A CN 113848289A
Authority
CN
China
Prior art keywords
matrix
value
soil
numerical
ftr1
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111446281.XA
Other languages
Chinese (zh)
Other versions
CN113848289B (en
Inventor
李富荣
王旭
吴志超
杜瑞英
文典
陈�光
赵沛华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute Of Agricultural Quality Standards And Monitoring Technology Guangdong Academy Of Agricultural Sciences
Original Assignee
Institute Of Agricultural Quality Standards And Monitoring Technology Guangdong Academy Of Agricultural Sciences
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Institute Of Agricultural Quality Standards And Monitoring Technology Guangdong Academy Of Agricultural Sciences filed Critical Institute Of Agricultural Quality Standards And Monitoring Technology Guangdong Academy Of Agricultural Sciences
Priority to CN202111446281.XA priority Critical patent/CN113848289B/en
Publication of CN113848289A publication Critical patent/CN113848289A/en
Application granted granted Critical
Publication of CN113848289B publication Critical patent/CN113848289B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N33/00Investigating or analysing materials by specific methods not covered by groups G01N1/00 - G01N31/00
    • G01N33/02Food
    • G01N33/025Fruits or vegetables
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N33/00Investigating or analysing materials by specific methods not covered by groups G01N1/00 - G01N31/00
    • G01N33/24Earth materials
    • G01N33/245
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization

Abstract

The invention provides a method and a system for evaluating the quality of aquatic vegetables based on production area environment data, acquiring heavy metal concentration data of soil and water of various vegetables in different producing areas as an environmental data set through a sensor, acquiring heavy metal concentration threshold values of various vegetables from a database as a threshold value array, initializing a numerical matrix of heavy metal concentration according to the environment data set, calculating by combining the numerical matrix and the threshold value array to obtain the deviation of the environment data set and the threshold value array, minimizing the deviation by using a gradient descent algorithm so as to optimize the numerical matrix to obtain an optimized numerical matrix, the upper limit values of the heavy metal concentrations of the various vegetables are obtained according to the optimized numerical matrix, and the beneficial effect that the upper limit values of the heavy metal concentrations of the various vegetables are obtained through automatic calculation according to the heavy metal concentrations in the producing area environment of the various vegetables is achieved.

Description

Aquatic vegetable quality evaluation method and system based on production place environment data
Technical Field
The invention belongs to the field of data processing technology and agricultural intelligent detection, and particularly relates to a method and a system for evaluating quality of aquatic vegetables based on production area environment data.
Background
In recent years, environmental pollution and food safety problems caused by heavy metals are attracted by the influence of events such as cadmium rice, arsenic poison and blood lead. Heavy metals enter soil or water in agricultural environment, possibly are absorbed and accumulated by crops to be enriched at edible parts, and then enter human bodies through food chains, so that potential harm is caused to human health. The discharge of a large amount of industrial production domestic sewage and the unreasonable use of chemical fertilizers and pesticides in the agricultural production process cause a large amount of heavy metals to enter the environment, the vegetable planting environment is continuously worsened, the heavy metal pollution in the soil of a production area and irrigation water body is increasingly serious, the yield is reduced, the quality is reduced, and the economic sustainable development of the vegetable planting industry is not facilitated. Because different varieties of vegetables have obvious difference on the absorption of heavy metals in the environment, the difference of the physical and chemical properties of soil and water in different areas can also influence the absorption and accumulation capacity of the vegetables on the heavy metals in the soil and the water. Therefore, the phenomenon that the exceeding rate of heavy metals in soil or water in the same production area is greatly different from the exceeding rate of vegetables is often caused when the environmental quality of the vegetable production area is evaluated by using the existing standard, and the objective requirements of safe production of the vegetables and effective utilization of cultivated land resources are difficult to guarantee at the same time. Based on the enrichment rule of different vegetables on heavy metals in soil and water in the producing area environment, a corresponding vegetable planting safety evaluation model is established for specific producing area environmental characteristics and vegetable varieties, and the method has important significance for guiding the safe production of the vegetables in a specific area and reasonably evaluating the producing area environmental quality.
Disclosure of Invention
The invention aims to provide a method and a system for evaluating the quality of aquatic vegetables based on production place environment data, which are used for solving one or more technical problems in the prior art and at least providing a beneficial selection or creation condition.
Based on the enrichment rule of different vegetables on heavy metals in the producing area environment, a corresponding vegetable planting safety evaluation model is established for specific producing area environment characteristics and vegetable varieties, the producing area environment soil and water body heavy metal threshold values of the large variety of vegetables for planting aquatic vegetables are obtained through the data of the producing area environment soil and water body heavy metals of various aquatic vegetables, the heavy metal concentration of the aquatic vegetables under the threshold value condition does not exceed a certain upper limit, and the method has important significance for guiding the safe production of the vegetables in a specific area and reasonably evaluating the producing area environment quality.
The invention provides a method and a system for evaluating aquatic vegetable quality based on habitat environment data, which are characterized in that data of heavy metal concentrations of soil and water of various aquatic vegetables in different habitat are obtained through a sensor to serve as an environment data set, threshold values of the heavy metal concentrations of the various vegetables are obtained from a database to serve as a threshold value array, a numerical matrix of the heavy metal concentrations is initialized according to the environment data set, deviation between the environment data set and the threshold value array is obtained through calculation in combination with the numerical matrix and the threshold value array, the deviation is minimized through a gradient descent algorithm, so that the numerical matrix is subjected to gradient descent to obtain the numerical matrix subjected to gradient descent, and the upper limit value of the heavy metal concentrations of the various vegetables is obtained according to the numerical matrix subjected to gradient descent.
In order to accomplish the above object, according to an aspect of the present invention, there is provided a method for evaluating quality of aquatic vegetables based on habitat environmental data, the method comprising the steps of:
s100, acquiring data of heavy metal concentrations of soil and water of various aquatic vegetables in a plurality of different producing places through a sensor to be used as environmental data to collect the aquatic vegetables;
s200, obtaining threshold values of heavy metal concentrations of various vegetables from a database as threshold value arrays;
s300, initializing a numerical matrix of heavy metal concentration according to the environment data set;
s400, calculating to obtain the deviation of the environment data set and the threshold value array by combining the numerical matrix and the threshold value array;
s500, minimizing deviation by using a gradient descent algorithm so as to perform gradient descent on the numerical matrix and obtain the numerical matrix after gradient descent;
s600, obtaining the upper limit values of the heavy metal concentrations of various vegetables according to the numerical matrix after gradient reduction;
in S100, the method for acquiring data of heavy metal concentrations in soil and water of a plurality of aquatic vegetables in a plurality of different production places by using a sensor as an environmental data set includes: for different aquatic leaf vegetables, acquiring data of heavy metal concentration of soil and data of heavy metal concentration of water of each vegetable in each production place of each vegetable respectively through a sensor, wherein the data of heavy metal concentration of soil comprises numerical values of cadmium, chromium, lead, arsenic, mercury and pH value in the soil and is recorded as soil cadmium, soil chromium, soil lead, soil arsenic, soil mercury and soil pH value, the data of heavy metal concentration of water comprises numerical values of cadmium, chromium, lead, arsenic, mercury and pH value in the water and is recorded as water cadmium, water chromium, water lead, water arsenic, water mercury and water pH value, the data of heavy metal concentration of vegetables comprises numerical values of cadmium, chromium, lead, arsenic and mercury in the vegetables and is recorded as vegetable cadmium, vegetable chromium, vegetable lead, vegetable arsenic and vegetable mercury, the numerical values and the data are subjected to dimensionless chemical treatment, and the vegetables are aquatic vegetables, storing data of cadmium in vegetables, chromium in vegetables, lead in vegetables, arsenic in vegetables, mercury in vegetables, cadmium in water, chromium in water, lead in water, arsenic in water, mercury in water, pH value in water, cadmium in soil, chromium in soil, lead in soil, arsenic in soil, mercury in soil and pH value in soil in a form of table as an environment data set;
in S200, the method of obtaining the threshold values of the heavy metal concentrations of the various vegetables from the database as the threshold value array includes: the heavy metal limit value requirements of various aquatic vegetable varieties in the food pollutant limit (GB 2762-2017) are stored in the database, wherein the heavy metal limit value requirements comprise limit values of cadmium, chromium, lead, arsenic and mercury in each aquatic vegetable, the limit values of cadmium, chromium, lead, arsenic and mercury in each aquatic vegetable are respectively used as corresponding heavy metal content threshold values in the aquatic vegetable, and an array consisting of the limit values of cadmium, chromium, lead, arsenic and mercury in each aquatic vegetable is used as a threshold value array.
Further, in S300, the method for initializing the numerical matrix of the heavy metal concentration according to the environmental data set includes:
each row of the environment data set comprises data of vegetable cadmium, vegetable chromium, vegetable lead, vegetable arsenic, vegetable mercury, water cadmium, water chromium, water lead, water arsenic, water mercury, water pH value, soil cadmium, soil chromium, soil lead, soil arsenic, soil mercury and soil pH value collected by an aquatic vegetable in a producing area, wherein the vegetable cadmium, vegetable chromium, vegetable lead, vegetable arsenic and vegetable mercury are numerical values of the content and the pH value of cadmium, chromium, lead, arsenic and mercury contained in the vegetable, the water cadmium, water chromium, water lead, water arsenic, water mercury and water pH value are numerical values of the content and the pH value of cadmium, chromium, lead, arsenic and mercury contained in irrigation water of the vegetable producing area, and the soil cadmium, soil chromium, soil lead, soil arsenic, soil mercury and soil pH value are numerical values of the content and the pH value of cadmium, chromium, lead, arsenic and mercury contained in soil of the vegetable producing area;
the method comprises the following steps that (1) target heavy metal elements in vegetables to be detected are 5 numerical values of cadmium, chromium, lead, arsenic and mercury, data of cadmium, chromium, lead, arsenic and mercury in soil of a vegetable production place and irrigation water are detected, and 10 numerical values of cadmium, chromium, lead, arsenic, mercury, cadmium, chromium, lead, arsenic and mercury are obtained;
in the process of inputting the numerical values of the soil and irrigation water to be detected into a numerical value matrix after dimensionless treatment, the process of obtaining the numerical value matrix by defining and calculating is as follows:
s301, letting scd be a variable representing the water cadmium value, scr be a variable representing the water chromium value, spb be a variable representing the water lead value, sas be a variable representing the water arsenic value, and shg be a variable representing the water mercury value;
s302, a variable representing the soil cadmium value is tcd, a variable representing the soil chromium value is tcr, a variable representing the soil lead value is tpb, a variable representing the soil arsenic value is tas, and a variable representing the soil mercury value is thg;
s303, taking an array formed by 10 numerical values of scd, scr, spb, sas, shg, tcd, tcr, tpb, tas and thg in sequence as an array Ctrs;
s304, enabling a variable k to represent the number of characteristic components, wherein k is greater than 1, the characteristic components are components representing a numerical value in a characteristic extraction process, the variable k represents a numerical value to obtain k components in the characteristic extraction process, the characteristic extraction represents that a numerical value is converted into a k-dimensional vector, the serial number of the dimensionality in the k-dimensional vector is v, v belongs to [1, k ], and three functions for calculating characteristic extraction are Ftr1(), Ftr2(), and Ftr3 ();
ftr1() represents that one value of the input function is output as a k-dimensional vector, the value of the input function is recorded as x, and the value of the dimension with the sequence number v in the output k-dimensional vector is the v-1 power of the value of the input function, that is, xv-1The dimension denoted by v in Ftr1(x) is Ftr1(x) [ v [ [ v ]]The formula is as follows:
Figure DEST_PATH_IMAGE001
ftr2() represents that a value of an input function is output as a k-dimensional vector, the value of the input function is recorded as x, k-times of x is recorded as (x/k), and the value of a dimension with a sequence number v in the output k-dimensional vector is (x/k) to the power of-v x, namely (x/k)-v*xThe formula is as follows:
Figure DEST_PATH_IMAGE002
ftr3() represents that a value of an input function is output as a k-dimensional vector, the value of the input function is recorded as x, k-times of x are recorded as (x/k), and the value of a cosine of a dimension with a sequence number v in the output k-dimensional vector is (x/k) v, i.e., cos ((x/k) v), where cos () represents a cosine-solving function, and the formula is:
Figure DEST_PATH_IMAGE003
respectively inputting variables scd representing the numerical value of the cadmium hydrate into three functions of feature extraction to obtain Ftr1(scd), Ftr2(scd) and Ftr3 (scd);
respectively inputting variables scr representing the numerical values of the chromium hydrate into three functions of feature extraction to obtain Ftr1(scr), Ftr2(scr) and Ftr3 (scr);
inputting variables spb representing the numerical values of lead hydrate into three functions of feature extraction respectively to obtain Ftr1(spb), Ftr2(spb) and Ftr3 (spb);
respectively inputting variables sa representing the numerical values of water arsenic into three functions of feature extraction to obtain Ftr1 (sa), Ftr2 (sa) and Ftr3 (sa);
inputting variables shg representing the numerical value of mercury into three functions of feature extraction respectively to obtain Ftr1(shg), Ftr2(shg) and Ftr3 (shg);
inputting a variable tcd representing the value of the soil cadmium into three functions of feature extraction respectively to obtain Ftr1(tcd), Ftr2(tcd) and Ftr3 (tcd);
inputting variables tcr representing the numerical value of the soil chromium into three functions of feature extraction respectively to obtain Ftr1(tcr), Ftr2(tcr) and Ftr3 (tcr);
inputting variables tpb representing the values of the lead of the soil into three functions of feature extraction respectively to obtain Ftr1(tpb), Ftr2(tpb) and Ftr3 (tpb);
respectively inputting variables tas representing the numerical values of the arsenic in the soil into three functions of feature extraction to obtain Ftr1(tas), Ftr2(tas) and Ftr3 (tas);
inputting variables thg representing the soil mercury values into three functions of feature extraction respectively to obtain Ftr1(thg), Ftr2(thg) and Ftr3 (thg);
s305, a matrix of 10 columns and k rows, in which 10 k-dimensional vectors, that is, Ftr1(scd), Ftr1(scr), Ftr1(spb), Ftr1(sas), Ftr1(shg), Ftr1(tcd), Ftr1(tcr), Ftr1(tpb), Ftr1(tas), and Ftr1(thg), are sequentially formed by using each k-dimensional vector as one column of the matrix, is referred to as a first matrix, Mat1 is referred to as the first matrix, and Mat1 has the following formula:
Mat1=[ Ftr1(scd), Ftr1(scr), Ftr1(spb), Ftr1(sas), Ftr1(shg), Ftr1(tcd), Ftr1(tcr), Ftr1(tpb), Ftr1(tas), Ftr1(thg)];
a matrix of 10 columns and k rows, in which 10 k-dimensional vectors of Ftr2(scd), Ftr2(scr), Ftr2(spb), Ftr2(sas), Ftr2(shg), Ftr2(tcd), Ftr2(tcr), Ftr2(tpb), Ftr2(tas), and Ftr2(thg) are sequentially formed by taking each k-dimensional vector as one column of the matrix, is referred to as a second matrix, and the second matrix is Mat2, and the Mat2 has the following formula:
Mat2=[ Ftr2(scd), Ftr2(scr), Ftr2(spb), Ftr2(sas), Ftr2(shg), Ftr2(tcd), Ftr2(tcr), Ftr2(tpb), Ftr2(tas), Ftr2(thg)];
defining a third matrix as a matrix with 10 columns and k rows, wherein the third matrix is named as Mat3, elements in the third matrix are variables, the values of the elements in the third matrix can be subjected to gradient reduction, the third matrix can be initialized, namely initial values of the elements in the matrix are set and then subjected to gradient reduction, and 10 k-dimensional vectors, namely Ftr3(scd), Ftr3(scr), Ftr3(spb), Ftr3(sas), Ftr3(shg), Ftr3(tcd), Ftr3(tcr), Ftr3(tpb), Ftr3(tas) and Ftr3(thg), are sequentially used as initial values of the matrix with 10 columns and k rows which are formed by taking each k-dimensional vector as one column of the matrix;
s306, recording the numerical matrix as Mats; in a matrix with 10 columns and k rows, v belongs to [1, k ], a sequence of rows of the matrix is represented by v, and serial numbers of columns of the matrix are marked as s, and s belongs to [1,10 ]; in Mat1, the elements in the v-th row and s-th column of Mat1 are denoted as Mat1(v, s); in Mat2, the elements in the v-th row and s-th column of Mat2 are denoted as Mat2(v, s); in Mat3, the elements in the v-th row and s-th column of Mat3 are denoted as Mat3(v, s); in Mats, the elements in the v-th row and s-th column of Mats are denoted as Mats (v, s);
elements of the s-th column of Mats are:
Figure DEST_PATH_IMAGE004
the formula for calculating Mats (v, s) is Mats (v, s) = [ Mat1(v, s) × Mat2(v, s) × Mat3(v, s) ]/3;
the steps from S301 to S306 are methods for calculating to obtain a numerical matrix, so as to obtain a numerical matrix Mats, wherein, since the third matrix Mat3 can perform gradient reduction on the initial value, the values of the elements in Mats can also perform gradient reduction accordingly.
Further, in S400, the method for calculating the deviation between the environment data set and the threshold array by combining the numerical matrix and the threshold array includes:
marking a threshold value array as a array Tarr, and respectively representing the numerical values of the limit values of cadmium, chromium, lead, arsenic and mercury in the aquatic vegetables in the Tarr by variables cdl, crl, pbl, asl and hgl, namely the Tarr = [ cdl, crl, pbl, asl and hgl ], marking the number of elements in the Tarr as L and the serial number of the elements as t, (t belongs to [1, L ]), and the serial number of the elements in the Tarr as t element is Tarr (t);
acquiring the matrix size of the numerical matrix and recording as k multiplied by c, wherein k represents the row number of the numerical matrix, and c represents the column number of the numerical matrix;
defining a variable v, v belongs to [1, k ]; defining a variable s, s belongs to [1, c ];
using v to represent the serial number of a row in the numerical matrix, and using s to represent the serial number of a column in the numerical matrix;
recording the numerical matrix as matrix Mats, recording the elements of the v-th row and the s-th column in the numerical matrix as Mats (v, s), wherein the Mats (v, s) belongs to Mats;
defining a fourth vector as a k-dimensional vector, wherein elements in the vector are variables, the fourth vector is denoted as Vec4, and the values of the elements in the fourth vector can be subjected to gradient descent; since the fourth vector is a k-dimensional vector, v is also used to represent the sequence number of the dimension in the fourth vector, and the element with the sequence number v of the dimension in the fourth vector is Vec4(v), and Vec4(v) belongs to Vec 4;
the variable initial value of the element in the fourth vector is a random number with a value range of (0,1) generated by a random function, or the variable initial value of the element in the fourth vector is Vec4(v) = cos (pi × v/2k), cos () represents a cosine function, and pi is a circumference ratio;
and (3) recording the calculation result of the combined numerical value matrixes Mats and Vec4 as Maty, wherein the calculation formula of Maty is as follows:
Figure DEST_PATH_IMAGE005
the calculation formula of Maty is a calculation formula combining Mats and Vec4, wherein because s ∈ [1, c ], Maty is a vector of c dimension, the dimension with the sequence number s in Maty is marked as Maty(s), and Maty(s) is as follows:
Figure DEST_PATH_IMAGE006
keeping the function of calculating the deviation between the environment data set and the threshold value array as Disr (), wherein Disr (Maty, Tarr) represents the deviation between the environment data set and the threshold value array calculated by the function Disr (), and the calculation formula of Disr (Maty, Tarr) is as follows:
Figure DEST_PATH_IMAGE007
wherein, the calculation process of Ur (Maty(s), Tarr (t)) is as follows:
Figure DEST_PATH_IMAGE008
the dist (Maty, Tarr) is a deviation between the environment data set and the threshold value array, and the calculation formula of the dist (Maty, Tarr) is a formula for calculating the deviation between the environment data set and the threshold value array.
Further, in S500, the method for obtaining a value matrix after gradient descent by performing gradient descent on the value matrix by minimizing the deviation using a gradient descent algorithm includes:
the deviation between the environment data set and the threshold value array is subjected to gradient descent through an Adam algorithm by using a random gradient descent algorithm based on a first derivative, the Adam algorithm is used for carrying out gradient descent on an initial value of a third matrix Mat3 in the gradient descent process, correspondingly, the numerical values of elements in the numerical matrix are also subjected to gradient descent, after the numerical matrix is subjected to gradient descent, the numerical matrix subjected to gradient descent is obtained and recorded as Mats', and the size of the numerical matrix subjected to gradient descent is kept consistent with the size of the numerical matrix.
Further, in S600, the method for obtaining the upper limit value of the heavy metal concentration of the various vegetables according to the numerical matrix after the gradient is decreased includes: taking each row in the numerical matrix subjected to gradient reduction, adding elements in each row respectively to obtain the accumulated sum of each row respectively, recording the ordered array formed by the accumulated sums of each row as an upper limit array according to the sequence number of each row in the numerical matrix subjected to gradient reduction, wherein the number of the rows in the numerical matrix is 10, the number of the elements in the upper limit array is 10, the elements in the upper limit array are respectively cadmium, chromium, lead, arsenic, mercury, cadmium, chromium, lead, arsenic and mercury, the upper limit value of 10 numerical values of soil and irrigation water needing to be detected, namely the upper limit value of the heavy metal concentration, judging whether the upper limit value of the heavy metal concentration is exceeded or not, the pollution exceeding the upper limit value of the heavy metal concentration is the pollution of the heavy metal concentration, and marking and outputting the polluted aquatic vegetables in the production area, thus, when only the data of heavy metals of cadmium, chromium, lead, arsenic, mercury, cadmium, chromium, lead, arsenic, and mercury in the aquatic vegetable production area is obtained, but the data of specific heavy metals contained in the sample of the aquatic vegetable produced in the aquatic vegetable production area is not obtained, the upper limit of the heavy metal concentration and the data of heavy metals in the aquatic vegetable production area are used to determine, and the aquatic vegetable produced in the aquatic vegetable production area is marked as contaminated, and the aquatic vegetable produced in the aquatic vegetable production area is stopped from being consumed.
The invention also provides a system for evaluating the quality of aquatic vegetables based on the production place environment data, which comprises: the aquatic vegetable quality evaluation system based on the production place environment data can be operated in computing equipment such as a desktop computer, a notebook computer, a palm computer, a cloud data center and the like, and can be operated by including but not limited to the processor, the memory and a server cluster, and the processor executes the computer program to operate in the following units of the system:
the system comprises an environmental data acquisition unit, a data acquisition unit and a data acquisition unit, wherein the environmental data acquisition unit is used for acquiring the data of the heavy metal concentrations of soil and water of various vegetables in a plurality of different producing areas as an environmental data set through a sensor;
the threshold value array obtaining unit is used for obtaining threshold values of heavy metal concentrations of various vegetables from the database to serve as threshold value arrays;
the numerical matrix initialization unit is used for initializing a numerical matrix of the heavy metal concentration according to the environment data set;
the deviation calculation unit is used for calculating the deviation between the environment data set and the threshold value array by combining the numerical matrix and the threshold value array;
the numerical matrix optimization unit is used for minimizing deviation by using a gradient descent algorithm so as to optimize the numerical matrix to obtain an optimized numerical matrix;
and the upper limit value calculating unit is used for obtaining the upper limit values of the heavy metal concentrations of the various vegetables according to the optimized numerical matrix.
The invention has the beneficial effects that: the invention provides a method and a system for evaluating the quality of aquatic vegetables based on production area environment data, initializing a numerical matrix of heavy metal concentration according to the environment data set, calculating by combining the numerical matrix and the threshold value array to obtain the deviation of the environment data set and the threshold value array, minimizing the deviation by using a gradient descent algorithm so as to optimize the numerical matrix to obtain an optimized numerical matrix, obtaining the upper limit value of the heavy metal concentration of various vegetables according to the optimized numerical matrix, obtaining the soil of the producing area environment and the water body heavy metal threshold value of the large class of vegetables for planting the aquatic vegetables according to the data of the soil of the producing area environment and the water body heavy metal of various aquatic vegetables, under the condition of the threshold value, the heavy metal concentration of the aquatic vegetables does not exceed the upper limit value, and the beneficial effect that the upper limit value of the heavy metal concentration of various vegetables is obtained through automatic calculation according to the heavy metal concentration in the production area environment of various vegetables is realized.
Drawings
The above and other features of the present invention will become more apparent by describing in detail embodiments thereof with reference to the attached drawings in which like reference numerals designate the same or similar elements, it being apparent that the drawings in the following description are merely exemplary of the present invention and other drawings can be obtained by those skilled in the art without inventive effort, wherein:
FIG. 1 is a flow chart showing a method for evaluating the quality of aquatic vegetables based on the habitat environmental data;
FIG. 2 is a system configuration diagram showing an aquatic vegetable quality evaluation system based on the habitat environmental data.
Detailed Description
The conception, the specific structure and the technical effects of the present invention will be clearly and completely described in conjunction with the embodiments and the accompanying drawings to fully understand the objects, the schemes and the effects of the present invention. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
In the description of the present invention, the meaning of a plurality of means is one or more, the meaning of a plurality of means is two or more, and larger, smaller, larger, etc. are understood as excluding the number, and larger, smaller, inner, etc. are understood as including the number. If the first and second are described for the purpose of distinguishing technical features, they are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
Referring to fig. 1, which is a flowchart illustrating a method for evaluating quality of aquatic vegetables based on habitat environmental data according to the present invention, a method and a system for evaluating quality of aquatic vegetables based on habitat environmental data according to an embodiment of the present invention will be described with reference to fig. 1.
The invention provides a method for evaluating the quality of aquatic vegetables based on production area environment data, which specifically comprises the following steps:
s100, acquiring heavy metal concentration data of soil and water of various aquatic vegetables in a plurality of different producing places as an environment data set through a sensor;
s200, obtaining threshold values of heavy metal concentrations of various vegetables from a database as threshold value arrays;
s300, initializing a numerical matrix of heavy metal concentration according to the environment data set;
s400, calculating to obtain the deviation of the environment data set and the threshold value array by combining the numerical matrix and the threshold value array;
s500, minimizing deviation by using a gradient descent algorithm so as to perform gradient descent on the numerical matrix and obtain the numerical matrix after gradient descent;
s600, obtaining the upper limit values of the heavy metal concentrations of various vegetables according to the numerical matrix after gradient reduction;
in S100, the method for acquiring data of heavy metal concentrations in soil and water of a plurality of aquatic vegetables in a plurality of different production places by using a sensor as an environmental data set includes: for different vegetables, acquiring data of heavy metal concentration of soil of each vegetable in each production area and data of heavy metal concentration of irrigation water from a plurality of different production areas of each vegetable through a sensor and heavy metal detection equipment respectively, wherein the data of heavy metal concentration of soil comprises numerical values of cadmium, chromium, lead, arsenic, mercury and pH value in the soil and is recorded as soil cadmium, soil chromium, soil lead, soil arsenic, soil mercury and soil pH value, the data of heavy metal concentration of irrigation water comprises numerical values of cadmium, chromium, lead, arsenic, mercury and pH value in the irrigation water and is recorded as water cadmium, water chromium, water lead, water arsenic, water mercury and water pH value, the data of heavy metal concentration in the vegetables comprises numerical values of cadmium, chromium, lead, arsenic and mercury in the vegetables and is recorded as vegetable cadmium, vegetable chromium, vegetable lead, vegetable arsenic and vegetable mercury, the numerical values and the data are subjected to dimensionless treatment, the vegetables are aquatic vegetables, and data of cadmium, chromium, lead, arsenic, mercury, water cadmium, water chromium, water lead, water arsenic, water mercury, water pH value, soil cadmium, soil chromium, soil lead, soil arsenic, soil mercury and soil pH value of the vegetables obtained from different production places are stored in a form of a table to serve as an environment data set;
in S200, the method of obtaining the threshold values of the heavy metal concentrations of the various vegetables from the database as the threshold value array includes: the method comprises the steps of storing heavy metal limit value requirements of various aquatic vegetable varieties in a database, wherein the heavy metal limit value requirements comprise limit values of cadmium, chromium, lead, arsenic and mercury in each aquatic vegetable, respectively taking the limit values of the cadmium, the chromium, the lead, the arsenic and the mercury in each aquatic vegetable as threshold values of the content of corresponding heavy metals in the aquatic vegetable, and taking an array formed by the limit values of the cadmium, the chromium, the lead, the arsenic and the mercury in each aquatic vegetable as a threshold value array.
Further, in S300, the method for initializing the numerical matrix of the heavy metal concentration according to the environmental data set includes:
each row of the environment data set comprises data of vegetable cadmium, vegetable chromium, vegetable lead, vegetable arsenic, vegetable mercury, water cadmium, water chromium, water lead, water arsenic, water mercury, water pH value, soil cadmium, soil chromium, soil lead, soil arsenic, soil mercury and soil pH value collected by an aquatic vegetable in a producing area, wherein the vegetable cadmium, vegetable chromium, vegetable lead, vegetable arsenic and vegetable mercury are numerical values of the content and the pH value of cadmium, chromium, lead, arsenic and mercury contained in the vegetable, the water cadmium, water chromium, water lead, water arsenic, water mercury and water pH value are numerical values of the content and the pH value of cadmium, chromium, lead, arsenic and mercury contained in irrigation water of the vegetable producing area, and the soil cadmium, soil chromium, soil lead, soil arsenic, soil mercury and soil pH value are numerical values of the content and the pH value of cadmium, chromium, lead, arsenic and mercury contained in soil of the vegetable producing area;
the method comprises the following steps that (1) target heavy metal elements in vegetables to be detected are 5 numerical values of cadmium, chromium, lead, arsenic and mercury, data of cadmium, chromium, lead, arsenic and mercury in soil of a vegetable production place and irrigation water are detected, and 10 numerical values of cadmium, chromium, lead, arsenic, mercury, cadmium, chromium, lead, arsenic and mercury are obtained;
in the process of inputting the numerical values of the soil and irrigation water to be detected into a numerical value matrix after dimensionless treatment, the process of obtaining the numerical value matrix by defining and calculating is as follows:
s301, letting scd be a variable representing the water cadmium value, scr be a variable representing the water chromium value, spb be a variable representing the water lead value, sas be a variable representing the water arsenic value, and shg be a variable representing the water mercury value;
s302, a variable representing the soil cadmium value is tcd, a variable representing the soil chromium value is tcr, a variable representing the soil lead value is tpb, a variable representing the soil arsenic value is tas, and a variable representing the soil mercury value is thg;
s303, taking an array formed by 10 numerical values of scd, scr, spb, sas, shg, tcd, tcr, tpb, tas and thg in sequence as an array Ctrs;
s304, enabling a variable k to represent the number of characteristic components, wherein k is greater than 1, the characteristic components are components representing a numerical value in a characteristic extraction process, the variable k represents a numerical value to obtain k components in the characteristic extraction process, the characteristic extraction represents that a numerical value is converted into a k-dimensional vector, the serial number of the dimensionality in the k-dimensional vector is v, v belongs to [1, k ], and three functions for calculating characteristic extraction are Ftr1(), Ftr2(), and Ftr3 ();
ftr1() represents that one value of the input function is output as a k-dimensional vector, the value of the input function is recorded as x, and the value of the dimension with the sequence number v in the output k-dimensional vector is the v-1 power of the value of the input function, that is, xv-1The dimension denoted by v in Ftr1(x) is Ftr1(x) [ v [ [ v ]]The formula is as follows:
Figure DEST_PATH_IMAGE009
ftr2() represents that a value of an input function is output as a k-dimensional vector, the value of the input function is recorded as x, k-times of x is recorded as (x/k), and the value of a dimension with a sequence number v in the output k-dimensional vector is (x/k) to the power of-v x, namely (x/k)-v*xThe formula is as follows:
Figure 591549DEST_PATH_IMAGE002
ftr3() represents that a value of an input function is output as a k-dimensional vector, the value of the input function is recorded as x, k-times of x are recorded as (x/k), and the value of a cosine of a dimension with a sequence number v in the output k-dimensional vector is (x/k) v, i.e., cos ((x/k) v), where cos () represents a cosine-solving function, and the formula is:
Figure 401374DEST_PATH_IMAGE003
respectively inputting variables scd representing the numerical value of the cadmium hydrate into three functions of feature extraction to obtain Ftr1(scd), Ftr2(scd) and Ftr3 (scd);
respectively inputting variables scr representing the numerical values of the chromium hydrate into three functions of feature extraction to obtain Ftr1(scr), Ftr2(scr) and Ftr3 (scr);
inputting variables spb representing the numerical values of lead hydrate into three functions of feature extraction respectively to obtain Ftr1(spb), Ftr2(spb) and Ftr3 (spb);
respectively inputting variables sa representing the numerical values of water arsenic into three functions of feature extraction to obtain Ftr1 (sa), Ftr2 (sa) and Ftr3 (sa);
inputting variables shg representing the numerical value of mercury into three functions of feature extraction respectively to obtain Ftr1(shg), Ftr2(shg) and Ftr3 (shg);
inputting a variable tcd representing the value of the soil cadmium into three functions of feature extraction respectively to obtain Ftr1(tcd), Ftr2(tcd) and Ftr3 (tcd);
inputting variables tcr representing the numerical value of the soil chromium into three functions of feature extraction respectively to obtain Ftr1(tcr), Ftr2(tcr) and Ftr3 (tcr);
inputting variables tpb representing the values of the lead of the soil into three functions of feature extraction respectively to obtain Ftr1(tpb), Ftr2(tpb) and Ftr3 (tpb);
respectively inputting variables tas representing the numerical values of the arsenic in the soil into three functions of feature extraction to obtain Ftr1(tas), Ftr2(tas) and Ftr3 (tas);
inputting variables thg representing the soil mercury values into three functions of feature extraction respectively to obtain Ftr1(thg), Ftr2(thg) and Ftr3 (thg);
s305, a matrix of 10 columns and k rows, in which 10 k-dimensional vectors, that is, Ftr1(scd), Ftr1(scr), Ftr1(spb), Ftr1(sas), Ftr1(shg), Ftr1(tcd), Ftr1(tcr), Ftr1(tpb), Ftr1(tas), and Ftr1(thg), are sequentially formed by using each k-dimensional vector as one column of the matrix, is referred to as a first matrix, Mat1 is referred to as the first matrix, and Mat1 has the following formula:
Mat1=[ Ftr1(scd), Ftr1(scr), Ftr1(spb), Ftr1(sas), Ftr1(shg), Ftr1(tcd), Ftr1(tcr), Ftr1(tpb), Ftr1(tas), Ftr1(thg)];
a matrix of 10 columns and k rows, in which 10 k-dimensional vectors of Ftr2(scd), Ftr2(scr), Ftr2(spb), Ftr2(sas), Ftr2(shg), Ftr2(tcd), Ftr2(tcr), Ftr2(tpb), Ftr2(tas), and Ftr2(thg) are sequentially formed by taking each k-dimensional vector as one column of the matrix, is referred to as a second matrix, and the second matrix is Mat2, and the Mat2 has the following formula:
Mat2=[ Ftr2(scd), Ftr2(scr), Ftr2(spb), Ftr2(sas), Ftr2(shg), Ftr2(tcd), Ftr2(tcr), Ftr2(tpb), Ftr2(tas), Ftr2(thg)];
defining a third matrix as a matrix with 10 columns and k rows, wherein the third matrix is named as Mat3, elements in the third matrix are variables, the values of the elements in the third matrix can be subjected to gradient reduction, the third matrix can be initialized, namely initial values of the elements in the matrix are set and then subjected to gradient reduction, and 10 k-dimensional vectors, namely Ftr3(scd), Ftr3(scr), Ftr3(spb), Ftr3(sas), Ftr3(shg), Ftr3(tcd), Ftr3(tcr), Ftr3(tpb), Ftr3(tas) and Ftr3(thg), are sequentially used as initial values of the matrix with 10 columns and k rows which are formed by taking each k-dimensional vector as one column of the matrix;
s306, recording the numerical matrix as Mats; in a matrix with 10 columns and k rows, v belongs to [1, k ], a sequence of rows of the matrix is represented by v, and serial numbers of columns of the matrix are marked as s, and s belongs to [1,10 ]; in Mat1, the elements in the v-th row and s-th column of Mat1 are denoted as Mat1(v, s); in Mat2, the elements in the v-th row and s-th column of Mat2 are denoted as Mat2(v, s); in Mat3, the elements in the v-th row and s-th column of Mat3 are denoted as Mat3(v, s); in Mats, the elements in the v-th row and s-th column of Mats are denoted as Mats (v, s);
elements of the s-th column of Mats are:
Figure DEST_PATH_IMAGE010
the formula for calculating Mats (v, s) is Mats (v, s) = [ Mat1(v, s) × Mat2(v, s) × Mat3(v, s) ]/3;
the steps from S301 to S306 are methods for calculating to obtain a numerical matrix, so as to obtain a numerical matrix Mats, wherein, since the third matrix Mat3 can perform gradient reduction on the initial value, the values of the elements in Mats can also perform gradient reduction accordingly.
Further, in S400, the method for calculating the deviation between the environment data set and the threshold array by combining the numerical matrix and the threshold array includes:
marking the threshold value array as a array Tarr, and respectively representing the numerical values of the limit values of cadmium, chromium, lead, arsenic and mercury in the aquatic vegetables in the Tarr by variables cdl, crl, pbl, asl and hgl, namely Tarr = [ cdl, crl, pbl, asl and hgl ], marking the number of elements in the Tarr as L, the serial number of the elements as t, and the serial number of the elements in the Tarr as t, and the element in the Tarr as Tarr (t);
acquiring the matrix size of the numerical matrix and recording as k multiplied by c, wherein k represents the row number of the numerical matrix, and c represents the column number of the numerical matrix;
defining a variable v, v belongs to [1, k ]; defining a variable s, s belongs to [1, c ];
using v to represent the serial number of a row in the numerical matrix, and using s to represent the serial number of a column in the numerical matrix;
recording the numerical matrix as matrix Mats, recording the elements of the v-th row and the s-th column in the numerical matrix as Mats (v, s), wherein the Mats (v, s) belongs to Mats;
defining a fourth vector as a k-dimensional vector, wherein elements in the vector are variables, the fourth vector is denoted as Vec4, and the values of the elements in the fourth vector can be subjected to gradient descent; since the fourth vector is a k-dimensional vector, v is also used to represent the sequence number of the dimension in the fourth vector, and the element with the sequence number v of the dimension in the fourth vector is Vec4(v), and Vec4(v) belongs to Vec 4;
the variable initial value of the element in the fourth vector is a random number with a value range of (0,1) generated by a random function, or the variable initial value of the element in the fourth vector is Vec4(v) = cos (pi × v/2k), cos () represents a cosine function, and pi is a circumference ratio;
and (3) recording the calculation result of the combined numerical value matrixes Mats and Vec4 as Maty, wherein the calculation formula of Maty is as follows:
Figure DEST_PATH_IMAGE011
the calculation formula of Maty is a calculation formula combining Mats and Vec4, wherein because s ∈ [1, c ], Maty is a vector of c dimension, the dimension with the sequence number s in Maty is marked as Maty(s), and Maty(s) is as follows:
Figure DEST_PATH_IMAGE012
keeping the function of calculating the deviation between the environment data set and the threshold value array as Disr (), wherein Disr (Maty, Tarr) represents the deviation between the environment data set and the threshold value array calculated by the function Disr (), and the calculation formula of Disr (Maty, Tarr) is as follows:
Figure DEST_PATH_IMAGE013
wherein, the calculation process of Ur (Maty(s), Tarr (t)) is as follows:
Figure DEST_PATH_IMAGE014
the dist (Maty, Tarr) is a deviation between the environment data set and the threshold value array, and the calculation formula of the dist (Maty, Tarr) is a formula for calculating the deviation between the environment data set and the threshold value array.
Further, in S500, the method for obtaining a value matrix after gradient descent by performing gradient descent on the value matrix by minimizing the deviation using a gradient descent algorithm includes:
the deviation of the environment data set from the threshold value array is subjected to gradient descent (the code can refer to the code of a drill. optimal. Adam module in an open Python machine learning library Pythch) by an Adam algorithm (see a paper: Kingma D, Ba J. Adam: A Method for Stochastic Optimization [ J ]. Computer Science, 2014.) through a random gradient descent algorithm based on a first derivative, the Adam algorithm is subjected to gradient descent by carrying out a gradient descent on an initial value of a third matrix Mat3 in the gradient descent process, correspondingly, the numerical values of elements in the numerical matrix are also subjected to gradient descent, and the numerical matrix subjected to gradient descent is recorded as Mats after the numerical matrix is subjected to gradient descent, wherein the size of the numerical matrix subjected to gradient descent is consistent with the size of the numerical matrix.
Further, in S600, the method for obtaining the upper limit value of the heavy metal concentration of the various vegetables according to the numerical matrix after the gradient is decreased includes: taking each row in the numerical matrix subjected to gradient reduction, adding elements in each row respectively to obtain the accumulated sum of each row respectively, recording the ordered array formed by the accumulated sums of each row as an upper limit array according to the sequence number of each row in the numerical matrix subjected to gradient reduction, wherein the number of the rows in the numerical matrix is 10, the number of the elements in the upper limit array is 10, the elements in the upper limit array are respectively cadmium, chromium, lead, arsenic, mercury, cadmium, chromium, lead, arsenic and mercury, the upper limit value of 10 numerical values of soil and irrigation water needing to be detected, namely the upper limit value of the heavy metal concentration, judging whether the upper limit value of the heavy metal concentration is exceeded or not, the pollution exceeding the upper limit value of the heavy metal concentration is the pollution of the heavy metal concentration, and marking and outputting the polluted aquatic vegetables in the production area, thus, when only the data of heavy metals of cadmium, chromium, lead, arsenic, mercury, cadmium, chromium, lead, arsenic, and mercury in the aquatic vegetable production area is obtained, but the data of specific heavy metals contained in the sample of the aquatic vegetable produced in the aquatic vegetable production area is not obtained, the upper limit of the heavy metal concentration and the data of heavy metals in the aquatic vegetable production area are used to determine, and the aquatic vegetable produced in the aquatic vegetable production area is marked as contaminated, and the aquatic vegetable produced in the aquatic vegetable production area is stopped from being consumed.
The aquatic vegetable quality evaluation system based on the production place environment data comprises: the aquatic vegetable quality evaluation system based on the production place environment data can be operated in computing equipment such as a desktop computer, a notebook computer, a palm computer, a cloud data center and the like, and the operable systems can include, but are not limited to, a processor, a memory and a server cluster.
An embodiment of the present invention provides a system for evaluating quality of aquatic vegetables based on habitat environmental data, as shown in fig. 2, the system for evaluating quality of aquatic vegetables based on habitat environmental data of the embodiment includes: a processor, a memory and a computer program stored in the memory and operable on the processor, the processor executing the computer program to implement the steps in an embodiment of the method for evaluating the quality of aquatic vegetables based on the habitat environmental data as described above, the processor executing the computer program to run in the units of the following system:
the system comprises an environmental data acquisition unit, a data acquisition unit and a data acquisition unit, wherein the environmental data acquisition unit is used for acquiring the data of the heavy metal concentrations of soil and water of various vegetables in a plurality of different producing areas as an environmental data set through a sensor;
the threshold value array obtaining unit is used for obtaining threshold values of heavy metal concentrations of various vegetables from the database to serve as threshold value arrays;
the numerical matrix initialization unit is used for initializing a numerical matrix of the heavy metal concentration according to the environment data set;
the deviation calculation unit is used for calculating the deviation between the environment data set and the threshold value array by combining the numerical matrix and the threshold value array;
the numerical matrix optimization unit is used for minimizing deviation by using a gradient descent algorithm so as to optimize the numerical matrix to obtain an optimized numerical matrix;
and the upper limit value calculating unit is used for obtaining the upper limit values of the heavy metal concentrations of the various vegetables according to the optimized numerical matrix.
The aquatic vegetable quality evaluation system based on the production place environment data can be operated in computing equipment such as a desktop computer, a notebook computer, a palm computer and a cloud data center. The aquatic vegetable quality evaluation system based on the production place environment data comprises a processor and a memory, but is not limited to the processor and the memory. It will be understood by those skilled in the art that the example is merely an example of the method and system for evaluating quality of aquatic vegetables based on the production area environment data, and does not constitute a limitation of the method and system for evaluating quality of aquatic vegetables based on the production area environment data, and may include more or less components than the production area environment data, or combine some components, or different components, for example, the system for evaluating quality of aquatic vegetables based on the production area environment data may further include an input/output device, a network access device, a bus, etc.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete component Gate or transistor logic, discrete hardware components, etc. The general processor may be a microprocessor or the processor may be any conventional processor or the like, the processor is a control center of the aquatic vegetable quality evaluation system based on the production place environment data, and various interfaces and lines are used for connecting various subareas of the whole aquatic vegetable quality evaluation system based on the production place environment data.
The memory can be used for storing the computer program and/or the module, and the processor realizes various functions of the aquatic vegetable quality evaluation method and system based on the production place environment data by operating or executing the computer program and/or the module stored in the memory and calling the data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
The invention provides a method and a system for evaluating the quality of aquatic vegetables based on production place environment data.
Although the present invention has been described in considerable detail and with reference to certain illustrated embodiments, it is not intended to be limited to any such details or embodiments or any particular embodiment, so as to effectively encompass the intended scope of the invention. Furthermore, the foregoing describes the invention in terms of embodiments foreseen by the inventor for which an enabling description was available, notwithstanding that insubstantial modifications of the invention, not presently foreseen, may nonetheless represent equivalent modifications thereto.

Claims (6)

1. An aquatic vegetable quality evaluation method based on production place environment data is characterized by comprising the following steps:
s100, acquiring heavy metal concentration data of soil and water of various aquatic vegetables in a plurality of different producing places as an environment data set through a sensor;
s200, obtaining threshold values of heavy metal concentrations of various vegetables from a database as threshold value arrays;
s300, initializing a numerical matrix of heavy metal concentration according to the environment data set;
s400, calculating to obtain the deviation of the environment data set and the threshold value array by combining the numerical matrix and the threshold value array;
s500, minimizing deviation by using a gradient descent algorithm so as to perform gradient descent on the numerical matrix and obtain the numerical matrix after gradient descent;
s600, obtaining the upper limit values of the heavy metal concentrations of various vegetables according to the numerical matrix after gradient reduction;
in S100, the method for acquiring data of heavy metal concentrations in soil and water of a plurality of aquatic vegetables in a plurality of different production places by using a sensor as an environmental data set includes: for different vegetables, acquiring data of heavy metal concentration of soil of each vegetable in each production area and data of heavy metal concentration of irrigation water from a plurality of different production areas of each vegetable through a sensor and heavy metal detection equipment respectively, wherein the data of heavy metal concentration of soil comprises numerical values of cadmium, chromium, lead, arsenic, mercury and pH value in the soil and is recorded as soil cadmium, soil chromium, soil lead, soil arsenic, soil mercury and soil pH value, the data of heavy metal concentration of irrigation water comprises numerical values of cadmium, chromium, lead, arsenic, mercury and pH value in the irrigation water and is recorded as water cadmium, water chromium, water lead, water arsenic, water mercury and water pH value, the data of heavy metal concentration in the vegetables comprises numerical values of cadmium, chromium, lead, arsenic and mercury in the vegetables and is recorded as vegetable cadmium, vegetable chromium, vegetable lead, vegetable arsenic and vegetable mercury, the numerical values and the data are subjected to dimensionless treatment, the vegetables are aquatic vegetables, and data of cadmium, chromium, lead, arsenic, mercury, water cadmium, water chromium, water lead, water arsenic, water mercury, water pH value, soil cadmium, soil chromium, soil lead, soil arsenic, soil mercury and soil pH value of the vegetables obtained from different production places are stored in a form of a table to serve as an environment data set;
in S200, the method of obtaining the threshold values of the heavy metal concentrations of the various vegetables from the database as the threshold value array includes: the method comprises the steps of storing heavy metal limit value requirements of various aquatic vegetable varieties in a database, wherein the heavy metal limit value requirements comprise limit values of cadmium, chromium, lead, arsenic and mercury in each aquatic vegetable, respectively taking the limit values of the cadmium, the chromium, the lead, the arsenic and the mercury in each aquatic vegetable as threshold values of the content of corresponding heavy metals in the aquatic vegetable, and taking an array formed by the limit values of the cadmium, the chromium, the lead, the arsenic and the mercury in each aquatic vegetable as a threshold value array.
2. The method of claim 1, wherein the initialization of the numerical matrix of the heavy metal concentration according to the environmental data set in step S300 comprises:
each row of the environmental data set comprises vegetable cadmium, vegetable chromium, vegetable lead, vegetable arsenic, vegetable mercury, water cadmium, water chromium, water lead, water arsenic, water mercury, water pH value, soil cadmium, soil chromium, soil lead, soil arsenic, soil mercury and soil pH value data collected by an aquatic vegetable in a production place, wherein the 5 values of cadmium, chromium, lead, arsenic and mercury in the target heavy metal elements in the vegetable to be detected are required, the data of cadmium, chromium, lead, arsenic and mercury in the soil of the vegetable production place and irrigation water are required to be detected, and the 10 values of cadmium, water chromium, water lead, water arsenic, water mercury, soil cadmium, soil chromium, soil lead, soil arsenic and soil mercury in the soil and irrigation water to be detected are obtained;
in the process of inputting the numerical values of the soil and irrigation water to be detected into a numerical value matrix after dimensionless treatment, the process of obtaining the numerical value matrix by defining and calculating is as follows:
s301, letting scd be a variable representing the water cadmium value, scr be a variable representing the water chromium value, spb be a variable representing the water lead value, sas be a variable representing the water arsenic value, and shg be a variable representing the water mercury value;
s302, a variable representing the soil cadmium value is tcd, a variable representing the soil chromium value is tcr, a variable representing the soil lead value is tpb, a variable representing the soil arsenic value is tas, and a variable representing the soil mercury value is thg;
s303, taking an array formed by 10 numerical values of scd, scr, spb, sas, shg, tcd, tcr, tpb, tas and thg in sequence as an array Ctrs;
s304, enabling a variable k to represent the number of characteristic components, wherein k is greater than 1, the characteristic components are components representing a numerical value in a characteristic extraction process, the variable k represents a numerical value to obtain k components in the characteristic extraction process, the characteristic extraction represents that a numerical value is converted into a k-dimensional vector, the serial number of the dimensionality in the k-dimensional vector is v, v belongs to [1, k ], and three functions for calculating characteristic extraction are Ftr1(), Ftr2(), and Ftr3 ();
ftr1() represents that one value of the input function is output as a k-dimensional vector, the value of the input function is recorded as x, and the value of the dimension with the sequence number v in the output k-dimensional vector is the v-1 power of the value of the input function, that is, xv-1The dimension denoted by v in Ftr1(x) is Ftr1(x) [ v [ [ v ]]The formula is as follows:
Figure 267189DEST_PATH_IMAGE001
ftr2() represents that a value of an input function is output as a k-dimensional vector, the value of the input function is recorded as x, k-times of x is recorded as (x/k), and the value of a dimension with a sequence number v in the output k-dimensional vector is (x/k) to the power of-v x, namely (x/k)-v*xThe formula is as follows:
Figure 287098DEST_PATH_IMAGE002
ftr3() represents that a value of an input function is output as a k-dimensional vector, the value of the input function is recorded as x, k-times of x are recorded as (x/k), and the value of a cosine of a dimension with a sequence number v in the output k-dimensional vector is (x/k) v, i.e., cos ((x/k) v), where cos () represents a cosine-solving function, and the formula is:
Figure 289689DEST_PATH_IMAGE003
respectively inputting variables scd representing the numerical value of the cadmium hydrate into three functions of feature extraction to obtain Ftr1(scd), Ftr2(scd) and Ftr3 (scd);
respectively inputting variables scr representing the numerical values of the chromium hydrate into three functions of feature extraction to obtain Ftr1(scr), Ftr2(scr) and Ftr3 (scr);
inputting variables spb representing the numerical values of lead hydrate into three functions of feature extraction respectively to obtain Ftr1(spb), Ftr2(spb) and Ftr3 (spb);
respectively inputting variables sa representing the numerical values of water arsenic into three functions of feature extraction to obtain Ftr1 (sa), Ftr2 (sa) and Ftr3 (sa);
inputting variables shg representing the numerical value of mercury into three functions of feature extraction respectively to obtain Ftr1(shg), Ftr2(shg) and Ftr3 (shg);
inputting a variable tcd representing the value of the soil cadmium into three functions of feature extraction respectively to obtain Ftr1(tcd), Ftr2(tcd) and Ftr3 (tcd);
inputting variables tcr representing the numerical value of the soil chromium into three functions of feature extraction respectively to obtain Ftr1(tcr), Ftr2(tcr) and Ftr3 (tcr);
inputting variables tpb representing the values of the lead of the soil into three functions of feature extraction respectively to obtain Ftr1(tpb), Ftr2(tpb) and Ftr3 (tpb);
respectively inputting variables tas representing the numerical values of the arsenic in the soil into three functions of feature extraction to obtain Ftr1(tas), Ftr2(tas) and Ftr3 (tas);
inputting variables thg representing the soil mercury values into three functions of feature extraction respectively to obtain Ftr1(thg), Ftr2(thg) and Ftr3 (thg);
s305, a matrix of 10 columns and k rows, in which 10 k-dimensional vectors, that is, Ftr1(scd), Ftr1(scr), Ftr1(spb), Ftr1(sas), Ftr1(shg), Ftr1(tcd), Ftr1(tcr), Ftr1(tpb), Ftr1(tas), and Ftr1(thg), are sequentially formed by using each k-dimensional vector as one column of the matrix, is referred to as a first matrix, Mat1 is referred to as the first matrix, and Mat1 has the following formula:
Mat1=[ Ftr1(scd), Ftr1(scr), Ftr1(spb), Ftr1(sas), Ftr1(shg), Ftr1(tcd), Ftr1(tcr), Ftr1(tpb), Ftr1(tas), Ftr1(thg)];
a matrix of 10 columns and k rows, in which 10 k-dimensional vectors of Ftr2(scd), Ftr2(scr), Ftr2(spb), Ftr2(sas), Ftr2(shg), Ftr2(tcd), Ftr2(tcr), Ftr2(tpb), Ftr2(tas), and Ftr2(thg) are sequentially formed by taking each k-dimensional vector as one column of the matrix, is referred to as a second matrix, and the second matrix is Mat2, and the Mat2 has the following formula:
Mat2=[ Ftr2(scd), Ftr2(scr), Ftr2(spb), Ftr2(sas), Ftr2(shg), Ftr2(tcd), Ftr2(tcr), Ftr2(tpb), Ftr2(tas), Ftr2(thg)];
defining a third matrix as a matrix with 10 columns and k rows, wherein the third matrix is named as Mat3, elements in the third matrix are variables, the values of the elements in the third matrix can be subjected to gradient reduction, the third matrix can be initialized, namely initial values of the elements in the matrix are set and then subjected to gradient reduction, and 10 k-dimensional vectors, namely Ftr3(scd), Ftr3(scr), Ftr3(spb), Ftr3(sas), Ftr3(shg), Ftr3(tcd), Ftr3(tcr), Ftr3(tpb), Ftr3(tas) and Ftr3(thg), are sequentially used as initial values of the matrix with 10 columns and k rows which are formed by taking each k-dimensional vector as one column of the matrix;
s306, recording the numerical matrix as Mats; in a matrix with 10 columns and k rows, v belongs to [1, k ], a sequence of rows of the matrix is represented by v, and serial numbers of columns of the matrix are marked as s, and s belongs to [1,10 ]; in Mat1, the elements in the v-th row and s-th column of Mat1 are denoted as Mat1(v, s); in Mat2, the elements in the v-th row and s-th column of Mat2 are denoted as Mat2(v, s); in Mat3, the elements in the v-th row and s-th column of Mat3 are denoted as Mat3(v, s); in Mats, the elements in the v-th row and s-th column of Mats are denoted as Mats (v, s); the formula for calculating Mats (v, s) is Mats (v, s) = [ Mat1(v, s) × Mat2(v, s) × Mat3(v, s) ]/3;
the steps from S301 to S306 are methods for calculating to obtain a numerical matrix, so as to obtain a numerical matrix Mats, wherein, since the third matrix Mat3 can perform gradient reduction on the initial value, the values of the elements in Mats can also perform gradient reduction accordingly.
3. A method for evaluating the quality of aquatic vegetables based on the environment data of the production area as claimed in claim 1, wherein the method for calculating the deviation between the environment data set and the threshold value array by combining the numerical matrix and the threshold value array in S400 comprises:
marking the threshold value array as a array Tarr, and respectively representing the numerical values of the limit values of cadmium, chromium, lead, arsenic and mercury in the aquatic vegetables in the Tarr by variables cdl, crl, pbl, asl and hgl, namely Tarr = [ cdl, crl, pbl, asl and hgl ], marking the number of elements in the Tarr as L, the serial number of the elements as t, and the serial number of the elements in the Tarr as t, and the element in the Tarr as Tarr (t);
acquiring the matrix size of the numerical matrix and recording as k multiplied by c, wherein k represents the row number of the numerical matrix, and c represents the column number of the numerical matrix;
defining a variable v, v belongs to [1, k ]; defining a variable s, s belongs to [1, c ];
using v to represent the serial number of a row in the numerical matrix, and using s to represent the serial number of a column in the numerical matrix;
recording the numerical matrix as matrix Mats, recording the elements of the v-th row and the s-th column in the numerical matrix as Mats (v, s), wherein the Mats (v, s) belongs to Mats;
defining a fourth vector as a k-dimensional vector, wherein elements in the vector are variables, the fourth vector is denoted as Vec4, and the values of the elements in the fourth vector can be subjected to gradient descent; since the fourth vector is a k-dimensional vector, v is also used to represent the sequence number of the dimension in the fourth vector, and the element with the sequence number v of the dimension in the fourth vector is Vec4(v), and Vec4(v) belongs to Vec 4;
the variable initial value of the element in the fourth vector is a random number with a value range of (0,1) generated by a random function, or the variable initial value of the element in the fourth vector is Vec4(v) = cos (pi × v/2k), cos () represents a cosine function, and pi is a circumference ratio;
and (3) recording the calculation result of the combined numerical value matrixes Mats and Vec4 as Maty, wherein the calculation formula of Maty is as follows:
Figure 240107DEST_PATH_IMAGE004
the calculation formula of Maty is a calculation formula combining Mats and Vec4, wherein because s ∈ [1, c ], Maty is a vector of c dimension, the dimension with the sequence number s in Maty is marked as Maty(s), and Maty(s) is as follows:
Figure 935530DEST_PATH_IMAGE005
keeping the function of calculating the deviation between the environment data set and the threshold value array as Disr (), wherein Disr (Maty, Tarr) represents the deviation between the environment data set and the threshold value array calculated by the function Disr (), and the calculation formula of Disr (Maty, Tarr) is as follows:
Figure 442735DEST_PATH_IMAGE006
wherein, the calculation process of Ur (Maty(s), Tarr (t)) is as follows:
Figure 858804DEST_PATH_IMAGE007
the dist (Maty, Tarr) is a deviation between the environment data set and the threshold value array, and the calculation formula of the dist (Maty, Tarr) is a formula for calculating the deviation between the environment data set and the threshold value array.
4. A method for evaluating quality of aquatic vegetables based on habitat environmental data according to claim 3, wherein in S500, a gradient descent algorithm is used to minimize the deviation so as to perform a gradient descent on the numerical matrix, and the method for obtaining the numerical matrix after the gradient descent comprises:
the deviation between the environment data set and the threshold value array is subjected to gradient descent through an Adam algorithm by using a random gradient descent algorithm based on a first derivative, the Adam algorithm is used for carrying out gradient descent on an initial value of a third matrix Mat3 in the gradient descent process, correspondingly, the numerical values of elements in the numerical matrix are also subjected to gradient descent, after the numerical matrix is subjected to gradient descent, the numerical matrix subjected to gradient descent is obtained and recorded as Mats', and the size of the numerical matrix subjected to gradient descent is kept consistent with the size of the numerical matrix.
5. The method of claim 4, wherein in step S600, the upper limit of the heavy metal concentration of the vegetables is obtained from the numerical matrix after the gradient is decreased by: taking each row in the numerical matrix subjected to gradient reduction, adding elements in each row respectively to obtain the accumulated sum of each row respectively, recording the ordered array formed by the accumulated sums of each row as an upper limit array according to the sequence number of each row in the numerical matrix subjected to gradient reduction, wherein the number of the rows in the numerical matrix is 10, the number of the elements in the upper limit array is 10, the elements in the upper limit array are respectively cadmium, chromium, lead, arsenic, mercury, cadmium, chromium, lead, arsenic and mercury, the upper limit value of 10 numerical values of soil and irrigation water needing to be detected, namely the upper limit value of the heavy metal concentration, judging whether the upper limit value of the heavy metal concentration is exceeded or not, the pollution exceeding the upper limit value of the heavy metal concentration is the pollution of the heavy metal concentration, and marking and outputting the polluted aquatic vegetables in the production area, thus, when only the data of heavy metals of cadmium, chromium, lead, arsenic, mercury, cadmium, chromium, lead, arsenic, and mercury in the aquatic vegetable production area is obtained, but the data of specific heavy metals contained in the sample of the aquatic vegetable produced in the aquatic vegetable production area is not obtained, the upper limit of the heavy metal concentration and the data of heavy metals in the aquatic vegetable production area are used to determine, and the aquatic vegetable produced in the aquatic vegetable production area is marked as contaminated, and the aquatic vegetable produced in the aquatic vegetable production area is stopped from being consumed.
6. An aquatic vegetable quality evaluation system based on habitat environmental data, characterized in that the aquatic vegetable quality evaluation system based on habitat environmental data comprises: the aquatic vegetable quality evaluation system based on the production place environment data can be operated in computing equipment of a desktop computer, a notebook computer, a palm computer and a cloud data center, and the operable system comprises the processor, the memory and a server cluster.
CN202111446281.XA 2021-12-01 2021-12-01 Aquatic vegetable quality evaluation method and system based on production place environment data Active CN113848289B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111446281.XA CN113848289B (en) 2021-12-01 2021-12-01 Aquatic vegetable quality evaluation method and system based on production place environment data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111446281.XA CN113848289B (en) 2021-12-01 2021-12-01 Aquatic vegetable quality evaluation method and system based on production place environment data

Publications (2)

Publication Number Publication Date
CN113848289A true CN113848289A (en) 2021-12-28
CN113848289B CN113848289B (en) 2022-02-08

Family

ID=78982534

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111446281.XA Active CN113848289B (en) 2021-12-01 2021-12-01 Aquatic vegetable quality evaluation method and system based on production place environment data

Country Status (1)

Country Link
CN (1) CN113848289B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106576809A (en) * 2016-12-09 2017-04-26 广东省农业科学院农产品公共监测中心 Method for lowering heavy-metal lead-cadmium content of Ipomoea aquatica
CN109885602A (en) * 2019-03-07 2019-06-14 四川省农业科学院土壤肥料研究所 A kind of screening technique and system of Accumulation of heavy metals vegetable variety
CN112883137A (en) * 2021-03-02 2021-06-01 农业农村部环境保护科研监测所 Agricultural product producing area safety early warning method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106576809A (en) * 2016-12-09 2017-04-26 广东省农业科学院农产品公共监测中心 Method for lowering heavy-metal lead-cadmium content of Ipomoea aquatica
CN109885602A (en) * 2019-03-07 2019-06-14 四川省农业科学院土壤肥料研究所 A kind of screening technique and system of Accumulation of heavy metals vegetable variety
CN112883137A (en) * 2021-03-02 2021-06-01 农业农村部环境保护科研监测所 Agricultural product producing area safety early warning method

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
李华荣等: "《Python程序员面试笔试宝典》", 31 March 2020, 机械工业出版社 *
李富荣等: "茄果类蔬菜对其产地土壤重金属的吸收富集与安全阈值研究", 《农产品质量与安全》 *
蒋振欣: "南京市蔬菜产地环境与蔬菜产品安全监测与评价", 《中国优秀硕士学位论文全文数据库 工程科技I辑》 *
覃辉等: "《CASIO fx-FD10Pro中文图形机道路桥梁隧道测量程序与案例》", 31 January 2014 *

Also Published As

Publication number Publication date
CN113848289B (en) 2022-02-08

Similar Documents

Publication Publication Date Title
Srivastava et al. Winter wheat yield prediction using convolutional neural networks from environmental and phenological data
Jackulin et al. A comprehensive review on detection of plant disease using machine learning and deep learning approaches
Nguyen et al. Bounded generalized Gaussian mixture model
Crossa et al. Genomic selection and prediction in plant breeding
Benkendorf et al. Effects of sample size and network depth on a deep learning approach to species distribution modeling
Wang et al. Early real-time detection algorithm of tomato diseases and pests in the natural environment
Larkin et al. Genomic selection—considerations for successful implementation in wheat breeding programs
Albattah et al. Artificial intelligence-based drone system for multiclass plant disease detection using an improved efficient convolutional neural network
CN110672323B (en) Bearing health state assessment method and device based on neural network
Kamath et al. Classification of paddy crop and weeds using semantic segmentation
Lepš et al. Biostatistics with R: an introductory guide for field biologists
Shirota et al. Approximate Bayesian computation and model assessment for repulsive spatial point processes
CN113848289B (en) Aquatic vegetable quality evaluation method and system based on production place environment data
Xie et al. A novel feature selection strategy based on Salp swarm algorithm for plant disease detection
CN110598732B (en) Plant health detection method and device based on image recognition
Sara et al. New learning approach for unsupervised neural networks model with application to agriculture field
Park et al. Advanced modelling techniques studying global changes in environmental sciences
Cai et al. Improved EfficientNet for corn disease identification
Verma et al. Applicability of machine learning algorithms for intelligent farming
Ni et al. A deep convolutional neural network-based method for identifying weed seedlings in maize fields
Patokar et al. Classification of Tomato Leaf Diseases: A Comparison of Different Optimizers
Reddy et al. Plant Leaf Disease Detection using IoT, DL and ML
Misra et al. Yield-SpikeSegNet: An extension of SpikeSegNet deep-learning approach for the yield estimation in the wheat using visual images
Huang et al. Modeling and simulation study of the stoichiometric niche space and niche overlap based on the copula method
Lawal et al. An improved YOLOv5s model using feature concatenation with attention mechanism for real-time fruit detection and counting

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20211228

Assignee: Guangdong Intelligent Inspection Station Technical Service Co.,Ltd.

Assignor: Institute of agricultural quality standards and monitoring technology, Guangdong Academy of Agricultural Sciences

Contract record no.: X2022980017483

Denomination of invention: A method and system for quality evaluation of aquatic vegetables based on environmental data

Granted publication date: 20220208

License type: Common License

Record date: 20221010

EE01 Entry into force of recordation of patent licensing contract