CN114638291A - Food-borne pathogenic bacteria classification method based on multilayer feedforward neural network algorithm - Google Patents

Food-borne pathogenic bacteria classification method based on multilayer feedforward neural network algorithm Download PDF

Info

Publication number
CN114638291A
CN114638291A CN202210226118.0A CN202210226118A CN114638291A CN 114638291 A CN114638291 A CN 114638291A CN 202210226118 A CN202210226118 A CN 202210226118A CN 114638291 A CN114638291 A CN 114638291A
Authority
CN
China
Prior art keywords
layer
neural network
neuron
input
food
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
CN202210226118.0A
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.)
Shanghai Institute of Technology
Original Assignee
Shanghai Institute of Technology
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 Shanghai Institute of Technology filed Critical Shanghai Institute of Technology
Priority to CN202210226118.0A priority Critical patent/CN114638291A/en
Publication of CN114638291A publication Critical patent/CN114638291A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • 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/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • G06F18/2135Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on approximation criteria, e.g. principal component analysis
    • 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/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16BBIOINFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR GENETIC OR PROTEIN-RELATED DATA PROCESSING IN COMPUTATIONAL MOLECULAR BIOLOGY
    • G16B30/00ICT specially adapted for sequence analysis involving nucleotides or amino acids
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16BBIOINFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR GENETIC OR PROTEIN-RELATED DATA PROCESSING IN COMPUTATIONAL MOLECULAR BIOLOGY
    • G16B40/00ICT specially adapted for biostatistics; ICT specially adapted for bioinformatics-related machine learning or data mining, e.g. knowledge discovery or pattern finding

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Biophysics (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Software Systems (AREA)
  • Biotechnology (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Bioethics (AREA)
  • Databases & Information Systems (AREA)
  • Epidemiology (AREA)
  • Computing Systems (AREA)
  • Public Health (AREA)
  • Molecular Biology (AREA)
  • Biomedical Technology (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Proteomics, Peptides & Aminoacids (AREA)
  • Measuring Or Testing Involving Enzymes Or Micro-Organisms (AREA)

Abstract

The invention discloses a food-borne pathogenic bacteria classification method based on a multilayer feedforward neural network algorithm, which comprises the following steps of 1: carrying out data preprocessing on the obtained food-borne pathogenic bacteria data; step 2: constructing a multilayer feedforward neural network; and step 3: and evaluating the constructed multilayer feedforward neural network model to obtain the accuracy of the current model classification. The method based on the multilayer feedforward neural network algorithm is used, and the accuracy of spectrum classification of the food-borne pathogenic bacteria is improved through structural configuration and optimization of the multilayer feedforward neural network algorithm. The invention mainly solves the technical problem of realizing the automation of the food-borne pathogenic bacteria spectral data classification by modeling a multilayer feedforward neural network algorithm and providing a new method for detecting the food-borne pathogenic bacteria.

Description

Food-borne pathogenic bacteria classification method based on multilayer feedforward neural network algorithm
Technical Field
The invention relates to the fields of Raman spectrum, food-borne pathogenic bacteria, deep learning and machine learning, in particular to a food-borne pathogenic bacteria classification method based on a multilayer feedforward neural network algorithm.
Background
The most common methods for detecting food-borne pathogenic bacteria at present mainly comprise microorganisms, biochemical identification, a bacterium-increasing culture separation method, simple polymerase chain reaction amplification (PCR), multiple polymerase chain reaction amplification (mPCR) and real-time/instant polymerase chain reaction amplification (qPCR). And the neural network algorithm for processing food-borne pathogenic bacteria classification detection can ensure that the detection accuracy is higher. Therefore, the present invention combines raman spectroscopy with neural network algorithms in deep learning.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention provides a food-borne pathogenic bacteria classification method based on a multilayer feedforward neural network algorithm, and solves the problems of complex detection operation, long turnover time and the like of food-borne pathogenic bacteria.
In order to achieve the above purpose, the technical solution adopted to solve the technical problems is as follows:
a food-borne pathogenic bacteria classification method based on a multilayer feedforward neural network algorithm comprises the following steps:
step 1: carrying out data preprocessing on the obtained food-borne pathogenic bacteria data;
step 2: constructing a multilayer feedforward neural network;
and step 3: and evaluating the constructed multilayer feedforward neural network model to obtain the accuracy of the current model classification.
Further, step 1 comprises the following:
step 1.1: carrying out Savitzky-Golay convolution smoothing algorithm on the obtained original Raman spectrum data, setting window point number and polynomial order parameters, and reducing noise interference and smoothing spectrum;
step 1.2: carrying out normalization processing on the food-borne pathogenic bacteria data, and distributing the data values between 0 and 1 by utilizing a Min-Max method;
step 1.3: carrying out dimension reduction on the normalized experimental data, and reducing the characteristic dimension of the experimental data by using a PCA dimension reduction method;
step 1.4: the spectral data is divided into training set and testing set according to the ratio of 7:3, so as to facilitate the training of the model.
Further, step 2 comprises the following steps:
step 2.1: the model comprises an input layer, a hidden layer and an output layer, wherein the number of nodes of the input layer, the hidden layer and the output layer is determined firstly, then the activation functions of the input layer and the hidden layer are determined, the activation function of the first layer uses a tanh function, the activation function of the second layer enables a sigmoid function, the input value is multiplied by a weight value, and the output value is obtained in a mode of summing offset values, so that a classification result is obtained;
step 2.2: initializing parameters, randomly initializing the weight w and the bias b, and performing forward propagation in a mode of y ═ x × w + b;
step 2.3: constructing a loss function, and constructing the loss function in the classification problem by using cross entropy;
step 2.4: error back propagation, adopting a gradient descending method to search the minimum value of the loss function along the gradient descending direction of the loss function, thereby obtaining the optimal parameter and optimizing the network structure;
step 2.5: training the neural network using the training data.
Further, in step 2.1, signals in the three-layer BP neural network are firstly propagated in the forward direction, and the signals pass through the hidden layer from the input layer and finally reach the output layer:
the output of the input layer is equal to the input signal of the whole network:
Figure BDA0003535803280000021
wherein the content of the first and second substances,
Figure BDA0003535803280000022
represents the input of the mth neuron of the input layer, and x (n) represents the input value;
passing through the hidden layer, the input of the ith neuron of the hidden layer is equal to
Figure BDA0003535803280000031
Weighted sum of (c):
Figure BDA0003535803280000032
wherein the content of the first and second substances,
Figure BDA0003535803280000033
input, ω, representing the ith neuron of the hidden layermi(n) represents the weight of the neuron between the two layers;
the output of the hidden layer passes through a Sigmoid function, and the output of the ith neuron of the hidden layer is equal to:
Figure BDA0003535803280000034
wherein the content of the first and second substances,
Figure BDA0003535803280000035
the output of the ith neuron representing the hidden layer,
Figure BDA0003535803280000036
an input representing a jth neuron of the hidden layer;
input to jth neuron of output layer is equal to
Figure BDA0003535803280000037
Weighted sum of (c):
Figure BDA0003535803280000038
wherein the content of the first and second substances,
Figure BDA0003535803280000039
representing the input, ω, of the jth neuron of the output layermi(n) represents the weight of the neuron between the two layers,
Figure BDA00035358032800000310
an output representing the ith neuron of the hidden layer;
the output of the jth neuron of the output layer is equal to:
Figure BDA00035358032800000311
wherein the content of the first and second substances,
Figure BDA00035358032800000312
represents the output of the jth neuron of the output layer,
Figure BDA00035358032800000313
an input representing the jth neuron of the output layer;
error of jth neuron of output layer:
Figure BDA00035358032800000314
wherein e isj(n) represents the error of the j-th neuron, dj(n) represents the actual value of the jth neuron,
Figure BDA0003535803280000041
a value representing a jth neural network prediction;
total error of network:
Figure BDA0003535803280000042
wherein e isj(n) represents the error of the jth neuron, e (n) represents the total error of the network;
error signal back propagation of three-layer BP neural network:
firstly, the error is reversely propagated through an output layer, the weight between a hidden layer and the output layer is adjusted, and the adjustment is carried out layer by layer along a network in a reverse direction in the weight adjusting stage; then adjusting the error of the input neuron and the hidden layer neuron; the calculation of the local gradient needs to use the result of the previous calculation, and the local gradient of the previous layer is the weighted sum of the local gradients of the next layer.
Further, in step 2.3, the loss function in back propagation is a Cross Entropy (Cross Entropy) loss function:
H(y-,y)=-∑y-*ln y
wherein y represents the true value of the data and y represents the predicted value of the neural network.
Further, in step 2.4, a gradient descent method is adopted:
calculate the gradient of the loss function with respect to the current parameter:
Figure BDA0003535803280000043
wherein, each iteration is one batch, t represents the total number of iterations of the current batch, ωtFor the parameters to be optimized, f (w) represents the loss function, gtIs the current parameter gradient t times;
calculating first-order momentum and second-order momentum according to historical gradients:
mt=φ(g1,g2,...,gt),Vt=ψ(g1,g2,...,gt)
wherein g is the gradient, mtOf first order momentum of t times, VtA second order momentum of t times;
calculating the falling gradient at the current moment:
Figure BDA0003535803280000051
wherein, alpha is the initial learning rate, mtOf first order momentum of t times, VtIs a second order momentum, ηtA decreasing gradient of t times;
updating according to the gradient of descent:
ωt+1=ωtt
wherein, ω istFor the parameter to be optimized, ηtIs t timesGradient of decrease, ωt+1Is the updated falling gradient.
Further, in step 2.5, a batch mode is selected as the training mode of the multilayer feedforward neural network, the batch mode is that the network obtains all training samples, the mean square error of all samples is calculated to be used as the total error, the batch mode can realize parallelization, and the learning speed of the neural network is accelerated.
Further, step 3 comprises the following steps:
step 3.1: taking k as 5 to perform cross validation, repeating for 5 times, randomly disordering the original data, and dividing a training set and a test set according to the ratio of 7: 3;
step 3.2: respectively training 5 groups of training sets by using the model in the step 2 to obtain 5 groups of different test results, finally taking the average value of the test results to obtain the overall performance index, and introducing a cross validation method to determine the generalization capability of the model.
Due to the adoption of the technical scheme, compared with the prior art, the invention has the following advantages and positive effects:
1. according to the invention, by means of a multilayer feedforward neural network algorithm model, food-borne pathogenic bacteria data are selected for data preprocessing, and then the multilayer feedforward neural network algorithm model is utilized to relieve the problem of artificially identifying two food-borne pathogenic bacteria Escherichia coli O with similar wave crests to a certain extent157∶H7And the misjudgment problem of the Brucella S2 strain;
2. the method based on the multilayer feedforward neural network algorithm is used, the accuracy of the spectrum classification of the food-borne pathogenic bacteria is improved through the structural configuration and optimization of the multilayer feedforward neural network algorithm, the automation of the spectrum data classification of the food-borne pathogenic bacteria is realized through modeling of the multilayer feedforward neural network algorithm, and a new method is provided for detecting the food-borne pathogenic bacteria.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 is a detailed flowchart of a food-borne pathogenic bacteria classification method based on a multi-layer feedforward neural network algorithm model according to the present invention;
FIG. 2 is a structural model diagram of a multi-layer feedforward neural network algorithm model according to an embodiment of the present invention;
FIG. 3 is a flow chart of a multi-layer feedforward neural network algorithm of an embodiment of the present invention;
FIG. 4 is a graph showing the spectrum of Escherichia coli O157: H7 and the spectrum of Brucella S2 strain in the examples of the present invention;
FIG. 5 is a Raman spectrum of two pathogens after pretreatment in accordance with an embodiment of the present invention;
FIG. 6 is a graph of a sigmoid function of an activation function used by an example of the present invention;
FIG. 7 is a diagram of the function of the activation function tanh used in an example of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1 to 3, a specific flowchart of a food-borne pathogenic bacteria classification method based on a Multilayer feed forward Neural Network Algorithm (Multilayer feed forward Neural Network Algorithm) provided by an embodiment of the present invention includes the following steps:
step 1: carrying out data preprocessing on the obtained food-borne pathogenic bacteria data;
specifically, step 1 includes the following:
step 1.1: carrying out Savitzky-Golay convolution smoothing algorithm on the obtained original Raman spectrum data, setting window point number and polynomial order parameters, and reducing noise interference and smoothing spectrum;
step 1.2: carrying out normalization processing on the food-borne pathogenic bacteria data, and distributing the data values between 0 and 1 by utilizing a Min-Max method;
step 1.3: carrying out dimension reduction on the normalized experimental data, and reducing the characteristic dimension of the experimental data by using a PCA dimension reduction method;
step 1.4: the spectral data is divided into training set and testing set according to the ratio of 7:3, so as to facilitate the training of the model.
And 2, step: constructing a Multilayer Feedforward Neural Network (multilayered fed forward Neural Network);
specifically, step 2 includes the following:
step 2.1: the model comprises an input layer, a hidden layer and an output layer, the number of nodes of the input layer, the hidden layer and the output layer is determined firstly, then the activation functions of the input layer and the hidden layer are determined, the activation function of the first layer uses a tanh function, the activation function of the second layer enables a sigmoid function, the input value is multiplied by a weight value, and the output value is obtained in a mode of summing offset values, so that a classification result is obtained.
The process of the multilayer feedforward neural network (multilayer feed-forward) is mainly divided into two stages, wherein the first stage is the forward propagation of signals, and the signals pass through an implied layer from an input layer and finally reach an output layer; the second stage is the back propagation of error, from the output layer back to the hidden layer and finally to the input layer, and the weights and offsets from the hidden layer to the output layer and from the input layer to the hidden layer are adjusted in turn.
Specifically, in step 2.1, signals in the three-layer BP neural network are first propagated in the forward direction, and the signals pass through the hidden layer from the input layer and finally reach the output layer:
the output of the input layer is equal to the input signal of the whole network:
Figure BDA0003535803280000071
wherein the content of the first and second substances,
Figure BDA0003535803280000072
representing the mth nerve of the input layerThe input of the element, x (n) represents the input value;
passing through the hidden layer, the input of the ith neuron of the hidden layer is equal to
Figure BDA0003535803280000073
Weighted sum of (c):
Figure BDA0003535803280000074
wherein, the first and the second end of the pipe are connected with each other,
Figure BDA0003535803280000075
input, ω, representing the ith neuron of the hidden layermi(n) represents the weight of the neuron between the two layers;
the output of the hidden layer passes through a Sigmoid function, and the output of the ith neuron of the hidden layer is equal to:
Figure BDA0003535803280000081
wherein the content of the first and second substances,
Figure BDA0003535803280000082
the output of the ith neuron representing the hidden layer,
Figure BDA0003535803280000083
an input representing the ith neuron of the hidden layer;
input to jth neuron of output layer is equal to
Figure BDA0003535803280000084
Weighted sum of (c):
Figure BDA0003535803280000085
wherein the content of the first and second substances,
Figure BDA0003535803280000086
representing the input, ω, of the jth neuron of the output layermi(n) represents the weight of the neuron between the two layers,
Figure BDA0003535803280000087
an output representing the ith neuron of the hidden layer;
the output of the jth neuron of the output layer is equal to:
Figure BDA0003535803280000088
wherein the content of the first and second substances,
Figure BDA0003535803280000089
representing the output of the jth neuron of the output layer,
Figure BDA00035358032800000810
an input representing the jth neuron of the output layer;
error of jth neuron of output layer:
Figure BDA00035358032800000811
wherein e isj(n) represents the error of the j-th neuron, dj(n) represents the actual value of the jth neuron,
Figure BDA00035358032800000812
a value representing a jth neural network prediction;
total error of network:
Figure BDA00035358032800000813
wherein e isj(n) represents the error of the jth neuron, e (n) represents the total error of the network;
in this embodiment, the number of neurons in each layer is: the number of input layers depends on the dimension of the input vector and the number of nodes of the output layers depends on the number of classes. The number of neurons in the hidden layer generally depends on an empirical formula:
Figure BDA0003535803280000091
wherein m is the number of nodes of the input layer, n is the number of nodes of the output layer, and alpha is a constant between 1 and 10.
In this embodiment, the introduction of the activation function is to increase the nonlinearity of the neural network model, and the use of the activation function can effectively alleviate the problem of gradient disappearance. The common activation functions include nonlinear functions such as Sigmoid function, Tanh function, Relu function, Leaky Relu function, and the like. Two activation functions, tanh and sigmoid, are used in this embodiment:
(1) the tanh function is:
Figure BDA0003535803280000092
(2) the sigmoid function is:
Figure BDA0003535803280000093
error signal back propagation of three-layer BP neural network:
firstly, the error is reversely propagated through an output layer, the weight between a hidden layer and the output layer is adjusted, and the adjustment is carried out layer by layer along a network in a reverse direction in the weight adjusting stage; then adjusting the error of the input neuron and the hidden layer neuron; the calculation of the local gradient needs to use the result of the previous calculation, and the local gradient of the previous layer is the weighted sum of the local gradients of the next layer.
Step 2.2: and initializing parameters, wherein the weight w and the bias b are randomly initialized, and forward propagation is carried out according to a mode of y ═ x × w + b.
Step 2.3: and constructing a loss function, and constructing the loss function in the classification problem by using Cross Entropy (Cross Entropy). The effectiveness of the neural network model and the goal of optimization are defined by the loss function. The loss function is typically a Mean Square Error (Mean Square Error) loss function, a Cross Entropy loss (Cross Entropy) function, and a custom loss function.
Specifically, in step 2.3, the loss function in back propagation is a Cross Entropy (Cross Entropy) loss function:
H(y-,y)=-∑y-*ln y
wherein, y-Representing the true value of the data and y representing the predicted value of the neural network.
Step 2.4: and (3) error back propagation, namely searching the minimum value of the loss function along the gradient descending direction of the loss function by adopting a gradient descending method so as to obtain the optimal parameter and optimize the network structure.
Specifically, in step 2.4, a gradient descent method is adopted:
calculate the gradient of the loss function with respect to the current parameter:
Figure BDA0003535803280000101
wherein, each iteration is a batch, t represents the total times of the current batch iteration, and ω istFor the parameters to be optimized, f (w) represents the loss function, gtIs the current parameter gradient of t times;
calculating first-order momentum and second-order momentum according to historical gradients:
mt=φ(g1,g2,...,gt),Vt=ψ(g1,g2,...,gt)
wherein g is gradient, mtFirst order momentum of t times, VtA second order momentum of t times;
calculating the falling gradient at the current moment:
Figure BDA0003535803280000102
where α is the initial learning rate, mtIs one of t timesMagnitude of order, VtIs a second order momentum, ηtA decreasing gradient of t times;
updating according to the gradient of descent:
ωt+1=ωtt
wherein, ω istFor the parameter to be optimized, ηtIs a decreasing gradient of t times, ωt+1Is the updated falling gradient.
Step 2.5: training the neural network using the training data.
Specifically, in step 2.5, a batch mode is selected as the training mode of the multilayer feedforward neural network, the batch mode is that the network obtains all training samples, the mean square error of all samples is calculated to be used as the total error, the batch mode can realize parallelization, and the learning speed of the neural network is accelerated.
And step 3: and evaluating the constructed multilayer feedforward neural network model to obtain the accuracy of the current model classification.
Specifically, step 3 includes the following:
step 3.1: taking k as 5 to perform cross validation, repeating 5 times to randomly scramble the original data, and dividing a training set (training set) and a test set (test set) according to a ratio of 7: 3;
step 3.2: respectively training 5 groups of training sets by using the model in the step 2 to obtain 5 groups of different test results, finally taking the average value of the test results to obtain the overall performance index, and introducing a cross validation method to determine the generalization capability of the model.
FIG. 4 is the spectrum diagram of two pathogenic bacteria, Escherichia coli O157: H7 and Brucella S2 strain, with the spectrum curves at 1200, 1400 and 1700cm-1Similar raman peaks are found on both sides.
FIG. 5 is a spectrum image of two pathogenic bacteria, Escherichia coli O157: H7 and Brucella S2 strain, which are subjected to Min-max normalization and Savitzky-Golay method smoothing denoising.
Fig. 6 is a diagram of a sigmoid function of an activation function used in an example of the present invention, and fig. 7 is a diagram of a tanh function of an activation function used in an example of the present invention.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A food-borne pathogenic bacteria classification method based on a multilayer feedforward neural network algorithm is characterized by comprising the following steps:
step 1: carrying out data preprocessing on the obtained food-borne pathogenic bacteria data;
step 2: constructing a multilayer feedforward neural network;
and step 3: and evaluating the constructed multilayer feedforward neural network model to obtain the accuracy of the current model classification.
2. The food-borne pathogenic bacteria classification method based on the multi-layer feedforward neural network algorithm is characterized in that the step 1 comprises the following steps:
step 1.1: carrying out Savitzky-Golay convolution smoothing algorithm on the obtained original Raman spectrum data, setting window point number and polynomial order parameters, and reducing noise interference and smoothing spectrum;
step 1.2: carrying out normalization processing on the food-borne pathogenic bacteria data, and distributing the data values between 0 and 1 by utilizing a Min-Max method;
step 1.3: carrying out dimension reduction on the normalized experimental data, and reducing the characteristic dimension of the experimental data by using a PCA dimension reduction method;
step 1.4: the spectral data were measured as 7:3 into a training set and a test set to facilitate training of the model.
3. The food-borne pathogenic bacteria classification method based on the multilayer feedforward neural network algorithm is characterized in that the step 2 comprises the following steps:
step 2.1: the model comprises an input layer, a hidden layer and an output layer, wherein the number of nodes of the input layer, the hidden layer and the output layer is determined firstly, then the activation functions of the input layer and the hidden layer are determined, the activation function of the first layer uses a tanh function, the activation function of the second layer enables a sigmoid function, the input value is multiplied by a weight value, and the output value is obtained in a mode of summing offset values, so that a classification result is obtained;
step 2.2: initializing parameters, randomly initializing the weight w and the bias b, and performing forward propagation in a mode of y ═ x × w + b;
step 2.3: constructing a loss function, and constructing the loss function in the classification problem by using cross entropy;
step 2.4: error back propagation, adopting a gradient descending method to search the minimum value of the loss function along the gradient descending direction of the loss function, thereby obtaining the optimal parameter and optimizing the network structure;
step 2.5: training the neural network using the training data.
4. The food-borne pathogenic bacteria classification method based on the multilayer feedforward neural network algorithm as claimed in claim 3, characterized in that, in step 2.1, the signal in the three-layer BP neural network is firstly propagated in the forward direction, and the signal passes through the hidden layer from the input layer and finally reaches the output layer:
the output of the input layer is equal to the input signal of the whole network:
Figure FDA0003535803270000021
wherein the content of the first and second substances,
Figure FDA0003535803270000022
represents the input of the mth neuron of the input layer, and x (n) represents the input value;
passing through the hidden layer, the input of the ith neuron of the hidden layer is equal to
Figure FDA0003535803270000023
Weighted sum of:
Figure FDA0003535803270000024
Wherein the content of the first and second substances,
Figure FDA0003535803270000025
input, ω, representing the ith neuron of the hidden layermi(n) represents the weight of the neuron between the two layers;
the output of the hidden layer passes through a Sigmoid function, and the output of the ith neuron of the hidden layer is equal to:
Figure FDA0003535803270000026
wherein, the first and the second end of the pipe are connected with each other,
Figure FDA0003535803270000027
the output of the ith neuron representing the hidden layer,
Figure FDA0003535803270000028
an input representing the ith neuron of the hidden layer;
input to jth neuron of output layer is equal to
Figure FDA0003535803270000029
Weighted sum of (c):
Figure FDA00035358032700000210
wherein the content of the first and second substances,
Figure FDA00035358032700000211
representing the input, ω, of the jth neuron of the output layermi(n) represents the weight of the neuron between the two layers,
Figure FDA0003535803270000031
an output representing the ith neuron of the hidden layer;
the output of the jth neuron of the output layer is equal to:
Figure FDA0003535803270000032
wherein the content of the first and second substances,
Figure FDA0003535803270000033
represents the output of the jth neuron of the output layer,
Figure FDA0003535803270000034
an input representing the jth neuron of the output layer;
error of jth neuron of output layer:
Figure FDA0003535803270000035
wherein e isj(n) represents the error of the j-th neuron, dj(n) represents the actual value of the jth neuron,
Figure FDA0003535803270000036
a value representing a jth neural network prediction;
total error of network:
Figure FDA0003535803270000037
wherein e isj(n) represents the error of the jth neuron, e (n) represents the total error of the network;
and (3) error signals of the three-layer BP neural network are propagated reversely:
firstly, the error is reversely propagated through an output layer, the weight between a hidden layer and the output layer is adjusted, and the adjustment is carried out layer by layer along a network in a reverse direction in the weight adjusting stage; then adjusting the error of the input neuron and the hidden layer neuron; the calculation of the local gradient needs to use the result of the previous calculation, and the local gradient of the previous layer is the weighted sum of the local gradients of the next layer.
5. A food-borne pathogenic bacteria classification method based on a multilayer feed-forward neural network algorithm as claimed in claim 3, characterized in that in step 2.3, the loss function in back propagation is Cross Entropy (Cross Entropy) loss function:
H(y_,y)=-∑y_*lny
wherein y _ represents the true value of the data and y represents the predicted value of the neural network.
6. The food-borne pathogenic bacteria classification method based on the multilayer feedforward neural network algorithm as claimed in claim 3, characterized in that in step 2.4, a gradient descent method is adopted:
calculate the gradient of the loss function with respect to the current parameter:
Figure FDA0003535803270000041
wherein, each iteration is one batch, t represents the total number of iterations of the current batch, ωtFor the parameters to be optimized, f (w) represents the loss function, gtIs the current parameter gradient t times;
calculating first-order momentum and second-order momentum according to historical gradients:
mt=φ(g1,g2,...,gt),Vt=ψ(g1,g2,...,gt)
wherein g is the gradient, mtOf first order momentum of t times, VtA second order momentum of t orders;
calculating the falling gradient at the current moment:
Figure FDA0003535803270000042
where α is the initial learning rate, mtOf first order momentum of t times, VtIs a second order momentum, ηtA decreasing gradient of t times;
updating according to the gradient of descent:
ωt+1=ωtt
wherein, ω istFor the parameter to be optimized, ηtIs a decreasing gradient of t times, ωt+1Is the updated falling gradient.
7. The food-borne pathogenic bacteria classification method based on the multilayer feedforward neural network algorithm as claimed in claim 3, characterized in that in step 2.5, the training mode of the multilayer feedforward neural network selects a batch mode, the batch mode is that the network obtains all training samples, the mean square error of all samples is calculated as the total error, the batch mode can realize parallelization, and the learning speed of the neural network is accelerated.
8. The food-borne pathogenic bacteria classification method based on the multi-layer feedforward neural network algorithm as claimed in claim 1, wherein the step 3 comprises the following steps:
step 3.1: taking k to be 5 for cross validation, repeating 5 times to randomly disorder the original data, and dividing a training set and a test set according to the ratio of 7: 3;
step 3.2: respectively training 5 groups of training sets by using the model in the step 2 to obtain 5 groups of different test results, finally taking the average value of the test results to obtain the overall performance index, and introducing a cross validation method to determine the generalization capability of the model.
CN202210226118.0A 2022-03-08 2022-03-08 Food-borne pathogenic bacteria classification method based on multilayer feedforward neural network algorithm Pending CN114638291A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210226118.0A CN114638291A (en) 2022-03-08 2022-03-08 Food-borne pathogenic bacteria classification method based on multilayer feedforward neural network algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210226118.0A CN114638291A (en) 2022-03-08 2022-03-08 Food-borne pathogenic bacteria classification method based on multilayer feedforward neural network algorithm

Publications (1)

Publication Number Publication Date
CN114638291A true CN114638291A (en) 2022-06-17

Family

ID=81947383

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210226118.0A Pending CN114638291A (en) 2022-03-08 2022-03-08 Food-borne pathogenic bacteria classification method based on multilayer feedforward neural network algorithm

Country Status (1)

Country Link
CN (1) CN114638291A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114817847A (en) * 2022-06-30 2022-07-29 广州兆和电力技术有限公司 Energy storage power station intelligent monitoring method based on multilayer feedforward neural network
CN117596462A (en) * 2023-11-21 2024-02-23 长春理工大学中山研究院 SMA motor, camera and anti-shake control method of camera

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015172560A1 (en) * 2014-05-16 2015-11-19 华南理工大学 Central air conditioner cooling load prediction method based on bp neural network
CN109781706A (en) * 2019-02-11 2019-05-21 上海应用技术大学 Training method based on the PCA-Stacking food-borne pathogens Raman spectrum identification model established
CN110245713A (en) * 2019-06-19 2019-09-17 上海应用技术大学 A kind of food-borne pathogens classification method
CN111274874A (en) * 2020-01-08 2020-06-12 上海应用技术大学 Food-borne pathogenic bacteria Raman spectrum classification model training method based on adaboost

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015172560A1 (en) * 2014-05-16 2015-11-19 华南理工大学 Central air conditioner cooling load prediction method based on bp neural network
CN109781706A (en) * 2019-02-11 2019-05-21 上海应用技术大学 Training method based on the PCA-Stacking food-borne pathogens Raman spectrum identification model established
CN110245713A (en) * 2019-06-19 2019-09-17 上海应用技术大学 A kind of food-borne pathogens classification method
CN111274874A (en) * 2020-01-08 2020-06-12 上海应用技术大学 Food-borne pathogenic bacteria Raman spectrum classification model training method based on adaboost

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘瑞芳等: "《程序设计实践》", 1 April 2020, pages: 291 - 296 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114817847A (en) * 2022-06-30 2022-07-29 广州兆和电力技术有限公司 Energy storage power station intelligent monitoring method based on multilayer feedforward neural network
CN114817847B (en) * 2022-06-30 2023-02-07 广州兆和电力技术有限公司 Energy storage power station intelligent monitoring method based on multilayer feedforward neural network
CN117596462A (en) * 2023-11-21 2024-02-23 长春理工大学中山研究院 SMA motor, camera and anti-shake control method of camera

Similar Documents

Publication Publication Date Title
CN114638291A (en) Food-borne pathogenic bacteria classification method based on multilayer feedforward neural network algorithm
CN108197648B (en) Hydroelectric generating set fault diagnosis method and system based on LSTM deep learning model
Haidong et al. Intelligent fault diagnosis among different rotating machines using novel stacked transfer auto-encoder optimized by PSO
CN109033719B (en) Wind turbine bearing fault diagnosis method
Leung et al. Dual extended Kalman filtering in recurrent neural networks
Zhou et al. Comparison of time series forecasting based on statistical ARIMA model and LSTM with attention mechanism
CN111027733A (en) Petrochemical device product yield optimization method based on big data technology
CN115828754A (en) Cutter wear state monitoring method based on multi-scale space-time fusion network model
Ren et al. A lightweight and adaptive knowledge distillation framework for remaining useful life prediction
CN115098563B (en) Time sequence abnormity detection method and system based on GCN and attention VAE
CN112765894A (en) K-LSTM-based aluminum electrolysis cell state prediction method
Lutfy et al. Non-linear modelling and control of a conveyor-belt grain dryer utilizing neuro-fuzzy systems
CN115062764B (en) Intelligent illuminance adjustment and environmental parameter Internet of things big data system
Zhang et al. Intermittent demand forecasting with transformer neural networks
CN112414446B (en) Data-driven transmission sensor fault diagnosis method
CN112818030B (en) Self-adaptive mining method for association rules of distributed stream data
Beskopylny et al. Comparison of the efficiency of neural network algorithms in recognition and classification problems
CN113008998A (en) Hidden engineering internal defect judgment method based on PCNN
Chen et al. Traffic-condition-awareness ensemble learning for traffic flow prediction
CN111160419A (en) Electronic transformer data classification prediction method and device based on deep learning
Liu et al. A nonlinear sparse neural ordinary differential equation model for multiple functional processes
Shashank et al. Intelligent fault diagnosis of Rolling-element bearing using 1-D Deep Convolutional Neural Networks.
CN112529344B (en) Algorithm for optimizing air quality value based on Elman neural network
Muntin et al. Artificial Intelligence and Machine Learning in Metallurgy. Part 1. Methods and Algorithms
Baptista et al. Pastprop-RNN: improved predictions of the future by correcting the past

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