CN111488851A - Traceability detection method, device, equipment and medium for fruit production place - Google Patents
Traceability detection method, device, equipment and medium for fruit production place Download PDFInfo
- Publication number
- CN111488851A CN111488851A CN202010306746.0A CN202010306746A CN111488851A CN 111488851 A CN111488851 A CN 111488851A CN 202010306746 A CN202010306746 A CN 202010306746A CN 111488851 A CN111488851 A CN 111488851A
- Authority
- CN
- China
- Prior art keywords
- fruit
- model
- training
- data
- spectral data
- 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.)
- Pending
Links
- 235000013399 edible fruits Nutrition 0.000 title claims abstract description 146
- 238000001514 detection method Methods 0.000 title claims abstract description 57
- 238000004519 manufacturing process Methods 0.000 title claims description 29
- 238000012549 training Methods 0.000 claims abstract description 123
- 230000003595 spectral effect Effects 0.000 claims abstract description 91
- 238000000034 method Methods 0.000 claims abstract description 67
- 238000012360 testing method Methods 0.000 claims abstract description 35
- 230000008569 process Effects 0.000 claims abstract description 33
- 238000001228 spectrum Methods 0.000 claims abstract description 29
- 238000004458 analytical method Methods 0.000 claims abstract description 17
- 238000007635 classification algorithm Methods 0.000 claims abstract description 17
- 238000005516 engineering process Methods 0.000 claims abstract description 17
- 238000002329 infrared spectrum Methods 0.000 claims abstract description 17
- 238000007781 pre-processing Methods 0.000 claims abstract description 15
- 238000004422 calculation algorithm Methods 0.000 claims description 14
- 238000004590 computer program Methods 0.000 claims description 11
- 238000012545 processing Methods 0.000 claims description 8
- 238000003860 storage Methods 0.000 claims description 8
- 238000001914 filtration Methods 0.000 claims description 6
- 238000012937 correction Methods 0.000 claims description 5
- 238000000513 principal component analysis Methods 0.000 claims description 5
- 238000010606 normalization Methods 0.000 claims description 4
- 238000012706 support-vector machine Methods 0.000 description 12
- 238000010586 diagram Methods 0.000 description 6
- 239000000126 substance Substances 0.000 description 6
- 244000298697 Actinidia deliciosa Species 0.000 description 5
- 235000009436 Actinidia deliciosa Nutrition 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 5
- 238000012569 chemometric method Methods 0.000 description 4
- 238000004497 NIR spectroscopy Methods 0.000 description 3
- 230000009471 action Effects 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000002360 preparation method Methods 0.000 description 3
- 238000010521 absorption reaction Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000002349 favourable effect Effects 0.000 description 2
- 235000013569 fruit product Nutrition 0.000 description 2
- 238000005286 illumination Methods 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 1
- 239000003153 chemical reaction reagent Substances 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 229910001385 heavy metal Inorganic materials 0.000 description 1
- 244000005700 microbiome Species 0.000 description 1
- 235000015097 nutrients Nutrition 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 239000002689 soil Substances 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 238000001429 visible spectrum Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2218/00—Aspects of pattern recognition specially adapted for signal processing
- G06F2218/02—Preprocessing
- G06F2218/04—Denoising
- G06F2218/06—Denoising by applying a scale-space analysis, e.g. using wavelet analysis
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/17—Systems in which incident light is modified in accordance with the properties of the material investigated
- G01N21/25—Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
- G01N21/31—Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry
- G01N21/35—Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light
- G01N21/359—Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light using near infrared light
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2411—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/018—Certifying business or products
- G06Q30/0185—Product, service or business identity fraud
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/02—Agriculture; Fishing; Forestry; Mining
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2218/00—Aspects of pattern recognition specially adapted for signal processing
- G06F2218/12—Classification; Matching
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/60—Type of objects
- G06V20/68—Food, e.g. fruit or vegetables
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- General Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Artificial Intelligence (AREA)
- Bioinformatics & Computational Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Spectroscopy & Molecular Physics (AREA)
- General Business, Economics & Management (AREA)
- Strategic Management (AREA)
- Marketing (AREA)
- Evolutionary Biology (AREA)
- Health & Medical Sciences (AREA)
- Economics (AREA)
- Signal Processing (AREA)
- Analytical Chemistry (AREA)
- Mining & Mineral Resources (AREA)
- Primary Health Care (AREA)
- Marine Sciences & Fisheries (AREA)
- Tourism & Hospitality (AREA)
- Animal Husbandry (AREA)
- Agronomy & Crop Science (AREA)
- Chemical & Material Sciences (AREA)
- Human Resources & Organizations (AREA)
- Biochemistry (AREA)
- Immunology (AREA)
- Pathology (AREA)
- Entrepreneurship & Innovation (AREA)
- Accounting & Taxation (AREA)
- Development Economics (AREA)
- Finance (AREA)
- Investigating Or Analysing Materials By Optical Means (AREA)
Abstract
The application discloses a traceability detection method, device, equipment and medium of fruit producing area, and the method comprises: detecting the origin of the fruit to be detected by using the prediction model to obtain the origin information of the fruit to be detected; the creating process of the prediction model comprises the following steps: acquiring original spectral data of target fruits in different producing areas and the same type by using a near infrared spectrum analysis technology, and preprocessing the original spectral data to obtain preprocessed spectral data; setting a corresponding producing area label for the preprocessed spectral data according to the geographical position information in the preprocessed spectral data to obtain reconstructed spectral data; selecting training set data and test set data from the reconstructed spectrum data; training the training set data based on a classification algorithm to obtain a training model; and if the training model has no over-fitting or under-fitting, judging the training model as a prediction model. The method can obviously reduce the detection cost and the detection time required when the source tracing detection is carried out on the fruit producing area.
Description
Technical Field
The invention relates to the technical field of fruit producing area tracing, in particular to a method, a device, equipment and a medium for detecting the fruit producing area tracing.
Background
The geographical mark products generally have better economic benefits than common products of the same type, so the traceability technology of the geographical mark products is also applied to production, wherein the traceability detection of the origin of the fruits, especially the traceability detection of the fruit products protected based on the geographical marks, is a current research hotspot because the traceability detection of the fruit products is wide in related range and has many links from production to circulation.
Currently, in the process of tracing the origin of fruits, Near Infrared Spectroscopy (NIST) is usually used to detect characteristic components in fruits to be detected, and meanwhile, the origin information, nutrient component information, trace heavy metals, and microorganism residue information of fruits to be detected are obtained by combining with a chemometric method, so as to trace the origin of fruits to be detected. Because certain chemical reagents and devices are needed, the traditional chemometry and near infrared spectroscopy combined library construction cost is high, and the detection time is long. In addition, although the characteristic spectrum signal of the biomolecule in the near infrared long wave region (1100 nm-2500 nm) is obvious, the hardware cost of the corresponding spectrometer is several times or even dozens of times of that of the near infrared short wave region (780 nm-1100 nm). The characteristic identification of the near-infrared short-wave region spectrum is far from enough by relying on the traditional chemometrics analysis because the frequency doubling and frequency combination information of the fundamental frequency vibration of chemical bonds in molecules is very weak. At present, no effective solution exists for the technical problem.
Therefore, how to reduce the detection cost and the detection time required for tracing the production area of the fruit is a technical problem to be solved urgently by the technical personnel in the field.
Disclosure of Invention
In view of the above, the present invention provides a method, an apparatus, a device and a medium for tracing and identifying a fruit producing area, so as to reduce the detection cost and the detection time required for tracing and detecting the fruit producing area. The specific scheme is as follows:
a tracing detection method for a fruit producing area comprises the following steps:
detecting the origin of the fruit to be detected by using a pre-trained prediction model to obtain the origin information of the fruit to be detected;
the creating process of the prediction model comprises the following steps:
acquiring original spectral data of target fruits in different producing areas and the same type by using a near infrared spectrum analysis technology, and preprocessing the original spectral data to obtain preprocessed spectral data; wherein the target fruit comprises the same type of fruit as the fruit to be detected;
extracting geographic position information in the preprocessed spectral data, and setting a corresponding producing area label for the preprocessed spectral data according to the geographic position information to obtain reconstructed spectral data;
selecting training set data and test set data from the reconstructed spectral data;
training the training set data based on a classification algorithm to obtain a training model;
testing the training model by using the test set data to judge whether the training model is over-fitted;
if not, judging whether the prediction model has under-fitting;
if not, the training model is judged as the prediction model.
Preferably, the step of preprocessing the raw spectral data to obtain preprocessed spectral data includes:
and carrying out normalization processing and/or Fourier transform and/or wavelet transform and/or multivariate scattering correction and/or standard normal variable transform and/or principal component analysis on the original spectral data to obtain the preprocessed spectral data.
Preferably, the training of the training set data based on the classification algorithm to obtain a training model includes:
training the training set data based on an SVM algorithm to obtain the training model.
Preferably, after the process of determining whether the training model has overfitting, the method further includes:
and if so, increasing the data volume of the training set data.
Preferably, after the determining whether the prediction model has the under-fitting process, the method further includes:
and if so, filtering the original spectrum data.
Preferably, after the process of detecting the origin of the fruit to be detected by using the pre-trained prediction model to obtain the origin information of the fruit to be detected, the method further includes:
and storing the producing area information of the fruits to be detected.
Preferably, after the process of detecting the origin of the fruit to be detected by using the pre-trained prediction model to obtain the origin information of the fruit to be detected, the method further includes:
and displaying the producing area information of the fruits to be detected by using an upper computer.
Correspondingly, the invention also discloses a traceability detection device of the fruit producing area, which comprises:
the model prediction module is used for detecting the origin of the fruit to be detected by using a pre-trained prediction model to obtain the origin information of the fruit to be detected;
the model prediction module is obtained by creating a model creation sub-model; wherein the model creation sub-module comprises:
the data preprocessing unit is used for acquiring original spectral data of target fruits in different producing areas and the same type by utilizing a near infrared spectrum analysis technology and preprocessing the original spectral data to obtain preprocessed spectral data; wherein the target fruit comprises the same type of fruit as the fruit to be detected;
the data creating unit is used for extracting geographic position information in the preprocessed spectral data and setting a corresponding producing area label for the preprocessed spectral data according to the geographic position information to obtain reconstructed spectral data;
the data selection unit is used for selecting training set data and test set data from the reconstructed spectrum data;
the model training unit is used for training the training set data based on a classification algorithm to obtain a training model;
the model testing unit is used for testing the training model by using the test set data so as to judge whether the training model is over-fitted;
the model judging unit is used for judging whether the prediction model has under-fitting or not when the judgment result of the model testing unit is negative;
and the model judging unit is used for judging the training model as the prediction model when the judgment result of the model judging unit is negative.
Correspondingly, the invention also discloses a fruit producing area tracing detection device, which comprises:
a memory for storing a computer program;
a processor for implementing the steps of the method for detecting fruit origin as disclosed in the foregoing when executing the computer program.
Correspondingly, the invention also discloses a computer readable storage medium, which stores a computer program, and the computer program realizes the steps of the traceability detection method of the fruit producing area as disclosed in the foregoing when being executed by a processor.
Therefore, in the invention, the near infrared spectrum analysis technology is utilized to collect the original spectrum data of target fruits with different producing areas and the same type, and the original spectrum data is preprocessed to obtain preprocessed spectrum data; then, extracting geographical position information in the preprocessed spectral data, and setting a corresponding producing area label for the preprocessed spectral data according to the geographical position information to obtain reconstructed spectral data; and then, selecting training set data and test set data from the reconstructed spectral data, training the training set data based on a classification algorithm to obtain a training model, testing the training model by using the test set data to judge whether the training model is over-fit or under-fit, and if the training model is not over-fit or under-fit, judging that the training model is a qualified prediction model. Under the condition, the origin of the fruit to be detected can be detected by using the trained prediction model, and the origin information of the fruit to be detected can be obtained. Obviously, the method is equivalent to combining a near infrared spectrum analysis technology and an artificial intelligence classification algorithm, and compared with the prior art, the method for detecting the fruit production place traceability not only can be favorable for capturing weak characteristic signals of a near infrared short wave region, but also avoids chemical preparations and complex steps required by analyzing and building a library by adopting a traditional chemometric method, so that the detection cost and the detection time required by detecting the fruit production place traceability can be obviously reduced. Correspondingly, the traceability detection device, equipment and medium of fruit origin provided by the application also have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for detecting fruit origin tracing according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating a SVM algorithm according to an embodiment of the present invention;
fig. 3 is a structural diagram of a traceability detection apparatus of a fruit production area according to an embodiment of the present invention;
fig. 4 is a structural diagram of a traceability detection apparatus of a fruit production area according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of a traceability detection method of a fruit production area according to an embodiment of the present invention, the traceability detection method includes:
detecting the origin of the fruit to be detected by using a pre-trained prediction model to obtain the origin information of the fruit to be detected;
the creating process of the prediction model comprises the following steps:
step S11: acquiring original spectral data of target fruits in different producing areas and the same type by using a near infrared spectrum analysis technology, and preprocessing the original spectral data to obtain preprocessed spectral data;
wherein the target fruit comprises the same type of fruit as the fruit to be detected;
step S12: extracting geographic position information in the preprocessed spectral data, and setting a corresponding producing area label for the preprocessed spectral data according to the geographic position information to obtain reconstructed spectral data;
step S13: selecting training set data and test set data from the reconstructed spectrum data;
step S14: training the training set data based on a classification algorithm to obtain a training model;
step S15: testing the training model by using the test set data to judge whether the training model is over-fitted; if not, go to step S16;
step S16: judging whether the prediction model has under-fitting; if not, go to step S17;
step S17: and judging the training model as a prediction model.
In this embodiment, a traceability detection method of a fruit producing area is provided, by which detection cost and detection time required for traceability detection of a fruit producing area to be detected can be significantly reduced.
Specifically, in this embodiment, the origin of the fruit to be tested is detected by using a pre-trained prediction model, so as to obtain the origin information of the fruit to be tested. In the process of creating the prediction model, the original spectral data of target fruits in different producing areas and the same type are collected by utilizing a near infrared spectrum analysis technology, and the original spectral data are preprocessed to obtain preprocessed spectral data. It should be noted that, in the present embodiment, the target fruit includes the same type of fruit as the fruit to be tested.
Because the near infrared light is electromagnetic wave between the visible spectrum region and the middle infrared spectrum region, and the movement of various groups combined by chemical bonds in molecules of organic matters and partial inorganic matters in the fruits to be detected has fixed vibration frequency, when the molecules are irradiated by the infrared rays, the molecules are excited to generate resonance, and simultaneously, part of the energy of the light is absorbed. On the principle, the near infrared spectrum analysis technology is utilized to analyze the characteristics of substances in the fruits to be detected, such as absorption, scattering, reflection, projection and the like of light, so that corresponding spectrum data can be obtained. It can be understood that, because the fruit from different producing areas has different factors affecting the growth of the fruit, such as illumination, humidity and soil in the growing environment, even if the fruit is of the same type, different spectral data can be obtained from different producing areas.
In the present embodiment, in the process of creating the prediction model, the near infrared spectrum analysis technology is used to collect the raw spectrum data of the target fruits of different producing areas and the same type. It is conceivable that there must be some useless data or noise data in the acquired raw spectral data, so after acquiring raw spectral data of target fruits of the same type in different production places, the raw spectral data needs to be preprocessed to obtain preprocessed spectral data without noise data.
Because the original spectral data is obtained by analyzing the fruits in different producing areas by using the near infrared spectrum analysis technology, different geographical position information is necessarily contained in the preprocessed spectral data. In order to enable the preprocessed spectrum data to represent the producing area of the fruit to be detected, after the preprocessed spectrum data are obtained, geographic position information in the preprocessed spectrum data need to be extracted, and a corresponding producing area label is set for the preprocessed spectrum data according to the geographic position information, so that reconstructed spectrum data are obtained. Here, the kiwi fruit in two production places is taken as an example for specific explanation, and assuming that the production place tags of the kiwi fruit production place 1 and the kiwi fruit production place 2 are 0 and 1 respectively, then the production place tags of the kiwi fruit production place 1 and the kiwi fruit production place 2 are {0,1 }.
Then, dividing the reconstructed spectrum data into two parts, namely setting one part of the reconstructed spectrum data as training set data and the other part of the reconstructed spectrum data as test set data; and training the training set data based on a classification algorithm to obtain a training model. In practical applications, the classification algorithm may be KNN (K-Nearest Neighbor) algorithm, naive bayes algorithm, or artificial neural network algorithm, etc.
In addition, in this embodiment, in order to ensure the accuracy when the training model is used to perform origin tracing detection on the fruit to be detected, it is required to detect whether the training model has over-fitting and under-fitting, and if the training model does not have over-fitting and under-fitting phenomena, it is indicated that the training model can reach the standard for detecting the origin of the fruit to be detected. In this case, the training model may be determined as a prediction model, and the origin of the fruit to be tested is detected by using the prediction model, so as to obtain the origin information of the fruit to be tested.
Obviously, the traceability detection method provided by the embodiment is equivalent to combining a near infrared spectrum analysis technology and an artificial intelligence classification algorithm, so that compared with the prior art, the traceability detection method for the fruit producing area not only can be beneficial to capturing weak characteristic signals of a near infrared short wave region, but also avoids chemical preparations and complex steps required by analyzing and building a library by adopting a traditional chemometric method, and therefore, the detection cost and the detection time required by traceability detection of the fruit producing area can be obviously reduced.
Therefore, in this embodiment, first, the near infrared spectrum analysis technology is used to collect the original spectrum data of the target fruits of different producing areas and the same type, and the original spectrum data is preprocessed to obtain preprocessed spectrum data; then, extracting geographical position information in the preprocessed spectral data, and setting a corresponding producing area label for the preprocessed spectral data according to the geographical position information to obtain reconstructed spectral data; and then, selecting training set data and test set data from the reconstructed spectral data, training the training set data based on a classification algorithm to obtain a training model, testing the training model by using the test set data to judge whether the training model is over-fit or under-fit, and if the training model is not over-fit or under-fit, judging that the training model is a qualified prediction model. Under the condition, the origin of the fruit to be detected can be detected by using the trained prediction model, and the origin information of the fruit to be detected can be obtained. Obviously, the method is equivalent to combining a near infrared spectrum analysis technology and an artificial intelligence classification algorithm, and compared with the prior art, the method for detecting the fruit production place traceability not only can be favorable for capturing weak characteristic signals of a near infrared short wave region, but also avoids chemical preparations and complex steps required by analyzing and building a library by adopting a traditional chemometric method, so that the detection cost and the detection time required by detecting the fruit production place traceability can be obviously reduced.
Based on the above embodiments, this embodiment further describes and optimizes the technical solution, and as a preferred implementation, the above steps: the process of preprocessing the original spectrum data to obtain preprocessed spectrum data comprises the following steps:
and carrying out normalization processing and/or Fourier transform and/or wavelet transform and/or multivariate scattering correction and/or standard normal variable transform and/or principal component analysis on the original spectral data to obtain preprocessed spectral data.
In this embodiment, in the process of performing the preprocessor on the original spectral data, the original spectral data may be normalized, and because the original spectral data is normalized, the original spectral data may be converted into data with a uniform data format, and the original spectral data may be limited within a certain preset range, which is more convenient for the subsequent processing.
In practical application, the original spectral data can be processed by utilizing Fourier transform and/or wavelet transform to remove noise data in the original spectral data, so that the accuracy and reliability of the preprocessed spectral data can be relatively ensured.
Alternatively, multivariate scattering correction and/or standard normal transformation can be performed on the original spectral data to eliminate the influence of the illumination scattering or diffuse reflection phenomenon on the original spectral data, so as to enhance the spectral absorption information related to the component content. Obviously, by such an arrangement, the accuracy of the pre-processing of the spectral data can be further improved. In addition, in the actual operation process, principal component analysis can be carried out on the original spectrum data to remove redundant data in the original spectrum data, and therefore the data processing speed in the subsequent data processing process is improved.
Based on the above embodiments, this embodiment further describes and optimizes the technical solution, and as a preferred implementation, the above steps: training the training set data based on a classification algorithm to obtain a training model, comprising the following steps:
training the training set data based on an SVM algorithm to obtain a training model.
Specifically, in this embodiment, an SVM (Support Vector Machine) algorithm is used to train the training set data to obtain a training model. Because the SVM algorithm is essentially an optimal classification plane for training set data under separable conditions, here, we specifically describe the training set data by performing two classifications, assuming that the decision plane is:
WTX+b=0;
in the formula, W is the normal vector of the hyperplane, X is the training set, and b is the intercept of the hyperplane.
The distance m from a sample point in the training set data to the decision plane can be expressed as:
in the formula, xiIs the ith characteristic variable, b is the intercept of the hyperplane, and W is the normal vector of the hyperplane.
The minimum value of the geometric interval of the decision plane relative to the sample points in all the test set data is the distance from the support vector to the decision plane, and the problem of solving the maximum division decision plane by the SVM can be equivalently solvedThen, the SVM solving the maximum decision plane problem can be equivalent to the following constrained optimization problem, that is:
the hard boundary SVM can be transformed into an equivalent quadratic convex optimization problem to solve, as shown in fig. 2, fig. 2 is a schematic diagram of the principle of the SVM algorithm provided in the embodiment of the present invention. In view of the above discussion, SVM may be represented as follows:
inputting: training data set T { (x)1,y1),...(xn,yn)},xi∈R,yi={+1,-1},i=1,2,...,n;
And (3) outputting: a decision plane and a classification decision function;
the method comprises the following steps: selecting a penalty parameter C > 0, constructing and solving a convex quadratic programming problem, namely:
Step three: finding a decision plane w*X+b*0 and the classification decision function: (X) sign (w X + b)*=0)。
Obviously, the technical scheme provided by the embodiment can relatively improve the universality of the application in practical application.
Based on the above embodiments, this embodiment further describes and optimizes the technical solution, and as a preferred implementation, the above steps: after the process of judging whether the training model has overfitting or not, the method further comprises the following steps:
if yes, increasing the data volume of the training set data.
It can be understood that the overfitting is a phenomenon that the training model is tested by using the training set data with good effect and the loss function is reduced to be low, but a phenomenon that the testing effect is poor occurs when the training model is tested by using the testing set data. According to practical operation experience, the reason for the phenomenon is as follows: since the training model relies heavily on the features of the existing training set data, in this case, the technical problem can be solved by increasing the data size of the training set data, that is, by increasing the data size of the training set data.
Obviously, the accuracy of the prediction model can be relatively increased by the technical scheme provided by the embodiment.
Based on the above embodiments, this embodiment further describes and optimizes the technical solution, and as a preferred implementation, the above steps: after the process of judging whether the prediction model has the under-fitting condition, the method further comprises the following steps:
and if so, filtering the original spectral data.
In practical application, if the prediction model has an under-fitting phenomenon, it indicates that the training set data has no generalization or is caused by the fact that the training set data is not accurate enough. In this case, it is possible to avoid this phenomenon by performing a filtering process on the raw spectral data. Specifically, in the actual operation process, the original spectral data may be filtered by using a clipping filter algorithm, a median filter algorithm, or an arithmetic mean filter algorithm.
Or, in practical application, the under-fitting phenomenon of the prediction model can be prevented by complicating the prediction model, increasing the characteristic quantity of the original spectral data, adjusting parameters and hyper-parameters, reducing regularization constraints and the like.
Therefore, the accuracy and the reliability of the prediction model can be further ensured by the technical scheme provided by the embodiment.
Based on the above embodiments, this embodiment further describes and optimizes the technical solution, and as a preferred implementation, the above steps: after the process of detecting the origin of the fruit to be detected by using the pre-trained prediction model to obtain the origin information of the fruit to be detected, the method further comprises the following steps:
and storing the producing area information of the fruits to be detected.
In this embodiment, after the origin of the fruit to be tested is detected by using the pre-trained prediction model to obtain the origin information of the fruit to be tested, the origin information of the fruit to be tested can be stored, so that the user can conveniently trace and analyze the origin information of the fruit to be tested in the subsequent process. In addition, in practical application, in order to reduce the manufacturing cost required by the storage medium, the production place information of the fruit to be detected can be stored in the cloud storage.
Therefore, by the technical scheme provided by the embodiment, the user experience of the user when using the prediction model can be improved.
Based on the above embodiments, this embodiment further describes and optimizes the technical solution, and as a preferred implementation, the above steps: after the process of detecting the origin of the fruit to be detected by using the pre-trained prediction model to obtain the origin information of the fruit to be detected, the method further comprises the following steps:
and displaying the producing area information of the fruits to be detected by using the upper computer.
In this embodiment, in order to further improve the user experience of the user when using the prediction model, the origin of the fruit to be tested may be detected by using the pre-trained prediction model, and after the origin information of the fruit to be tested is obtained, the origin information of the fruit to be tested may be displayed by using the upper computer.
That is, through the technical scheme provided by this embodiment, the place of production information of the fruit to be tested can be displayed in front of the user more clearly and intuitively, so that the user can better trace back and analyze the place of production information of the fruit to be tested.
Referring to fig. 3, fig. 3 is a structural diagram of a traceability detection apparatus of a fruit production area provided in an embodiment of the present invention, the traceability detection apparatus includes:
the model prediction module is used for detecting the origin of the fruit to be detected by using a pre-trained prediction model to obtain the origin information of the fruit to be detected;
the model prediction module is obtained by establishing a model establishing sub-model; wherein the model creation submodule comprises:
the data preprocessing unit 21 is configured to collect original spectral data of target fruits of different production places and the same type by using a near infrared spectrum analysis technology, and preprocess the original spectral data to obtain preprocessed spectral data; wherein the target fruit comprises the same type of fruit as the fruit to be detected;
the data creating unit 22 is configured to extract geographic position information in the preprocessed spectral data, and set a corresponding origin tag for the preprocessed spectral data according to the geographic position information to obtain reconstructed spectral data;
a data selecting unit 23, configured to select training set data and test set data from the reconstructed spectrum data;
the model training unit 24 is used for training the training set data based on a classification algorithm to obtain a training model;
a model testing unit 25, configured to test the training model by using the test set data to determine whether the training model is over-fit;
a model judging unit 26 for judging whether the prediction model has under-fitting or not when the judgment result of the model testing unit is no;
and a model determination unit 27 configured to determine the training model as the prediction model if the determination result of the model determination unit is negative.
Preferably, the data preprocessing unit 21 includes:
and the data preprocessing subunit is used for carrying out normalization processing and/or Fourier transform and/or wavelet transform and/or multivariate scattering correction and/or standard normal variable transform and/or principal component analysis on the original spectral data to obtain preprocessed spectral data.
Preferably, the model training unit 24 includes:
and the model training subunit is used for training the training set data based on the SVM algorithm to obtain a training model.
Preferably, the method further comprises the following steps:
and the data increasing unit is used for increasing the data volume of the training set data after judging that the over-fitting process exists in the training model.
Preferably, the method further comprises the following steps:
and a data filtering unit for performing filtering processing on the original spectral data when the determination result of the model determination unit 26 is yes.
Preferably, the method further comprises the following steps:
and the information storage module is used for detecting the origin of the fruit to be detected by using the pre-trained prediction model, and storing the origin information of the fruit to be detected after the process of obtaining the origin information of the fruit to be detected.
Preferably, the method further comprises the following steps:
and the information display module is used for detecting the origin of the fruit to be detected by using the pre-trained prediction model, and displaying the origin information of the fruit to be detected by using the upper computer after the process of obtaining the origin information of the fruit to be detected.
The fruit producing area tracing detection device provided by the embodiment of the invention has the beneficial effects of the fruit producing area tracing detection method disclosed by the embodiment.
Referring to fig. 4, fig. 4 is a structural diagram of a traceability detection apparatus of a fruit production area provided in an embodiment of the present invention, the traceability detection apparatus includes:
a memory 31 for storing a computer program;
a processor 32, configured to implement the steps of the method for detecting fruit origin location tracing as disclosed in the foregoing when executing the computer program.
The fruit producing area tracing detection equipment provided by the embodiment of the invention has the beneficial effects of the fruit producing area tracing detection method.
Accordingly, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method for detecting the traceability of the fruit producing area as disclosed in the foregoing are implemented.
The computer-readable storage medium provided by the embodiment of the invention has the beneficial effects of the fruit producing area tracing detection method disclosed in the foregoing.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The method, the device, the equipment and the medium for detecting the fruit origin of the fruit provided by the invention are described in detail, a specific example is applied in the text to explain the principle and the implementation mode of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (10)
1. A traceability detection method of a fruit producing area is characterized by comprising the following steps:
detecting the origin of the fruit to be detected by using a pre-trained prediction model to obtain the origin information of the fruit to be detected;
the creating process of the prediction model comprises the following steps:
acquiring original spectral data of target fruits in different producing areas and the same type by using a near infrared spectrum analysis technology, and preprocessing the original spectral data to obtain preprocessed spectral data; wherein the target fruit comprises the same type of fruit as the fruit to be detected;
extracting geographic position information in the preprocessed spectral data, and setting a corresponding producing area label for the preprocessed spectral data according to the geographic position information to obtain reconstructed spectral data;
selecting training set data and test set data from the reconstructed spectral data;
training the training set data based on a classification algorithm to obtain a training model;
testing the training model by using the test set data to judge whether the training model is over-fitted;
if not, judging whether the prediction model has under-fitting;
if not, the training model is judged as the prediction model.
2. The traceability detection method of claim 1, wherein the step of preprocessing the raw spectral data to obtain preprocessed spectral data comprises:
and carrying out normalization processing and/or Fourier transform and/or wavelet transform and/or multivariate scattering correction and/or standard normal variable transform and/or principal component analysis on the original spectral data to obtain the preprocessed spectral data.
3. The tracing detection method according to claim 1, wherein the process of training the training set data based on the classification algorithm to obtain a training model comprises:
training the training set data based on an SVM algorithm to obtain the training model.
4. The tracing detection method according to claim 1, wherein after the process of determining whether the training model has overfitting, further comprising:
and if so, increasing the data volume of the training set data.
5. The tracing detection method of claim 1, wherein after the process of determining whether the prediction model is under-fitted, further comprising:
and if so, filtering the original spectrum data.
6. The tracing detection method according to claims 1 to 5, wherein after the process of detecting the origin of the fruit to be detected by using the pre-trained prediction model to obtain the origin information of the fruit to be detected, the tracing detection method further comprises:
and storing the producing area information of the fruits to be detected.
7. The tracing detection method according to claims 1 to 5, wherein after the process of detecting the origin of the fruit to be detected by using the pre-trained prediction model to obtain the origin information of the fruit to be detected, the tracing detection method further comprises:
and displaying the producing area information of the fruits to be detected by using an upper computer.
8. The utility model provides a detection device traces to source in fruit place of production which characterized in that includes:
the model prediction module is used for detecting the origin of the fruit to be detected by using a pre-trained prediction model to obtain the origin information of the fruit to be detected;
the model prediction module is obtained by creating a model creation sub-model; wherein the model creation sub-module comprises:
the data preprocessing unit is used for acquiring original spectral data of target fruits in different producing areas and the same type by utilizing a near infrared spectrum analysis technology and preprocessing the original spectral data to obtain preprocessed spectral data; wherein the target fruit comprises the same type of fruit as the fruit to be detected;
the data creating unit is used for extracting geographic position information in the preprocessed spectral data and setting a corresponding producing area label for the preprocessed spectral data according to the geographic position information to obtain reconstructed spectral data;
the data selection unit is used for selecting training set data and test set data from the reconstructed spectrum data;
the model training unit is used for training the training set data based on a classification algorithm to obtain a training model;
the model testing unit is used for testing the training model by using the test set data so as to judge whether the training model is over-fitted;
the model judging unit is used for judging whether the prediction model has under-fitting or not when the judgment result of the model testing unit is negative;
and the model judging unit is used for judging the training model as the prediction model when the judgment result of the model judging unit is negative.
9. The utility model provides a detection equipment traces to source in fruit place of production which characterized in that includes:
a memory for storing a computer program;
a processor for implementing the steps of a method for detecting fruit origin tracing according to any one of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, implements the steps of a method for detecting fruit origin tracking according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010306746.0A CN111488851A (en) | 2020-04-17 | 2020-04-17 | Traceability detection method, device, equipment and medium for fruit production place |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010306746.0A CN111488851A (en) | 2020-04-17 | 2020-04-17 | Traceability detection method, device, equipment and medium for fruit production place |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111488851A true CN111488851A (en) | 2020-08-04 |
Family
ID=71811166
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010306746.0A Pending CN111488851A (en) | 2020-04-17 | 2020-04-17 | Traceability detection method, device, equipment and medium for fruit production place |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111488851A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113505661A (en) * | 2021-06-22 | 2021-10-15 | 中国农业大学 | Method, device, electronic equipment and storage medium for origin identification |
CN113836784A (en) * | 2021-07-23 | 2021-12-24 | 塔里木大学 | Apple identification system and method based on information fusion technology |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105938093A (en) * | 2016-06-08 | 2016-09-14 | 福建农林大学 | Oolong tea producing area discrimination method based on combination of genetic algorithm and support vector machine |
CN109376933A (en) * | 2018-10-30 | 2019-02-22 | 成都云材智慧数据科技有限公司 | Lithium ion battery negative material energy density prediction technique neural network based |
CN109668859A (en) * | 2019-03-03 | 2019-04-23 | 西南大学 | The near infrared spectrum recognition methods in the Chinese prickly ash place of production and kind based on SVM algorithm |
CN109948676A (en) * | 2019-03-06 | 2019-06-28 | 颐保医疗科技(上海)有限公司 | A kind of discrimination method in the Chinese medicine plantation place of production based on artificial intelligence |
CN110186871A (en) * | 2019-06-25 | 2019-08-30 | 湖北省农业科学院果树茶叶研究所 | A kind of method of discrimination in the fresh tea leaves place of production |
CN110398473A (en) * | 2019-07-25 | 2019-11-01 | 黑龙江八一农垦大学 | A kind of rapid test paper detection method and system |
-
2020
- 2020-04-17 CN CN202010306746.0A patent/CN111488851A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105938093A (en) * | 2016-06-08 | 2016-09-14 | 福建农林大学 | Oolong tea producing area discrimination method based on combination of genetic algorithm and support vector machine |
CN109376933A (en) * | 2018-10-30 | 2019-02-22 | 成都云材智慧数据科技有限公司 | Lithium ion battery negative material energy density prediction technique neural network based |
CN109668859A (en) * | 2019-03-03 | 2019-04-23 | 西南大学 | The near infrared spectrum recognition methods in the Chinese prickly ash place of production and kind based on SVM algorithm |
CN109948676A (en) * | 2019-03-06 | 2019-06-28 | 颐保医疗科技(上海)有限公司 | A kind of discrimination method in the Chinese medicine plantation place of production based on artificial intelligence |
CN110186871A (en) * | 2019-06-25 | 2019-08-30 | 湖北省农业科学院果树茶叶研究所 | A kind of method of discrimination in the fresh tea leaves place of production |
CN110398473A (en) * | 2019-07-25 | 2019-11-01 | 黑龙江八一农垦大学 | A kind of rapid test paper detection method and system |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113505661A (en) * | 2021-06-22 | 2021-10-15 | 中国农业大学 | Method, device, electronic equipment and storage medium for origin identification |
CN113836784A (en) * | 2021-07-23 | 2021-12-24 | 塔里木大学 | Apple identification system and method based on information fusion technology |
CN113836784B (en) * | 2021-07-23 | 2023-10-27 | 塔里木大学 | Apple identification system and method based on information fusion technology |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10706260B2 (en) | Analyzing digital holographic microscopy data for hematology applications | |
CN105389593B (en) | Image object recognition methods based on SURF feature | |
CN103235095B (en) | Water-injected meat detection method and device | |
Dacal-Nieto et al. | Common scab detection on potatoes using an infrared hyperspectral imaging system | |
Chen et al. | Authenticity detection of black rice by near-infrared spectroscopy and support vector data description | |
Samsudin et al. | Spectral feature selection and classification of roofing materials using field spectroscopy data | |
Mishra et al. | Identification of citrus greening (HLB) using a VIS-NIR spectroscopy technique | |
Kumar et al. | Deep remote sensing methods for methane detection in overhead hyperspectral imagery | |
Ngugi et al. | A new approach to learning and recognizing leaf diseases from individual lesions using convolutional neural networks | |
CN111488851A (en) | Traceability detection method, device, equipment and medium for fruit production place | |
Pan et al. | Identification of complex mixtures for Raman spectroscopy using a novel scheme based on a new multi-label deep neural network | |
Batchuluun et al. | Deep learning-based plant classification and crop disease classification by thermal camera | |
CN103278467A (en) | Rapid nondestructive high-accuracy method with for identifying abundance degree of nitrogen element in plant leaf | |
CN110705619B (en) | Mist concentration grade discriminating method and device | |
Gale et al. | Automatic detection of wireless transmissions | |
Dubey | Automatic recognition of fruits and vegetables and detection of fruit diseases | |
Bionda et al. | Deep autoencoders for anomaly detection in textured images using CW-SSIM | |
Jing et al. | Patterned fabric defect detection via convolutional matching pursuit dual-dictionary | |
Zdunek et al. | Segmented convex-hull algorithms for near-separable NMF and NTF | |
Zhao et al. | Spectral–spatial classification of hyperspectral images using trilateral filter and stacked sparse autoencoder | |
Cai et al. | Deep metric learning framework combined with Gramian angular difference field image generation for Raman spectra classification based on a handheld Raman spectrometer | |
Kurniati et al. | GLCM-Based Feature Combination for Extraction Model Optimization in Object Detection Using Machine Learning | |
Qin et al. | Characterization of unplasticized polyvinyl chloride windows by confocal raman microspectroscopy and chemometrics | |
Wu et al. | Identification of lambda-cyhalothrin residues on Chinese cabbage using fuzzy uncorrelated discriminant vector analysis and MIR spectroscopy. | |
Long et al. | Robust plastic waste classification using wavelet transform multi-resolution analysis and convolutional neural networks |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200804 |