CN113418889B - Real-time detection method for water content and total colony count of dried vegetables based on deep learning - Google Patents

Real-time detection method for water content and total colony count of dried vegetables based on deep learning Download PDF

Info

Publication number
CN113418889B
CN113418889B CN202110531732.3A CN202110531732A CN113418889B CN 113418889 B CN113418889 B CN 113418889B CN 202110531732 A CN202110531732 A CN 202110531732A CN 113418889 B CN113418889 B CN 113418889B
Authority
CN
China
Prior art keywords
sample
laver
moisture content
samples
dried
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.)
Active
Application number
CN202110531732.3A
Other languages
Chinese (zh)
Other versions
CN113418889A (en
Inventor
王鹏
沈照鹏
徐锡明
孙文珂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ocean University of China
Original Assignee
Ocean University of China
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 Ocean University of China filed Critical Ocean University of China
Priority to CN202110531732.3A priority Critical patent/CN113418889B/en
Publication of CN113418889A publication Critical patent/CN113418889A/en
Application granted granted Critical
Publication of CN113418889B publication Critical patent/CN113418889B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • 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/3563Investigating relative effect of material at wavelengths characteristic of specific elements or molecules, e.g. atomic absorption spectrometry using infrared light for analysing solids; Preparation of samples therefor
    • CCHEMISTRY; METALLURGY
    • C12BIOCHEMISTRY; BEER; SPIRITS; WINE; VINEGAR; MICROBIOLOGY; ENZYMOLOGY; MUTATION OR GENETIC ENGINEERING
    • C12QMEASURING OR TESTING PROCESSES INVOLVING ENZYMES, NUCLEIC ACIDS OR MICROORGANISMS; COMPOSITIONS OR TEST PAPERS THEREFOR; PROCESSES OF PREPARING SUCH COMPOSITIONS; CONDITION-RESPONSIVE CONTROL IN MICROBIOLOGICAL OR ENZYMOLOGICAL PROCESSES
    • C12Q1/00Measuring or testing processes involving enzymes, nucleic acids or microorganisms; Compositions therefor; Processes of preparing such compositions
    • C12Q1/02Measuring or testing processes involving enzymes, nucleic acids or microorganisms; Compositions therefor; Processes of preparing such compositions involving viable microorganisms
    • C12Q1/04Determining presence or kind of microorganism; Use of selective media for testing antibiotics or bacteriocides; Compositions containing a chemical indicator therefor
    • C12Q1/06Quantitative determination
    • 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
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/2431Multiple classes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Biophysics (AREA)
  • Organic Chemistry (AREA)
  • Immunology (AREA)
  • Biochemistry (AREA)
  • Analytical Chemistry (AREA)
  • Computing Systems (AREA)
  • Proteomics, Peptides & Aminoacids (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Mathematical Physics (AREA)
  • Biomedical Technology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Pathology (AREA)
  • Zoology (AREA)
  • Software Systems (AREA)
  • Wood Science & Technology (AREA)
  • Computational Linguistics (AREA)
  • Microbiology (AREA)
  • Biotechnology (AREA)
  • Toxicology (AREA)
  • Genetics & Genomics (AREA)
  • Investigating Or Analysing Materials By Optical Means (AREA)

Abstract

The invention provides a real-time detection method for the moisture content and the total number of bacterial colonies of dried vegetables based on deep learning. The real-time detection method comprises the following steps: (1) collecting a dried vegetable sample; (2) collecting a near infrared spectrum of the sample; (3) calibrating the moisture content of the sample and the total colony count; (4) identifying and rejecting abnormal samples; (5) sample spectrum information preprocessing; (6) creating a sample dataset; (7) establishing a prediction model; (8) checking and correcting the prediction model; and (9) model integration. According to the invention, by combining the deep learning neural network with the near infrared spectrum technology, the characteristics of linear factors and nonlinear factors related to the moisture content and the total number of bacterial colonies in the laver are comprehensively utilized, and the real-time rapid detection of the sample is realized by combining the portable spectrum equipment.

Description

Real-time detection method for water content and total colony count of dried vegetables based on deep learning
Technical Field
The invention belongs to the field of food safety detection, and particularly relates to a real-time detection method for the moisture content and the total number of bacterial colonies of dried vegetables based on deep learning.
Background
The moisture content and the total number of bacterial colonies are important factors influencing the quality of the dried laver, and have great influence on the sensory, safety and shelf life of the dried laver. The quality safety of dried laver becomes the focus of world laver trade competition and is also a decisive factor of transaction success or failure and transaction pricing. In the present stage, the indexes of the moisture content and the total colony count of the dry laver are still carried out by adopting the traditional detection means, but the evaluation period is too long, the additional cost is high, and the detection requirement of a large quantity in the trading period is difficult to meet. Therefore, a real-time rapid detection method for detecting the moisture content and the total number of bacterial colonies in the dried laver on site is not yet available.
Near infrared spectroscopy utilizes the optical properties of chemicals in the near infrared region of the spectrum to rapidly determine the content and identity of one or more chemical components in a sample. For example, the biomass and the component concentration in the fermentation process are detected by combining near infrared spectrum with a least square, a support vector machine and regression; hemicellulose, cellulose and lignin in phyllostachys pubescens are determined by combining near infrared spectrum with ANN and PLSR-SVM. However, the infrared spectrum wavelength number is far greater than the acquired sample number, so that the existing modeling method has the problems of poor collinearity, overfitting and the like, and meanwhile, the solving capability on nonlinear relation variables is poor. In order to solve these problems, complicated dimension reduction processing is often required for the spectrum data in modeling and detection, but the selection of the spectrum information is subjective, so that the characteristic spectrum information is difficult to effectively and comprehensively cover.
In addition, near infrared spectrum information is derived from the frequency multiplication and frequency combination of the internal vibration of the molecule, and mainly reflects the frequency multiplication and frequency combination vibration absorption of the C-H, N-H, O-H group in the molecule. The dried laver has therein components of sugar, protein, etc. containing a large amount of C-H, N-H, O-H chemical bonds, which interfere with the measurement of the moisture content mainly of O-H bonds. On the other hand, the total number of bacterial colonies in the laver is quantitatively calibrated by integrating the spectrum information of some unknown components such as cell wall polysaccharide, protein, metabolite and the like. Therefore, the interference among components and the uncertainty of characteristic components are also key factors for limiting the application of the existing method to the real-time and rapid detection of the moisture content and the total colony count of the dried laver.
The deep learning algorithm has multidimensional data processing capability and excellent feature learning capability, and has great influence in the fields of face recognition, intelligent diagnosis and the like. Establishing a real-time rapid detection model based on a deep learning method is a potential feasible scheme.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a real-time detection method for the moisture content and the total number of bacterial colonies of dried vegetables based on deep learning. The detection method provided by the invention avoids a complicated spectrum pretreatment process in the existing detection method, realizes real-time and rapid detection of the moisture content and the total number of bacterial colonies of the dried laver, shortens the detection period, effectively improves the use convenience of detection personnel, and can also meet the real-time detection requirements of a large number of on-site and improve the detection effect and accuracy.
In order to achieve the aim of the invention, the invention is realized by adopting the following technical scheme:
a real-time detection method for the moisture content and the total number of bacterial colonies of dried vegetables based on deep learning comprises the following steps:
(1) Collecting at least 500 dried vegetable samples of different manufacturers and different production places, covering the dried vegetable samples processed in various seasons, and carrying out conditioning and bacteria increasing treatment on at least 100 dried vegetable samples at random respectively;
(2) Collecting near infrared spectrum of the dried vegetable sample by using a near infrared spectrum analyzer, wherein the scanning range is 700 nm-2500 nm, the resolution is 2 nm-8 nm, and taking the average value as near infrared spectrum data of the dried vegetable sample after scanning for 10-100 times;
(3) Measuring the moisture content and the total number of bacterial colonies in each dried vegetable sample by adopting a direct drying method and a plate counting method, setting 3 groups of parallel tests for each sample, and taking the average value of the parallel tests as a sample calibration value of the moisture content and the total number of bacterial colonies;
(4) Identifying and removing the dried vegetable samples with abnormal sample calibration values in the step (3) by adopting a Markov distance method, and reserving the dried vegetable samples with normal sample calibration values;
(5) Preprocessing the near infrared spectrum in the step (2), and eliminating noise doping and baseline drift to obtain preprocessed spectrum information;
(6) Respectively carrying out data grouping on the sample calibration value of the dried vegetable sample reserved in the step (4) and the pretreatment spectrum information in the step (5), and establishing the correlation between the moisture content of the dried vegetable sample, the total number of bacterial colonies and the spectrum information; randomly dividing the sample data with the established association into a training set sample and a test set sample according to the number ratio of 9:1, wherein the training set sample comprises associated sample data with different moisture contents and different amounts of colony count;
(7) Utilizing the training set sample in the step (6) to establish a prediction model of the moisture content and the total number of bacterial colonies of the dried vegetable sample through a deep learning network;
(8) Using the test set sample in the step (6) as an unknown sample, checking the prediction capacity of the prediction model in the step (7), and adjusting the prediction model according to the checking result to obtain an optimal prediction model;
(9) And (3) integrating the near infrared spectrum pretreatment algorithm based on Python with the optimal prediction model in the step (8), and detecting the moisture content and the total colony number of the dried vegetable sample in real time through direct input of the near infrared spectrum.
Preferably, in the step (2), a near infrared spectrum analyzer is used to collect near infrared spectrum of the dried vegetable sample, the scanning range is 900nm-1700nm, the resolution is 6 nm-7 nm, and after 50-100 times of scanning, the average value is taken as near infrared spectrum data of the dried vegetable sample.
Further, in the step (4), identifying and removing the dried vegetable samples with the sample calibration values larger than the threshold value of the mahalanobis distance by adopting a mahalanobis distance method, and reserving the dried vegetable samples with the sample calibration values smaller than or equal to the threshold value of the mahalanobis distance.
Further, the threshold calculation formula of the mahalanobis distance is as follows: threshold value =
Figure DEST_PATH_IMAGE001
+α standard deviation, wherein->
Figure 362757DEST_PATH_IMAGE001
The mean value of the mahalanobis distance is given, and α is the standard deviation weight.
Further, the standard deviation weight is 3.4.
Further, the calculation formula of the mahalanobis distance is as follows:
Figure DEST_PATH_IMAGE003
wherein->
Figure 155133DEST_PATH_IMAGE004
For the mean vector of the sample spectral matrix X, +.>
Figure DEST_PATH_IMAGE005
Is covariance matrix>
Figure 408301DEST_PATH_IMAGE006
Is the spectrum of the ith sample.
Further, the preprocessing method of the near infrared spectrum comprises at least one of differentiation, multi-element scattering correction MSC, standard normal transformation SNV and continuous projection algorithm SPA.
Preferably, the preprocessing method of the near infrared spectrum is a continuous projection algorithm SPA.
Further, in the step (7), a predictive model of the moisture content and the total number of colonies of the dried vegetable sample is established through a deep learning network by using the training set sample at a learning rate of 0.0001 and a lot number of 256.
Further, the deep learning network in the step (7) includes at least one of a residual network res net, a convolutional neural network CNN, a deep neural network DNN, a cyclic neural network RNN, an antagonistic neural network GAN, and a deep belief network DBN.
Preferably, the deep learning network is a residual network ResNet.
Further, the deep learning network comprises a one-dimensional convolution layer, a full connection layer, a batch standardization layer and an activation function layer between the one-dimensional convolution layers, a maximum pooling layer positioned behind the first-layer convolution layer and an average pooling layer positioned behind the full connection layer, wherein the number of the one-dimensional convolution layers is more than or equal to 12.
Further, the convolution kernel number of the one-dimensional convolution layer is 64-512, the convolution kernel size of the first one-dimensional convolution layer is 5-12, and the step is 2-8; the convolution kernel size of the one-dimensional convolution layers of other layers is 1-7; the activation function employed by each one-dimensional convolution layer is ReLU.
Further, the dried vegetable includes dried laver.
After scheme optimization, the invention provides a real-time detection method for the moisture content and the total number of bacterial colonies of dry laver based on deep learning, which comprises the following steps:
(1) Collecting 500 dry laver samples of different manufacturers and different production places, covering the dry laver samples processed in various seasons, randomly carrying out moisture regaining treatment on 100 dry laver samples, and carrying out bacteria increasing treatment on 100 dry laver samples;
(2) Spreading a Shan Zhanggan laver sample on a polytetrafluoroethylene plate by taking polytetrafluoroethylene as a reference background, placing the polytetrafluoroethylene plate under a portable near infrared spectrum analyzer probe to collect near infrared spectrum of a dried laver sample, scanning the dried laver sample for 100 times with a scanning range of 900nm-1700nm and a resolution of 6.0nm, and taking an average value as near infrared spectrum data of the dried laver sample;
(3) Measuring the moisture content and the total number of bacterial colonies in each dry laver sample by adopting a direct drying method and a plate counting method, setting 3 groups of parallel tests for each sample, and taking the average value of the parallel tests as a sample calibration value of the moisture content and the total number of bacterial colonies of the dry laver sample;
(4) Identifying and removing the dried laver sample with abnormal sample calibration value in the step (3) by using a Markov distance method, and reserving the dried laver sample with normal sample calibration value so as to improve the prediction accuracy and stability of the model;
(5) Preprocessing the near infrared spectrum in the step (2) by adopting a continuous projection algorithm SPA, eliminating noise doping and baseline drift, and analyzing characteristic variables of the noise doping and baseline drift to obtain preprocessed spectrum information;
(6) Respectively carrying out data grouping on the sample calibration value of the dried laver sample reserved in the step (4) and the pretreated spectrum information in the step (5), and establishing the correlation between the moisture content and the total colony number of the dried laver sample and the spectrum information; randomly distributing the sample data with the established association into 450 training set samples and 50 test set samples, wherein the training set samples comprise associated sample data with different moisture contents and different amounts of total bacterial colony numbers;
(7) Depending on a Python learning framework, establishing a ResNet-18 depth residual error network; the ResNet-18 depth residual error network consists of 17 one-dimensional convolution layers and 1 full-connection layer; the convolution kernel size of the first convolution layer is 7, the convolution kernel number is 64, and the first convolution layer is followed by the largest pooling layer; the other convolution layers are divided into 4 ResBlock structures except the first convolution layer, each ResBlock comprises 4 convolution layers, the number of convolution kernels from top to bottom is 64, 128, 256 and 512, and the convolution kernels are 3; a batch standardization layer and an activation function layer exist between convolution layers in the ResBlock structure; the neuron number of the full-connection layer is 1, and an average pooling layer exists behind the full-connection layer;
utilizing the training set sample in the step (6), wherein the training iteration times are 300 times, the learning rate is 0.0001, the loss function adopts L2 norm, and meanwhile, the early_stopping strategy is adopted to prevent overfitting training, and a prediction model of the moisture content and the total colony number of the dry laver sample is established;
(8) Using 35 test set samples in the step (6) as unknown samples to test the prediction capability of the prediction model in the step (7), adjusting the prediction model according to the test result, and predicting the rest 15 test set samples by the adjusted prediction model to finally obtain an optimal prediction model;
(9) And (3) integrating the SPA spectrum processing algorithm with the optimal prediction model in the step (8) through Python language, and detecting the moisture content and the total colony number of the dried laver sample in real time through direct input of a near infrared spectrum.
Compared with the prior art, the invention has the advantages that:
the invention provides a real-time rapid detection method for the moisture content and the total number of bacterial colonies of dried laver based on deep learning, which provides a method for rapidly predicting the moisture content and the total number of bacterial colonies in the laver by comprehensively utilizing the characteristics of linear factors and nonlinear factors related to the moisture content and the total number of bacterial colonies of the laver through a deep learning neural network combined near infrared spectrum technology. According to the detection method, a prediction model is built through deep learning, a computer programming integration model and a spectrum preprocessing algorithm are used, and the portable spectrum equipment is combined, so that real-time and rapid detection of samples is realized, the operation is convenient, the method is suitable for site batch detection requirements of site quality supervision, transaction, production management and the like, the gap of a rapid detection technology of dry laver quality and safety indexes is filled, and technical support is provided for site quality supervision, and production management and supervision level of laver industry in China is improved.
Drawings
FIG. 1 is a distribution diagram of near infrared spectrum characteristic variables of dried laver of example.
FIG. 2 is a diagram showing the construction of ResNet neural network for rapid detection of moisture content and total colony count of dried laver in example.
FIG. 3 is a graph showing the result of predicting water content of an unknown laver sample by using the dried laver rapid model according to the embodiment.
FIG. 4 is a graph showing the result of predicting the total number of colonies of unknown laver samples by using the dried laver rapid model according to the embodiment.
Detailed Description
The invention will be further described with reference to specific examples, but the scope of the invention is not limited thereto.
Example 1
The embodiment provides a real-time rapid detection method for the moisture content and the total number of bacterial colonies of dry laver based on deep learning, which comprises the following steps:
(1) Sample collection: and collecting Porphyra yezoensis samples of different manufacturers and different production places, wherein the samples need to cover the Porphyra yezoensis samples processed in different seasons, and carrying out conditioning and bacteria increasing treatment on part of the samples at random.
(2) Collecting a sample near infrared spectrum: a medium with stable properties such as polytetrafluoroethylene is selected as a reference background, a single laver sample is paved on a polytetrafluoroethylene plate, a sample spectrum is collected under an SR-1901PT/2501PT portable near infrared spectrometer probe, the spectrum scanning range is 900-1700 nm, the resolution is 6.0nm, the scanning is 100 times, and the average value is taken as near infrared spectrum data of the laver sample.
(3) Calibration of sample moisture content and total colony count: the measurement standard refers to national standard GB 5009.3-2016 (first method) for measuring moisture in food safety national standard food and GB 4789.2-2016 (total number of colony count for food safety national standard food microbiology) for measuring moisture content and colony count in a sample by adopting a direct drying method and a plate counting method. Each sample was subjected to 3 sets of parallel tests, and the average value thereof was taken as a calibration value of the moisture content of the sample and the total number of colonies, respectively. The total number of samples was 500, which contained 100 samples of enriched and rewet.
(4) Abnormal sample identification and elimination: and (3) identifying and removing the samples with abnormal calibration value data measured in the step (3) by adopting a Markov Distance (MD) method so as to improve the prediction accuracy and stability of the model. First, calculate the mean vector of the sample spectrum matrix X
Figure 198403DEST_PATH_IMAGE004
And covariance matrix->
Figure 15049DEST_PATH_IMAGE005
Then, the mahalanobis distance between each sample spectrum and the center spectrum is calculated, and the formula is as follows:
Figure DEST_PATH_IMAGE007
in the method, in the process of the invention,
Figure 79957DEST_PATH_IMAGE006
spectrum for the ith sample, +.>
Figure 635965DEST_PATH_IMAGE008
The mahalanobis distance for the i-th sample. The threshold calculation method is threshold = =>
Figure 862547DEST_PATH_IMAGE001
+α standard deviation,/->
Figure 369752DEST_PATH_IMAGE001
The mean value of the mahalanobis distance is the standard deviation of the mahalanobis distance, and the standard deviation weight is alpha, and the standard deviation is used for evaluating the dispersity among the spectra of the sample. And taking the weight alpha of the Markov distance algorithm as 3.4, removing abnormal sample spectrums exceeding the Markov distance threshold, and using the rest sample data for the establishment and test of a prediction model.
(5) Sample spectrum information preprocessing: preprocessing the sample spectrum acquired in the step (2) by adopting a continuous projection algorithm (SPA), eliminating noise doping and baseline drift, and analyzing characteristic variables of the sample spectrum, wherein the result is shown in figure 1.
(6) Establishing a sample data set: and (3) carrying out data grouping on the moisture content and the calibration value of the total number of the colonies of the sample reserved in the step (4) and the sample spectrum information preprocessed in the step (5), so that the data group of the same sample contains the moisture content data, the total number of the colonies and the infrared spectrum data, and further, the correlation between the sample spectrum information and the moisture content and the total number of the colonies is established. Randomly distributing the sample data sets which are associated into a training set and a testing set according to the proportion of 90% and 10%, wherein the training set has 450 samples, and the testing set has 50 samples; sample data in the training set should contain colony counts of different moisture content and different magnitudes.
(7) Establishing a prediction model: depending on the Python learning framework, a ResNet-18 depth residual error network is established, and as shown in fig. 2, the network structure is composed of 17 layers of one-dimensional convolution layers (conv 1 d) and 1 layer of full connection layers (dense). Except for the convolution layer with the top convolution kernel size of 7, the other convolution layers all belong to the special structure of ResBlock, and a short-circuit special structure is arranged in the structure so as to reduce gradient dispersion. The ResNet-18 comprises 4 ResBlock structures, each ResBlock comprises 4 convolution layers, batch standardization layers and activation function layers exist among layers, and the adopted activation functions are ReLU. The number of convolution kernels from top to bottom of each ResBlock is 64, 128, 256 and 512, and the convolution kernel size is 3. The maximum pooling layer and the average pooling layer are present after the first convolution layer and the last full connection layer, respectively, for magnifying the features. The number of neurons of the fully connected layer is 1 for outputting a continuous value. And (3) utilizing a training set, wherein the training iteration times are 300 times, the learning rate is 0.0001, the loss function adopts an L2 norm, and meanwhile, an early_stopping strategy is adopted to prevent overfitting training, so as to establish a prediction model of the water content and the total colony number of the Porphyra yezoensis.
(8) Checking and correcting a model: using 35 samples in the test set as unknown samples to test the prediction model; determining a coefficient R according to a correlation coefficient R of a model 2 And evaluating the model by indexes such as prediction error Root Mean Square (RMSE).
According to the evaluation result, in this embodiment, the network is adjusted, the convolution kernel size of the first convolution layer of the network structure is changed to 10, and the predicted average absolute deviation is reduced by 3%. The corrected model is adopted to predict the rest 15 samples of the test set, and the result is shown in fig. 3 and 4, and the model prediction has a deviation of less than 0.2% on the water content prediction and less than 0.3% on the total colony prediction, so that the porphyra yezoensis grade pattern recognition model has practical application value.
(9) Model integration: SPA spectrum processing algorithm is integrated with a water content and colony total number prediction model through Python language, and the SPA spectrum processing algorithm can be used for real-time detection of unknown samples.
The above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that modifications may be made to the technical solutions described in the foregoing embodiments, or equivalents may be substituted for some of the technical features thereof; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (1)

1. A real-time detection method for the moisture content and the total number of bacterial colonies of dried vegetables based on deep learning is characterized by comprising the following steps: the method comprises the following steps:
(1) Collecting 500 dry laver samples of different manufacturers and different production places, covering the dry laver samples processed in various seasons, randomly carrying out moisture regaining treatment on 100 dry laver samples, and carrying out bacteria increasing treatment on 100 dry laver samples;
(2) Spreading a Shan Zhanggan laver sample on a polytetrafluoroethylene plate by taking polytetrafluoroethylene as a reference background, placing the polytetrafluoroethylene plate under a portable near infrared spectrum analyzer probe to collect near infrared spectrum of a dried laver sample, scanning the dried laver sample for 100 times with a scanning range of 900-1700 nm and a resolution of 6.0nm, and taking an average value as near infrared spectrum data of the dried laver sample;
(3) Measuring the moisture content and the total number of bacterial colonies in each dry laver sample by adopting a direct drying method and a plate counting method, setting 3 groups of parallel tests for each sample, and taking the average value of the parallel tests as a sample calibration value of the moisture content and the total number of bacterial colonies of the dry laver sample;
(4) Identifying and removing the dried laver sample with abnormal sample calibration value in the step (3) by using a Markov distance method, and reserving the dried laver sample with normal sample calibration value so as to improve the prediction accuracy and stability of the model;
(5) Preprocessing the near infrared spectrum in the step (2) by adopting a continuous projection algorithm SPA, eliminating noise doping and baseline drift, and analyzing characteristic variables of the noise doping and baseline drift to obtain preprocessed spectrum information;
(6) Respectively carrying out data grouping on the sample calibration value of the dried laver sample reserved in the step (4) and the pretreated spectrum information in the step (5), and establishing the correlation between the moisture content and the total colony number of the dried laver sample and the spectrum information; randomly distributing the sample data with the established association into 450 training set samples and 50 test set samples, wherein the training set samples comprise associated sample data with different moisture contents and different amounts of total bacterial colony numbers;
(7) Depending on a Python learning framework, establishing a ResNet-18 depth residual error network; the ResNet-18 depth residual error network consists of 17 one-dimensional convolution layers and 1 full-connection layer; the convolution kernel size of the first convolution layer is 7, the convolution kernel number is 64, and the first convolution layer is followed by the largest pooling layer; the other convolution layers are divided into 4 ResBlock structures except the first convolution layer, each ResBlock comprises 4 convolution layers, the number of convolution kernels from top to bottom is 64, 128, 256 and 512, and the convolution kernels are 3; a batch standardization layer and an activation function layer exist between convolution layers in the ResBlock structure; the neuron number of the full-connection layer is 1, and an average pooling layer exists behind the full-connection layer;
utilizing the training set sample in the step (6), wherein the training iteration times are 300 times, the learning rate is 0.0001, the loss function adopts L2 norm, and meanwhile, the early_stopping strategy is adopted to prevent overfitting training, and a prediction model of the moisture content and the total colony number of the dry laver sample is established;
(8) Using 35 test set samples in the step (6) as unknown samples to test the prediction capability of the prediction model in the step (7), adjusting the prediction model according to the test result, and predicting the rest 15 test set samples by the adjusted prediction model to finally obtain an optimal prediction model;
(9) And (3) integrating the SPA spectrum processing algorithm with the optimal prediction model in the step (8) through Python language, and detecting the moisture content and the total colony number of the dried laver sample in real time through direct input of a near infrared spectrum.
CN202110531732.3A 2021-05-17 2021-05-17 Real-time detection method for water content and total colony count of dried vegetables based on deep learning Active CN113418889B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110531732.3A CN113418889B (en) 2021-05-17 2021-05-17 Real-time detection method for water content and total colony count of dried vegetables based on deep learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110531732.3A CN113418889B (en) 2021-05-17 2021-05-17 Real-time detection method for water content and total colony count of dried vegetables based on deep learning

Publications (2)

Publication Number Publication Date
CN113418889A CN113418889A (en) 2021-09-21
CN113418889B true CN113418889B (en) 2023-05-26

Family

ID=77712435

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110531732.3A Active CN113418889B (en) 2021-05-17 2021-05-17 Real-time detection method for water content and total colony count of dried vegetables based on deep learning

Country Status (1)

Country Link
CN (1) CN113418889B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118090648B (en) * 2024-04-02 2024-06-21 常州建昊建筑鉴定检测有限公司 Method and system for detecting water content of engineering material

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111103416A (en) * 2019-12-30 2020-05-05 重庆商勤科技有限公司 Water source pollution early warning method and system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
IL157954A0 (en) * 2001-03-16 2004-03-28 Ewatertek Inc Water quality monitoring and transmission system and method
CN101968438B (en) * 2010-09-25 2013-03-06 西北农林科技大学 Method for distinguishing water injection of raw material muscles quickly
CN107478598A (en) * 2017-09-01 2017-12-15 广东省智能制造研究所 A kind of near-infrared spectral analytical method based on one-dimensional convolutional neural networks
CN107894408B (en) * 2017-11-24 2021-04-13 中国农业科学院油料作物研究所 Edible oil multi-element adulteration identification method based on near-infrared spectrometer
CN108760647A (en) * 2018-03-20 2018-11-06 南京财经大学 A kind of wheat content of molds line detecting method based on Vis/NIR technology
EP3620984B1 (en) * 2018-09-06 2024-04-10 Accenture Global Solutions Limited Digital quality control using computer visioning with deep learning

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111103416A (en) * 2019-12-30 2020-05-05 重庆商勤科技有限公司 Water source pollution early warning method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
A Non-Destructive System Based on Electrical Tomography and Machine Learning to Analyze the Moisture of Buildings;Tomasz Rymarczyk 等;Sensors;全文 *
基于近红外光谱融合与深度学习的玉米成分定量建模方法;谈爱玲 等;分析与检测;全文 *

Also Published As

Publication number Publication date
CN113418889A (en) 2021-09-21

Similar Documents

Publication Publication Date Title
CN111141836B (en) Method and device for nondestructive detection of early internal diseases of pome based on fusion of sound vibration multi-domain spectrum and near infrared spectrum information
Tian et al. Online detection of apples with moldy core using the Vis/NIR full-transmittance spectra
CN102937575B (en) Watermelon sugar degree rapid modeling method based on secondary spectrum recombination
CN107219184A (en) A kind of meat discrimination method and device traced to the source applied to the place of production
CN113418889B (en) Real-time detection method for water content and total colony count of dried vegetables based on deep learning
Liu et al. Diagnosis of citrus greening using raman spectroscopy-based pattern recognition
Chang et al. Detection of sugar content in food based on the electrochemical method with the assistance of partial least square method and deep learning
CN107247033B (en) Identify the method for Huanghua Pear maturity based on rapid decay formula life cycle algorithm and PLSDA
Zhou et al. Research on hyperspectral regression method of soluble solids in green plum based on one-dimensional deep convolution network
CN113310934A (en) Method for quickly identifying milk cow milk mixed in camel milk and mixing proportion thereof
Huang et al. Optimal wavelength selection for hyperspectral scattering prediction of apple firmness and soluble solids content
CN107796779A (en) The near infrared spectrum diagnostic method of rubber tree LTN content
Wang et al. Monitoring model for predicting maize grain moisture at the filling stage using NIRS and a small sample size
CN114062306B (en) Near infrared spectrum data segmentation preprocessing method
CN100429501C (en) Non-destructive detection method for quickly detecting brown core of pear
CN115586159A (en) Method for evaluating aging association degree of white spirit based on mid-infrared spectrum detection technology
CN1789978A (en) Non-destructive detection method for quickly detecting inner quality of apple
CN105651727B (en) The method that near-infrared spectrum analysis based on JADE and ELM differentiates apple shelf life
Li et al. SVM-based apple classification of soluble solids content by near-infrared spectroscopy
CN112801172A (en) Chinese cabbage pesticide residue qualitative analysis method based on fuzzy pattern recognition
Zhang et al. Analysis of moisture and total sugar content of Huizao based on surface images
Liu et al. Retrieval of Water Parameters from Absorption Spectrum Based on Convolutional Neural Network
Yan et al. Prediction Analysis of Soluble Solids Content in Apples Based on Wavelet Packet Analysis and BP Neural Network
CN117929356B (en) LIBS quantitative analysis method based on Gaussian process regression
CN113791049B (en) Method for rapidly detecting freshness of chilled duck meat by combining NIRS and CV

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant