Visual method and device for neural network practical training
By constructing a set of failure samples and generating a sequence of sample residual graphs from the dominant semantic vectors, and combining graph sequence interaction data and model interaction data, the visualization of the neural network training process was realized. This solved the problem that existing tools could not interactively explore the model decision boundary, and improved students' learning efficiency and analytical accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN QIANXING TECH CO LTD
- Filing Date
- 2026-04-27
- Publication Date
- 2026-06-19
Smart Images

Figure CN122243701A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of model training, and more particularly to a visualization method and apparatus for neural network training. Background Technology
[0002] With the widespread application of deep learning technology in fields such as image recognition, natural language processing, and autonomous driving, the internal working mechanism of neural network models has long been considered a black box that is difficult to understand intuitively due to its highly nonlinear and high-dimensional parameter space characteristics. This characteristic not only makes model debugging and optimization difficult, but also becomes a core obstacle in deep learning teaching. Students can often only indirectly infer the model's behavior through input and output results, and cannot intuitively perceive the feature extraction process, the formation mechanism of decision boundaries, and the intrinsic causes of failure modes. Existing visualization teaching tools also focus on static feature display. For example, methods represented by class activation mapping and its variant Grad-CAM can only passively view pre-calculated heatmaps and scatter plots. They cannot interactively explore the dynamic impact of model decision boundaries or feature changes on output through independent operation. As a result, the observation records and model intervention operations generated by students during training exist in an unstructured form and cannot be effectively integrated and fed back to the training end through visualization. Summary of the Invention
[0003] This application provides a visualization method and apparatus for neural network training, which solves the problem of difficulty in visualizing the neural network training process.
[0004] To achieve the above objectives, the embodiments of this application adopt the following technical solutions: Firstly, a visualization method for neural network training is provided, applied to a neural network training platform, which includes a training terminal and a central server. The method includes: The central server collects neural network verification data and neural network training data of the target neural network model in real time, and filters out all verification failure samples and corresponding failure sample characteristics in the neural network verification data. Based on the characteristics of the failure samples, construct the failure sample set and corresponding failure feature vector of all verified failure samples respectively, and calculate the dominant semantic vector of all failure sample sets based on the failure feature vector; Based on the dominant semantic vector and using a pre-trained image generator, all validation failure samples are visualized to obtain a sequence of sample residual maps; The sample residual map sequence is transmitted to the training terminal through the central server, and the graph sequence interaction data of the sample residual map sequence and the model interaction data of the target neural network model are collected from the training terminal. Based on the neural network training data and using the backpropagation algorithm, the loss analysis of the failed samples was completed. Based on the loss analysis results and the graph sequence interaction data, the interaction consistency verification of the model interaction data was completed, and the interaction verification data was obtained. Repeat the above steps until the training terminal outputs a training end signal, and collect the failure sample parameters of the training terminal in real time through the central server; A training knowledge graph is constructed by combining all failure sample parameters, graph sequence interaction data, and interaction verification data, and then transmitted to the training terminal for visualization display through the central server.
[0005] Optionally, constructing a failure sample set and corresponding failure feature vector for all verified failure samples based on the failure sample characteristics, and calculating the dominant semantic vector for all failure sample sets based on the failure feature vector includes the following steps: All verification failure samples are projected onto a two-dimensional canvas coordinate system using a nonlinear dimensionality reduction algorithm to obtain the verification failure point cloud; Based on the characteristics of the failure samples, clustering algorithms are used to cluster the sample features of all verified failure point clouds, resulting in multiple failure sample sets. For any set of failure samples, the failure set metadata is calculated based on the two-dimensional canvas coordinate system and the failure sample features. The failure set metadata includes the two-dimensional centroid of the set, the high-dimensional centroid of the set, the failure set radius, and the set failure label. Based on the characteristics of the failed samples, a failure feature vector of the failed sample set is constructed, and the failure feature vector is decentered based on the high-dimensional centroid of the set. Based on the decentering result, a failure feature matrix is constructed. Based on the failure feature matrix, several dominant semantic vectors of the failure sample set are selected from all failure feature vectors using the eigenvalue decomposition algorithm.
[0006] Optionally, the visualization of all validation failure samples based on the dominant semantic vector and using a pre-trained image generator to obtain the sample residual map sequence includes the following steps: For any dominant semantic vector, starting from the high-dimensional centroid of the set, the failure feature vector is moved along the positive and negative semantic directions of the dominant semantic vector with a fixed step size, until the failure feature vector touches the decision boundary of the model classifier, and the critical feature vector is output. Here, the model classifier is the model classification layer of the target neural network model, and the critical feature vector includes positive critical feature vector and negative critical feature vector. The failure feature vector and critical feature vector are sequentially input into a pre-trained image generator to obtain failure sample images, which include the original failure image, the positive end failure image, and the negative end failure image. Calculate the absolute pixel difference between the original failure image and the positive end failure image and the negative end failure image respectively, and generate the sample residual image based on the absolute pixel difference; The interpolation algorithm is used to generate a sequence of sample residual maps for all sample residual images.
[0007] Optionally, the neural network training data includes training sample data and model training parameters. The step of performing loss analysis on the failed samples using the neural network training data and the backpropagation algorithm, and performing interaction consistency verification of the model interaction data based on the loss analysis results and graph sequence interaction data to obtain interaction verification data includes the following steps: Training benchmark samples are selected from the training sample data based on the high-dimensional centroid of the set; Determine all key training nodes of the target neural network model based on the model training parameters; For any key training node, the cross-entropy loss function is used to perform loss gradient analysis on the training benchmark samples and the validation failure samples, and the set of key neurons is constructed based on the loss gradient analysis results. The set of intervention neurons in the training terminal is determined based on the model interaction data, and the neuron consistency rate is calculated by combining the set of intervention neurons and the set of key neurons. The semantic verification data of the training terminal is calculated by combining the graph sequence interaction data and the radius of the failure set; By integrating neuron consistency rate and semantic verification data, interactive verification data of model interaction data is obtained.
[0008] Optionally, the loss gradient analysis of the training benchmark samples and validation failure samples is performed using the cross-entropy loss function, and the key neuron set is constructed based on the loss gradient analysis results, including the following steps: The cross-entropy loss function is used to calculate the sample loss gradients of the training benchmark sample and the validation failure sample for all output neurons in the fully connected layer of the model. The fully connected layer of the model is the model layer structure of the target neural network model, and the sample loss gradient includes the benchmark loss gradient and the failure loss gradient. The influence degree of the neuron is obtained by summing the dot product of the baseline loss gradient and the failure loss gradient. The semantic alignment coefficients between all dominant semantic vectors and sample loss gradients are calculated using the cosine similarity formula. The neuron intervention weights of all output neurons are then calculated by combining the semantic alignment coefficients and neuron influence. The key neuron set is selected from all output neurons based on the neuron intervention weights.
[0009] Optionally, calculating the semantic verification data for the training end by combining the graph sequence interaction data and the failure set radius includes the following steps: For any key neuron in the set of key neurons, the matching semantic vector corresponding to the key neuron is selected from all dominant semantic vectors based on the semantic alignment coefficient; Based on the graph sequence interaction data, the interaction semantic vector of the training terminal is extracted, and the semantic direction consistency rate is obtained by verifying the semantic consistency between the interaction semantic vector and the matching semantic vector. The direction of intervention and regulation of key neurons is determined based on the semantic alignment coefficient. The direction of intervention and regulation is then used to perform directional verification of the interaction regulation parameters in the model interaction data, and the directional verification result is obtained. The adjustment range of the interactive adjustment parameters is verified based on the radius of the failure set corresponding to the matched semantic vector, and the rationality of the adjustment is obtained. All semantic direction consistency rates, directionality verification results, and adjustment rationality are integrated as semantic verification data for the training end.
[0010] Optionally, constructing the training knowledge graph by combining all failure sample parameters, graph sequence interaction data, and interaction verification data includes the following steps: For any set of failure samples, the set of failure samples is taken as a failure phenomenon node, and the phenomenon node attributes of the failure phenomenon node are determined by combining the failure sample parameters and neural network training data. The dominant semantic vectors corresponding to the set of failed samples are used to construct semantic direction nodes, and the direction node attributes of the semantic direction nodes are determined by combining the failure feature values and the sample residual map sequence. The key neuron set corresponding to the set of failed samples is taken as the neuron node, and the meta-node attributes of the neuron node are determined based on the loss gradient analysis results. Student interaction nodes are constructed by combining graph sequence interaction data and interaction verification data, and the interaction verification data is used as the interaction node attribute of the student interaction nodes; Traverse all failure phenomenon nodes, semantic direction nodes, neuron nodes and student interaction nodes to construct directed edges of nodes and obtain the initial training graph. Visualize and render the initial training map to output a training knowledge map.
[0011] Optionally, determining the phenomenon node attributes of the failure phenomenon node by combining the failure sample parameters and neural network training data includes the following steps: For any key training node, extract the training node model parameters corresponding to the key training node from the model training parameters, and load the training node model according to the training node model parameters. The high-dimensional centroid of the set of parameters of the failed samples is input into the training node model for forward propagation, and the sample historical feature vector is output through the fully connected layer of the training node model. Calculate the vector similarity between all historical feature vectors of the samples, and construct the sample feature drift sequence based on the vector similarity; The gradient attribution method is used to calculate the attribution contribution distribution of the set of failure samples to all output neurons, and the attribution neuron set is selected from all output neurons based on the attribution contribution distribution. Calculate the Jaccard similarity of the attribution neuron sets between adjacent key training nodes, and combine the Jaccard similarity and sample feature drift sequence to calculate the node mutation degree of key training nodes; The core formation period of the failed sample set is determined based on the node mutation degree, and the core formation period, sample feature drift sequence, and Jaccard similarity are used as the phenomenon node attributes of the failed phenomenon nodes.
[0012] In a second aspect, this application provides a machine-readable storage medium storing instructions that cause a machine to execute the visualization method for neural network training as described in the first aspect.
[0013] Thirdly, this application provides a visualization device for neural network training, comprising: The memory is configured to store instructions; and The processor is configured to retrieve the instructions from the memory and, when executing the instructions, to implement the visualization method for neural network training as described in the first aspect.
[0014] By grouping scattered individual verification failure samples into several failure sample sets, each set corresponding to a failure mode, the efficiency of verification failure sample analysis can be effectively improved, significantly reducing the cognitive burden of practical training. Simultaneously, the dominant semantic vector of each failure sample set is extracted, and a sequence of sample residual maps reflecting the continuous changes in the characteristics of the verification failure samples is generated. This effectively reveals the most significant direction of feature variation within each failure mode, allowing students to observe feature evolution in a continuous dimension, rather than viewing isolated single error images. This greatly improves students' learning efficiency regarding the causes of failure samples and facilitates their understanding of the visual characteristics of the target neural network model under different failure modes. By collecting students' graph sequence interaction data and model interaction data, semantic verification data at the training end can be calculated, effectively quantifying the accuracy of students' analysis of the causes of each failure mode. The data accumulated by students during practical training is organized into a training knowledge graph, which is then transmitted to the training end for visualization, thereby enabling visualization of students' various operations in the neural network training process. In summary, this application can transform student training-related data, such as graph sequence interaction data and model interaction data, as well as student training results, such as semantic verification data, generated during neural network training into a visualized knowledge graph format, thereby realizing the visualization of the neural network training process.
[0015] Other features and advantages of the embodiments of this application will be described in detail in the following detailed description section. Attached Figure Description
[0016] Figure 1 A flowchart illustrating a visualization method for neural network training provided in an embodiment of this application; Figure 2 A flowchart illustrating a dominant semantic vector calculation method provided in this application embodiment; Figure 3 This is a flowchart illustrating a method for constructing a key neuron set, as provided in an embodiment of this application. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for illustration and explanation of the embodiments of this application and are not intended to limit the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0018] It should be noted that if the embodiments of this application involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.
[0019] Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0020] Figure 1 The illustration schematically shows a flowchart of a visualization method for neural network training according to an embodiment of this application. Figure 1 As shown in the figure, this application provides a visualization method for neural network training, applied to a neural network training platform. The neural network training platform includes a training terminal and a central server. The method may include the following steps: S101. Collect neural network verification data and neural network training data of the target neural network model at the training end in real time through the central server, and filter out all verification failure samples and corresponding failure sample features in the neural network verification data.
[0021] In this embodiment, a continuous data communication link is established between the central server and the training terminal. During the training process, the training terminal loads and runs a target neural network model that has completed basic training. The central server acquires in real time the neural network validation data generated by the model performing forward inference on the validation set, as well as the neural network training data generated during the training phase. The neural network validation data includes the true label of each validation sample, the predicted label output by the model, and the predicted probability values of each category output by the model classifier. The neural network training data includes training sample data, model training parameters corresponding to each training epoch, and snapshots of model parameters at training nodes saved during the training process.
[0022] The central server automatically intercepts validation failure samples from the neural network validation data based on a dual criterion. The first criterion is the classification bias criterion: if the predicted label of a validation sample does not match its true label, the sample is marked as a validation failure sample. The second criterion is the confidence uncertainty criterion: if the predicted label of a validation sample matches the true label, but the maximum predicted probability value output by the model is lower than a preset confidence threshold, such as 0.6, the sample is also marked as a validation failure sample. These steps extract the failure sample features corresponding to each validation failure sample, providing the original data foundation for subsequent failure mode clustering and semantic analysis.
[0023] S102. Based on the characteristics of the failure samples, construct the failure sample set and the corresponding failure feature vector of all verified failure samples respectively, and calculate the dominant semantic vector of all failure sample sets based on the failure feature vector.
[0024] In this embodiment, scattered individual verification failure samples are grouped into sets of failure samples with similar failure mechanisms, and the dominant semantic vector of each set is extracted. A nonlinear dimensionality reduction algorithm projects the high-dimensional failure sample features onto a two-dimensional canvas coordinate system, allowing the distribution patterns of failure samples, which were previously difficult to observe in abstract high-dimensional space, to be intuitively presented in the form of point clouds. The application of clustering algorithms automatically groups samples with adjacent feature spatial locations and similar failure behaviors into the same failure sample set, effectively reducing the cognitive burden on students to analyze individual error samples one by one, and achieving a cognitive leap from isolated samples to failure modes. For each failure sample set, the set's two-dimensional centroid, high-dimensional centroid, failure set radius, and set failure label are calculated, providing a complete description of the spatial location, distribution range, and category attributes of the failure mode. By extracting the dominant semantic vector through feature decomposition, the most significant direction of feature variation within each failure sample set is revealed, enabling students to understand the causes of failure from a continuously changing dimension, rather than being limited to static single-point analysis.
[0025] S103. Based on the dominant semantic vector and using a pre-trained image generator, visualize all the validation failure samples to obtain a sequence of sample residual maps.
[0026] In this embodiment, the abstract dominant semantic vector is transformed into a sequence of sample residual maps that can be intuitively observed, solving the problem that high-dimensional semantic directions are difficult for humans to perceive visually. By probing the decision boundary along the positive and negative directions of the dominant semantic vector and recording the critical feature vector, the boundary positions where the model's classification results change in this semantic direction can be defined, providing start and end points for subsequent continuous visualization. A pre-trained image generator is used to synthesize the high-dimensional centroid and critical feature vectors into a visualized image, establishing a mapping bridge between the high-dimensional feature space and the human-understandable image space. By generating a sequence of sample residual maps from the original failure image to the endpoint failure image, and highlighting key image regions at the pixel level, students can continuously observe the corresponding changes in the image as features evolve along the semantic direction by dragging a slider. This allows them to intuitively understand which visual features the target neural network model is sensitive to in this failure mode, providing a cognitive basis for subsequent precise intervention.
[0027] S104. The sample residual map sequence is transmitted to the training terminal through the central server, and the graph sequence interaction data of the sample residual map sequence and the model interaction data of the target neural network model are collected from the training terminal.
[0028] In this embodiment, the main area of the training terminal's front-end interactive interface is a two-dimensional canvas exploration area. This area uses a two-dimensional canvas coordinate system as a reference and renders the verification failure point cloud as a scatter plot. Each verification failure sample is represented by an interactive graphical element on the two-dimensional canvas, and different sets of failure samples can be distinguished by different colored dot markers. The two-dimensional canvas exploration area allows students to pan the canvas by dragging a pointer and zoom it using a scroll wheel, enabling them to observe the distribution patterns of failure samples at different scales. Below or to the side of the two-dimensional canvas exploration area can be used to set up a semantic direction exploration area to display the visualization of the dominant semantic vectors. For the currently selected set of failure samples, each dominant semantic vector occupies an independent exploration panel within the semantic direction exploration area. Each exploration panel contains the following interface elements: a sample residual map sequence playback area, a semantic direction slider control, and a residual map highlight overlay. The sample residual map sequence playback area displays the sample residual map sequence corresponding to the current semantic direction in the form of a canvas or image element. Students can continuously browse the complete transition sequence from the original failure image to the positive or negative failure image by dragging the semantic direction slider control.
[0029] The residual image highlight overlay is superimposed on the sample residual image as a semi-transparent colored mask, highlighting the areas with the most significant pixel changes in a striking color. This helps students quickly identify key image regions that change along this semantic direction. Key image regions refer to the core areas that cause errors in the validation process and are thus marked as validation failure samples. They are also the local parts in the image space where the most significant visual changes occur when moving the failure feature vector along the current dominant semantic vector direction. For example, for a set of failure samples that misclassify a truck as a bus, when evolving along the dominant semantic vector of "significance of roof-mounted air conditioning equipment," the key image region is usually located in the spatial position of the roof-mounted air conditioning equipment; when evolving along the dominant semantic vector of "vehicle length and window arrangement," the key image region is concentrated in the side window area of the vehicle. By overlaying a semi-transparent colored overlay onto the sample residual image to highlight key image regions, students can be guided to focus their attention on visual features directly related to the current failure mode when observing the sequence of sample residual images. This avoids being distracted by pixel fluctuations in the background or other irrelevant image regions, thus enabling a more efficient understanding of the sensitive visual features relied upon by the target neural network model when making misclassification decisions. Each semantic direction exploration panel has an independent activation state.
[0030] When a student clicks on a semantic direction exploration panel or interacts with it, that panel is marked as the currently active semantic direction context. The currently active semantic direction identifier can be recorded in real time as a data source for determining the semantic vectors of subsequent interactions. The graph sequence interaction data includes the student's currently active semantic direction identifier, the offset percentage corresponding to the drag position of the semantic direction slider control, the duration of dwell at each offset percentage, and the timestamp of each semantic direction switch. This data comprehensively records the student's exploration trajectory and observation depth in each semantic direction.
[0031] The Neuron Topology View area is located to the side of the Semantic Exploration area, displaying the topology of the output neurons in the fully connected layers of the target neural network model as a node connection graph. Each output neuron is represented as an interactive circular node, and the connections between nodes are represented by line segments. The Neuron Topology View area allows students to select individual neuron nodes, which are highlighted with a border or magnified effect. The Neuron Intervention Control area is located below the Neuron Topology View area and is used to perform parameter intervention operations on the selected neuron. When a student selects a neuron node in the Neuron Topology View area, the Neuron Intervention Control area automatically displays the neuron's basic information, including the neuron index and current output value. The core control of the Neuron Intervention Control area is the neuron adjustment slider. Students can adjust the neuron's output value in real time by dragging the neuron adjustment slider. Each slider drag operation is captured by the system in real time, and the following model interaction data is recorded: the index of the neuron being intervened, the original output value of the neuron before intervention, the new output value of the neuron after intervention, the difference between the two, i.e. the interaction adjustment parameter, the timestamp of the intervention operation, and the currently activated semantic direction identifier in the semantic direction exploration area when the intervention operation is performed. The above data completely records every parameter intervention behavior performed by the student on the target neural network model.
[0032] The aforementioned graph sequence interaction data and model interaction data are uploaded to the central server in real time from the training terminal in the form of structured data streams. The central server then classifies and persistently stores the data according to student identifiers and training task identifiers. Since all data collection is automatically triggered by the system in the background based on the state changes of the interface controls, students do not need to perform any additional data submission operations, ensuring the integrity, objectivity, and immutability of the data collection.
[0033] S105. Based on the neural network training data and using the backpropagation algorithm, perform loss analysis on the failed samples, and based on the loss analysis results and graph sequence interaction data, perform interaction consistency verification of the model interaction data to obtain interaction verification data.
[0034] In this embodiment, the actual intervention behaviors of students are objectively compared with the optimal intervention path derived by the system based on mathematical analysis, generating quantitative consistency verification data. Using the backpropagation algorithm and cross-entropy loss function to perform loss gradient analysis on the verification failure samples, the system can identify key neuron sets that significantly contribute to each failure mode from the internal parameter level of the model, providing an objective benchmark for evaluating the accuracy of students' intervention target selection. Comparing the neuron sets of students' actual interventions with the key neuron sets to calculate the neuron consistency rate quantifies the accuracy of students' understanding of the failure mechanism. Combining graph sequence interaction data to perform semantic direction consistency rate verification, intervention directionality verification, and adjustment amplitude verification comprehensively measures the standardization of students' intervention behaviors from three dimensions: semantic context matching degree, operational polarity correctness, and adjustment strength rationality.
[0035] S106. Repeat the above steps until the training terminal outputs a training end signal, and collect the failure sample parameters of the training terminal in real time through the central server.
[0036] In this embodiment, the above steps are repeated, enabling the training platform to continuously respond to the state changes of the target neural network model during training or validation, dynamically update the set of failure samples, recalculate the dominant semantic vector, and refresh the visualization content. This allows students to conduct in-depth diagnosis and intervention attempts on multiple failure modes one by one. When the training terminal outputs a training end signal, the central server aggregates all accumulated failure sample parameters during the training process, including the set's two-dimensional centroid, the set's high-dimensional centroid, the radius of the failure set, the set's failure labels, and the historical feature vectors of samples corresponding to each key training node. This provides a complete dataset for subsequent knowledge graph construction. This cyclical mechanism makes the training process closer to the workflow of continuous iterative diagnosis in real model development, enhancing the engineering simulation of the training.
[0037] S107. Combine all failure sample parameters, graph sequence interaction data and interaction verification data to construct a training knowledge graph, and transmit the training knowledge graph to the training terminal for visualization display through the central server.
[0038] In this embodiment, each set of failed samples is instantiated as a failure phenomenon node, each dominant semantic vector is instantiated as a semantic direction node, neurons in the key neuron set are instantiated as neuron nodes, and each intervention operation is instantiated as a student interaction node. Then, all nodes are traversed to establish five types of directed edges: phenomenon-semantic direction edges, semantic direction-neuron edges, neuron-phenomenon edges, student operation association edges, and operation sequence temporal edges, forming a complete initial training graph. This achieves a complete knowledge representation from the model's internal static structure to the student's dynamic cognitive behavior. The central server performs visualization rendering of the initial training graph, distinguishing node types with different colors and shapes, and edge types and weights with different line types and thicknesses, resulting in a training knowledge graph. The rendered training knowledge graph is then transmitted to the training terminal in an interactive vector graphics format. Students can expand nodes to view attribute details, zoom and drag to examine the global structure of the graph, and view the complete cognitive path from observing the failure phenomenon, exploring the semantic direction, locating key neurons, to executing intervention operations and undergoing consistency verification, thus achieving a visual display of the training process.
[0039] In one embodiment, reference is made to Figure 2 The process involves constructing a failure sample set and corresponding failure feature vector for all verified failure samples based on their characteristics, and then calculating the dominant semantic vector for all failure sample sets based on the failure feature vectors. This includes the following steps: S201. Use a nonlinear dimensionality reduction algorithm to project all verification failure samples onto a two-dimensional canvas coordinate system to obtain the verification failure point cloud. S202. Based on the characteristics of the failure samples, clustering algorithms are used to cluster the sample features of all verified failure point clouds to obtain multiple failure sample sets. S203. For any set of failure samples, calculate the failure set metadata based on the two-dimensional canvas coordinate system and the failure sample features. The failure set metadata includes the two-dimensional centroid of the set, the high-dimensional centroid of the set, the failure set radius, and the set failure label. S204. Construct the failure feature vector of the failure sample set based on the characteristics of the failure samples, and complete the decentralization process of the failure feature vector based on the high-dimensional centroid of the set, and construct the failure feature matrix based on the decentralization process result. S205. Based on the failure feature matrix and using the eigenvalue decomposition algorithm, select several dominant semantic vectors from all failure feature vectors to identify the failure sample set.
[0040] In this embodiment, the failure sample features output from the feature extraction layer of the target neural network model for each of the verification failure samples are first extracted. Then, a unified manifold approximation and projection algorithm is used to reduce the dimensionality of these high-dimensional features, i.e., the failure sample features. The unified manifold approximation and projection algorithm preserves the local neighborhood structure in the high-dimensional space while maintaining the global topological relationships, ensuring that verification failure samples that are close in distance in the feature space are also close to each other on the two-dimensional projection plane. After feature dimensionality reduction, all verification failure samples are projected onto a two-dimensional canvas coordinate system to obtain the verification failure point cloud. The two-dimensional canvas coordinate system is a pre-established two-dimensional Cartesian coordinate system, where the horizontal and vertical axes each correspond to a pixel coordinate range of a visualization canvas, used to map the abstract feature distribution in high-dimensional space into an observable point matrix on a two-dimensional plane. After completing the above steps, each verification failure sample obtains a two-dimensional canvas coordinate, and the set of all two-dimensional canvas coordinates constitutes the verification failure point cloud.
[0041] Using the failure sample features of each verification failure sample as the basis for clustering, the K-means clustering algorithm can be performed on the verification failure point cloud. The number of clusters is dynamically determined based on the total number of categories in the training set used by the target neural network model, typically set to 1.5 times the total number of categories in the training set. For example, for an image classification training set containing 10 categories, the number of clusters is set to 15. This is because the distribution of verification failure samples in the feature space is usually more dispersed than that of correctly classified samples. A single category may correspond to multiple different failure modes. Too few clusters will lead to the incorrect merging of verification failure samples with different causes, while too many clusters will generate a large number of fragmented small clusters that lose their inductive significance. Setting the number of clusters to 1.5 times the total number of categories achieves a good balance between pattern discrimination and inductive effect. After clustering, the verification failure samples in each cluster constitute an independent set of failure samples, and each set represents a specific failure mode exhibited by the target neural network model during the verification process.
[0042] The method for calculating the two-dimensional centroid of the set is as follows: Calculate the mean of the horizontal and vertical coordinates of the two-dimensional canvas coordinates of all verified failure samples within the set. The resulting two-dimensional coordinate point is the center position of the set on the canvas. The method for calculating the high-dimensional centroid of the set is as follows: Calculate the arithmetic mean of the failure sample feature vectors of all verified failure samples within the set dimension-wise. The resulting high-dimensional vector is the representative feature of the set in the high-dimensional feature space. The failure sample feature vector is the vectorized result of the failure sample features. The method for calculating the radius of the failure set is as follows: Calculate the Euclidean distances from the failure sample feature vectors of all verified failure samples within the set to the high-dimensional centroid of the set. Take the maximum distance value as the radius of the failure set, which is used to quantify the coverage breadth of the failure mode in the feature space. The method for determining the set failure label is as follows: Statistically analyze the distribution of the true and predicted labels of the verified failure samples within the set. Extract the combination of the most frequently occurring true label and mispredicted label as the set failure label. For example, a sample combination whose true label is "truck" but is predicted as "bus" by the target neural network model is labeled as a "truck misjudged as bus" failure mode.
[0043] For any set of failure samples, extract the failure sample feature vectors of each verified failure sample within the set as the failure feature vector of the set. Subtract the high-dimensional centroid of the set from each failure feature vector to obtain a decentralized feature vector. Arrange all decentralized feature vectors in rows to form the failure feature matrix of the failure sample set. The number of rows in the matrix equals the number of verified failure samples in the set, and the number of columns equals the dimension of the failure feature vectors. Then, based on the failure feature matrix and using an eigenvalue decomposition algorithm, select several dominant semantic vectors for the failure sample set from all failure feature vectors. The process of selecting several dominant semantic vectors for the failure sample set based on the failure feature matrix and using an eigenvalue decomposition algorithm includes the following steps: For any verification failure sample in the failure sample set, the failure feature vector of the verification failure sample is input into the model classifier of the target neural network model, and the model classifier outputs the sample classification score of the verification failure sample. Calculate the multidimensional partial derivatives of the sample classification score with respect to the failure feature vector, and determine the sensitivity weight vector of the failure feature vector based on the multidimensional partial derivatives; The sensitivity weight vector is multiplied dimension by dimension by the matrix elements in the failure feature matrix to obtain the weighted failure matrix; Based on the high-dimensional centroid of the set, and using the cosine similarity formula, the training benchmark samples corresponding to the validation failure samples are selected from the training sample data. The training benchmark samples are input into the fully connected layer of the target neural network model, and the benchmark sample vector of the training benchmark samples is extracted through the fully connected layer. Then, a sensitivity weighting operation is performed on the benchmark sample vector to obtain the weighted benchmark vector. A weighted benchmark matrix is constructed based on all weighted benchmark vectors; Calculate the covariance matrices of the weighted failure matrix and the weighted benchmark matrix respectively, and calculate the contrast covariance operator between the weighted failure matrix and the weighted benchmark matrix based on the covariance matrices; Complete the eigenvalue decomposition of the contrast covariance operator, and select several dominant semantic vectors from the failure sample set based on the eigenvalue decomposition results.
[0044] Specifically, for any verification failure sample in the failure sample set, the verification failure sample is input into the model classifier of the target neural network model, and the model classifier outputs the sample classification score of the verification failure sample. The model classifier refers to the classification layer structure in the target neural network model located after the feature extraction layer. Its input is the failure feature vector, and its output is the sample classification score for each preset category. The sample classification score refers to the logical value output by the model classifier for the true label category of the verification failure sample before it is processed by the normalized exponential function. The sample classification score reflects the degree to which the target neural network model classifies the sample into its true category. Next, the partial derivatives of the sample classification score with respect to each dimension of the failure feature vector are calculated, that is, the multi-dimensional partial derivatives. Then, the absolute values of each component of the multi-dimensional partial derivatives are taken and normalized to obtain the sensitivity weight vector. The sensitivity weight vector is multiplied by the elements of the same dimension in the failure feature matrix to obtain the weighted matrix elements. For example, the element in the i-th row and d-th column of the failure feature matrix represents the component value of the d-th dimension of the decentralized failure sample feature vector of the i-th validation failure sample. Multiplying this element by the d-th component of the sensitivity weight vector yields the weighted matrix element. All weighted matrix elements are arranged in their original row and column positions to form the weighted failure matrix. The weighted failure matrix strengthens the feature dimensions that significantly influence the classification decision of the target neural network model, suppresses redundant dimensions that the model is insensitive to, and makes subsequent feature decomposition more focused on the key feature factors that lead to model failure.
[0045] In the training sample data, all training samples with the same true labels as the high-dimensional centroid of the set are retrieved. The high-dimensional feature vectors output by the feature extraction layer of the target neural network model for each training sample are extracted. The cosine similarity between the high-dimensional feature vector of each training sample and the high-dimensional centroid of the set is calculated. Several training samples with the highest cosine similarity are selected as training benchmark samples, typically one to two times the number of validation failure samples in the failure sample set. Next, the training benchmark samples are input into the fully connected layer of the target neural network model. The benchmark sample vector is extracted from the fully connected layer, which is the fully connected layer structure in the target neural network model located after the feature extraction layer and before the model classifier, usually the second to last layer. The benchmark sample vector is the high-dimensional feature vector output by the training benchmark sample in this fully connected layer. For each training benchmark sample, following the same sensitivity weighting method as for the validation failure samples, the partial derivatives of its classification score with respect to each dimension are calculated to generate a sensitivity weight vector. Then, the benchmark sample vector is decentered by subtracting the high-dimensional centroid of the set. Finally, the centered benchmark sample vector is multiplied dimension-by-dimensionally by the sensitivity weight vector to obtain the weighted benchmark vector. All the weighted benchmark vectors corresponding to the training benchmark samples are arranged row-wise to form a weighted benchmark matrix. The weighted benchmark matrix reflects the distribution of samples that the target neural network model can stably and correctly classify and that are semantically similar to the failure samples in the model's perceptual feature space, providing a precise reference for subsequent comparative analysis.
[0046] Next, the covariance matrices of the weighted failure matrix and the weighted benchmark matrix are calculated separately, and the contrast covariance operator between the two matrices is calculated based on the covariance matrices. The covariance matrix of the weighted failure matrix is calculated by multiplying the transpose of the weighted failure matrix by itself and then dividing by the number of validation failure samples. This matrix reflects the discrete distribution structure of failure samples in the model's sensitive feature space. The covariance matrix of the weighted benchmark matrix is calculated by multiplying the transpose of the weighted benchmark matrix by itself and then dividing by the number of training benchmark samples. Combining the covariance matrices of the weighted failure matrix and the weighted benchmark matrix, the contrast covariance operator between them is calculated. The formula for the contrast covariance operator is: Contrast Covariance Operator = Covariance Matrix of Weighted Benchmark Matrix - Q × Covariance Matrix of Weighted Benchmark Matrix, where Q is the contrast intensity coefficient, which is defaulted to 0.5. Next, the eigenvalue decomposition of the contrastive covariance operator is performed, and several dominant semantic vectors of the failure sample set are selected from the failure feature vectors based on the eigenvalue decomposition results. The contrastive covariance operator is a real symmetric matrix. Eigenvalue decomposition yields a set of real eigenvalues and corresponding eigenvectors. The sign and absolute value of the real eigenvalues reflect the difference between the weighted variance of the failure samples and the weighted variance of the success samples in the corresponding eigenvector direction. A positive real eigenvalue with a larger absolute value indicates that the variation in that direction is significantly higher than that in the success samples, representing a specific variation direction of the failure mode. The top few eigenvectors with the largest positive and largest absolute values are selected as the dominant semantic vectors of the failure sample set. The number of dominant semantic vectors is usually two. This is based on the fact that two dominant semantic vectors can explain most feature variations while allowing students to explore them separately in an intuitive way using independent sliders on a two-dimensional interactive interface, achieving a balance between teaching effectiveness and interactive complexity. Each dominant semantic vector is a unit vector with the same dimension as the feature vector of the failed samples. Its direction represents the independent semantic dimension with the most significant feature variation within the set of failed samples. Here, semantics specifically refers to the visual feature pattern that caused the model failure, rather than semantics in natural language. For example, for a set of failed samples that misclassified a truck as a bus, the first dominant semantic vector might correspond to the salience of the roof-mounted air conditioning equipment, while the second dominant semantic vector might correspond to changes in vehicle length and window arrangement. Extracting dominant semantic vectors allows students to observe the causes of failure from a continuously changing perspective, rather than analyzing a single erroneous sample in isolation, significantly improving the efficiency and depth of failure analysis.
[0047] In one embodiment, the visualization of all validation failure samples based on the dominant semantic vector and utilizing a pre-trained image generator to obtain a sequence of sample residual maps includes the following steps: For any dominant semantic vector, starting from the high-dimensional centroid of the set, the failure feature vector is moved along the positive and negative semantic directions of the dominant semantic vector with a fixed step size, until the failure feature vector touches the decision boundary of the model classifier, and the critical feature vector is output. Here, the model classifier is the model classification layer of the target neural network model, and the critical feature vector includes positive critical feature vector and negative critical feature vector. The failure feature vector and critical feature vector are sequentially input into a pre-trained image generator to obtain failure sample images, which include the original failure image, the positive end failure image, and the negative end failure image. Calculate the absolute pixel difference between the original failure image and the positive end failure image and the negative end failure image respectively, and generate the sample residual image based on the absolute pixel difference; The interpolation algorithm is used to generate a sequence of sample residual maps for all sample residual images.
[0048] In this embodiment, for any dominant semantic vector, starting from the high-dimensional centroid of the set, the failure feature vector is moved along the positive and negative semantic directions of the dominant semantic vector with a fixed step size, until the failure feature vector touches the decision boundary of the model classifier, at which point a critical feature vector is output. Here, the model classifier refers to the classification layer structure in the target neural network model located after the feature extraction layer, responsible for mapping the high-dimensional feature vector to the predicted probabilities of each category. The critical feature vector includes a positive critical feature vector and a negative critical feature vector, corresponding to the feature vectors in the positive and negative semantic directions when the classification result is about to change but has not yet changed. The fixed step size is based on the standard deviation of the feature distribution of each validation failure sample in the failure sample set along the direction of the dominant semantic vector, typically taken as 0.1 times this standard deviation. For example, if the standard deviation of the features along a certain dominant semantic vector direction is 0.8, then the fixed step size is 0.08. During each step of the movement, the failure feature vector after the movement is input into the model classifier for forward inference. When the predicted label output by the model classifier differs from the original predicted label corresponding to the high-dimensional centroid of the set for the first time, it is determined that the decision boundary has been reached at that position, the step-by-step detection in that direction is stopped, and the failure feature vector of the previous step is recorded as the critical feature vector in that direction. Furthermore, if the decision boundary is not reached before reaching the preset maximum detection distance, the failure feature vector at the maximum detection distance is used as the critical feature vector. The maximum detection distance is typically three times the standard deviation of the features in the direction of the dominant semantic vector.
[0049] The failure feature vector and critical feature vector are sequentially input into a pre-trained image generator to obtain failure sample images. These failure sample images include the original failure image, the positive-end failure image, and the negative-end failure image. The pre-trained image generator refers to a generative model that is independent of the target neural network model and has already been trained, such as the generator part of a generative adversarial network or the decoder part of a variational autoencoder. Furthermore, since this approach does not involve professional fields such as medical imaging, industrial defect detection, or remote sensing images, but is only for practical training for deep learning beginners, the pre-trained image generator can directly use existing image generation models, such as the StyleGAN series and BigGAN, to reduce necessary computational costs. This adaptation layer typically only requires a small number of samples for fine-tuning training to complete the alignment, significantly reducing computational overhead compared to training a complete image generator. This image generator has the ability to map high-dimensional feature vectors back to image space; its input is a feature vector with the same dimension as the failure feature vector, and its output is the corresponding visualization image. The high-dimensional centroid of the set is used as the original failure feature vector and input into the image generator to generate the original failure image, which represents the typical failure mode of the failure sample set at the center of the feature space. The positive critical feature vector is input into the image generator to generate the positive-end failure image, which represents the extreme failure mode when evolving along the positive direction of the dominant semantic vector to the decision boundary. The negative critical feature vector is input into the image generator to generate the negative-end failure image, which represents the extreme failure mode when evolving along the negative direction of the dominant semantic vector to the decision boundary.
[0050] Next, the absolute pixel difference between the original failure image and the positive-end failure image, and between the original failure image and the negative-end failure image, is calculated pixel by pixel, and a sample residual image is generated based on the absolute pixel difference. Taking the original failure image and the positive-end failure image as an example, for the pixel position in row u and column v of the image, the absolute value of the difference between the pixel value in the original failure image and the pixel value in the positive-end failure image at that position is taken as the pixel value of the sample residual image at that position. The higher the pixel value in the sample residual image, the more significant the change in that region is during the evolution from the original failure image to the positive-end failure image. To further highlight key change areas, a preset pixel threshold can be applied to the sample residual image for binarization or pseudo-color mapping, and the most significantly changed local areas can be highlighted with a prominent color. The pixel threshold is determined based on the statistical distribution of all pixel values in the sample residual image, usually taking the 90th percentile of the pixel value distribution as the threshold. For example, if the pixel value corresponding to the 90th percentile in the sample residual image is 50, then the region with a pixel value greater than 50 is identified as a significantly changed region and highlighted.
[0051] Next, an interpolation algorithm is used to generate a sequence of sample residual maps for all sample residual images. The sequence includes transition sequences from the original failure image to the positive-end failure image, and transition sequences from the original failure image to the negative-end failure image. The interpolation algorithm can use linear interpolation, generating several intermediate feature vectors at equal intervals between the original failure feature vector and the critical feature vector. Each intermediate feature vector is then sequentially input into the image generator to obtain intermediate transition images. All intermediate transition images arranged in order constitute the sample residual map sequence. After transmitting the above sample residual map sequence to the training terminal, students can continuously observe the complete evolution process from the original failure mode to the extreme failure mode by dragging a slider. This allows them to intuitively understand the influence mechanism of feature changes controlled by the dominant semantic vector on the model's classification results, thereby improving their understanding of image recognition models in deep learning.
[0052] In one embodiment, the neural network training data includes training sample data and model training parameters. The step of performing loss analysis on the failed samples using the neural network training data and the backpropagation algorithm, and performing interaction consistency verification of the model interaction data based on the loss analysis results and graph sequence interaction data to obtain interaction verification data includes the following steps: Training benchmark samples are selected from the training sample data based on the high-dimensional centroid of the set; Determine all key training nodes of the target neural network model based on the model training parameters; For any key training node, the cross-entropy loss function is used to perform loss gradient analysis on the training benchmark samples and the validation failure samples, and the set of key neurons is constructed based on the loss gradient analysis results. The set of intervention neurons in the training terminal is determined based on the model interaction data, and the neuron consistency rate is calculated by combining the set of intervention neurons and the set of key neurons. The semantic verification data of the training terminal is calculated by combining the graph sequence interaction data and the radius of the failure set; By integrating neuron consistency rate and semantic verification data, interactive verification data of model interaction data is obtained.
[0053] In this embodiment, the high-dimensional centroid of the set is a feature vector in the high-dimensional feature space that represents the entire set of failed samples. It comprehensively reflects the central position of all verified failed samples in the feature space. Based on the high-dimensional centroid of the set, the high-dimensional feature vectors output by the feature extraction layer of the target neural network model are calculated from all training samples with the same true label as the high-dimensional centroid of the set in the training sample data. Several samples with the highest model prediction confidence are selected as training benchmark samples. Model prediction confidence refers to the maximum predicted probability value output by the target neural network model when classifying the training samples. The basis for selecting the samples with the highest prediction confidence as training benchmark samples is that high-confidence samples represent the stable cognition of the target neural network model for that category feature. Using them as a reference benchmark for attribution analysis can more accurately measure the difference in response at the neuron level between verified failed samples and correctly classified samples. The number of training benchmark samples is typically 3 to 5.
[0054] The model training parameters include snapshots of model parameters corresponding to multiple training nodes saved during the training process of the target neural network model. Each training node corresponds to a specific training epoch. Key training nodes refer to several representative training nodes selected from all training nodes, used to capture the parameter states of the target neural network model at different training stages. The training nodes corresponding to the initial training epoch, the training epoch with the fastest decrease in loss function value, and the training epoch with the final convergence can be selected as key training nodes. This is because the initial training epoch reflects the parameter state when the model has not yet fully learned; the epoch with the fastest decrease in loss function value reflects the key stage of the target neural network model rapidly fitting the main features of the training set; and the final convergence epoch reflects the final state of the target neural network model after training. These three together cover the starting point, turning point, and ending point of the target neural network model training process, and can relatively completely depict the evolution trajectory of the model parameters along the training time axis.
[0055] Next, the cross-entropy loss function is used to calculate the baseline loss gradient and failure loss gradient of the training baseline sample and the validation failure sample at each key training node. The baseline loss gradient and failure loss gradient are combined to select all key neurons in the fully connected layer of the target neural network model and integrate them into a key neuron set.
[0056] Model interaction data refers to the complete behavioral records generated by students during practical training when they intervene in the target neural network model. This includes the neuron identifier targeted for each intervention, the specific values of the intervention parameters, and the timestamp of the intervention. All neuron identifiers actually intervened in by the students are extracted from the model interaction data and deduplicated to form the intervention neuron set. The neuron consistency rate is calculated as follows: the neuron consistency rate equals the number of elements in the intersection of the intervention neuron set and the key neuron set, divided by the number of elements in the intervention neuron set. For example, if a student intervenes in 8 different neurons during training, and 6 of them belong to the key neuron set, then the student's neuron consistency rate is 0.75. The neuron consistency rate ranges from 0 to 1. A higher value indicates a higher degree of overlap between the student's selected intervention target and the key causal pathways derived from the system's attribution analysis, reflecting a more accurate understanding of the failure mechanism.
[0057] By combining graph sequence interaction data and the radius of the failure set, semantic verification data for the training end is calculated. This semantic verification data is a multi-dimensional data structure, containing at least neuron consistency rate, semantic direction consistency rate, average pass rate of directional verification, and average reasonableness rate of adjustment amplitude. Integrating the neuron consistency rate and semantic verification data yields the interaction verification data for the model interaction data. Through these steps, the accuracy of students' intervention operations can be effectively quantified, providing a data foundation for their deep understanding of the essence of neural networks.
[0058] In one embodiment, reference is made to Figure 3 The loss gradient analysis of the training benchmark samples and validation failure samples is performed using the cross-entropy loss function, and the key neuron set is constructed based on the loss gradient analysis results, including the following steps: S301. Calculate the sample loss gradients of the training benchmark sample and the validation failure sample for all output neurons in the fully connected layer of the model using the cross-entropy loss function. The fully connected layer of the model is the model layer structure of the target neural network model. The sample loss gradient includes the benchmark loss gradient and the failure loss gradient. S302. Perform a dot product summation on the baseline loss gradient and the failure loss gradient to obtain the neuron influence degree. S303. Calculate the semantic alignment coefficients between all dominant semantic vectors and sample loss gradients using the cosine similarity formula, and calculate the neuron intervention weights of all output neurons by combining the semantic alignment coefficients and neuron influence. S304. Select the set of key neurons from all output neurons based on the neuron intervention weights.
[0059] In this embodiment, for any key training node, the cross-entropy loss function is used to calculate the sample loss gradients of the training benchmark sample and the validation failure sample with respect to all output neurons in the fully connected layer of the model. The fully connected layer refers to the fully connected layer structure in the target neural network model located after the feature extraction layer and before the model classifier, typically the penultimate layer. The feature vector output by this layer highly abstracts the semantic information of the input sample. The sample loss gradient includes the benchmark loss gradient and the failure loss gradient. The benchmark loss gradient is calculated as follows: the training benchmark sample is input into the target neural network model loaded with the model parameters corresponding to the key training node. After obtaining the model output through forward propagation, the loss value is calculated using the cross-entropy loss function. Then, the partial derivative of this loss value with respect to each output neuron in the fully connected layer is calculated using the backpropagation algorithm, thus obtaining the benchmark loss gradient. The failure loss gradient is calculated in the same way, except that the input sample is replaced with a validation failure sample. The magnitude of the gradient value reflects the degree of influence of a small change in the output of the output neuron on the current sample loss value, and the sign of the gradient reflects the direction of the influence. Next, the benchmark loss gradient and the failure loss gradient are summed by a dot product to obtain the neuron's influence. The formula for calculating the influence of a neuron is as follows: in, Indicates the first Output neurons at key training nodes The baseline loss gradient for the training baseline samples. Indicates the first Output neurons at key training nodes The failure loss gradient for the validation failure samples. Key training nodes corresponding to the initial training rounds, The key training node corresponding to the training epoch where the loss function value decreases the fastest. The key training nodes corresponding to the final convergence round. As key training nodes The corresponding learning rate is derived from the actual learning rate values used by each training node, which are stored in the model training parameters.
[0060] The dot product operation reflects a comprehensive measure of the consistency and magnitude of the gradient directions of the training benchmark sample and the validation failure sample on the neuron: if the gradient directions are the same and the magnitudes are both large, the dot product result is a large positive value, indicating that the neuron's response direction to correct and failure samples is consistent during training, and it is a key channel leading to the formation of failure modes; if the gradient directions are opposite or the magnitude of one aspect is very small, the dot product result is small or negative, indicating that the causal relationship between the neuron and the failure mode is weak. The neuron's influence degree is obtained by multiplying the dot product results at each key training node by the corresponding learning rate and summing them.
[0061] The cosine similarity between all dominant semantic vectors and sample loss gradients is calculated using the cosine similarity formula, and then normalized to serve as the semantic alignment coefficient between the dominant semantic vectors and sample loss gradients. A larger absolute value of the semantic alignment coefficient indicates that the gradient direction of the neuron is more consistent with the direction of the dominant semantic vector, meaning that the function of the neuron is more closely related to the feature variation occurring along the dominant semantic vector. If the failure sample set extracts two or more dominant semantic vectors, the one with the larger absolute value is taken as the semantic alignment coefficient for each output neuron. Then, the semantic alignment coefficient and neuron influence are weighted and summed to calculate the neuron intervention weight for all output neurons. Both the semantic alignment coefficient and neuron influence can be set to 0.5. The neuron intervention weight indicates that the output neuron has a high causal contribution to the failure mode of the current failure sample set. All output neurons are arranged in descending order of their neuron intervention weights. A number of neurons with the highest weights are selected to form a key neuron set. For example, the top 10% of output neurons with the highest neuron intervention weights can be selected as the key neuron set. This can cover the main causal channels while avoiding the introduction of too many weakly correlated neurons, thus maintaining the refinement of the key neuron set. The selected key neuron set will be used for subsequent interaction consistency verification as a benchmark for evaluating the accuracy of student intervention behavior.
[0062] In one embodiment, calculating the semantic verification data of the training terminal by combining graph sequence interaction data and the radius of the failure set includes the following steps: For any key neuron in the set of key neurons, the matching semantic vector corresponding to the key neuron is selected from all dominant semantic vectors based on the semantic alignment coefficient; Based on the graph sequence interaction data, the interaction semantic vector of the training terminal is extracted, and the semantic direction consistency rate is obtained by verifying the semantic consistency between the interaction semantic vector and the matching semantic vector. The direction of intervention and regulation of key neurons is determined based on the semantic alignment coefficient. The direction of intervention and regulation is then used to perform directional verification of the interaction regulation parameters in the model interaction data, and the directional verification result is obtained. The adjustment range of the interactive adjustment parameters is verified based on the radius of the failure set corresponding to the matched semantic vector, and the rationality of the adjustment is obtained. All semantic direction consistency rates, directionality verification results, and adjustment rationality are integrated as semantic verification data for the training end.
[0063] In this embodiment, for any key neuron in the key neuron set, a matching semantic vector corresponding to the key neuron is selected from all dominant semantic vectors based on the semantic alignment coefficient. Specifically, for any key neuron, its semantic alignment coefficient for all dominant semantic vectors of the failure sample set is obtained, and the dominant semantic vector with the largest absolute value of the semantic alignment coefficient is taken as the matching semantic vector of the key neuron. The matching semantic vector refers to the dominant semantic vector corresponding to the feature direction with the greatest influence among all causal influences of the key neuron on the current failure sample set. The key neuron can obtain the most significant intervention effect along the dominant semantic vector.
[0064] Then, the interactive semantic vectors of the training terminal are extracted based on the graph sequence interaction data, and the semantic direction consistency rate is obtained by verifying the semantic consistency between the interactive semantic vectors and the matching semantic vectors. Graph sequence interaction data refers to the operation records generated by students participating in the training terminal when viewing the sample residual graph sequence, including which semantic direction the student stayed on the display interface, the proportion of the slider dragged, and the semantic direction view in which the output neuron intervention operation was performed. The front-end interactive interface of the training terminal sets up an independent visualization display area for each dominant semantic vector. When a student enters the exploration view of a certain semantic direction, the semantic direction identifier of that view is recorded as the currently active semantic direction context. When a student operates on the corresponding control of the output neuron within a certain semantic direction view, the currently active semantic direction identifier is read from the interface state manager at the same time as the intervention event is recorded, and it is used as the interactive semantic vector of this intervention operation. If the student does not enter any semantic direction details page during the intervention process, but directly adjusts the neuron parameters in the global neuron topology view, the active semantic direction identifier cannot be directly obtained at the time of intervention. At this point, the semantic direction page identifier where the student last visited before this intervention can be used as the interaction semantic vector for this intervention. For example, if a student first observed within the view of semantic direction C1 for 30 seconds, then switched to the global neuron topology view and directly adjusted a neuron, C1 can be used as the interaction semantic vector for this intervention. If the student never entered any semantic direction display page during the entire training process, or if any semantic direction selection record cannot be traced due to system malfunction, the interaction semantic vector identifier for this intervention will be recorded as "null," and the corresponding semantic direction selection consistency identifier will be directly recorded as 0. Furthermore, in the final evaluation report, this operation will be marked as "missing semantic context," indicating that the student lacked a clear semantic observation dimension reference during the intervention.
[0065] For a given intervention, if its interaction semantic vector matches the matching semantic vector of the key neuron being intervened in, the intervention is considered to have passed the semantic consistency check, and the semantic direction consistency flag is set to 1; otherwise, it is set to 0. For all interventions in a set of failed samples, the semantic direction consistency rate is calculated as follows: the semantic direction consistency rate equals the number of interventions that passed the semantic consistency check, divided by the total number of interventions in that set of failed samples. The semantic direction consistency rate is an important indicator for students diagnosing the rigor of their logic.
[0066] Next, the intervention direction of the key neuron is determined based on the semantic alignment coefficient. The directionality of the interaction adjustment parameters in the model interaction data is then verified based on this direction, yielding the directionality verification result. The sign of the semantic alignment coefficient contains directional information: a positive semantic alignment coefficient indicates that when the feature vector is moved along the positive direction of the matching semantic vector, the activation change direction of the key neuron is consistent with the loss decrease direction; the correct intervention direction should be positive adjustment, i.e., the interaction adjustment parameter should be positive. Conversely, a negative semantic alignment coefficient indicates that when the feature vector is moved along the negative direction of the matching semantic vector, it is consistent with the loss decrease direction; the correct intervention direction should be negative adjustment, i.e., the interaction adjustment parameter should be negative.
[0067] The interaction regulation parameters of the key neuron by the student are extracted from the model interaction data, and their signs are compared with the semantic alignment coefficient. If the signs of the interaction regulation parameters and the semantic alignment coefficient are both positive or both negative, the intervention is considered to have passed the directionality check, and the directionality check result is set to 1; if the signs are opposite or the interaction regulation parameters are 0, the directionality check is considered to have failed, and the directionality check result is set to 0. The directionality check result reflects whether the student understands the regulatory polarity of the neuron along the semantic direction, that is, whether they know whether they should increase or decrease the output of the neuron to repair sample failure.
[0068] Then, the adjustment range of the interaction adjustment parameters is verified based on the radius of the failure set corresponding to the matched semantic vector, thus obtaining the adjustment rationality. The radius of the failure set quantifies the distribution range of the failure sample set in the feature space and can be used as a reference boundary to judge whether the intervention adjustment range is too large. The specific method of adjustment range verification is as follows: the absolute value of the student's interaction adjustment parameter for the key neuron is compared with the radius of the failure set. If the absolute value of the interaction adjustment parameter is less than or equal to the radius of the failure set, the adjustment range of the intervention is determined to be within a reasonable range, and the adjustment rationality value is 1; if the absolute value of the interaction adjustment parameter is greater than the radius of the failure set, the adjustment range is determined to be too large, which may cause the feature vector to deviate from the actual distribution area of the failure sample set and enter the feature space area that the model has not fully learned, and the adjustment rationality value is 0. The adjustment rationality reflects the student's ability to control the adjustment intensity when applying intervention, avoiding unreliable simulation results due to excessive adjustment range.
[0069] Finally, all semantic direction consistency rates, directionality verification results, and modulation rationality are integrated as semantic verification data for the training end. For a given set of failed samples, the semantic direction consistency rate is a scalar value between 0 and 1, the directionality verification result is the average of the directionality verification results of all intervention operations, and the modulation rationality is the average of the modulation rationality of all intervention operations. These three indicators are summarized and integrated with the neuron consistency rate to obtain the interaction verification data for the model interaction data corresponding to that set of failed samples. Through these steps, objective and multi-dimensional training evaluation criteria are provided for the quality of students' intervention operations.
[0070] In one embodiment, constructing the training knowledge graph by combining all failure sample parameters, graph sequence interaction data, and interaction verification data includes the following steps: For any set of failure samples, the set of failure samples is taken as a failure phenomenon node, and the phenomenon node attributes of the failure phenomenon node are determined by combining the failure sample parameters and neural network training data. The dominant semantic vectors corresponding to the set of failed samples are used to construct semantic direction nodes, and the direction node attributes of the semantic direction nodes are determined by combining the failure feature values and the sample residual map sequence. The key neuron set corresponding to the set of failed samples is taken as the neuron node, and the meta-node attributes of the neuron node are determined based on the loss gradient analysis results. Student interaction nodes are constructed by combining graph sequence interaction data and interaction verification data, and the interaction verification data is used as the interaction node attribute of the student interaction nodes; Traverse all failure phenomenon nodes, semantic direction nodes, neuron nodes and student interaction nodes to construct directed edges of nodes and obtain the initial training graph. Visualize and render the initial training map to output a training knowledge map.
[0071] In this embodiment, for any set of failed samples, the set of failed samples is taken as a failure phenomenon node. The phenomenon node attributes of the failure phenomenon node are determined by combining the failed sample parameters and neural network training data. A failure phenomenon node is a node type in the training knowledge graph that reflects a macroscopic failure mode exhibited by the target neural network model in a specific semantic region. The phenomenon node attributes of a failure phenomenon node include: the total number of verified failed samples within the failed sample set, the main misclassified category pairs (i.e., the combination of the true category label and the incorrectly predicted category label), the core formation period, the sample feature drift sequence, and the Jaccard similarity sequence. These attributes together constitute a complete characterization of the failure mode's distribution in the feature space, label confusion patterns, and training evolution trajectory.
[0072] The dominant semantic vector corresponding to the failure sample set is used to construct semantic direction nodes, and the direction node attributes of the semantic direction nodes are determined by combining the failure feature values and the sample residual map sequence. For each failure sample set, its dominant semantic vector is instantiated as an independent semantic direction node. If two dominant semantic vectors are extracted from a failure sample set, two semantic direction nodes are generated, and the node identifier adopts the combination of "failure sample set identifier - axis number". The direction node attributes of the semantic direction node include: the directional unit vector of the dominant semantic vector, the proportion of the failure feature value corresponding to the dominant semantic vector to the sum of all failure feature values, the endpoint image identifiers corresponding to the positive and negative critical feature vectors detected along the positive and negative directions of the dominant semantic vector, and the storage path of its corresponding sample residual map sequence in the central server storage system.
[0073] Then, the key neuron sets corresponding to the failed sample sets are used as neuron nodes, and the meta-node attributes of the neuron nodes are determined based on the loss gradient analysis results. For each failed sample set, each output neuron within the key neuron set is treated as an independent neuron node. If the same neuron appears in the key neuron sets of multiple failed sample sets, an independent neuron node is established for each failed sample set to ensure the integrity of the causal chain within each failed sample set. The node identifier of the neuron node adopts a combination of "failed sample set identifier - neuron index". The meta-node attributes of the neuron node include: neuron intervention weight, semantic alignment coefficient for each dominant semantic vector, and the dominant semantic vector identifier of the neuron, i.e., the axis number corresponding to the dominant semantic vector with the largest absolute value of the semantic alignment coefficient. These attributes quantify the causal contribution of the key neuron to the current failed sample set and its correlation strength with each semantic variation direction.
[0074] Next, student interaction nodes are constructed by combining graph sequence interaction data and interaction verification data, with the interaction verification data serving as the interaction node attribute of each student interaction node. Each student interaction node represents a valid intervention operation performed by a student participating in the training. Records of each intervention operation are extracted from the collected graph sequence interaction data and model interaction data, and each intervention operation is assigned a globally incrementing operation sequence number as a node identifier. The interaction node attributes of each student interaction node include: the timestamp of the intervention operation, the identifier of the set of failed samples targeted, the identifier of the currently activated interaction semantic vector when the intervention operation is performed, the index of the intervened neuron, the intervention adjustment parameters, and the interaction verification data. Student interaction nodes are a crucial data hub connecting the static analysis results of the target neural network model with the dynamic cognitive behavior of the students in the training.
[0075] Next, all failure phenomenon nodes, semantic direction nodes, neuron nodes, and student interaction nodes are traversed to construct directed edges, resulting in the initial training graph. Directed edges represent the logical connections or causal relationships between different types of nodes, and include the following five types of directed edges. The first type is the phenomenon-semantic direction edge, which is a directed edge from the failure phenomenon node to the semantic direction nodes corresponding to the failure sample set, indicating that the failure mode can be decomposed into continuous feature variations along the semantic direction. The edge weight is set to the proportion of the explained variance corresponding to the semantic direction; a higher proportion of explained variance indicates a stronger ability of the axis to describe the variations within the failure sample set. The proportion of explained variance refers to the proportion of the failure feature value corresponding to the dominant semantic vector to the sum of all failure feature values. The second type is the semantic direction-neuron edge, which is a directed edge from the semantic direction node to the key neuron node, indicating that the feature changes in the semantic direction are mainly controlled by the key neuron. The conditions for establishing this edge are: the dominant semantic vector identifier of the key neuron is consistent with that of the semantic direction node, and the absolute value of the semantic alignment coefficient of the neuron for that semantic direction is greater than a preset threshold, such as 0.4. The third type is the neuron-phenomenon edge, which is a directed edge from a key neuron node to a failure phenomenon node, indicating that the key neuron has a significant causal contribution to the current failure mode. The edge weight is set as the neuron intervention weight of that neuron; the higher the neuron intervention weight, the stronger the causal relationship. The above three types of directed edges together form a closed-loop causal link of "failure phenomenon node → semantic direction node → neuron node → failure phenomenon node", which is the core structure for causal reasoning in the training knowledge graph. The fourth type is the student operation association edge, which includes three sub-type edges: operation-family edge, which is a directed edge from a student interaction node to a failure phenomenon node, indicating that the intervention operation is aimed at the failure sample set; operation-semantic direction edge, which is a directed edge from a student interaction node to a semantic direction node, indicating that the intervention operation is performed in the observation context of the semantic direction. If the semantic direction is not explicitly selected during the operation, this edge is not established; operation-neuron edge, which is a directed edge from a student interaction node to a neuron node, indicating that the intervention operation modulates the neuron. The edge attributes record the intervention and modulation parameters and various interaction consistency identifiers. The fifth type is the operation sequence temporal edge, which is a directed edge established between different student interaction nodes according to the order of operation timestamps, with the direction pointing from the earlier operation to the later operation, forming a complete operation sequence chain. This edge enables the training knowledge graph to preserve the temporal dependencies of the student exploration process.
[0076] After constructing the nodes and directed edges, an initial training graph is obtained. The central server then visualizes and renders this initial training graph, outputting a training knowledge graph. For example, failure phenomenon nodes are represented by red circles, with the node size positively correlated with the number of verified failure samples in the failure sample set; the more samples, the larger the node radius. Semantic direction nodes are represented by blue diamonds; neuron nodes are represented by green squares, with the node size positively correlated with the neuron's intervention weight; the higher the weight, the larger the node. Student interaction nodes are represented by small gray circles. The visualization rules for directed edges are as follows: phenomenon-semantic direction edges, semantic direction-neuron edges, and neuron-phenomenon edges are drawn with solid arrows, and the line width is positively correlated with the edge weight; student operation association edges are drawn with dashed lines; and operation sequence temporal edges are drawn with thin gray solid lines. The final output training knowledge graph is transmitted to the training terminal in an interactive vector graphics format. Students can click on each node to expand and view its complete attribute information, and use zoom and drag operations to examine the graph structure at different granularities. The practical training knowledge graph visually presents the complete cognitive path of each student participating in the training, from observing failure phenomena, exploring semantic directions, locating key neurons, to performing intervention operations and undergoing consistency verification.
[0077] In one embodiment, determining the phenomenon node attributes of a failure phenomenon node by combining failure sample parameters and neural network training data includes the following steps: For any key training node, extract the training node model parameters corresponding to the key training node from the model training parameters, and load the training node model according to the training node model parameters. The high-dimensional centroid of the set of parameters of the failed samples is input into the training node model for forward propagation, and the sample historical feature vector is output through the fully connected layer of the training node model. Calculate the vector similarity between all historical feature vectors of the samples, and construct the sample feature drift sequence based on the vector similarity; The gradient attribution method is used to calculate the attribution contribution distribution of the set of failure samples to all output neurons, and the attribution neuron set is selected from all output neurons based on the attribution contribution distribution. Calculate the Jaccard similarity of the attribution neuron sets between adjacent key training nodes, and combine the Jaccard similarity and sample feature drift sequence to calculate the node mutation degree of key training nodes; The core formation period of the failed sample set is determined based on the node mutation degree, and the core formation period, sample feature drift sequence, and Jaccard similarity are used as the phenomenon node attributes of the failed phenomenon nodes.
[0078] In this embodiment, for any key training node, the training node model parameters corresponding to that key training node are extracted from the model training parameters, and the training node model is loaded based on these parameters. Key training nodes mainly include the initial training round, the training round with the fastest decrease in loss function value, and the final convergence round. The model training parameters store the complete model weight parameters for each key training node. These parameters are read sequentially by the central server according to the time order of the key training nodes and loaded into the inference engine to recover the target neural network model instance corresponding to the training stage, i.e., the training node model. Using the high-dimensional centroid of the set as input, a forward propagation operation is performed on the loaded training node model to extract the high-dimensional feature vector output from the fully connected layer of the model in that training node model. This high-dimensional feature vector is used as the sample history feature vector of the failed sample set at that key training node. After traversing all key training nodes, a sequence of sample history feature vectors arranged in order of training rounds is obtained. The vector similarity between all historical feature vectors of all samples can be calculated using the cosine similarity formula. A smaller vector similarity indicates that the historical feature vectors of the two samples are more aligned in direction, meaning the feature representation of the failed sample set changes less within the training interval. A larger vector similarity indicates a significant shift in feature representation. To eliminate the influence of feature scale changes during training, the vector similarity between adjacent key training nodes is divided by the training epoch interval between the two key training nodes to obtain the feature drift rate for that interval. The feature drift rate sequence is the sequence of sample feature drifts along the training time axis for the failed sample set, quantifying the severity of the spatial displacement of the failure mode at different training stages.
[0079] Next, for each key training node, using the model at that training node as the computational vehicle, gradient attribution methods are employed. For example, integral gradient or input multiplication gradient methods are used to calculate the attribution contribution score of the set's high-dimensional centroid to all output neurons in the fully connected layer of the model. Each output neuron receives an attribution contribution score; a higher score indicates a greater contribution of that neuron to the feature representation of the failed sample set in the current training stage. Taking the integral gradient method as an example, the core idea is to perform linear interpolation between a non-informative reference input, such as a zero vector, and the actual input sample, i.e., the set's high-dimensional centroid. Gradients are accumulated along the interpolation path to obtain the attribution score of each set's high-dimensional centroid to the output neuron. The calculation formula is as follows: in, For the first The actual output value of each output neuron when the input is the high-dimensional centroid of the set. For the first The reference output value of each output neuron with the reference input; this value is 0 when the reference input is a zero vector. (Integral sign) Indicates the interpolation coefficients The accumulation of gradients from 0 to 1. Represents the classification score function For the first on the path Each output neuron outputs The partial derivative of is the gradient of the output neuron at the current interpolation point, where the classification score function is... This refers to the classification score of a target neural network model for a classification task, where the model scores the true label class corresponding to the centroid of the set in high dimension. In other words, it represents the logistic value of the classifier before Softmax normalization, and the interpolation coefficients are used. This refers to taking multiple equally spaced values in the range of 0-1 using a discretization method to approximate a continuous integral path. This indicates that the target neural network model has interpolation coefficients of . At that time, the classification score function value is given for the true label category corresponding to the high-dimensional centroid of the set. Indicates the interpolation coefficients are At that time, the neuron output vector output by the fully connected layer of the model is obtained by linear interpolation between the reference input vector and the actual input vector.
[0080] After calculating the attribution contribution scores of all output neurons, all neurons are arranged in descending order of their absolute attribution contribution scores. The larger the absolute value of the attribution contribution score, the more significant the neuron's contribution to the feature expression of the set of failed samples in the current training stage. A predetermined proportion of the output neurons, such as the top 10%, are selected to form the attribution neuron set corresponding to this key training node.
[0081] Next, the Jaccard similarity of the attribution neuron sets between adjacent key training nodes is calculated. The formula for calculating the Jaccard similarity is as follows: Among them, molecules Indicates the first a set of attribution neurons With the a set of attribution neurons The number of output neurons contained in the intersection of the denominator Indicates the first a set of attribution neurons With the a set of attribution neurons The number of output neurons contained in the union of the two sets of attribution neurons is Jaccard similarity. The value ranges from 0 to 1. The larger the value, the higher the degree of overlap between the attribution neuron sets of two adjacent training stages, that is, the more stable the model's internal attribution logic for the set of failed samples. The smaller the value, the more significant the reorganization of the attribution structure, and the neurons that originally played a dominant role were replaced by other neurons.
[0082] Next, the sample feature drift sequence and Jaccard similarity sequence are normalized respectively. Combining the normalized feature drift rate and the normalized Jaccard similarity, the node mutation degree between each adjacent key training node interval is calculated. The formula for calculating the node mutation degree is as follows: in, The weighting coefficient is set to a value between 0 and 1, with a default value of 0.5, indicating that the contributions of the two dimensions are equally important. Indicates the normalized i-th The feature drift rate of each training interval reflects the drastic degree of change in the feature spatial location. For the normalized first The Jaccard similarity of each training interval reflects the stability of the attribution structure, where a training interval refers to the interval of training rounds between two adjacent key training nodes.
[0083] The greater the node mutation degree, the more significant the spatial shift in the feature representation of the failure sample set within the training interval, and the more drastic the reorganization of its internal attribution structure. This training interval is more likely to be a critical turning point in the formation of the failure mode. The training interval with the highest node mutation degree is then marked as the core formation period of the failure sample set, and the core formation period, sample feature drift sequence, and Jaccard similarity are used as the phenomenon node attributes of the failure phenomenon node. These attribute data can be visualized in the training environment by expanding the time-series panel of the failure phenomenon node. The visualization, presented as a line graph overlaid with event markers, visually demonstrates the feature drift and attribution reconstruction process of the failure sample set during training, providing data support for students to understand the root causes of failure modes from a training dynamic perspective.
[0084] This application also provides a machine-readable storage medium storing instructions that cause a machine to execute the visualization method for neural network training according to any one of the above embodiments.
[0085] This application also provides a visualization device for neural network training, comprising: The memory is configured to store instructions; and The processor is configured to retrieve the instructions from the memory and, when executing the instructions, to implement the visualization method for neural network training as described above.
[0086] The processor can be a central processing unit (CPU). Of course, depending on the actual use, it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc., and this application does not limit it.
[0087] The memory can be an internal storage unit of a computer device, such as a hard disk or RAM, or an external storage device, such as a plug-in hard disk, smart memory card (SMC), secure digital card (SD), or flash memory card (FC) provided on the computer device. Furthermore, the memory can be a combination of internal storage units and external storage devices of a computer device. The memory is used to store computer programs and other programs and data required by the computer device. The memory can also be used to temporarily store data that has been output or will be output. This application does not limit this.
[0088] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0089] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, 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 instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0090] 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.
[0091] 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.
[0092] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0093] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0094] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0095] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0096] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A visualization method for neural network training, characterized in that, The method, applied to a neural network training platform comprising a training terminal and a central server, includes the following steps: The central server collects neural network verification data and neural network training data of the target neural network model in real time, and filters out all verification failure samples and corresponding failure sample characteristics in the neural network verification data. Based on the characteristics of the failure samples, construct the failure sample set and corresponding failure feature vector of all verified failure samples respectively, and calculate the dominant semantic vector of all failure sample sets based on the failure feature vector; Based on the dominant semantic vector and using a pre-trained image generator, all validation failure samples are visualized to obtain a sequence of sample residual maps; The sample residual map sequence is transmitted to the training terminal through the central server, and the graph sequence interaction data of the sample residual map sequence and the model interaction data of the target neural network model are collected from the training terminal. Based on the neural network training data and using the backpropagation algorithm, the loss analysis of the failed samples was completed. Based on the loss analysis results and the graph sequence interaction data, the interaction consistency verification of the model interaction data was completed, and the interaction verification data was obtained. Repeat the above steps until the training terminal outputs a training end signal, and collect the failure sample parameters of the training terminal in real time through the central server; A training knowledge graph is constructed by combining all failure sample parameters, graph sequence interaction data, and interaction verification data, and then transmitted to the training terminal for visualization display through the central server.
2. The method according to claim 1, characterized in that, The steps of constructing a failure sample set and a corresponding failure feature vector for all verified failure samples based on the failure sample characteristics, and calculating the dominant semantic vector for all failure sample sets based on the failure feature vectors, include the following: All verification failure samples are projected onto a two-dimensional canvas coordinate system using a nonlinear dimensionality reduction algorithm to obtain the verification failure point cloud; Based on the characteristics of the failure samples, clustering algorithms are used to cluster the sample features of all verified failure point clouds, resulting in multiple failure sample sets. For any set of failure samples, the failure set metadata is calculated based on the two-dimensional canvas coordinate system and the failure sample features. The failure set metadata includes the two-dimensional centroid of the set, the high-dimensional centroid of the set, the failure set radius, and the set failure label. Based on the characteristics of the failed samples, a failure feature vector of the failed sample set is constructed, and the failure feature vector is decentered based on the high-dimensional centroid of the set. Based on the decentering result, a failure feature matrix is constructed. Based on the failure feature matrix, several dominant semantic vectors of the failure sample set are selected from all failure feature vectors using the eigenvalue decomposition algorithm.
3. The method according to claim 2, characterized in that, The process of visualizing all validation failure samples based on dominant semantic vectors and utilizing a pre-trained image generator to obtain a sequence of sample residual maps includes the following steps: For any dominant semantic vector, starting from the high-dimensional centroid of the set, the failure feature vector is moved along the positive and negative semantic directions of the dominant semantic vector with a fixed step size, until the failure feature vector touches the decision boundary of the model classifier, and the critical feature vector is output. Here, the model classifier is the model classification layer of the target neural network model, and the critical feature vector includes positive critical feature vector and negative critical feature vector. The failure feature vector and critical feature vector are sequentially input into a pre-trained image generator to obtain failure sample images, which include the original failure image, the positive end failure image, and the negative end failure image. Calculate the absolute pixel difference between the original failure image and the positive end failure image and the negative end failure image respectively, and generate the sample residual image based on the absolute pixel difference; The interpolation algorithm is used to generate a sequence of sample residual maps for all sample residual images.
4. The method according to claim 2, characterized in that, The neural network training data includes training sample data and model training parameters. The steps involved using the neural network training data and backpropagation algorithm to perform loss analysis on the failed samples, and then using the loss analysis results and graph sequence interaction data to perform interaction consistency verification of the model interaction data, resulting in interaction verification data. These steps include: Training benchmark samples are selected from the training sample data based on the high-dimensional centroid of the set; Determine all key training nodes of the target neural network model based on the model training parameters; For any key training node, the cross-entropy loss function is used to perform loss gradient analysis on the training benchmark samples and the validation failure samples, and the set of key neurons is constructed based on the loss gradient analysis results. The set of intervention neurons in the training terminal is determined based on the model interaction data, and the neuron consistency rate is calculated by combining the set of intervention neurons and the set of key neurons. The semantic verification data of the training terminal is calculated by combining the graph sequence interaction data and the radius of the failure set; By integrating neuron consistency rate and semantic verification data, interactive verification data of model interaction data is obtained.
5. The method according to claim 4, characterized in that, The process of using the cross-entropy loss function to perform loss gradient analysis on the training benchmark samples and validation failure samples, and constructing a set of key neurons based on the loss gradient analysis results, includes the following steps: The cross-entropy loss function is used to calculate the sample loss gradients of the training benchmark sample and the validation failure sample for all output neurons in the fully connected layer of the model. The fully connected layer of the model is the model layer structure of the target neural network model, and the sample loss gradient includes the benchmark loss gradient and the failure loss gradient. The influence degree of the neuron is obtained by summing the dot product of the baseline loss gradient and the failure loss gradient. The semantic alignment coefficients between all dominant semantic vectors and sample loss gradients are calculated using the cosine similarity formula. The neuron intervention weights of all output neurons are then calculated by combining the semantic alignment coefficients and neuron influence. The key neuron set is selected from all output neurons based on the neuron intervention weights.
6. The method according to claim 5, characterized in that, The process of calculating the semantic verification data for the training end by combining the graph sequence interaction data and the radius of the failure set includes the following steps: For any key neuron in the set of key neurons, the matching semantic vector corresponding to the key neuron is selected from all dominant semantic vectors based on the semantic alignment coefficient; Based on the graph sequence interaction data, the interaction semantic vector of the training terminal is extracted, and the semantic direction consistency rate is obtained by verifying the semantic consistency between the interaction semantic vector and the matching semantic vector. The direction of intervention and regulation of key neurons is determined based on the semantic alignment coefficient. The direction of intervention and regulation is then used to perform directional verification of the interaction regulation parameters in the model interaction data, and the directional verification result is obtained. The adjustment range of the interactive adjustment parameters is verified based on the radius of the failure set corresponding to the matched semantic vector, and the rationality of the adjustment is obtained. All semantic direction consistency rates, directionality verification results, and adjustment rationality are integrated as semantic verification data for the training end.
7. The method according to claim 4, characterized in that, The process of constructing the training knowledge graph by combining all failure sample parameters, graph sequence interaction data, and interaction verification data includes the following steps: For any set of failure samples, the set of failure samples is taken as a failure phenomenon node, and the phenomenon node attributes of the failure phenomenon node are determined by combining the failure sample parameters and neural network training data. The dominant semantic vectors corresponding to the set of failed samples are used to construct semantic direction nodes, and the direction node attributes of the semantic direction nodes are determined by combining the failure feature values and the sample residual map sequence. The key neuron set corresponding to the set of failed samples is taken as the neuron node, and the meta-node attributes of the neuron node are determined based on the loss gradient analysis results. Student interaction nodes are constructed by combining graph sequence interaction data and interaction verification data, and the interaction verification data is used as the interaction node attribute of the student interaction nodes; Traverse all failure phenomenon nodes, semantic direction nodes, neuron nodes and student interaction nodes to construct directed edges of nodes and obtain the initial training graph. Visualize and render the initial training map to output a training knowledge map.
8. The method according to claim 7, characterized in that, The process of determining the phenomenon node attributes of failure phenomenon nodes by combining failure sample parameters and neural network training data includes the following steps: For any key training node, extract the training node model parameters corresponding to the key training node from the model training parameters, and load the training node model according to the training node model parameters. The high-dimensional centroid of the set of parameters of the failed samples is input into the training node model for forward propagation, and the sample historical feature vector is output through the fully connected layer of the training node model. Calculate the vector similarity between all historical feature vectors of the samples, and construct the sample feature drift sequence based on the vector similarity; The gradient attribution method is used to calculate the attribution contribution distribution of the set of failure samples to all output neurons, and the attribution neuron set is selected from all output neurons based on the attribution contribution distribution. Calculate the Jaccard similarity of the attribution neuron sets between adjacent key training nodes, and combine the Jaccard similarity and sample feature drift sequence to calculate the node mutation degree of key training nodes; The core formation period of the failed sample set is determined based on the node mutation degree, and the core formation period, sample feature drift sequence, and Jaccard similarity are used as the phenomenon node attributes of the failed phenomenon nodes.
9. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores instructions for causing the machine to execute the visualization method for neural network training according to any one of claims 1 to 8.
10. A visualization device for neural network training, characterized in that, include: The memory is configured to store instructions; as well as A processor is configured to retrieve the instructions from the memory and, when executing the instructions, to implement the visualization method for neural network training according to any one of claims 1 to 8.