Text classification method based on Bayesian uncertainty capture

By introducing additional structures and Bayesian layers into the Bayesian neural network, combined with the expectation module and the distribution module, the problem of insufficient uncertainty estimation in text classification is solved, achieving more accurate uncertainty capture and robustness. , suitable for a variety of application scenarios.

CN118779448APending Publication Date: 2024-10-15NANTONG UNIV +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410843275.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Existing text classification methods have insufficient accuracy in uncertainty estimation, especially when dealing with heterogeneously distributed data, it is difficult to accurately capture uncertainty, resulting in overconfidence in classification results.

Method used

Adopting a Bayesian neural network with additional structure, combining the expectation module and the distribution module, using the Bayesian layer to build the uncertainty module, segmenting the data space to distinguish between internal distribution, partially heterogeneous distribution and completely heterogeneous distribution data, and through confrontation Principle and pseudo-label training methods balance accuracy and uncertainty to improve model robustness.

Benefits of technology

The model's robustness and uncertainty capture capabilities are significantly improved, and it can better handle heterogeneously distributed data, reduce misclassification, and provide more reliable uncertainty estimates, which is suitable for risk assessment in fields such as medical or finance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779448A_ABST
    Figure CN118779448A_ABST
Patent Text Reader

Abstract

The invention provides a text classification method based on Bayesian uncertainty capture. The method comprises the following steps: acquiring a to-be-classified text data set; preprocessing the data set; optimizing out-of-distribution data, and associating the out-of-distribution data with the category of the text; constructing a Bayesian neural network with an additional structure; training the Bayesian neural network model with the additional structure by using the text data set; classifying the texts by using the trained Bayesian neural network model with the additional structure; and outputting a classification result and corresponding uncertainty estimation. The method has the advantages that by adding an additional structure to the Bayesian neural network, the capacity of capturing uncertainty is improved, the robustness of the model is improved, the uncertainty can be managed and utilized more meticulously, and particularly, the accuracy of unknown subject classification is improved when text type classification is processed in the field of file retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of neural network, and in particular relates to a text classification method based on Bayesian uncertainty capture. Background Art

[0002] The use of machine learning technology in paper retrieval systems is mainly to optimize the quality of retrieval results, improve retrieval efficiency, realize personalized retrieval, and realize automatic classification and clustering. Among them, text classification is a common machine learning application, which is mainly used to automatically classify massive academic documents into corresponding subject areas or research topics. The trained text classification model can be applied to the paper retrieval system to automatically classify newly entered papers and classify them into corresponding categories or labels. In this way, users can quickly locate the research field of interest according to the subject classification when searching, which improves the convenience and accuracy of retrieval. In terms of supervised learning, naive Bayes, support vector machine, convolutional neural network, recurrent neural network, etc. are generally used to automatically classify papers, which is convenient for users to browse and search by category. However, uncertainty estimation is a major challenge because they often make overconfident predictions. Therefore, uncertainty estimation is still a challenge in text classification.

[0003] Bayesian neural networks are a very influential way to capture uncertainty. Bayesian neural networks are a method that combines Bayesian statistical principles with deep learning. In text classification, Bayesian neural networks estimate the uncertainty of the model by treating the weight parameters in the neural network as random variables and assigning them probability distributions. This allows the Bayesian neural network to not only output classification results, but also provide quantitative information about the uncertainty of the classification results. Therefore, using Bayesian neural networks to solve the problem of insufficient uncertainty estimation accuracy in text classification is a practical way. Summary of the invention

[0004] In order to solve the above technical problems, the present invention provides a text classification method based on Bayesian uncertainty capture, which is particularly suitable for text classification of papers and improves the accuracy of text classification by using a stronger ability to capture uncertainty.

[0005] The technical solution adopted by the present invention is: an embodiment of the present invention provides a text classification method based on Bayesian uncertainty capture, including: obtaining a text data set to be classified; preprocessing the data set; optimizing out-of-distribution data and associating it with the category of the text; constructing a Bayesian neural network with an additional structure; using the text data set to train the Bayesian neural network model with the additional structure; using the trained Bayesian neural network model with the additional structure to classify text; and outputting the classification result and its corresponding uncertainty estimate.

