Method and device for coloring nodes in neural network
By dyeing the nodes in the deep neural network, analyzing and optimizing the node functions, the problem of insufficient interpretability of the deep neural network is solved, the reliability and robustness of the model are improved, and it is suitable for applications in high-risk fields.
Patent Information
- Application Number
- CN202111052005.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-08
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-09-08
AI Technical Summary
The interpretability of deep neural networks is weak and it is difficult to understand the role of each node in the model, which limits its application in high-risk fields, especially in autonomous driving, medical and financial decision-making.
A method based on the dyeing principle is proposed. By dyeing the nodes in the neural network, the node's area of action and changes in classification accuracy are analyzed, unimportant nodes are removed, key nodes are retained, and the interpretability and robustness of the network are improved. Great sex.
It improves the interpretability and robustness of the deep neural network, simplifies the network structure, clarifies the role of nodes, and enhances the reliability and classification accuracy of the model.
Smart Images

Figure CN113792779B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer multimedia technology and relates to technologies such as image classification and target detection. Background Art
[0002] In recent years, artificial intelligence represented by deep neural networks has developed rapidly. At present, deep neural network models have demonstrated their powerful capabilities in many fields, such as natural language, computer vision, speech, and multimedia. However, deep learning models use "end-to-end" as the basic architecture, and continuously optimize model parameters through a large amount of annotated data to drive the back propagation of errors, and finally achieve specific functions. Such a learning process is called a "black box", which makes it difficult or even impossible for people to understand deep neural networks. Due to the weak interpretability of current deep neural networks, the application of deep neural networks has been hindered in fields with high reliability requirements and strong interpretability requirements. In "high-risk" fields such as autonomous driving, medical and financial decision-making, when using deep neural models to make major decisions, it is necessary not only to know what the decision is, but also to know the basis for the decision made by the algorithm. Therefore, it is of great significance to study the interpretability of deep neural networks.
[0003] At present, the interpretability of deep neural networks has attracted widespread attention from scholars at home and abroad. Top international conferences in the fields of computer vision, machine learning, and artificial intelligence have held seminars on the interpretability of neural networks, further expanding the research on the interpretability of deep neural networks. With the deepening of the research on the interpretability of deep neural networks, a large number of related research results have emerged in recent years. At present, the research on the interpretation of deep neural networks mainly focuses on different network structures, among which there are more methods for interpreting convolutional neural networks (CNN), and the interpretation of recurrent neural networks (RNN) and generative adversarial networks (GAN) is constantly deepening.
[0004] The method of outputting or reconstructing the feature map learned by the filter to the original image output in a visual way has the problem of information loss during reverse reconstruction, and the semantics of the high-level filter feature map is not clear, which makes this method only suitable for the visual interpretation of the feature map of the low- and medium-level filters, and cannot have a more complete explanation of the entire deep neural network; through sensitivity analysis, such as changing the impact of the input image pixels on the results to analyze the importance of pixels, this method can only explain the impact of image pixels on the results, and cannot explain the working mechanism of the model itself. Although there are already a large number of methods for explaining deep neural networks, these methods do not explain the role of each node unit in the model, but understanding the role of each node is of great significance to explaining the deep neural model. Therefore, according to the relevant principles of biological staining, the present invention proposes an interpretable neural network based on the staining principle. Summary of the invention
[0005] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.
[0006] To this end, the first purpose of the present invention is to propose a method for coloring nodes in a neural network, so as to realize the study of the role of nodes in the neural network and solve the interpretability problem of each node in the deep neural network.
[0007] The second object of the present invention is to provide a device for coloring nodes in a neural network.
[0008] To achieve the above-mentioned purpose, the first aspect of the embodiment of the present invention proposes a method for coloring nodes in a neural network, including: obtaining training data and preprocessing the training data; extracting features corresponding to the preprocessed training data through a preset feature extraction network, and classifying the features through a classification network, and outputting a category vector corresponding to the classification; storing the node parameters of the feature extraction network and the classification network in sequence in a pre-established node storage area; traversing the node information in the node storage area, labeling and classifying the nodes, and coloring the nodes of each category.
[0009] The method for coloring nodes in a neural network proposed in an embodiment of the present invention improves the interpretability of the deep neural network by coloring the nodes; the proposed neural network based on the coloring principle analyzes the performance changes of the node network after coloring and removes unimportant nodes to achieve network simplification; the proposed model for clarifying the role of nodes in the network ensures the stability of key nodes by paying attention to the changes of key nodes, thereby improving the reliability and robustness of the neural network.
[0010] In addition, the method for coloring nodes in a neural network according to the above embodiment of the present invention may also have the following additional technical features:
[0011] Furthermore, in one embodiment of the present invention, the training data is preprocessed, including: obtaining pictures in the training data, marking the types of objects at different positions in the pictures according to the annotation information, and storing the preprocessing result of each picture in a vector, wherein the vector is represented as:
[0012] [(X i ,y i ),X′ i ]=[(X i ,y i ),(x i1 ,x i2 ,...,x ij )],
[0013] in, X i represents the original information of the image, y represents the classification of the image, Represents the coordinate information of an object annotation box in the image, y ij Represents the category information of this annotation box, i represents the i-th image, j represents the j-th object in the image, and k represents the k-th vertex of the annotation box.
[0014] Furthermore, in one embodiment of the present invention, the label classification of nodes and the coloring operation of nodes of each category include:
[0015] For the convolution kernels in the feature extraction network, each convolution kernel is convolved with the original information of the image, and the area with the largest convolution result is used as the action area of the node;
[0016] Determine the label box to which the action area belongs, and use the category label of the label box as the label category of the convolution kernel;
[0017] The value of the node whose label category is image classification is proportionally enlarged or reduced, and the classification result is determined as the change in the classification accuracy of the image classification data after coloring.
[0018] Furthermore, in one embodiment of the present invention, after coloring the nodes of each category, the method further includes:
[0019] Acquire data to be tested, and input the data to be tested into a neural network;
[0020] determining a change in classification accuracy of a node in the neural network;
[0021] The node is operated according to the change of the classification accuracy, and the operation includes retaining the node or deleting the node.
[0022] The step of operating the node according to the change of the classification accuracy rate includes:
[0023] If the change in the classification accuracy of the node is that the classification accuracy is improved or remains unchanged, retaining the node;
[0024] Otherwise, the node is deleted from the neural network.
[0025] To achieve the above-mentioned purpose, another embodiment of the present invention proposes a device for coloring nodes in a neural network, including: a first acquisition module, used to acquire training data and preprocess the training data; a processing module, used to extract features corresponding to the preprocessed training data through a preset feature extraction network, and classify the features through a classification network, and output a category vector corresponding to the classification; a storage module, used to store the node parameters of the feature extraction network and the classification network in sequence in a pre-established node storage area; a coloring module, used to traverse the node information in the node storage area, label the nodes, and perform coloring operations on nodes of each category.
[0026] The device for coloring nodes in a neural network proposed in an embodiment of the present invention improves the interpretability of the deep neural network by coloring the nodes; the neural network based on the coloring principle proposed analyzes the performance changes of the node network after coloring and removes unimportant nodes to achieve network simplification; the model for clarifying the role of nodes in the network proposed can improve the reliability and robustness of the neural network by paying attention to the changes of key nodes and ensuring the stability of key nodes.
[0027] Furthermore, in one embodiment of the present invention, the dyeing module is also used for:
[0028] For the convolution kernels in the feature extraction network, each convolution kernel is convolved with the original information of the image, and the area with the largest convolution result is used as the action area of the node;
[0029] Determine the label box to which the action area belongs, and use the category label of the label box as the label category of the convolution kernel;
[0030] The value of the node whose label category is image classification is proportionally enlarged or reduced, and the classification result is determined as the change in the classification accuracy of the image classification data after coloring.
[0031] Furthermore, in one embodiment of the present invention, the device for coloring nodes in a neural network further includes:
[0032] A second acquisition module is used to acquire the data to be tested and input the data to be tested into the neural network;
[0033] A determination module, used to determine the change in classification accuracy of nodes in the neural network;
[0034] An operation module is used to operate the node according to the change of the classification accuracy, and the operation includes retaining the node or deleting the node.
[0035] Wherein, the operation module is also used for:
[0036] If the change in the classification accuracy of the node is that the classification accuracy is improved or remains unchanged, retaining the node;
[0037] Otherwise, the node is deleted from the neural network.
[0038] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0040] Figure 1 A schematic flow chart of a method for coloring nodes in a neural network provided in an embodiment of the present invention.
[0041] Figure 2 A schematic diagram of a process of a device for coloring nodes in a neural network provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0043] The following describes a method and apparatus for coloring nodes in a neural network according to an embodiment of the present invention with reference to the accompanying drawings.
[0044] Figure 1 A schematic flow chart of a method for coloring nodes in a neural network provided in an embodiment of the present invention.
[0045] like Figure 1 As shown, the method for coloring nodes in a neural network includes the following steps:
[0046] S1, obtain training data and preprocess the training data.
[0047] It is understandable that in order to facilitate the coloring of nodes in a neural network, the input data needs to be preprocessed first.
[0048] Furthermore, in one embodiment of the present invention, preprocessing the training data includes: obtaining
[0049] For the images in the training data, the types of objects at different positions in the images are marked according to the annotation information, and the preprocessing results of each image are stored in a vector, where the vector is represented as:
[0050] [(X i ,y i ),X′ i ]=[(X i ,y i ),(x i1 ,x i2 ,...,x ij )],
[0051] in, X i represents the original information of the image, y represents the classification of the image, Represents the coordinate information of an object annotation box in the image, y ij Represents the category information of this annotation box, i represents the i-th image, j represents the j-th object in the image, and k represents the k-th vertex of the annotation box.
[0052] S2, extracts the features corresponding to the preprocessed training data through the preset feature extraction network, classifies the features through the classification network, and outputs the category vector corresponding to the classification.
[0053] The function of the feature extraction network is to extract the features contained in the data. Different deep neural network architectures can be selected according to actual needs, such as ResNet1, VGGNet2, etc. We select the convolution part of these networks to obtain our feature extraction network F, where the node parameters in F are expressed as:
[0054]
[0055] F l m represents the mth convolution kernel of the lth layer in the network, F l m It will be stored in the node storage area and colored in the coloring network, and nl is the total number of convolution kernels in the lth layer.
[0056] DataX i The corresponding feature f can be obtained through the feature extraction network F i ,Right now
[0057] f i =F(X i ),
[0058] For the i-th data X i The extracted feature f i Will be used to train the classification network.
[0059] The role of the classification network is to generate the feature extraction network i Classify and output a category vector. The present invention is applicable to single-label classification and multi-label classification problems. The appropriate classification model is selected according to the actual data set. In the following description, we take a single label as an example. Assume that our classification network is C, where the node parameters of C are expressed as:
[0060] C=(W1,W2,...W C )
[0061] For X i The feature f extracted by the feature extraction network i The category is output through the classification network C(f i ) to judge the degree of association. Using the softmax method, C(f i ) is the largest output component of the data X i Category, i.e.
[0062] c(X i )=argmax(C(F(X i )))=argmax(C(f i ))
[0063] Where c(X i ) represents data X i The classification label obtained after passing through the feature extraction network and the classification network.
[0064] S3, storing the node parameters of the feature extraction network and the classification network in sequence in a pre-established node storage area.
[0065] It is understandable that in order to realize the function of coloring nodes, a node storage area is pre-established for storing node information. After the training of the feature extraction network and the classification network is completed, the node parameters in the feature network and the classification network are stored in the node storage area in sequence. This storage area is only used to store node related information.
[0066] S4, traverse the node information in the node storage area, classify the nodes by labels, and perform coloring operations on the nodes of each category.
[0067] Furthermore, in one embodiment of the present invention, the nodes are classified by labels, and the nodes of each category are colored, including:
[0068] For the convolution kernel in the feature extraction network, convolve each convolution kernel with the original information of the image, and use the area with the largest convolution result as the action area of the node;
[0069] Determine the label box to which the action area belongs, and use the category label of the label box as the label category of the convolution kernel;
[0070] The value of the node whose label category is image classification is proportionally enlarged or reduced to determine the change in classification accuracy of the data whose classification result is image classification after coloring.
[0071] Furthermore, in one embodiment of the present invention, after coloring the nodes of each category, the method further includes:
[0072] Obtaining the data to be tested, and inputting the data to be tested into the neural network;
[0073] Determine changes in classification accuracy of nodes in a neural network;
[0074] The nodes are operated according to the changes in classification accuracy, and the operations include retaining the nodes or deleting the nodes.
[0075] Among them, the nodes are operated according to the change of classification accuracy, including:
[0076] If the change in the classification accuracy of the node is that the classification accuracy is improved or unchanged, the node is retained;
[0077] Otherwise, remove the node from the neural network.
[0078] Specifically, the node information in the node storage area is traversed, and the nodes of the feature network and the classification network are labeled and classified respectively. For the convolution kernel in the feature extraction network, each convolution kernel is compared with X i Perform convolution operation and take the area with the highest activation degree, that is, the area with the largest convolution result, as the action area of the node, and judge whether the area belongs to X i Which label box in the convolution kernel is used as the label category of the convolution kernel. For the weight node in the classification network, a certain weight W i Set it to 0, analyze its impact on the classification results, and use the category with the greatest impact as the category label of the node. The above process is as follows:
[0079]
[0080]
[0081]
[0082] Among them, F l m represents the mth convolution kernel of the lth layer in the feature network, Indicates F l m The label is y j The number of .
[0083] Dye the nodes of each category. The dyeing operation is to change the label category to y j The value of the node is proportionally enlarged or reduced, and the performance of the feature network and the classification network after this operation is observed, that is, the classification result is y j The change in classification accuracy of the data after dyeing.
[0084] By coloring the nodes in the entire neural network in the previous step, input the test data into the network and observe the changes in classification accuracy, that is:
[0085] c′(X i )=argmax(C′(F′(X i )))=argmax(C′(f i ′))
[0086]
[0087] According to all the above steps, the role of the node in the network can be explained by observing the change in the classification accuracy of the entire deep neural network when the role of the node is enhanced or weakened. If the change of the node has no effect on the classification accuracy, then these nodes can be deleted from the network to simplify the network; if changing the node can improve the classification accuracy or keep it unchanged, then keep the node. By operating the nodes that have the main effect, higher accuracy can be achieved in more data sets. The above method can reduce the redundant parameters of the network on the one hand, and improve the interpretability and reliability of the network on the other hand.
[0088] Since the staining network has advantages such as interpretability, the staining network can be applied to target detection networks such as pathological section detection. Since the function of each neuron in the staining network is known, the pathological section location that the artificial neural network pays attention to during detection can be known by network application personnel such as doctors. On the one hand, it can promote the reliability of artificial neural network detection, and on the other hand, it may help doctors explore new lesion indication locations. At the same time, the staining network can also be used in network models such as image classification. In the staining network, the network can be clearly marked according to a certain feature in the picture, which promotes trust in the classification network during use. The staining network can also be applied to stock price prediction in the financial field. Using this network, it can be clearly known by which features the network predicts the stock price, which can provide effective information for financial personnel. Its application method is mainly to clearly know the function of each neuron in the training network stage, and to clearly mark which neurons play a major role when using it, so as to better help users understand the working process of artificial neural networks.
[0089] According to the method for coloring nodes in a neural network proposed in an embodiment of the present invention, the interpretability of the deep neural network is improved by coloring the nodes; the proposed neural network based on the coloring principle analyzes the performance changes of the node network after coloring and removes unimportant nodes to achieve network simplification; the proposed model for clarifying the role of nodes in the network ensures the stability of key nodes by paying attention to the changes of key nodes, thereby improving the reliability and robustness of the neural network.
[0090] In order to implement the above embodiment, the present invention also proposes a device for coloring nodes in a neural network.
[0091] Figure 2 A schematic diagram of the structure of a device for coloring nodes in a neural network provided in an embodiment of the present invention.
[0092] like Figure 2 As shown, the device for coloring nodes in a neural network includes: a first acquisition module, a processing module, a storage module, and a coloring module.
[0093] Among them, the first acquisition module is used to acquire training data and preprocess the training data; the processing module is used to extract features corresponding to the preprocessed training data through a preset feature extraction network, and classify the features through a classification network, and output a category vector corresponding to the classification; the storage module is used to store the node parameters of the feature extraction network and the classification network in a pre-established node storage area in order; the coloring module is used to traverse the node information in the node storage area, classify the nodes by labels, and perform coloring operations on the nodes of each category. The device for coloring nodes in a neural network proposed in an embodiment of the present invention improves the interpretability of the deep neural network by coloring the nodes; the proposed neural network based on the coloring principle analyzes the performance changes of the node network after coloring and removes unimportant nodes to simplify the network; the proposed model for clarifying the role of nodes in the network can improve the reliability and robustness of the neural network by paying attention to the changes of key nodes and ensuring the stability of key nodes.
[0094] Furthermore, in one embodiment of the present invention, the dyeing module is also used for:
[0095] For the convolution kernel in the feature extraction network, convolve each convolution kernel with the original information of the image, and use the area with the largest convolution result as the action area of the node;
[0096] Determine the label box to which the action area belongs, and use the category label of the label box as the label category of the convolution kernel;
[0097] The value of the node whose label category is image classification is proportionally enlarged or reduced to determine the change in classification accuracy of the data whose classification result is image classification after coloring.
[0098] Furthermore, in one embodiment of the present invention, the device for coloring nodes in a neural network is also used for:
[0099] The second acquisition module is used to acquire the data to be tested and input the data to be tested into the neural network;
[0100] A determination module, for determining changes in classification accuracy of nodes in a neural network;
[0101] The operation module is used to operate the node according to the change of classification accuracy, and the operation includes retaining the node or deleting the node.
[0102] The operation module is also used for:
[0103] If the change in the classification accuracy of the node is that the classification accuracy is improved or unchanged, the node is retained;
[0104] Otherwise, remove the node from the neural network.
[0105] It should be noted that the explanation of the aforementioned method embodiment for coloring nodes in a neural network is also applicable to the device for coloring nodes in a neural network in this embodiment, and will not be repeated here.
[0106] The device for coloring nodes in a neural network proposed in an embodiment of the present invention improves the interpretability of the deep neural network by coloring the nodes; the proposed neural network based on the coloring principle analyzes the performance changes of the node network after coloring and removes unimportant nodes to achieve network simplification; the proposed model for clarifying the role of nodes in the network ensures the stability of key nodes by paying attention to the changes of key nodes, thereby improving the reliability and robustness of the neural network.
[0107] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0108] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0109] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A method for coloring nodes in a neural network, characterized in that: The following steps are involved: Acquiring training data and preprocessing the training data; Extract features corresponding to the preprocessed training data through a preset feature extraction network, classify the features through a classification network, and output a category vector corresponding to the classification; Storing the node parameters of the feature extraction network and the classification network in sequence in a pre-established node storage area; Traversing the node information in the node storage area, classifying the nodes by labels, and performing coloring operations on the nodes of each category; The label classification of nodes and coloring of nodes of each category include: For the convolution kernels in the feature extraction network, each convolution kernel is convolved with the original information of the image, and the area with the largest convolution result is used as the action area of the node; Determine the label box to which the action area belongs, and use the category label of the label box as the label category of the convolution kernel; For the weight nodes in the classification network, the weight of any weight node is set to 0, and its impact on the classification results is analyzed. The category with the greatest impact is used as the label category of the arbitrary weight node; The value of the node whose label category is image classification is enlarged or reduced proportionally, and the classification result is determined as the change in the classification accuracy of the image classification data after coloring; After coloring the nodes of each category, it also includes: Acquire image data to be tested, and input the image data to be tested into a neural network; determining a change in classification accuracy of a node in the neural network; Performing an operation on the node according to the change of the classification accuracy, wherein the operation includes retaining the node or deleting the node; The node is operated according to the change of the classification accuracy, including: If the change in the classification accuracy of the node is that the classification accuracy is improved or remains unchanged, retaining the node; Otherwise, the node is deleted from the neural network.
2. The method according to claim 1, characterized in that Preprocessing the training data includes: The images in the training data are obtained, the types of objects at different positions in the images are marked according to the marking information, and the preprocessing results of each image are stored in a vector.
3. The method according to claim 2, characterized in that The vector is represented as: [(X i ,y i ),X i ′]=[(X i ,y i ),(x i1 ,x i2 ,...,x ij )], in, X i represents the original information of the image, y represents the classification of the image, Represents the coordinate information of an object annotation box in the image, y ij Represents the category information of this annotation box, i represents the i-th image, j represents the j-th object in the image, and k represents the k-th vertex of the annotation box.
4. A device for coloring nodes in a neural network, characterized in that: include: A first acquisition module, used to acquire training data and preprocess the training data; A processing module, used to extract features corresponding to the preprocessed training data through a preset feature extraction network, classify the features through a classification network, and output a category vector corresponding to the classification; A storage module, used to store the node parameters of the feature extraction network and the classification network in a pre-established node storage area in sequence; A coloring module, used to traverse the node information in the node storage area, classify the nodes by labels, and perform coloring operations on the nodes of each category; Wherein, the dyeing module is also used for: For the convolution kernels in the feature extraction network, each convolution kernel is convolved with the original information of the image, and the area with the largest convolution result is used as the action area of the node; Determine the label box to which the action area belongs, and use the category label of the label box as the label category of the convolution kernel; For the weight nodes in the classification network, the weight of any weight node is set to 0, and its impact on the classification results is analyzed. The category with the greatest impact is used as the label category of the arbitrary weight node; The value of the node whose label category is image classification is enlarged or reduced proportionally, and the classification result is determined as the change in the classification accuracy of the image classification data after coloring; The device also includes: A second acquisition module is used to acquire the data to be tested and input the data to be tested into the neural network; A determination module, used to determine the change in classification accuracy of nodes in the neural network; An operation module, used to operate the node according to the change of the classification accuracy, wherein the operation includes retaining the node or deleting the node; The operation module is also used for: If the change in the classification accuracy of the node is that the classification accuracy is improved or remains unchanged, retaining the node; Otherwise, the node is deleted from the neural network.
