CN112285054A - Apple identity recognition model establishing method and system and identity recognition method and system - Google Patents

Apple identity recognition model establishing method and system and identity recognition method and system Download PDF

Info

Publication number
CN112285054A
CN112285054A CN202010932453.3A CN202010932453A CN112285054A CN 112285054 A CN112285054 A CN 112285054A CN 202010932453 A CN202010932453 A CN 202010932453A CN 112285054 A CN112285054 A CN 112285054A
Authority
CN
China
Prior art keywords
sample
model
initial
apple
parameter
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
Application number
CN202010932453.3A
Other languages
Chinese (zh)
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.)
Tarim University
Original Assignee
Tarim University
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 Tarim University filed Critical Tarim University
Priority to CN202010932453.3A priority Critical patent/CN112285054A/en
Publication of CN112285054A publication Critical patent/CN112285054A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/17Systems in which incident light is modified in accordance with the properties of the material investigated
    • G01N21/25Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
    • G01N21/31Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry
    • G01N21/35Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light
    • G01N21/359Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light using near infrared light
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/17Systems in which incident light is modified in accordance with the properties of the material investigated
    • G01N21/25Colour; Spectral properties, i.e. comparison of effect of material on the light at two or more different wavelengths or wavelength bands
    • G01N21/31Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry

Abstract

The invention relates to an apple identity recognition model establishing method and system and an apple identity recognition method and system, comprising the following steps: a1, selecting a sample to obtain initial spectrum information; a2, preprocessing to extract corresponding useful spectrum information; a3, extracting effective spectral characteristic parameters meeting preset requirements from useful spectral information; a4, establishing a PSO-SVM model, and optionally selecting partial effective spectral characteristic parameters; a5, training the initial PSO-SVM model through partial effective spectral characteristic parameters, and acquiring optimal values of c and g according to training results to acquire an initial prediction model; a6, predicting the residual effective spectral characteristic parameters through an initial prediction model to judge whether the prediction result is accurate, if so, executing A7, and if not, executing A5; and A7, using the initial prediction model as a final prediction model. The method can realize rapid identification of the apple identity, and has important theoretical significance and practical significance for standardizing the trading market.

Description

Apple identity recognition model establishing method and system and identity recognition method and system
Technical Field
The invention relates to the technical field of apple identity recognition, in particular to an apple identity recognition model establishing method and system and an apple identity recognition method and system.
Background
The red Fuji apples produced in Aksu area are influenced by unique climatic conditions such as large temperature difference between day and night, sugar is slowly accumulated in the kernels to form unique 'ice sugar core' apples, the apples have thin and crisp meat, much fruit juice and excellent taste, and have been used as brand characteristics to go beyond the name of China and obtain the name of a national geographical mark protection product. However, the law enforcement is driven by the interest that the phenomenon of counterfeiting Acksu's "rock candy heart" apples is frequently prohibited. Therefore, the Aksu related department specially sends a large number of professionals to the interior to perform fake making every year, but the fake making problem is large and the technical support is lacked.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method and a system for establishing an apple identity recognition model, and a method and a system for identifying an apple identity, aiming at some technical defects in the prior art.
The technical scheme adopted by the invention for solving the technical problems is as follows: an apple identity recognition model building method is constructed, and comprises the following steps:
a1, selecting a sample and acquiring initial spectrum information of the surface of the sample;
a2, preprocessing the initial spectrum information to extract useful spectrum information corresponding to the sample;
a3, extracting spectral characteristic parameters meeting preset requirements from the useful spectral information as effective spectral characteristic parameters;
a4, establishing a PSO-SVM model initially utilizing a particle swarm optimization support vector machine, and optionally selecting partial effective spectral characteristic parameters;
a5, training the initial PSO-SVM model through the partial effective spectral characteristic parameters, obtaining the optimal parameter values of a punishment parameter c and a nuclear parameter g according to the training result, and obtaining an initial prediction model according to the optimal parameter values;
a6, predicting the residual effective spectral characteristic parameters through the initial prediction model to obtain a prediction result, judging whether the prediction result is accurate, if so, executing the step A7, and if not, executing the step A5;
and A7, using the initial prediction model as a final prediction model for identifying the sample to be tested.
Preferably, in the step a1, the sample includes:
a first sample that is consistent with a target identity and/or a second sample that is inconsistent with the target identity.
Preferably, in the step a2, the preprocessing the initial spectrum information to extract the corresponding useful spectrum information of the sample includes:
and processing the initial spectrum information through a standard normal variable transformation algorithm SNV to obtain the useful spectrum information.
Preferably, in the step a1, the acquiring initial spectrum information of the sample surface includes:
acquiring a hyperspectral image of the surface of each sample,
selecting a plurality of ROI areas on the surface of each sample based on the hyperspectral images to respectively acquire hyperspectral information of the ROI areas;
and obtaining the average value of the hyperspectral information corresponding to all the ROI areas on the same sample surface as the initial spectral information of the sample surface.
The method further comprises the following steps:
and performing black and white correction on the hyperspectral image.
Preferably, in the step a2, the spectral feature parameter meeting the preset requirement in the extracted useful spectral information is an effective spectral feature parameter; the method comprises the following steps:
and performing iterative calculation on the full waveband of the useful spectral information through a continuous projection algorithm SPA to reduce redundant information in the full waveband, and acquiring specific wavelength of which the redundant information is reduced to meet the preset requirement as the effective spectral characteristic parameter.
Preferably, the method for acquiring the number of specific wavelengths includes:
in the iterative calculation process of the SPA, establishing a multivariate linear regression model of the specific wavelength, and obtaining the Root Mean Square Error (RMSE) of the multivariate linear regression model;
and acquiring the number of the corresponding specific wavelengths when the RMSE meets a preset value, and acquiring the corresponding specific wavelengths based on the number of the specific wavelengths.
Preferably, the training results include: judging accuracy, recall ratio, precision ratio and evaluation model result respectively corresponding to the samples;
in step a5, the training of the initial PSO-SVM model is performed according to the partial effective spectral feature parameters, and the obtaining of the optimal parameter values of the penalty parameter c and the kernel parameter g according to the training result includes:
respectively setting a search range of the punishment parameter c, a search range of the kernel parameter g and the particle swarm maximum optimization generation times of the PSO-SVM model;
respectively adjusting the punishment parameter c and the kernel parameter g according to preset steps and respectively carrying out training of the maximum optimization iteration times to obtain the training result;
obtaining a punishment parameter c and a nuclear parameter g corresponding to the maximum judgment accuracy as the optimal parameter values; and/or
And the kernel function of the initial PSO-SVM model is sigmoid.
The invention also constructs an apple identification model establishing system, which comprises:
the acquisition unit is used for selecting a sample and acquiring initial spectral information of the surface of the sample;
the preprocessing unit is used for preprocessing the initial spectrum information to extract useful spectrum information corresponding to the sample;
the extraction unit is used for extracting the spectral characteristic parameters meeting the preset requirements from the useful spectral information as effective spectral characteristic parameters;
the modeling unit is used for establishing a PSO-SVM model initially utilizing a particle swarm optimization support vector machine and selecting partial effective spectral characteristic parameters;
the training unit is used for training the initial PSO-SVM model through the partial effective spectral characteristic parameters, obtaining the optimal parameter values of a punishment parameter c and a kernel parameter g according to the training result, and obtaining a PSO-SVM prediction model according to the optimal parameter values;
the judging unit is used for predicting the residual effective spectral characteristic parameters through the PSO-SVM prediction model to obtain a prediction result, judging whether the prediction result is accurate or not, outputting a positive result when the prediction result is accurate, and otherwise driving the training unit to act;
and the execution unit is used for taking the PSO-SVM prediction model as a final prediction model for identifying the sample to be detected when the judgment unit outputs a positive result.
The invention also discloses an apple identity identification method, which comprises the following steps:
b1, acquiring initial spectrum information of the surface of the sample to be detected;
b2, preprocessing the initial spectrum information to extract useful spectrum information corresponding to the sample to be detected;
b3, extracting a spectral characteristic parameter meeting a preset requirement in the useful spectral information corresponding to the sample to be detected as an effective spectral characteristic parameter corresponding to the sample to be detected;
and B4, receiving useful spectrum information corresponding to the sample to be detected and identifying the sample to be detected through a prediction model, wherein the prediction model is a final prediction model obtained through the apple identity identification model establishing method.
The invention also constructs an apple identity recognition system, comprising:
the acquisition unit is used for acquiring initial spectral information of the surface of a sample to be detected;
the preprocessing unit is used for preprocessing the initial spectrum information to extract useful spectrum information corresponding to the sample to be detected;
the extraction unit is used for extracting the spectral characteristic parameter meeting the preset requirement in the useful spectral information corresponding to the sample to be detected as the effective spectral characteristic parameter corresponding to the sample to be detected;
and the identification unit is provided with a prediction model and is used for receiving the useful spectrum information corresponding to the sample to be detected and identifying the sample to be detected through the prediction model, wherein the prediction model is a final prediction model obtained by any one of the above apple identity identification model establishment methods.
The method and the system for establishing the apple identity recognition model and the method and the system for identifying the apple identity have the following beneficial effects: the method realizes rapid identification of apple identity, and has important theoretical significance and practical significance for standardizing the trading market.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flowchart illustrating a procedure of an embodiment of a method for establishing an apple identity recognition model according to the present invention;
FIG. 2a is a schematic diagram of the initial spectral information obtained;
FIG. 2b is a schematic illustration of useful spectral information obtained based on FIG. 2 a;
FIG. 3a is a schematic diagram of RMSE values of different subset models in the apple identification model building method of the present invention;
FIG. 3b is a schematic diagram of effective spectral characteristics in the apple identification model building method of the present invention;
FIG. 4 is a flowchart of an embodiment of model training in a method for establishing an apple identity recognition model according to the present invention;
FIG. 5 is a diagram illustrating the results of an embodiment of model training in the apple identity recognition model building method of the present invention;
FIG. 6 is a logic block diagram of an embodiment of an apple identification model building system of the present invention;
FIG. 7 is a flowchart illustrating an embodiment of an apple identity recognition method according to the present invention;
FIG. 8 is a logic block diagram of an embodiment of an apple identification system according to the present invention.
Detailed Description
For a more clear understanding of the technical features, objects and effects of the present invention, embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
As shown in fig. 1, in an embodiment of the apple identification model building method of the present invention, the method includes: a1, selecting a sample and acquiring initial spectrum information of the surface of the sample; selecting an apple sample, wherein the requirement of selecting the sample is that the whole sample of the apple is an apple, namely the surface of the apple has no defects. In order to ensure the accuracy of model establishment, the apple sample needs to be cleaned. Meanwhile, in the process of acquiring the initial spectral information of the surface of the apple sample, the environment of the apple is normal temperature or the temperature of the apple is room temperature. The size of the apple can be limited in the apple sample selecting process, if the diameter range of the selected apple is 65-85 mm, the size uniformity of the apple sample can be guaranteed as much as possible when a plurality of apple samples are selected. I.e. selecting apple samples with the same or similar diameter as much as possible. In addition, the surface of the apple sample can be subjected to spectrum collection through a hyperspectral system, and corresponding initial spectrum information is obtained. In the spectral information acquisition process, the apple sample can be numbered, and the apple sample corresponds to the initial spectral information of the apple sample through the numbering.
A2, preprocessing the initial spectrum information to extract useful spectrum information corresponding to the sample; in the process of acquiring the spectral data of the apple sample, the surface flatness of the apple sample is difficult to guarantee, and the unevenness of the apple sample is difficult to avoid to generate a scattering phenomenon so as to influence the real spectral information of the surface of the apple, so that the original spectral information is preprocessed subsequently after the original spectral information is acquired so as to remove noise from the original spectral information, and the spectral information which can truly reflect the surface information of the apple, namely the useful spectral information is obtained.
A3, extracting spectral characteristic parameters meeting preset requirements from useful spectral information as effective spectral characteristic parameters; because the dimension of the original spectral information is too high, if the original spectral information is directly processed, the processing process is complex, the running time is long, the running occupies more resources, meanwhile, the original spectral information contains too much redundant data, and the redundant data can influence the prediction precision of the established model in the establishing process of the identification model, so that spectral characteristic parameters need to be extracted from the useful spectral information, the spectral information is calibrated through the extracted spectral characteristic parameters, and the spectral information can also be understood as being approximately interpreted from the obtained effective spectral characteristic parameters.
A4, establishing a PSO-SVM model initially utilizing a particle swarm optimization support vector machine, and optionally selecting partial effective spectral characteristic parameters; the Particle Swarm Optimization (PSO) algorithm is a swarm computing technique based on iterative optimization. The PSO-SVM model is a process of performing parameter optimization on SVM parameters by using a PSO algorithm, and continuously updating the particle fitness by using the characteristics of a particle swarm algorithm until a global optimal solution is found. In the invention, an initial PSO-SVM model is established, and meanwhile, partial effective spectral characteristic parameters are selected to carry out the next operation.
A5, training the initial PSO-SVM model through partial effective spectral characteristic parameters, obtaining the optimal parameter values of a punishment parameter c and a nuclear parameter g according to the training result, and obtaining an initial prediction model according to the optimal parameter values; the method comprises the steps of firstly carrying out initialization setting on parameters of PSO, setting particle dimensions of the PSO, setting the number of particles in a particle swarm of each dimension and the maximum iteration number in the particle swarm optimization process, respectively setting parameter values corresponding to local search capacity, global search capacity and inertia weight factors of the PSO, simultaneously respectively setting search ranges of a punishment parameter c and a kernel parameter g of the PSO, inputting a selected part of effective spectral characteristic parameters according to the initialization setting, carrying out PSO training, and obtaining the optimal parameter values of the punishment parameter c and the kernel parameter g, wherein the optimal parameter values can be values of the punishment parameter c and the kernel parameter g when the value of the best classification accuracy bestCVaccuracy in the final CV meaning of a model is the maximum value. And substituting the optimized parameters into the initial PSO-SVM model to obtain a prediction model, wherein the prediction model can be an initial prediction model.
A6, predicting the residual effective spectral characteristic parameters through an initial prediction model to obtain a prediction result, judging whether the prediction result is accurate, if so, executing the step A7, and if not, executing the step A5; and A7, using the initial prediction model as a final prediction model for identifying the sample to be tested. After the prediction model is obtained, the prediction model can be verified through the residual effective spectral characteristic parameters, and optimization is carried out according to the verification result. And (4) performing result prediction on the residual effective spectral characteristic parameters through a prediction model, and judging whether the prediction model is established to meet the requirements according to the accuracy of the prediction result. When the accuracy of the prediction result meets the requirement, the established prediction model has high accuracy and can be used for predicting other samples to be tested, namely the prediction model is defined as a final prediction model. In an embodiment, in the prediction process of the known effective spectral characteristic parameters, the accuracy of the obtained prediction result is not high, and the accuracy of the established prediction model can be considered to be not high, so that when the prediction model is used for predicting a sample to be detected, the prediction result is difficult to guarantee. At the moment, some parameters of the initial PSO-SVM model are changed to carry out new initial PSO-SVM training.
Optionally, in step a1, the sample includes: a first sample that is consistent with the target identity and/or a second sample that is inconsistent with the target identity. In the process of predicting the model, the prediction result comprises the prediction of the sample which is consistent with the target identity and the prediction of the sample which is inconsistent with the target identity, namely the obtained prediction model can identify the sample with the target identity and can also identify the sample with the non-target identity. In the sample selection process, in addition to the first sample with the consistent target identity, a second sample with inconsistent target identity can be selected.
Optionally, in step a2, the preprocessing the initial spectrum information to extract useful spectrum information corresponding to the sample includes: processing the initial spectrum information through a standard normal variable transformation algorithm SNV to obtain useful spectrum information; generally, in the process of acquiring hyperspectral data of an apple, the surface of the apple is inevitably uneven to cause a scattering phenomenon, so that the real spectral information of the apple is influenced, and the SNV (standard normal transformation, standard normal variable exchange pretreatment) method can be specifically adopted to eliminate the influence of scattering on the surface, the size of solid particles and the optical length on the near-infrared diffuse reflection spectrum, so as to achieve the denoising effect. From fig. 2a it can be seen that the general trend and the characteristic absorption peaks of the different kinds of spectral curves are substantially the same. There are 2 distinct reflection valleys near 1200 and 1430nm, 1200nm is the second harmonic absorption wavelength of the C-H group, representing the characteristic absorption peak of carbohydrates; 1400-1500 nm is the first frequency doubling absorption wavelength of O-H group and N-H group, which respectively represents the characteristic absorption peak of water and protein. The useful spectral information shown in fig. 2b is obtained after SNV processing.
Optionally, in step a1, acquiring initial spectral information of the sample surface includes: acquiring a hyperspectral image of the surface of each sample, and selecting a plurality of ROI areas on the surface of each sample based on the hyperspectral images to respectively acquire hyperspectral information of the ROI areas; and obtaining the average value of the hyperspectral information corresponding to all ROI areas on the surface of the same sample as the initial spectral information of the surface of the sample. Specifically, a hyperspectral image of the surface of an apple can be collected, regions of Interest (regions of Interest) of a hyperspectral image of an apple sample are selected by using an EVNI system, hyperspectral data are respectively extracted from each ROI Region, the hyperspectral data corresponding to a plurality of ROI regions extracted from the sample are averaged, and the average value is used as initial spectral information of the sample. When the ROI area is selected on the surface of the sample, the surface of the sample is covered at uniform intervals as much as possible, so that the obtained data can reflect the sample as truly as possible.
Optionally, the method for establishing an apple identification model of the present invention further includes: and performing black and white correction on the hyperspectral image. In order to reduce the influence of uneven illumination and dark current on the experiment, before obtaining useful spectral information, black and white correction needs to be performed on the acquired hyperspectral image, useful spectral information corresponding to a sample is extracted based on the corrected spectrum, and the correction formula is as follows:
R=(I-B)/(W-B) (1)
in the formula (1), I is collected original hyperspectral data; b is data collected by the camera lens covered (the reflectivity corresponding to the camera lens covered is close to 0); w is data collected by aligning the white board (the reflectivity corresponding to the white board is close to 1); and R is the corrected hyperspectral data. This corrective action may be implemented by SpewVIEW software, which in some embodiments may be integrated with the spectral acquisition system design used to obtain initial spectral information of the sample surface.
Optionally, in step a2, extracting a spectral feature parameter satisfying a preset requirement from the useful spectral information as an effective spectral feature parameter; the method comprises the following steps: iterative calculation is carried out on the full wave band of the useful spectral information through a continuous projection algorithm SPA, so that redundant information in the full wave band is reduced, and the obtained redundant information is reduced to meet the preset requirement of a specific wavelength to be used as an effective spectral characteristic parameter. Specifically, the continuous projection Algorithm (SPA) selects a wavelength combination with the minimum linear relation through a projection mode, searches a variable group containing the lowest redundant information from the spectral information, so that the co-linearity between variables is minimum, and simultaneously retains most of characteristics of original data.
Optionally, the method for acquiring the number of specific wavelengths includes: in the iterative calculation process through SPA, establishing a multivariate linear regression model of a specific wavelength, and obtaining the root mean square error RMSE of the multivariate linear regression model; and acquiring the number of corresponding specific wavelengths when the RMSE meets a preset value, and acquiring the corresponding specific wavelengths based on the number of the specific wavelengths. And performing dimension reduction and feature extraction by adopting an SPA algorithm. The specific process is that an initial wavelength is selected, then a new wavelength is added in each iteration until a specified wavelength number N is reached, and the aim is to select the wavelength which meets the preset requirement when the redundant information amount is small, so that the problem of collinearity is solved. It is assumed that the initial wavelength k (0) and the number of wavelengths N are given.
Sep 0 let x before the first iteration (n ═ 1)j=XcalColumn j in (1), i.e. correction set spectral matrix XcalSpectral data of the j-th wavelength point: j is 1 … J, J is the total number of wavelengths;
step1 let S be the set of wavelengths that have not been selected, i.e. S is a wavelength set
Figure BDA0002670697700000091
Figure BDA0002670697700000092
It refers to the collection of other wavelength points left after the initial wavelength point is removed;
step 2: calculating xjOrthogonal to x in subspacek(n-1)Projection Px ofj=xj-(xj Txk(n-1))xk(n-1)(xk(n-1) Txk(n-1))-1For all j ∈ S, where P is the projection operator. Namely, the projection of the initial wavelength point spectrum data orthogonal to the other wavelength point spectrum data is calculated.
Step 3: let k (n) argmax (| | Px)jI, j belongs to S), namely the maximum projection value in the N-1 projection values obtained in Step 2;
step4: let xj=PxjJ belongs to S, namely the maximum projection value is used as the initial value of the next iteration;
step 5: let N be N +1, return to Step1 if N < N;
and (4) ending: the resulting wavelength is { k (n); n is 0, …, N-1 }.
It is understood that the optimal sample set of the SPA model is selected by calculating the root mean square error RMSE values of the multiple linear regression model for different sample subsets, and the subset represented when the RMSE value is the lowest is the optimal sample subset.
Optionally, the training result includes: judging accuracy, recall ratio, precision ratio and evaluation model result respectively corresponding to the samples; as shown in fig. 4, in step a5, training the initial PSO-SVM model by using partial effective spectral feature parameters, and obtaining optimal parameter values of penalty parameter c and kernel parameter g according to the training result, including: a51, respectively setting a search range of a penalty parameter c, a search range of a kernel parameter g and the particle swarm maximum optimization iteration times of a PSO-SVM model; a52, respectively adjusting a punishment parameter c and a kernel parameter g according to a preset step, and respectively training the maximum optimization iteration times to obtain a training result; a53, obtaining a penalty parameter c and a kernel parameter g which correspond to the maximum judgment accuracy as the optimal parameter values. Selecting corresponding indexes of the multi-classification problem by the evaluation standard: accuracy (Accuracy), recall (call), precision (precision) and F1 evaluation models, and the calculation formula is as follows:
Accuracy=(TP+TN)/(TP+TN+FP+FN) (2)
recall=TP/(TP+FN) (3)
precision=TP/(TP+FP) (4)
F1=2*recall*precision/(recall+precision) (5)
in equations (2) to (5), TP indicates that the positive type sample is correctly predicted as the positive type sample; TN indicates that the negative class sample is correctly predicted as the negative class sample; FN indicates that the positive class sample is mispredicted to a negative class sample; FP indicates that the negative class sample is mispredicted as a positive class sample; accuracy (Accuracy) represents the percentage of total samples that predict correct results; recall (recall) represents the number of correctly classified instances in the actual class; precision (precision) represents the number of instances of true correct classification in the prediction class; the F1 evaluation model indicates that precision is as important as recall, with 4 values being as close to 1 as possible. The final judgment can be judged by the evaluation index F1. In one embodiment, the average value of the 4 indexes of the model can be obtained by repeating the operation of the initial PSO-SVM model for 20 times. In the process of repeated operation of the initial PSO-SVM model, a penalty parameter c and a kernel parameter g can be increased or decreased each time until an optimal value is obtained.
In one particular embodiment of the present invention,
the Xinjiang Aksu crystal sugar apple, Henan Lingbao apple, Gansu Jingning apple and Gansu Tianhuaniu apple are taken as experimental objects, the surface of the apple used in the experiment is free of defects, the diameter range is 65-85 mm, the size is uniform, and the total number of the apples is 258, namely 144 parts of Xinjiang Aksu area, 82 parts of Gansu Tianhuaniu apple, 24 parts of Gansu Jingning apple and 8 parts of Henan Lingbao area. The purchased apples were stored in a freezer, taken out in batches before the experiment, and the experiment was started after the temperature was returned to room temperature. In the experiment, 1/2 samples are randomly selected from each apple type to serve as a modeling correction set, and the rest samples serve as modeling prediction sets. And selecting 9 ROI areas on the A surface (the positive surface) and the B surface (the negative surface) of the sample apple respectively, taking the average value of the 18 ROI areas as a spectrum record of the sample, and denoising by adopting an SNV method.
In the iterative calculation process of SPA, FIG. 3a shows the RMSE values of different subset models, wherein "□" represents the number of samples of the optimal sample subset, and it can be seen from FIG. 3a that when the number of variables is less than 19, the RMSE values are in a descending trend as a whole, and when the number of variables is more than or equal to 19, the variation trend is slow. Therefore, in the present embodiment, a total of 19 feature variables are selected using the SPA. FIG. 3b shows the selection of specific variables, "□" represents the selected variables, and 19 bands are: 932.90002nm, 1005.31nm, 1037.1nm, 1169.35nm, 907.95001nm, 967.40997nm, 1218.51nm, 951.70001nm, 1130.3199nm, 1261.4399nm, 1422.67nm, 1324.76nm, 1065.87nm, 1104.45nm, 1676.01nm, 1707.92nm, 1460.22nm, 1392.12nm and 942.28998nm, and the importance of the compounds is reduced in sequence. Taking the 19 extracted wave bands as input and the sample apple as output, establishing an identification model based on an SVM classifier, initializing and setting parameters of a PSO, setting the particle dimension to be 2, the number of particles in each dimension of particle swarm to be 20, the maximum optimization algebra of the particle swarm to be 200, the local search capacity c1 to be 1.5, the global search capacity c2 to be 1.7, the inertial weight factor omega to be 1, the search range of a penalty parameter c to be (0.1, 100), and the search range of a kernel parameter g to be (0.01, 1000). The fitness variation curve of the PSO training process is shown in fig. 5, and the optimal fitness is adopted as the evaluation criterion of the training process, and the optimal fitness is 93.8931%, and the corresponding optimal parameter values are c-7.4062 and g-2.0153. In one embodiment, the initial PSO-SVM model takes signoid as a kernel function, and the optimized parameters are substituted into the PSO-SVM prediction model to obtain the prediction results of a training set and a test set of the 4 types of apples. In different embodiments, different kernel functions may be employed, the results of which are shown in the following table. The prediction effect is better when sigmoid is taken as a kernel function, and corresponding Accuracy is 91.6016%, Precision is 96.1574%, Recall is 88.6111% and F1 is 92.2269%.
Figure BDA0002670697700000111
In addition, as shown in fig. 6, an apple identification model establishing system 100 of the present invention includes:
the acquisition unit is used for selecting a sample and acquiring initial spectral information of the surface of the sample;
the preprocessing unit is used for preprocessing the initial spectrum information to extract useful spectrum information corresponding to the sample;
the extraction unit is used for extracting the spectral characteristic parameters meeting the preset requirements from the useful spectral information as effective spectral characteristic parameters;
the modeling unit is used for establishing a PSO-SVM model initially utilizing a particle swarm optimization support vector machine and selecting partial effective spectral characteristic parameters;
the training unit is used for training the initial PSO-SVM model through partial effective spectral characteristic parameters, acquiring optimal parameter values of a punishment parameter c and a kernel parameter g according to a training result, and acquiring a PSO-SVM prediction model according to the optimal parameter values;
the judging unit is used for predicting the residual effective spectral characteristic parameters through a PSO-SVM prediction model to obtain a prediction result, judging whether the prediction result is accurate or not, outputting a positive result when the prediction result is accurate, and otherwise, driving the training unit to act;
and the execution unit is used for taking the PSO-SVM prediction model as a final prediction model for identifying the sample to be detected when the judgment unit outputs a positive result.
Specifically, the specific coordination operation process among the units of the apple identification model building system may specifically refer to the above apple identification model building method, and is not described herein again.
As shown in fig. 7, the apple identity recognition method of the present invention includes: b1, acquiring initial spectrum information of the surface of the sample to be detected; b2, preprocessing the initial spectrum information to extract useful spectrum information corresponding to the sample to be detected; b3, extracting the spectral characteristic parameter meeting the preset requirement in the useful spectral information corresponding to the sample to be detected as the effective spectral characteristic parameter corresponding to the sample to be detected; and B4, receiving useful spectrum information corresponding to the sample to be detected and identifying the sample to be detected through a prediction model, wherein the prediction model is a final prediction model obtained through any one of the above apple identity identification model establishing methods.
Namely, when the identity of the apple is identified, the spectrum acquisition can be carried out on the surface of the apple sample through the hyperspectral system, and corresponding initial spectrum information is acquired. And preprocessing the original spectrum information after the original spectrum information is acquired so as to de-noise the original spectrum information and obtain the spectrum information which can truly reflect the apple surface information, namely useful spectrum information. The spectral characteristic parameters are extracted from the useful spectral information, and the spectral information is calibrated through the extracted spectral characteristic parameters, which can also be understood as approximately explaining the spectral information from the obtained effective spectral characteristic parameters. And identifying the identity of the apple according to the effective spectral characteristic parameters corresponding to the sample to be detected and the above-disclosed prediction model. The specific processes of obtaining the initial spectrum information, obtaining useful spectrum information from the initial spectrum information, and extracting effective spectrum characteristic parameters from the useful spectrum information may refer to the above partial process of obtaining the prediction model. And will not be described in detail herein.
As shown in fig. 8, an apple identification system 200 of the present invention includes: the acquisition unit is used for acquiring initial spectral information of the surface of a sample to be detected; the preprocessing unit is used for preprocessing the initial spectrum information to extract useful spectrum information corresponding to the sample to be detected; the extraction unit is used for extracting the spectral characteristic parameter meeting the preset requirement in the useful spectral information corresponding to the sample to be detected as the effective spectral characteristic parameter corresponding to the sample to be detected; and the identification unit is provided with a prediction model and is used for receiving the useful spectral information corresponding to the sample to be detected and identifying the sample to be detected through the prediction model, wherein the prediction model is a final prediction model obtained by any one of the above apple identity identification model establishment methods. Specifically, the specific coordination operation process among the units of the apple identity recognition system may specifically refer to the above apple identity recognition method, and is not described herein again.
It is to be understood that the foregoing examples, while indicating the preferred embodiments of the invention, are given by way of illustration and description, and are not to be construed as limiting the scope of the invention; it should be noted that, for those skilled in the art, the above technical features can be freely combined, and several changes and modifications can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention; therefore, all equivalent changes and modifications made within the scope of the claims of the present invention should be covered by the claims of the present invention.

