Classification method and device based on restricted Boltzmann machine

Through the classification method based on the restricted Boltzmann machine, the joint probability distribution of the data set is constructed and the sample distribution is judged, which solves the shortcomings of the traditional method in large data sets and complex nonlinear classification problems, improves the classification accuracy, and avoids Features are lost.

CN118657969APending Publication Date: 2024-09-17SHENZHEN TIEYUE ELECTRIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410287110.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-13
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

Traditional machine learning methods and convolutional neural networks perform poorly on large data sets and complex nonlinear classification problems, and convolutional neural networks cause feature loss as the layer depth increases, reducing classification accuracy.

Method used

The classification method based on the restricted Boltzmann machine is used to construct the joint probability distribution of the data set through the display layer and the hidden layer, and based on the independent probability distribution, it is judged whether the input sample and the training data set have the same distribution, so as to classify.

Benefits of technology

It avoids feature loss caused by increasing network layer depth and improves classification accuracy, especially in large data sets and complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657969A
    Figure CN118657969A
Patent Text Reader

Abstract

The invention discloses a classification method and device based on a restricted Boltzmann machine, and the method comprises the steps: inputting a training data set and an input sample into a restricted Boltzmann network for training, and obtaining the conditional probability distribution of a display layer and a hidden layer; calculating joint probability distribution of the display layer and the hidden layer according to a conditional probability distribution formula; judging whether the input sample and the training data set are in the same distribution or not according to an independent probability distribution formula, if yes, the input sample belongs to the class to which the training data set belongs, and if not, the input sample does not belong to the class to which the training data set belongs. Compared with a neural network with multiple convolutional layers, the restricted Boltzmann network only has a display layer and a hidden layer, and feature loss caused by increase of the depth of the network layer does not exist. The RBM judges whether a training data set and a test sample belong to the same distribution or not according to the definition of independent probability distribution by constructing joint probability distribution of the data set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of graph classification algorithms, and in particular to a classification method and device based on a restricted Boltzmann machine. Background Art

[0002] Image classification algorithms mainly include traditional machine learning methods and convolutional neural network methods. Traditional machine learning algorithms include decision trees, naive Bayes, support vector machines, and ensemble learning methods. Support vector machines and ensemble learning methods are generally used to develop projects, and have achieved good results, but there are also certain problems. For example: 1. Now is the era of large data sets. The number of parameters contained in support vector machines and ensemble learning models is not enough to cover the distribution of data sets, resulting in low classification accuracy. Traditional machine learning algorithms are mainly used in the classification of small samples. 2. For nonlinear classification problems in more complex scenarios, the classification accuracy of traditional machine learning is low.

[0003] The convolutional neural network method mainly performs classification through convolutional neural layers and fully connected layers. The classification accuracy has been greatly improved compared with traditional machine learning methods. However, it also has a disadvantage: as the depth of the convolutional layer increases, the receptive field of the key pixels of the image increases, resulting in a decrease in the weight of the key pixels of the image for the classification results, thereby reducing the classification accuracy. Summary of the invention

[0004] In view of the above technical problems, the present invention provides a classification method and device based on restricted Boltzmann machine (RBM), which at least solves some of the above problems.

[0005] A first aspect of the present invention provides a classification method based on a restricted Boltzmann machine, characterized in that the restricted Boltzmann machine includes a display layer and a hidden layer, including:

[0006] Inputting the training data set and the input sample into the restricted Boltzmann network training to obtain the conditional probability distribution of the display layer and the hidden layer;

[0007] Calculating the joint probability distribution of the display layer and the hidden layer according to a conditional probability distribution formula;

[0008] According to the independent probability distribution formula, it is determined whether the input sample and the training data set are of the same distribution. If they are of the same distribution, the input sample belongs to the class to which the training data set belongs. If they are not of the same distribution, the input sample does not belong to the class to which the training data set belongs.

[0009] In an optional implementation manner, the calculating the joint probability distribution of the display layer and the hidden layer according to the conditional probability distribution formula includes:

[0010] The connection from the input layer to the hidden layer is defined as the node probability of the hidden layer when the input layer is known; the connection from the hidden layer to the input layer is defined as the node probability of the input layer when the hidden layer is known; the joint probability distribution and energy function of all nodes of the restricted Boltzmann machine are calculated by accumulating the node probabilities of all hidden layers and the node probabilities of the input layer.

[0011] In an optional implementation, the joint probability distribution and energy function of all nodes of the restricted Boltzmann machine are calculated according to the following formula:

[0012] Joint probability distribution:

[0013] Energy function E: E(V, H) = -b T Vc T HV T WH;

[0014] Where w is the weight parameter, b is the bias of the input layer, c is the bias of the hidden layer, H is the hidden layer node, and V is the input node of the training data set.

[0015] In an optional implementation, judging whether the input sample and the training data set are of the same distribution according to the independent probability distribution formula includes: calculating the classification coefficient α according to the relationship between the joint probability of the input layer nodes, the node probability of the training data set, and the node probability of the test sample:

[0016] According to the formula P(V, V′) = αP(V)*P(V′), we can get Among them, the probability of the input sample node V of the training data set is: The probability of the input layer node V' of the test sample: Joint probability of input layer nodes:

[0017] In an optional implementation, the determining whether the input sample and the training data set are of the same distribution according to an independent probability distribution formula includes:

[0018] If α is greater than or equal to the preset threshold, the test sample and the training data set belong to the same distribution and both belong to the same class.

[0019] If α is less than the pre-threshold, the test sample and the training data set do not belong to the same distribution and do not belong to the same class.

[0020] A second aspect of the present invention provides a classification device based on a restricted Boltzmann machine, comprising: the restricted Boltzmann machine comprises a display layer and a hidden layer, comprising:

[0021] A first computing module, used for inputting a training data set and an input sample into the restricted Boltzmann network training to obtain a conditional probability distribution of the display layer and the hidden layer;

[0022] A second calculation module, used for calculating the joint probability distribution of the display layer and the hidden layer according to a conditional probability distribution formula;

[0023] The third calculation module is used to determine whether the input sample and the training data set are of the same distribution according to the independent probability distribution formula. If they are of the same distribution, the input sample belongs to the class to which the training data set belongs; if they are not of the same distribution, the input sample does not belong to the class to which the training data set belongs.

[0024] In an optional implementation, the second calculation module includes:

[0025] The node probability calculation module is used to define the node probability of the hidden layer when the connection meaning from the input layer to the hidden layer is the case where the input layer is known, and to define the node probability of the input layer when the connection meaning from the hidden layer to the input layer is the case where the hidden layer is known; the node probabilities of all hidden layers and the node probabilities of the input layer are accumulated to calculate the joint probability distribution and energy function of all nodes of the restricted Boltzmann machine.

[0026] According to a third aspect of the present invention, a computer program product is provided, comprising a computer program / instruction, which, when executed by a processor, implements the steps of a classification method based on a restricted Boltzmann machine.

[0027] A fourth aspect of the present invention provides an electronic device, comprising:

[0028] At least one processor; and at least one memory communicatively connected to the processor, wherein: the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the classification method based on the restricted Boltzmann machine as the first aspect of the embodiment of the present invention.

[0029] According to a fifth aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a computer, the classification method based on a restricted Boltzmann machine according to the first aspect of the embodiment of the present invention is executed.

[0030] Compared with neural networks with multiple convolutional layers, restricted Boltzmann networks only have explicit layers and hidden layers, and there is no feature loss caused by the increase in network layer depth. RBM constructs a joint probability distribution of the data set, and then determines whether the training data set and the test sample belong to the same distribution based on the definition of independent probability distribution. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1The figure is a flow chart of a classification method based on a restricted Boltzmann machine in an embodiment of the present invention.

[0032] Figure 2 Schematic diagram of a module of a classification device based on a restricted Boltzmann machine in an embodiment of the present invention. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0034] At present, classification algorithms mainly include traditional machine learning methods and convolutional neural network methods. Mainstream traditional machine learning methods include support vector machines and ensemble learning algorithms. The core idea of ​​support vector machines is to maximize the hyperplane intervals of different classes. The larger the interval, the greater the confidence of the classification.

[0035] For example, suppose the input sample, where x1, x2, ..., xn is the feature of the input sample, and y1, y2, ..., yn is the class to which the input sample belongs. The training process is:

[0036] Objective function:

[0037] Constraints: y i (w T x i +b)≥1, i=1, 2,..., n;

[0038] The objective function is equivalent to:

[0039] According to the Lagrangian duality and KKT conditions, the model parameters w and b are solved.

[0040] Assume the input sample is xi. If it satisfies: w T x i +b≥0, then the sample xi belongs to the positive sample.

[0041] Satisfy: w t x i +b<0, then the sample xi is a negative sample.

[0042] If the data set is not linearly separable, it is necessary to first perform a high-dimensional mapping on the data set so that the data set is linearly separable in a higher-dimensional feature space.

[0043] In the field of ensemble learning algorithms, the XGBoost algorithm is widely used in actual projects and machine learning competitions. The XGBoost algorithm is an efficient gradient boosting decision tree algorithm. The core of the XGBoost algorithm is to use the Boosting ensemble idea to integrate multiple weak learners into a strong learner through a certain method. That is, multiple trees are used to make decisions together, and the result of each tree is the difference between the target value and the predicted results of all previous trees. All the results are accumulated to get the final result, so as to improve the effect of the entire model. For example:

[0044] Assume that XGBoost is an additive model consisting of T decision trees, and the classification function of each decision tree is:

[0045] f j (x), where j = 1, 2, ..., T;

[0046] After the training of the tth decision tree is completed, the prediction result of the sample is:

[0047]

[0048] Where xi represents the input sample.

[0049] The relationship between the predicted sample results after the training of the t-th decision tree and the training of the t-1-th decision tree is as follows:

[0050] The loss function of each tree is:

[0051] Among them: yi, Represent the true result and input sample x respectively i The prediction result of , N represents the number of input samples.

[0052] XGBoost training process:

[0053] Train the t-1th tree and obtain the optimal classification function by minimizing the loss function: f t-1 (x i );

[0054] After training, the loss function of the prediction result is:

[0055] The tth tree is trained on the above loss function, and the optimal classification function of the tth tree is obtained by minimizing the loss function: t (x i );

[0056] By recursion, we can get the optimal classification function of all decision trees: j (x), where j = 1, 2, ..., T;

[0057] Assume the input sample xi, if: xi belongs to the positive sample; otherwise, xi belongs to the negative sample.

[0058] In the convolutional neural network method, a convolutional neural network is a type of feedforward neural network that contains convolution calculations and has a deep structure. The convolutional neural network consists of an input layer, a convolution layer, a pooling layer, and a fully connected layer. Among them:

[0059] Input layer: that is, input pictures and other data;

[0060] Convolution layer: performs convolution operation on the input data to extract the features of the image;

[0061] Pooling layer: downsampling, reducing the dimension of features, and supporting multi-scale input;

[0062] Fully connected layer: The features after the pooling layer pass through the fully connected layer to output the final classification result.

[0063] Assuming binary classification, the input sample is imported into the input layer for normalization, scaling and other preprocessing operations, the convolution layer extracts the features of the sample, and the fully connected layer classifies according to the extracted features. If the classification result is 0, the sample belongs to the positive class; otherwise, it belongs to the negative class. As the depth of the convolutional neural network increases, the receptive field of the key pixels of the image increases, resulting in a decrease in the weight of the key pixels of the image for the classification result, thereby reducing the classification accuracy. In view of this shortcoming, the present invention proposes a classification method based on a restricted Boltzmann machine.

[0064] The differences between the present invention and the prior art are as follows:

[0065] Compared with neural networks with multiple convolutional layers, RBM only has display layers and hidden layers, and there is no feature loss caused by the increase in network layer depth.

[0066] RBM obtains the joint probability distribution of the data set.

[0067] According to the joint probability distribution, different variables are integrated to obtain the joint probability of the training data set and the probability of the input sample. The independence of the training data set and the input sample is determined according to the independent probability formula. If they are independent, they have different distributions, that is, the input sample does not belong to the class to which the training data set belongs; if they have the same distribution, the input sample belongs to the class to which the training data set belongs, and classification is performed based on distribution similarity.

[0068] like Figure 1 As shown, a classification method based on a restricted Boltzmann machine is characterized in that the restricted Boltzmann machine includes a display layer and a hidden layer, including:

[0069] Step 10: Input the training data set and the input sample into the restricted Boltzmann network training to obtain the conditional probability distribution of the display layer and the hidden layer;

[0070] Step 20: Calculate the joint probability distribution of the display layer and the hidden layer according to the conditional probability distribution formula;

[0071] Step 30: Determine whether the input sample and the training data set are of the same distribution according to the independent probability distribution formula. If they are of the same distribution, the input sample belongs to the class to which the training data set belongs. If they are not of the same distribution, the input sample does not belong to the class to which the training data set belongs.

[0072] For example, suppose the node vectors of the RBM input layer and hidden layer are V and H respectively,

[0073] V=v1,v2,...,v n

[0074] H=h1,h2,...,h j ;

[0075] The connection from the input layer to the hidden layer is defined as the node probability of the hidden layer when the input layer is known; the connection from the hidden layer to the input layer is defined as the node probability of the input layer when the hidden layer is known; the joint probability distribution and energy function of all nodes of the restricted Boltzmann machine are calculated by accumulating the node probabilities of all hidden layers and the node probabilities of the input layer.

[0076] The weight parameter w, the bias b of the input layer, the bias c of the hidden layer, and the connection from the input layer to the hidden layer mean the node probability of the hidden layer when the input layer is known:

[0077] P(H|V)=WV+b;

[0078] The connection from the hidden layer to the input layer means the node probability of the input layer when the hidden layer is known:

[0079] P(V|H)=W T H+c;

[0080] The joint probability distribution and energy function E formula of all RBM nodes is:

[0081]

[0082] The energy function E is:

[0083] E(V,H)=-b T Vc T HV T WH;

[0084] w is the weight parameter, b is the bias of the input layer, c is the bias of the hidden layer, H is the hidden layer node, and V is the input node of the training data set.

[0085] The energy function of all possible variables in all nodes of the input layer and hidden layer is accumulated to obtain E.

[0086] Loss function:

[0087] L=-logP(V)

[0088] Train the RBM and minimize the loss function l to obtain the parameters W, b and c of the RBM.

[0089] Assume that the input layer node of RBM is V0, which includes nodes V and V', where the nodes of V correspond to the input nodes of the training data set, the nodes of V' correspond to the input nodes of the test sample, and the common hidden layer node H.

[0090] Input node V corresponding to the training data set:

[0091] V=v1,v2,...,v n ;

[0092] Input node V' corresponding to the test sample:

[0093] V′=v′1, v′2,..., v′ n ;

[0094] Shared hidden layer nodes H:

[0095] H=h1,h2,...,h k .

[0096] Then: Calculate the classification coefficient α based on the relationship between the joint probability of the input layer nodes, the node probability of the training data set, and the node probability of the test sample:

[0097] According to the formula P(V, V′) = αP(V)*P(V′), we can get Among them, the probability of the input sample node V of the training data set is: The probability of the input layer node V' of the test sample: Joint probability of input layer nodes:

[0098] Specifically, according to the above introduction, the joint probability distribution P(V, V', H) of nodes V, V' and H can be obtained.

[0099] Accumulate all possible V' and H variables to get the probability of input layer node V:

[0100]

[0101] Accumulate all possible V and H variables to get the probability of input layer node V':

[0102]

[0103] Accumulate all possible H variables to get the joint probability of the input layer nodes:

[0104]

[0105] According to the relationship between the joint probability of the input layer nodes, the probability of the input layer training data set nodes and the probability of the input layer input sample nodes:

[0106] P(V,V′)=αP(V)*P(V′);

[0107] Calculate the coefficient α:

[0108]

[0109] The relationship between α and classification results:

[0110] If α is greater than or equal to the preset threshold, the test sample and the training data set belong to the same distribution and both belong to the same class. If α is less than the preset threshold, the test sample and the training data set do not belong to the same distribution and both do not belong to the same class.

[0111] For example, if α ≥ T, the input sample and the training set have the same distribution, and the category of the input sample belongs to the class of the training set; otherwise, they are not the same distribution, and the categories of the two are different.

[0112] In practical applications, all pixels of the training sample are expanded into the node vector V of the input layer:

[0113] V=(v1,...,v n );

[0114] Expand all the pixels of the test sample into the node vector V' of the input layer:

[0115] V′=(v′1,...,v′ m );

[0116] Set the node vector H of the hidden layer:

[0117] H=(h1,...,h k ).

[0118] Set the RBM parameter to W, the bias of the input layer to b, and the bias of the hidden layer to c, then the input layer and the hidden layer satisfy the following equation:

[0119] H = σ(WV + b);

[0120] If the output of the activation layer is ≥ 0.5, the node of the hidden layer is 1; otherwise it is 0.

[0121] The hidden layer is used as input and the input layer is used as output, and the following equation is given:

[0122] V=σ(W T H+C);

[0123] According to the relationship between the energy function E of RBM and the joint probability distribution, we have:

[0124]

[0125] Energy function E:

[0126] E(V,H,V')=-b T Vc T HV T WH;

[0127] The solution of Z is obtained by traversing all the values ​​of variables V, H, V', that is:

[0128]

[0129] The loss function is L, which is:

[0130] L = -logP(V, V');

[0131] Train RBM, minimize the loss function L, and obtain the model parameters W, input layer node b, and hidden layer node c through multiple iterations of minimum gradient descent method.

[0132] According to the training parameters, the joint probability distribution P(V, H, V′) of all RBM nodes can be obtained. Therefore, the probability distribution P(V) of the training dataset nodes is:

[0133]

[0134] The probability distribution P(V') of the test sample node is:

[0135]

[0136] The joint probability distribution of the training data set and the test sample nodes is:

[0137]

[0138] Setting the parameter α, we have the following equation:

[0139] P(V, V′)=αP(V)*P(V′);

[0140] If α is greater than or equal to a certain threshold (such as 0.8), the test sample and the training data set belong to the same distribution and both belong to the same class.

[0141] If α is less than the threshold, the test sample and the training data set do not belong to the same distribution and do not belong to the same class.

[0142] like Figure 2 The present invention provides a classification device based on a restricted Boltzmann machine, wherein the restricted Boltzmann machine includes a display layer and a hidden layer, including:

[0143] A first calculation module 21 is used to input the training data set and the input sample into the restricted Boltzmann network training to obtain the conditional probability distribution of the display layer and the hidden layer;

[0144] A second calculation module 22, used to calculate the joint probability distribution of the display layer and the hidden layer according to the conditional probability distribution formula;

[0145] The third calculation module 23 is used to determine whether the input sample and the training data set are of the same distribution according to the independent probability distribution formula. If they are of the same distribution, the input sample belongs to the class to which the training data set belongs; if they are not of the same distribution, the input sample does not belong to the class to which the training data set belongs.

[0146] The second calculation module 22 includes:

[0147] The node probability calculation module is used to define the node probability of the hidden layer when the connection meaning from the input layer to the hidden layer is the case where the input layer is known, and to define the node probability of the input layer when the connection meaning from the hidden layer to the input layer is the case where the hidden layer is known; the node probabilities of all hidden layers and the node probabilities of the input layer are accumulated to calculate the joint probability distribution and energy function of all nodes of the restricted Boltzmann machine.

[0148] The present invention also provides a computer program product, comprising a computer program / instruction, characterized in that when the computer program / instruction is executed by a processor, the steps of a classification method based on a restricted Boltzmann machine are implemented.

[0149] The present invention also provides an electronic device, comprising:

[0150] At least one processor; and at least one memory communicatively connected to the processor, wherein: the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the above-mentioned classification method based on the restricted Boltzmann machine.

[0151] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned classification method based on a restricted Boltzmann machine is implemented.

[0152] It can be understood that computer-readable storage media may include: any entity or device capable of carrying a computer program, recording media, USB flash drives, mobile hard disks, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution media, etc. A computer program includes computer program code. The computer program code may be in source code form, object code form, executable file, or some intermediate form, etc. A computer-readable storage medium may include: any entity or device capable of carrying a computer program code, recording media, USB flash drives, mobile hard disks, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution media, etc.

[0153] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.

[0154] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0155] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A classification method based on restricted Boltzmann machine, characterized in that: The restricted Boltzmann machine consists of a display layer and a hidden layer, including: Inputting the training data set and the input sample into the restricted Boltzmann network training to obtain the conditional probability distribution of the display layer and the hidden layer; Calculating the joint probability distribution of the display layer and the hidden layer according to a conditional probability distribution formula; According to the independent probability distribution formula, it is determined whether the input sample and the training data set are of the same distribution. If they are of the same distribution, the input sample belongs to the class to which the training data set belongs. If they are not of the same distribution, the input sample does not belong to the class to which the training data set belongs.

2. The classification method based on restricted Boltzmann machine according to claim 1, characterized in that: The calculating the joint probability distribution of the display layer and the hidden layer according to the conditional probability distribution formula includes: The connection from the input layer to the hidden layer is defined as the node probability of the hidden layer when the input layer is known; the connection from the hidden layer to the input layer is defined as the node probability of the input layer when the hidden layer is known; the joint probability distribution and energy function of all nodes of the restricted Boltzmann machine are calculated by accumulating the node probabilities of all hidden layers and the node probabilities of the input layer.

3. The classification method based on restricted Boltzmann machine according to claim 2, characterized in that: The joint probability distribution and energy function of all nodes of the restricted Boltzmann machine are calculated according to the following formula: Joint probability distribution: Energy function E: E(V,H) = -bV-cTH-VTWH; Where w is the weight parameter, b is the bias of the input layer, c is the bias of the hidden layer, H is the hidden layer node, and V is the input node of the training data set.

4. The classification method based on restricted Boltzmann machine according to claim 1, characterized in that: The step of judging whether the input sample and the training data set are of the same distribution according to the independent probability distribution formula includes: calculating the classification coefficient α according to the relationship between the joint probability of the input layer nodes, the node probability of the training data set and the node probability of the test sample: According to the formula P(V,V′)=αP(V)*P(V′) Among them, the probability of the input sample node V of the training data set is: The probability of the input layer node V' of the test sample: Joint probability of input layer nodes:

5. The classification method based on restricted Boltzmann machine according to claim 4, characterized in that: The determining, according to the independent probability distribution formula, whether the input sample and the training data set are of the same distribution includes: If α is greater than or equal to the preset threshold, the test sample and the training data set belong to the same distribution and both belong to the same class. If α is less than the pre-threshold, the test sample and the training data set do not belong to the same distribution and do not belong to the same class.

6. A classification device based on a restricted Boltzmann machine, characterized in that: The restricted Boltzmann machine consists of a display layer and a hidden layer, including: A first computing module, used for inputting a training data set and an input sample into the restricted Boltzmann network training to obtain a conditional probability distribution of the display layer and the hidden layer; A second calculation module, used for calculating the joint probability distribution of the display layer and the hidden layer according to a conditional probability distribution formula; The third calculation module is used to determine whether the input sample and the training data set are of the same distribution according to the independent probability distribution formula. If they are of the same distribution, the input sample belongs to the class to which the training data set belongs; if they are not of the same distribution, the input sample does not belong to the class to which the training data set belongs.

7. The classification device based on restricted Boltzmann machine according to claim 6, characterized in that: The second calculation module includes: The node probability calculation module is used to define the node probability of the hidden layer when the connection meaning from the input layer to the hidden layer is the case where the input layer is known, and to define the node probability of the input layer when the connection meaning from the hidden layer to the input layer is the case where the hidden layer is known; the node probabilities of all hidden layers and the node probabilities of the input layer are accumulated to calculate the joint probability distribution and energy function of all nodes of the restricted Boltzmann machine.

8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

9. An electronic device, characterized in that: include: at least one processor; and at least one memory communicatively connected to the processor, wherein: the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the method as claimed in any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a computer, the method according to any one of claims 1 to 5 is executed.