Training method and device of neural network model
Patent Information
- Application Number
- CN202310826389.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-06
- Publication Date
- 2026-10-13
- Estimated Expiration
- 2043-07-06
AI Technical Summary
[0020]本公开实施例中,在训练神经网络模型的过程中,通过将预设范围内的训练样本数量到达预设数量的第一组节点从优胜节点候选中剔除的方式,提高除第一组节点外的第二组节点被确定为优胜节点的概率。第一组节点的预设范围内的训练样本数量已经到达预设数量表明第一组节点已经处于训练样本密集的区域,有极大概率会被确定为优胜节点,降低第一组节点被确定为优胜节点的概率可以使原本获胜概率较低的其他节点被确定为优胜节点的概率提高,能够有效降低“死神经元”出现的概率,提高神经网络模型的训练效率,从而提高经训练的神经网络模型在应用于分类时分类结果的准确性。
Smart Images

Figure CN116882479B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of big data analytics, and in particular to a method and apparatus for training a neural network model. Background Technology
[0002] With the rapid development of internet technology, the channels for information dissemination have become increasingly diversified. How to quickly and effectively categorize information has become a pressing issue.
[0003] In related technologies, neural network models are used to classify information. For example, a self-organizing map neural network model that includes an input layer and a competition layer is used to classify information. Summary of the Invention
[0004] In related technologies, when training neural network models for information classification, the structure of the neural network model is fixed because it includes an input layer and a competition layer. Furthermore, the iterative update of this neural network model uses competitive learning, which, limited by the initial weight settings, means that some nodes may never be identified as winning nodes, becoming "dead neurons." The appearance of "dead neurons" reduces the training efficiency of the neural network model and affects the accuracy of the classification results when the neural network model is applied to classification.
[0005] To address the aforementioned problems, the present disclosure provides the following technical solutions.
[0006] According to one aspect of the present disclosure, a method for training a neural network model is provided. The neural network model includes an input layer and a competition layer, the competition layer including multiple nodes. The method includes performing multiple operations, each operation including: selecting one training sample from multiple training samples as a first training sample; determining a first group of nodes where the number of training samples within a preset range reaches a preset number; calculating the similarity between each node in a second group of nodes (excluding the first group of nodes) and the first training sample; determining a winning node from the second group of nodes based on the similarity; and updating the weight of each node in the winning node's winning neighborhood.
[0007] In some embodiments, in at least one first operation, the winning node is determined based on the similarity and the number of wins for each node in the second group of nodes. The higher the similarity, the higher the probability that the corresponding node is determined as the winning node, and the more wins, the lower the probability that the corresponding node is determined as the winning node.
[0008] In some embodiments, determining the winning node based on the similarity and the number of wins for each node in the second group of nodes includes: determining the winning parameter for each node in the second group of nodes, wherein the winning parameter is smaller for nodes with more wins; and determining the node with the largest product of the similarity and the winning parameter as the winning node.
[0009] In some embodiments, the at least one first operation includes multiple first operations, in which a first node is determined to be the winning node in the previous first operation, wherein: in the first first operation, the winning parameters of each node in the second group of nodes are the same; in the current first operation, the winning parameter of the first node is less than the winning parameter in the previous first operation, and the winning parameters of the other nodes in the second group of nodes, excluding the first node, are equal to the winning parameters in the previous first operation.
[0010] In some embodiments, each node in the neural network model occupies a unit area in the two-dimensional result space. The method further includes: determining, based on known actual classification results, a first region occupied in the two-dimensional result space by nodes corresponding to at least one type of training sample among the plurality of training samples; determining, based on the training classification results output by the neural network model training the plurality of training samples, a second region occupied in the two-dimensional result space by nodes corresponding to at least one type of training sample among the plurality of training samples; and determining the error of the neural network model based on the area of the non-overlapping portion between the first region and the second region corresponding to at least one type of training sample.
[0011] In some embodiments, the at least one type includes multiple types; determining the error of the neural network model based on the area of the non-overlapping portion between the first region and the second region corresponding to the training samples of at least one type includes: determining the error of the neural network model based on the sum of the areas of the non-overlapping portions between the first region and the second region corresponding to the training samples of the multiple types.
[0012] In some embodiments, in the actual classification result, there are multiple types of training samples corresponding to the same target node. The unit area occupied by the target node is divided into multiple sub-regions that correspond one-to-one according to the multiple types. The ratio of the area of each two sub-regions is the same as the ratio of the number of training samples of each type corresponding to each two sub-regions. The first region corresponding to each type of training sample includes the sub-regions corresponding to each type.
[0013] According to another aspect of the present disclosure, a method for classifying information is provided, comprising: classifying information using a neural network model trained according to any of the neural network model training methods described above.
[0014] In some embodiments, the information classification method further includes: determining the processing method of the information based on the classification result.
[0015] According to another aspect of the present disclosure, a training apparatus for a neural network model is provided. The neural network model includes an input layer and a competition layer, the competition layer including multiple nodes. The apparatus is configured to perform multiple operations. The apparatus includes: a selection module configured to select one training sample from multiple training samples as a first training sample in each operation; a first determination module configured to determine, in each operation, a first group of nodes where the number of training samples within a preset range reaches a preset number; a calculation module configured to calculate, in each operation, the similarity between each node in a second group of nodes (excluding the first group of nodes) and the first training sample; a second determination module configured to determine a winning node from the second group of nodes based on the similarity in each operation; and an update module configured to update the weight of each node in the winning neighborhood of the winning node in each operation.
[0016] According to another aspect of the present disclosure, an information classification apparatus is provided, comprising: a classification module configured to classify information using a neural network model trained by the neural network model training apparatus according to any of the above embodiments.
[0017] According to another aspect of the present disclosure, an electronic device is provided, including: a memory; and a processor coupled to the memory, configured to implement the method described in any of the above embodiments based on instructions stored in the memory.
[0018] According to another aspect of the present disclosure, a computer-readable storage medium is provided, including computer program instructions, wherein the computer program instructions, when executed by a processor, implement the method described in any of the above embodiments.
[0019] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program, when executed by a processor, implements the method described in any of the above embodiments.
[0020] In this embodiment of the disclosure, during the training of the neural network model, the probability of a second group of nodes (excluding the first group) being identified as winning nodes is increased by removing the first group of nodes from the winning node candidates when the number of training samples within a preset range reaches a preset number. The fact that the first group of nodes has reached a preset number of training samples indicates that it is already in a region with dense training samples and has a very high probability of being identified as winning nodes. Reducing the probability of the first group of nodes being identified as winning nodes increases the probability of other nodes with lower winning probabilities being identified as winning nodes. This effectively reduces the probability of "dead neurons," improves the training efficiency of the neural network model, and thus improves the accuracy of the classification results when the trained neural network model is applied for classification.
[0021] The technical solutions of this disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a flowchart illustrating a method for training a neural network model according to some embodiments of the present disclosure;
[0024] Figure 2 This is a schematic diagram of the structure of a neural network model according to some embodiments of the present disclosure;
[0025] Figure 3 This is a flowchart illustrating a method for training a neural network model according to some embodiments of the present disclosure;
[0026] Figure 4a and Figure 4b A schematic diagram of a two-dimensional result space based on some embodiments of this disclosure;
[0027] Figure 5 This is a schematic diagram of a two-dimensional result space according to some embodiments of the present disclosure;
[0028] Figure 6 This is a schematic diagram of the structure of a training apparatus for a neural network model according to some embodiments of the present disclosure;
[0029] Figure 7 This is a schematic diagram of the structure of an information classification device according to some embodiments of the present disclosure;
[0030] Figure 8This is a schematic diagram of the structure of an electronic device according to some embodiments of the present disclosure. Detailed Implementation
[0031] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0032] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of this disclosure.
[0033] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.
[0034] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0035] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.
[0036] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0037] Figure 1 This is a flowchart illustrating a method for training a neural network model according to some embodiments of the present disclosure.
[0038] Figure 2 This is a schematic diagram of the structure of a neural network model according to some embodiments of the present disclosure.
[0039] In some embodiments, such as Figure 2 As shown, the neural network model includes an input layer and a competition layer. The competition layer includes multiple nodes, i.e., multiple neurons. The input layer contains x1 to x... n Represents multiple training samples. For example... Figure 1 As shown, the training method for the neural network model includes performing multiple operations, each of which includes steps 102 to 110.
[0040] In some embodiments, the neural network model is a self-organizing map (SOM) neural network model.
[0041] In some embodiments, the method for training the neural network model further includes initializing the neural network model before the first operation begins. Initializing the neural network model includes setting initial weights for each node in the neural network model.
[0042] In step 102, one of the multiple training samples is selected as the first training sample.
[0043] In some embodiments, selecting one of a plurality of training samples as the first training sample includes randomly selecting a first training sample from the plurality of training samples.
[0044] In other embodiments, one of a plurality of training samples is selected in a preset order.
[0045] In some embodiments, different training samples are selected in each operation so that each training sample is traversed during the training process.
[0046] In step 104, the first group of nodes is determined to have reached a preset number of training samples within a preset range.
[0047] In some embodiments, the number of training samples reaching a preset number means that the proportion of the number of training samples in the total number of training samples reaches a preset proportion. For example, the first group of nodes includes nodes whose number of training samples within a preset range reaches 30% of the total number of samples.
[0048] In step 106, the similarity between each node in the second group of nodes (excluding the first group of nodes) and the first training sample is calculated.
[0049] In some embodiments, similarity is characterized by Euclidean distance, and the greater the Euclidean distance between a node and a training sample, the smaller the similarity.
[0050] In other embodiments, the similarity between a node and a training sample is cosine similarity.
[0051] In step 108, the winning node is determined from the second group of nodes based on similarity.
[0052] In step 110, the weight of each node in the winning neighborhood of the winning node is updated.
[0053] In some embodiments, the winning neighborhood is a circular region centered on the winning node. The size of the circular region is determined based on the neighborhood radius.
[0054] In some embodiments, the neighborhood radius decreases as the number of operations increases. In the early stages of training, a larger neighborhood radius is set to facilitate rapid adjustment of node positions. In the later stages of training, the neighborhood radius is reduced to allow for more precise adjustments to node positions.
[0055] In some embodiments, a neighborhood function is used to determine the update magnitude of each node within the winning neighborhood in a single operation. In some embodiments, the neighborhood function is a Gaussian function.
[0056] In some embodiments, among nodes within the winning neighborhood, the closer to the winning node, the larger the update magnitude; the farther away from the winning node, the smaller the update magnitude.
[0057] In some embodiments, the update magnitude of nodes within the winning neighborhood is also controlled by the learning efficiency. Setting an appropriate learning efficiency can improve the training efficiency of the neural network model.
[0058] In some embodiments, learning efficiency decreases as the cumulative number of operations increases.
[0059] In some embodiments, the weights are updated according to formula (1).
[0060]
[0061] In formula (1), This represents the weight of node j in the winning neighborhood after the update in this round of operations. Let R be the weight of the last operation of node j. k G represents the learning efficiency of the k-th operation (i.e., the current operation). ij X represents the return value of the neighborhood function for node j. i This represents the first training sample.
[0062] In the process of training the neural network model in the above manner, by removing the first group of nodes whose training sample count within a preset range reaches a preset number from the winning node candidates, the probability of the second group of nodes (excluding the first group of nodes) being identified as winning nodes is increased. The fact that the first group of nodes has reached the preset number of training samples indicates that it is already in a region with dense training samples and has a very high probability of being identified as winning nodes. Reducing the probability of the first group of nodes being identified as winning nodes increases the probability of other nodes with lower winning probabilities being identified as winning nodes. This effectively reduces the probability of "dead neurons," improves the training efficiency of the neural network model, and thus improves the accuracy of the classification results when the trained neural network model is applied for classification.
[0063] In some embodiments, in at least one first operation out of multiple operations, the winning node is determined based on similarity and the number of times each node in the second group of nodes wins. Higher similarity increases the probability that the corresponding node is determined as the winning node. A higher number of wins decreases the probability that the corresponding node is determined as the winning node.
[0064] In the above method, when determining the winning node, not only similarity but also the number of wins of the node are considered. This can reduce the probability of frequently winning nodes winning again, thereby further reducing the probability of "dead neurons" appearing. For example, in a first operation, there are two nodes with similarity to the sample, but one node has accumulated 50 wins, while the other node has never won. In this case, the node that has never won can be selected as the winning node.
[0065] In some embodiments, each of the multiple operations is the first operation. Determining the winning node based on similarity and the node's number of wins in each operation can further reduce the probability of "dead neurons" occurring.
[0066] In some embodiments, determining the winning node based on similarity and the number of wins for each node in the second group of nodes in at least one first operation includes steps 1 and 2.
[0067] In step 1, the winning parameters of each node in the second group of nodes are determined. Nodes with more wins have smaller winning parameters. The second group of nodes consists of all nodes in the neural network model other than those in the first group, whose training sample count has reached a preset number within a preset range.
[0068] In step 2, the node with the largest product of similarity and winning parameter is determined as the winning node.
[0069] The above method uses the winning parameter to represent the number of times the winning node wins, and determines the winning node based on the product of similarity and the winning parameter. This can more effectively control the probability of a node being determined as a winning node and improve the training efficiency of the neural network model.
[0070] In some embodiments, at least one first operation includes multiple first operations, in which the first node was determined to be the winning node in the previous first operation. In the first first operation, the winning parameter of each node in the second group of nodes is the same. In the current first operation, the winning parameter of the first node is less than the winning parameter in the previous first operation. The winning parameters of the other nodes in the second group of nodes, excluding the first node, are equal to the winning parameters in the previous first operation.
[0071] For example, in the first operation, the winning parameters of all nodes are set to the same initial winning parameters. In this first operation, since all nodes have the same winning parameters, the node with the highest similarity is selected as the winning node. Starting from the second operation, in this operation, the winning parameter of the first node is smaller than its winning parameter in the previous operation. That is, the winning parameter of the previously winning node is reduced to decrease the probability of the winning node winning again in this operation. The other nodes in the second group, excluding the first node, did not win in the previous operation, so their winning range remains unchanged.
[0072] The above method reduces the probability of a previously winning node winning again in each first operation, which can effectively reduce the probability of "dead neurons" and help improve the training efficiency of neural network models.
[0073] In some embodiments, from the second first operation and any subsequent first operation, the winning parameter ρ of the first node in this first operation is... n =ερ n-1 . ρ n-1 Let ε represent the winning parameter of the first node in the previous first operation, where 0 < ε < 1. In this approach, each first operation proportionally reduces the winning parameter of the winning node, meaning that the probability of the previously winning node winning again decreases proportionally in each first operation. The winning parameter of each node is inversely proportional to the number of times that node has won. This method is easy to implement, helps improve the training efficiency of neural network models, and effectively reduces the probability of "dead neurons."
[0074] The classification results of the neural network model trained through the above embodiments may contain errors compared to the actual classification results of the known training samples. Therefore, it is necessary to verify the training results of the neural network model. The verification process for the neural network model is described below.
[0075] Figure 3 This is a flowchart illustrating a method for training a neural network model according to some embodiments of the present disclosure.
[0076] In some embodiments, each node in the neural network model occupies one unit area in the two-dimensional result space. For example... Figure 3 As shown, the training method for the neural network model also includes steps 302 to 306.
[0077] In step 302, based on the known actual classification results, the first region occupied in the two-dimensional result space by the node corresponding to at least one type of training sample among the multiple training samples is determined.
[0078] Figure 4a and Figure 4b This is a schematic diagram of a two-dimensional result space according to some embodiments of the present disclosure.
[0079] In some embodiments, the neural network model includes 9 nodes, each node occupying an area of... Figure 4a A unit area in the two-dimensional result space shown (in) Figure 4a (Represented by a box in the image). Based on the known actual classification results of the training samples, the multiple training samples include two classes, A and B. The first region occupied by the node corresponding to the training sample of class A in the two-dimensional result space is region 401. The first region occupied by the node corresponding to the training sample of class B in the two-dimensional result space is region 402.
[0080] In step 304, based on the training classification results output by the neural network model from multiple training samples, the second region occupied by the node corresponding to at least one type of training sample in the multiple training samples is determined in the two-dimensional result space. For example... Figure 4b As shown, the training classification results show that the second region occupied by the node corresponding to the training sample of class A in the two-dimensional result space is region 403, and the second region occupied by the node corresponding to the training sample of class B in the two-dimensional result space is region 404. Figure 4a and Figure 4b This represents the actual classification result and the training classification result of the training samples in the same two-dimensional result space.
[0081] In step 306, the error of the neural network model is determined based on the area of the non-overlapping portion between the first and second regions corresponding to at least one type of training sample.
[0082] The output of a neural network model, which includes an input layer and a competition layer, is generally mapped in a two-dimensional result space. The above method can accurately characterize the error of the neural network model, quickly verify the accuracy of the neural network model, and help improve the training efficiency of the neural network model.
[0083] In some embodiments, the area of the non-overlapping portion includes both the area of the first region extending beyond the second region and the area of the second region extending beyond the first region. For example, as... Figure 4a and Figure 4b As shown, for training samples of class A, the area of the non-overlapping portion between the first region 401 and the second region 403 includes both the area of the first region 401 that extends beyond the second region 403 (i.e., the area occupied by node 5) and the area of the second region 403 that extends beyond the first region 401 (i.e., the area occupied by node 8).
[0084] In some embodiments, at least one type includes multiple types. Determining the error of the neural network model based on the area of the non-overlapping portion between the first and second regions corresponding to training samples of at least one type includes: determining the error of the neural network model based on the sum of the areas of the non-overlapping portions between the first and second regions corresponding to training samples of multiple types. In this approach, the area of the non-overlapping portion between the first and second regions can not only characterize the accuracy of the training classification result for a single type of training sample, but also simultaneously obtain the accuracy of the training classification results for different types of training samples, which helps to further improve the training efficiency of the neural network model.
[0085] In some embodiments, the area of the non-overlapping portion between the first and second regions corresponding to each type of training sample is referred to as the spatial error score of that type of training sample.
[0086] Figure 5 This is a schematic diagram of a two-dimensional result space according to some embodiments of the present disclosure.
[0087] In some embodiments, such as Figure 5 As shown, the neural network model includes 9 nodes, each occupying an area as shown in the figure. Figure 5 A unit area in the two-dimensional result space shown (in) Figure 5 (Represented by a box in the middle).
[0088] In some embodiments, multiple types of training samples correspond to the same target node in the actual classification results. The unit area occupied by the target node is divided into multiple corresponding sub-regions according to the multiple types corresponding to the same target node. The ratio of the area of each pair of sub-regions is the same as the ratio of the number of training samples of each type corresponding to each pair of sub-regions, and the first region corresponding to each type of training sample includes the sub-regions corresponding to each type.
[0089] Based on the known classification results of the training samples, multiple training samples include two classes, A and B. According to the actual classification results, three A-class training samples and one B-class training sample all correspond to node 5. That is, node 5 is the target node. At this point, node 5 is divided into two sub-regions according to a 3:1 ratio of A-class to B-class training samples. The sub-region corresponding to class A occupies three-quarters of the unit area of node 5, and the sub-region corresponding to class B occupies one-quarter of the unit area of node 5. Therefore, the area of the first region 501 corresponding to the class A node includes the area of the sub-region occupying three-quarters of the unit area of node 5, and the area of the first region 502 corresponding to the class B node includes the area of the sub-region occupying one-quarter of the unit area of node 5. The division of sub-region areas can also be expressed as percentages; for example, the area of the first region 502 corresponding to the class B node also includes the area of the sub-region occupying 25% of the unit area of node 5.
[0090] The above methods can improve the accuracy of neural network model errors, more clearly represent the accuracy of training sample classification results, and help to further improve the training efficiency of neural network models.
[0091] In some embodiments, the method for training a neural network model further includes obtaining the current neural network model when the neural network model meets preset conditions.
[0092] In some embodiments, the preset condition includes a first condition, which is that the number of times the operation has been performed has reached a preset number.
[0093] In some embodiments, the preset condition includes a second condition, which is that the spatial error score of at least one type of training samples among a plurality of training samples is less than a preset threshold. The smaller the spatial error score, the more accurate the classification result of the corresponding neural network model for that category of samples, and the closer it is to the applied standard. Using a neural network model that meets the second condition for subsequent classification can ensure the accuracy of the classification result.
[0094] In some embodiments, the trained neural network model is used to classify public opinion events, wherein the training samples are the neuron vectors corresponding to the public opinion events.
[0095] In some embodiments, training samples include multiple dimensions. For example, training samples for public opinion events include multiple dimensions such as keywords, time, location, number of likes, and number of reposts.
[0096] In addition to the training method of the neural network model described above, this disclosure also provides a method for classifying information, including classifying information using a neural network model trained according to any of the above embodiments.
[0097] In some embodiments, the information includes public opinion events. With the rapid development of internet technology, the channels for disseminating online information have become increasingly diversified, and the development of online public opinion is becoming increasingly uncontrollable. Quickly and effectively handling public opinion events targeting oneself has become an important capability for enterprises and individuals. When handling public opinion events, rapid and accurate classification is a crucial step. Neural network models can quickly and effectively classify public opinion events, effectively reducing manual labor costs.
[0098] In some embodiments, the information classification method further includes determining the processing method of the information based on the classification result. This method improves the speed of information processing and further reduces labor costs.
[0099] For example, a pre-set neural network model can be used to categorize comments on a news story into positive, negative, and neutral comments, and a corresponding processing method can be set for each category. For instance, positive comments can be automatically liked, and negative comments can be automatically deleted. When a comment is classified as positive by the pre-trained neural network model, it is automatically liked; conversely, when another comment is classified as negative, it is automatically deleted.
[0100] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus embodiments, since they largely correspond to the method embodiments, the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0101] Figure 6 This is a schematic diagram of the structure of a training apparatus for a neural network model according to some embodiments of the present disclosure.
[0102] A neural network model includes an input layer and a competition layer, with the competition layer consisting of multiple nodes. The training device for the neural network model is configured to perform multiple operations.
[0103] like Figure 6 As shown, the training device for the neural network includes: a selection module 601, a first determination module 602, a calculation module 603, a second determination module 604, and an update module 605.
[0104] The selection module 601 is configured to select one of multiple training samples as the first training sample in each operation.
[0105] The first determining module 602 is configured to determine, in each operation, the first group of nodes whose number of training samples within a preset range reaches a preset number.
[0106] The calculation module 603 is configured to calculate the similarity between each node in the second group of nodes (excluding the first group of nodes) and the first training sample in each operation.
[0107] The second determining module 604 is configured to determine the winning node from the second group of nodes based on similarity in each operation.
[0108] The update module 605 is configured to update the weight of each node in the winning neighborhood of the winning node in each operation.
[0109] It should be understood that the training apparatus for the above-described neural network model may also include other modules to perform the training method of the neural network model of any of the above embodiments.
[0110] Figure 7 This is a schematic diagram of the structure of an information classification device according to some embodiments of the present disclosure.
[0111] like Figure 7 As shown, the information classification device includes a training device for the neural network model and a classification module 701 in any of the above embodiments.
[0112] The classification module 701 is configured to classify information using a neural network model trained by a training device according to any of the above embodiments.
[0113] Figure 8 This is a schematic diagram of the structure of an electronic device according to some embodiments of the present disclosure.
[0114] like Figure 8 As shown, the electronic device 800 includes a memory 801 and a processor 802 coupled to the memory 801. The processor 802 is configured to execute the training method of the neural network model and the information classification method of any of the foregoing embodiments based on the instructions stored in the memory 801.
[0115] The memory 801 may include, for example, system memory, fixed non-volatile storage media, etc. The system memory may store, for example, the operating system, application programs, boot loader, and other programs.
[0116] Electronic device 800 may also include input / output interface 803, network interface 804, and storage interface 805. The input / output interface 803, network interface 804, and storage interface 805, as well as the memory 801 and processor 802, can be connected via, for example, a bus 806. Input / output interface 803 provides a connection interface for input / output devices such as monitors, mice, keyboards, and touchscreens. Network interface 804 provides a connection interface for various networked devices. Storage interface 805 provides a connection interface for external storage devices such as SD cards and USB flash drives.
[0117] This disclosure also provides a computer-readable storage medium including computer program instructions that, when executed by a processor, implement the method of any of the above embodiments.
[0118] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the method of any of the above embodiments.
[0119] The embodiments of this disclosure have now been described in detail. To avoid obscuring the concept of this disclosure, some details known in the art have not been described. Those skilled in the art can fully understand how to implement the technical solutions disclosed herein based on the above description.
[0120] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable non-transitory storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0121] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that the functions specified in one or more flowchart illustrations and / or one or more blocks in a block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate functions for implementing the functions in the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0122] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0123] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0124] While specific embodiments of this disclosure have been described in detail by way of examples, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of this disclosure. Those skilled in the art should understand that modifications can be made to the above embodiments or equivalent substitutions can be made to some technical features without departing from the scope and spirit of this disclosure. The scope of this disclosure is defined by the appended claims.
Claims
1. A method for classifying information, wherein the information includes public opinion events, the method comprising: Training a neural network model, which includes an input layer and a competition layer, wherein the competition layer includes multiple nodes, involves performing multiple operations, each operation including: One of the multiple training samples is selected as the first training sample. The training sample is the neuron vector corresponding to the public opinion event. The training sample includes multiple dimensions, including keywords, time, space, number of likes, and number of reposts. Determine the first group of nodes whose number of training samples within a preset range reaches a preset number among the plurality of nodes; Calculate the similarity between each node in the second group of nodes (excluding the first group of nodes) and the first training sample; The winning node is determined from the second group of nodes based on the similarity score. The higher the similarity score, the higher the probability that the corresponding node is determined to be the winning node. Update the weight of each node in the winning neighborhood of the winning node; The trained neural network model is used to classify the information to obtain classification results, which include positive comments, negative comments, and neutral comments. The processing method for the information is determined based on the classification results.
2. The method according to claim 1, wherein, In at least one first operation, the winning node is determined based on the similarity and the number of times each node in the second group of nodes wins. The higher the similarity, the higher the probability that the corresponding node is determined as the winning node. The more times the node wins, the lower the probability that the corresponding node is determined as the winning node.
3. The method according to claim 2, wherein, The step of determining the winning node based on the similarity and the number of wins for each node in the second group of nodes includes: Determine the winning parameter for each node in the second group of nodes, where the node with more wins has a smaller winning parameter; The node with the largest product of the similarity and the winning parameter is determined as the winning node.
4. The method according to claim 3, wherein, The at least one first operation includes multiple first operations, in which the first node was determined as the winning node in the previous first operation, wherein: In the first operation, the winning parameters of each node in the second group of nodes are the same; In this first operation, the winning parameter of the first node is less than the winning parameter in the previous first operation, and the winning parameters of the other nodes in the second group of nodes, excluding the first node, are equal to the winning parameters in the previous first operation.
5. The method according to any one of claims 1-4, wherein, Each node in the neural network model occupies one unit area in the two-dimensional result space, and the method further includes: Based on the known actual classification results, determine the first region occupied by the node corresponding to at least one type of training sample in the two-dimensional result space; Based on the training classification results output by the neural network model through the plurality of training samples, determine the second region occupied by the node corresponding to the at least one type of training sample in the plurality of training samples in the two-dimensional result space; The error of the neural network model is determined based on the area of the non-overlapping portion between the first and second regions corresponding to at least one type of training sample.
6. The method according to claim 5, wherein, The at least one type includes multiple types; Determining the error of the neural network model based on the area of the non-overlapping portion between the first and second regions corresponding to at least one type of training samples includes: The error of the neural network model is determined by the sum of the areas of the non-overlapping portions between the first and second regions corresponding to the various types of training samples.
7. The method according to claim 5, wherein, In the actual classification results, there are multiple types of training samples corresponding to the same target node. The unit area occupied by the target node is divided into multiple sub-regions that correspond one-to-one according to the multiple types. The ratio of the area of each two sub-regions is the same as the ratio of the number of training samples of each type corresponding to each two sub-regions. The first region corresponding to each type of training sample includes the sub-regions corresponding to each type.
8. An information classification device, the information including public opinion events, the classification device comprising: A training apparatus for a neural network model, the neural network model including an input layer and a competition layer, the competition layer including multiple nodes, the training apparatus being configured to perform multiple operations, the training apparatus comprising: The selection module is configured to select one of multiple training samples as the first training sample in each operation. The training sample is the neuron vector corresponding to the public opinion event. The training sample includes multiple dimensions, including keywords, time, space, number of likes, and number of reposts. The first determining module is configured to determine, in each operation, the first group of nodes whose number of training samples within a preset range reaches a preset number. The calculation module is configured to calculate the similarity between each node in the second group of nodes (excluding the first group of nodes) and the first training sample in each operation. The second determining module is configured to determine the winning node from the second group of nodes based on the similarity in each operation. The higher the similarity, the higher the probability that the corresponding node is determined as the winning node. The update module is configured to update the weight of each node in the winning neighborhood of the winning node in each operation; The classification device further includes a classification module configured to classify the information using a trained neural network model to obtain classification results, which include positive comments, negative comments, and neutral comments. The classification device is configured to determine the processing method of the information based on the classification result.
9. An electronic device, comprising: Memory; as well as A processor coupled to the memory is configured to execute the method of any one of claims 1-7 based on instructions stored in the memory.
10. A computer-readable storage medium comprising computer program instructions, wherein, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1-7.
Citation Information
Patent Citations
Social network high-quality node detection method and system
CN106126746A
Consumption credit scene fraud detection method based on ABC-SOM neural network
CN112488821A