Claims (10)

1. An apple identity recognition model establishing method is characterized by comprising the following steps:
a1, selecting a sample and acquiring initial spectrum information of the surface of the sample;
a2, preprocessing the initial spectrum information to extract useful spectrum information corresponding to the sample;
a3, extracting spectral characteristic parameters meeting preset requirements from the useful spectral information as effective spectral characteristic parameters;
a4, establishing a PSO-SVM model initially utilizing a particle swarm optimization support vector machine, and optionally selecting partial effective spectral characteristic parameters;
a5, training the initial PSO-SVM model through the partial effective spectral characteristic parameters, obtaining the optimal parameter values of a punishment parameter c and a nuclear parameter g according to the training result, and obtaining an initial prediction model according to the optimal parameter values;
a6, predicting the residual effective spectral characteristic parameters through the initial prediction model to obtain a prediction result, judging whether the prediction result is accurate, if so, executing the step A7, and if not, executing the step A5;
and A7, using the initial prediction model as a final prediction model for identifying the sample to be tested.
2. The apple identification model building method of claim 1, wherein in the step a1, the sample comprises:
a first sample consistent with a target identity and/or a second sample inconsistent with the target identity; and/or
In step a2, the preprocessing the initial spectrum information to extract useful spectrum information corresponding to the sample includes:
and processing the initial spectrum information through a standard normal variable transformation algorithm SNV to obtain the useful spectrum information.
3. The apple identification model building method of claim 1, wherein in the step a1, the acquiring initial spectral information of the sample surface comprises:
acquiring a hyperspectral image of the surface of each sample,
selecting a plurality of ROI areas on the surface of each sample based on the hyperspectral images to respectively acquire hyperspectral information of the ROI areas;
and obtaining the average value of the hyperspectral information corresponding to all the ROI areas on the same sample surface as the initial spectral information of the sample surface.
4. The apple identification model building method of claim 3, wherein the method further comprises:
and performing black and white correction on the hyperspectral image.
5. The apple identification model building method of claim 1, wherein in the step a2, the spectral feature parameters satisfying the preset requirements in the extracted useful spectral information are effective spectral feature parameters; the method comprises the following steps:
and performing iterative calculation on the full waveband of the useful spectral information through a continuous projection algorithm SPA to reduce redundant information in the full waveband, and acquiring specific wavelength of which the redundant information is reduced to meet the preset requirement as the effective spectral characteristic parameter.
6. The apple identification model building method of claim 5, wherein the number of specific wavelengths is obtained by a method comprising:
in the iterative calculation process of the SPA, establishing a multivariate linear regression model of the specific wavelength, and obtaining the Root Mean Square Error (RMSE) of the multivariate linear regression model;
and acquiring the number of the corresponding specific wavelengths when the RMSE meets a preset value, and acquiring the corresponding specific wavelengths based on the number of the specific wavelengths.
7. The apple identification model building method of claim 1, wherein the training result comprises: judging accuracy, recall ratio, precision ratio and evaluation model result respectively corresponding to the samples;
in step a5, the training of the initial PSO-SVM model is performed according to the partial effective spectral feature parameters, and the obtaining of the optimal parameter values of the penalty parameter c and the kernel parameter g according to the training result includes:
respectively setting a search range of the punishment parameter c, a search range of the kernel parameter g and the particle swarm maximum optimization iteration times of the PSO-SVM model;
respectively adjusting the punishment parameter c and the kernel parameter g according to preset steps and respectively carrying out training of the maximum optimization iteration times to obtain the training result;
obtaining a punishment parameter c and a nuclear parameter g corresponding to the maximum judgment accuracy as the optimal parameter values; and/or
And the kernel function of the initial PSO-SVM model is sigmoid.
8. An apple identification model building system is characterized by comprising:
the acquisition unit is used for selecting a sample and acquiring initial spectral information of the surface of the sample;
the preprocessing unit is used for preprocessing the initial spectrum information to extract useful spectrum information corresponding to the sample;
the extraction unit is used for extracting the spectral characteristic parameters meeting the preset requirements from the useful spectral information as effective spectral characteristic parameters;
the modeling unit is used for establishing a PSO-SVM model initially utilizing a particle swarm optimization support vector machine and selecting partial effective spectral characteristic parameters;
the training unit is used for training the initial PSO-SVM model through the partial effective spectral characteristic parameters, obtaining the optimal parameter values of a punishment parameter c and a kernel parameter g according to the training result, and obtaining a PSO-SVM prediction model according to the optimal parameter values;
the judging unit is used for predicting the residual effective spectral characteristic parameters through the PSO-SVM prediction model to obtain a prediction result, judging whether the prediction result is accurate or not, outputting a positive result when the prediction result is accurate, and otherwise driving the training unit to act;
and the execution unit is used for taking the PSO-SVM prediction model as a final prediction model for identifying the sample to be detected when the judgment unit outputs a positive result.
9. An apple identity recognition method is characterized by comprising the following steps:
b1, acquiring initial spectrum information of the surface of the sample to be detected;
b2, preprocessing the initial spectrum information to extract useful spectrum information corresponding to the sample to be detected;
b3, extracting a spectral characteristic parameter meeting a preset requirement in the useful spectral information corresponding to the sample to be detected as an effective spectral characteristic parameter corresponding to the sample to be detected;
b4, receiving useful spectrum information corresponding to the sample to be detected and identifying the sample to be detected through a prediction model, wherein the prediction model is a final prediction model obtained through the apple identity identification model establishing method according to any one of claims 1-7.
10. An apple identification system, comprising:
the acquisition unit is used for acquiring initial spectral information of the surface of a sample to be detected;
the preprocessing unit is used for preprocessing the initial spectrum information to extract useful spectrum information corresponding to the sample to be detected;
the extraction unit is used for extracting the spectral characteristic parameter meeting the preset requirement in the useful spectral information corresponding to the sample to be detected as the effective spectral characteristic parameter corresponding to the sample to be detected;
an identification unit provided with a prediction model, configured to receive useful spectral information corresponding to the sample to be detected and identify the sample to be detected through the prediction model, where the prediction model is a final prediction model obtained by the apple identification model establishment method according to any one of claims 1 to 7.
CN202010932453.3A 2020-09-08 2020-09-08 Apple identity recognition model establishing method and system and identity recognition method and system Pending CN112285054A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010932453.3A CN112285054A (en) 2020-09-08 2020-09-08 Apple identity recognition model establishing method and system and identity recognition method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010932453.3A CN112285054A (en) 2020-09-08 2020-09-08 Apple identity recognition model establishing method and system and identity recognition method and system

Publications (1)

Publication Number Publication Date
CN112285054A true CN112285054A (en) 2021-01-29

Family

ID=74420332

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010932453.3A Pending CN112285054A (en) 2020-09-08 2020-09-08 Apple identity recognition model establishing method and system and identity recognition method and system

Country Status (1)

Country Link
CN (1) CN112285054A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113203725A (en) * 2021-05-06 2021-08-03 塔里木大学 Apple identity identification method based on Raman spectrum technology and chemometrics method
CN113218898A (en) * 2021-05-06 2021-08-06 塔里木大学 Plant disease remote sensing feature extraction method based on spectral analysis
CN113218885A (en) * 2021-05-06 2021-08-06 塔里木大学 Verticillium wilt severity estimation method based on feature extraction method and classification algorithm
CN113836784A (en) * 2021-07-23 2021-12-24 塔里木大学 Apple identification system and method based on information fusion technology

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104048927A (en) * 2014-06-27 2014-09-17 上海理工大学 Method for detecting soluble solid content of apple
CN104406928A (en) * 2014-12-01 2015-03-11 上海理工大学 Method for realizing non-destructive test of waxing kinds of apple surfaces
CN105866063A (en) * 2016-04-08 2016-08-17 北京工商大学 Detection method for quality grade of sausage
CN106290238A (en) * 2016-08-09 2017-01-04 西北农林科技大学 A kind of apple variety method for quick identification based on high light spectrum image-forming
CN108760655A (en) * 2018-04-28 2018-11-06 东北电力大学 A kind of apple sense of taste profile information method for visualizing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104048927A (en) * 2014-06-27 2014-09-17 上海理工大学 Method for detecting soluble solid content of apple
CN104406928A (en) * 2014-12-01 2015-03-11 上海理工大学 Method for realizing non-destructive test of waxing kinds of apple surfaces
CN105866063A (en) * 2016-04-08 2016-08-17 北京工商大学 Detection method for quality grade of sausage
CN106290238A (en) * 2016-08-09 2017-01-04 西北农林科技大学 A kind of apple variety method for quick identification based on high light spectrum image-forming
CN108760655A (en) * 2018-04-28 2018-11-06 东北电力大学 A kind of apple sense of taste profile information method for visualizing

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113203725A (en) * 2021-05-06 2021-08-03 塔里木大学 Apple identity identification method based on Raman spectrum technology and chemometrics method
CN113218898A (en) * 2021-05-06 2021-08-06 塔里木大学 Plant disease remote sensing feature extraction method based on spectral analysis
CN113218885A (en) * 2021-05-06 2021-08-06 塔里木大学 Verticillium wilt severity estimation method based on feature extraction method and classification algorithm
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
CN112285054A (en) Apple identity recognition model establishing method and system and identity recognition method and system
CN110516596B (en) Octave convolution-based spatial spectrum attention hyperspectral image classification method
Pasquet-Itam et al. Deep learning approach for classifying, detecting and predicting photometric redshifts of quasars in the Sloan Digital Sky Survey stripe 82
CN111968080B (en) Method for detecting quality of inside and outside of Feicheng peaches based on hyperspectral and deep learning
Nandi et al. A machine vision-based maturity prediction system for sorting of harvested mangoes
Moses et al. Deep CNN-based damage classification of milled rice grains using a high-magnification image dataset
Arsalane et al. An embedded system based on DSP platform and PCA-SVM algorithms for rapid beef meat freshness prediction and identification
CN107341505B (en) Scene classification method based on image significance and Object Bank
US20150160128A1 (en) Selection of spectral bands or filters for material classification under multiplexed illumination
Zhou et al. Identification of the variety of maize seeds based on hyperspectral images coupled with convolutional neural networks and subregional voting
Yu et al. Rapid and visual measurement of fat content in peanuts by using the hyperspectral imaging technique with chemometrics
CN112084825B (en) Cooking evaluation method, cooking recommendation method, computer device and storage medium
Chaudhari Steel surface defect detection using glcm, gabor wavelet, hog, and random forest classifier
Deulkar et al. An automated tomato quality grading using clustering based support vector machine
Yang et al. Assessment of the vigor of rice seeds by near-infrared hyperspectral imaging combined with transfer learning
CN115545383A (en) Binocular stereoscopic vision detection method for crisp appearance quality of strawberries
McDonald et al. Images, features, or feature distributions? A comparison of inputs for training convolutional neural networks to classify lentil and field pea milling fractions
CN112949592B (en) Hyperspectral image classification method and device and electronic equipment
Tran et al. Machine learning-based classification of apple sweetness with multispectral sensor
Nicolau et al. Fusarium damaged kernels detection using transfer learning on deep neural network architecture
CN114463269A (en) Chip defect detection method based on deep learning method
E Irhebhude et al. Recognition of mangoes and oranges colour and texture features and locality preserving projection
Cai et al. Study on Tea Identification of Hyperspectral Image Integrating Spectral and Texture Features.
CN113191259B (en) Dynamic data expansion method for hyperspectral image classification and image classification method
Peng et al. Defects recognition of pine nuts using hyperspectral imaging and deep learning approaches

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