[0006] Furthermore, the preprocessing method of the data set includes removing word segmentation, removing stop words, removing irrelevant characters and vectorizing the text.

[0007] Furthermore, the data partitioning refers to partitioning the data set into a training set, a validation set, and a test set.

[0008] Furthermore, the optimization of heterogeneously distributed data refers to dividing the heterogeneously distributed data into partially heterogeneously distributed data and completely heterogeneously distributed data.

[0009] Furthermore, associating with the category of the text means corresponding the in-distribution data to known subject categories, corresponding the partially heterogeneous distribution data to emerging subject categories, and corresponding the completely heterogeneous distribution data to unknown subject categories.

[0010] Furthermore, the Bayesian neural network with additional structure includes an expectation module and a distribution module, wherein the expectation module is used to process internal distribution data and generate main prediction results; and the distribution module is used to capture uncertainty from distribution data.

[0011] Furthermore, the distribution module is constructed by a Bayesian layer.

[0012] The advantages and positive effects of the present invention are: due to the adoption of the above technical solution, the robustness of the model is improved by improving the ability to capture uncertainty, and a more reliable tool is provided for other applications where uncertainty is crucial (such as medical or financial risk assessment); the use of expectation modules and distribution modules not only enables the model to better distinguish uncertainty, but also provides the model with more flexible learning capabilities. Compared with traditional Bayesian neural networks, the Bayesian neural network structure with additional structure performs better in terms of heterogeneous distribution data detection, misclassification detection, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 is a method flow chart of an embodiment of the present invention

[0014] Figure 2 A data segmentation diagram according to an embodiment of the present invention

[0015] Figure 3 This is a model structure diagram of an embodiment of the present invention

[0016] Figure 4 This is a clustering experiment result diagram of an embodiment of the present invention. DETAILED DESCRIPTION

[0017] In the following description, those skilled in the art will recognize that the embodiments of the invention described below can be implemented in various ways (e.g., processes, devices, systems, equipment, or methods) on a tangible computer-readable medium. Throughout this discussion, components may be described as separate functional units (which may include subunits), but those skilled in the art will recognize that various components or parts thereof may be divided into separate components, or may be integrated together (including integration into a single system or component). It should be noted that the functions or operations discussed herein may be implemented as components. Components may be implemented in software, hardware, or a combination thereof.

[0018] The embodiments of the present invention are described below with reference to the accompanying drawings.

[0019] The present invention proposes a text classification method based on Bayesian uncertainty capture, specifically training text data, which effectively solves the problem of weak uncertainty estimation capabilities. The specific steps include: collecting a large amount of text data to ensure that all target text types are covered, including known subject categories and texts outside known subject categories. The model needs to estimate uncertainty, especially for heterogeneous data. A training set that fully covers the target categories can help the model better understand the boundaries of various types of data, thereby providing more reliable uncertainty estimates when facing uncertain or edge cases; the preprocessing process of the data set includes first removing noise, word segmentation, removing stop words, stem extraction, etc., and then dividing the data set into a training set, a validation set, and a test set. Finally, the text is converted into a vector form that can be processed by the model, such as a bag of words model, TF-IDF or pre-trained word embedding.

[0020] like Figure 2 , optimize the heterogeneous distribution data and associate them with the categories of the text. Optimizing heterogeneous distribution data means dividing heterogeneous distribution data into partially heterogeneous distribution data and completely heterogeneous distribution data, corresponding the data within the distribution to known subject categories, partially heterogeneous distribution data to emerging subject categories, and completely heterogeneous distribution data to unknown subject categories. We use the following method for classification. First, the entire data space D is divided into subspaces D ID , D semiOOD and D fullOOD , to describe the properties of different data. This segmentation is based on the evaluation of whether the sample clearly belongs to a certain distribution (low uncertainty), may belong to a certain distribution (medium uncertainty), or obviously does not belong to a certain distribution (high uncertainty). This segmentation method fully considers the uncertainty of the data and divides the data space into different subspaces to better understand and analyze different types of data. (D ID ). Let X denote the input, X∈D. {f(X,θ):θ∈θ} is the family of density functions on D, θ is the parameter, θ={θ1,θ2,...,θK} represents the parameter corresponding to the data distribution. Given δ>0,ε>0, we will And θ j ∈θ,f(X,θ i )>f(X,θ j )+δ} is called the internal distribution data space; After distinguishing the heterogeneous distribution data, it can be applied to the classification of paper texts. To give a common example, the known subject categories are matched with the data within the distribution. These paper abstracts clearly belong to a traditional or core subject. For example, a paper discussing the optimization of machine learning algorithms has an abstract that clearly points to the field of computer science and is significantly different from papers in other non-computer science fields. Some heterogeneous distribution data corresponds to emerging subject categories. Some paper abstracts involve emerging interdisciplinary subjects. These subjects may have characteristics of multiple traditional fields, but are not sufficient to be fully covered by any existing category. For example, a paper that explores the combination of quantum computing and information theory is related to both physics and computer science, but does not completely belong to any single traditional category. Completely heterogeneous distribution data corresponds to unknown subject categories. There are also some papers that may not belong to the existing subject classification system at all, such as a paper on the combination of ancient cooking skills and modern molecular cuisine. Such content is a completely unknown field for the classification system that focuses on science, medicine or social sciences.

[0021] like Figure 3, a Bayesian neural network with an additional structure is constructed. The Bayesian neural network with an additional structure consists of an expectation module and multiple distribution modules. The expectation module is a backbone deep network centered on the original task, and the distribution module is a miniature Bayesian structure as an attachment to the backbone network; the expectation module is constructed by common network layers, responsible for the original task, processing internal distribution data, and generating the main prediction results. We have no constraints on the expectation module on heterogeneous distribution data. This independence and flexibility enable the Bayesian neural network with an additional structure to adapt to different data distributions and task requirements, thus having wider applicability and scalability. Preferably, the expectation module uses a residual network as the backbone network. The distribution module is constructed by Bayesian layers, fitting the posterior distribution of certain specific layers of data within a given distribution and heterogeneous data, and is mainly responsible for extracting uncertainty from data in already subject categories and data in non-already subject categories. Only a few Bayesian layers are sufficient to capture uncertainty. Therefore, we design the distribution module to be mini in size, which looks like an attachment to the expectation module. This modular design enables the Bayesian neural network with an additional structure to flexibly cope with the uncertainty of different types of data and achieve good performance in different tasks. In order to train a Gaussian variational inference Bayesian neural network that meets certain criteria, we need to address several key issues. First, we want to add appropriately small noise to the in-distribution data during the forward propagation process to maintain its accurate prediction. Second, for heterogeneous data, we need to add large noise during the forward propagation process to increase the variance of the prediction results and thus increase uncertainty. Finally, for partially heterogeneous data, we want to maintain high prediction accuracy while increasing a certain amount of uncertainty. To achieve this goal, we first specify pseudo labels for heterogeneous data to derive pseudo posteriors and determine the most appropriate training method. However, directly applying this training method may harm prediction accuracy, so we propose an additional structure for balancing accuracy and uncertainty. In addition, we also show that despite the introduction of heterogeneous data training, our method is still consistent with the typical Bayesian neural network framework because our objective function can be interpreted as a regular objective function under certain assumptions. By addressing these issues, we can train a Bayesian neural network model with high accuracy and appropriate uncertainty estimates.

[0022] like Figure 4In order to demonstrate the superiority of the Bayesian neural network with additional structure, we compare the Bayesian neural network with additional structure with the following uncertainty estimation or heterogeneous data detection methods: (1) BBP, a classic variational inference Bayesian neural network; (2) VBOE, a Bayesian neural network similar to OE that includes heterogeneous data training; (3) SDE-Net, a method specifically used for heterogeneous data detection, whose structure and training process are similar to those of the Bayesian neural network with additional structure; (4) OE, one of the most typical heterogeneous data training methods; (5) WOODS, a variant of OE, which achieves state-of-the-art heterogeneous data detection performance. Through these comparisons, we can comprehensively evaluate the performance of the Bayesian neural network with additional structure in uncertainty estimation and heterogeneous data detection, and understand its advantages and limitations in practical applications.

[0023] After constructing a Bayesian neural network structure with additional structure, the Bayesian neural network model with additional structure is trained using a text dataset. The training process can capture an appropriate amount of uncertainty through the adversarial principle between in-distribution data training and heterogeneous data training. The uncertainty of heterogeneous data is represented by increasing the variance of certain parameters while maintaining the performance on in-distribution data, which means that q(ω|μ,σ2) should still fit p(ω|D ID ). The introduction of this adversarial principle enables the model to balance the needs between different data distributions during training, thereby improving its adaptability to unknown data. The rate of parameter adjustment during training on heterogeneous data is proportional to the rate during training on data within the distribution. This balanced adjustment strategy helps ensure that the model does not overly bias in any direction during training, thereby better adapting to the characteristics of different data distributions. For the expectation module, the cross entropy loss function is used to optimize the classification performance; the loss function of the distribution module can include a KL divergence term to constrain the variational approximation of the posterior distribution, and combine NLL (negative log likelihood) to evaluate the accuracy of uncertainty estimation. First train the expectation module separately to a certain degree of convergence, and then jointly train all modules. It may be necessary to adopt alternating training or joint optimization strategies. Use strategies such as early stopping and learning rate decay to prevent overfitting. When the model training is completed, you can quickly read the text when a new paper comes in, and use the expectation module to quickly give a rough classification. At the same time, the distribution module will evaluate the uncertainty of this classification, visualize the predictions of different categories and different uncertainty levels, so as to intuitively understand the behavior of the model and finally output the results.

[0024] The embodiments of the present invention are described in detail above, but the contents described are only preferred embodiments of the present invention and cannot be considered to limit the scope of implementation of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the patent coverage of the present invention.

[0025] The scheme of the present invention is described below in conjunction with the accompanying drawings, wherein the experimental methods without specific operating steps are all carried out in accordance with the corresponding product instructions, and the instruments, reagents, and consumables used in the examples can all be purchased from commercial companies unless otherwise specified.

Claims

1. A text classification method based on Bayesian uncertainty capture, characterized in that: include: Get the text dataset to be classified; Preprocessing the data set; Optimize heterogeneous distribution data and associate it with text categories; Building Bayesian neural networks with additional structure; Using the text data set to train the Bayesian neural network model with the additional structure; Classifying text using the trained Bayesian neural network model with the additional structure; Output the classification results and their corresponding uncertainty estimates.

2. The method according to claim 1, characterized in that: The preprocessing method of the data set includes removing word segmentation, removing stop words, removing irrelevant characters, data partitioning and vectorizing the text.

3. The data partitioning according to claim 2, characterized in that: The data partitioning refers to dividing the data set into a training set, a validation set, and a test set.

4. The method according to claim 1, characterized in that: The optimization of heterogeneous distribution data refers to dividing heterogeneous distribution data into partially heterogeneous distribution data and completely heterogeneous distribution data.

5. The method according to claim 1, characterized in that: Associating with the category of the text means corresponding the in-distribution data to known subject categories, corresponding the partially heterogeneous distribution data to emerging subject categories, and corresponding the completely heterogeneous distribution data to unknown subject categories.

6. The method according to claim 1, characterized in that: The Bayesian neural network with additional structure includes an expectation module and a distribution module. The expectation module is used to process internal distribution data and generate main prediction results; the distribution module is used to capture uncertainty from distribution data.

7. The distribution module according to claim 6, characterized in that: The distribution module is constructed by Bayesian layers.