Questionnaire data analysis method based on feature fingerprints

Through the Vision Transformer model and the improved K-nearest neighbor algorithm, combined with data ablation technology, the problems of insufficient feature representation and low classification accuracy in questionnaire analysis are solved, efficient feature extraction and key problem identification are achieved, and the interpretability of questionnaire analysis is enhanced.

CN120340073APending Publication Date: 2025-07-18HUBEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510444817.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The existing questionnaire analysis methods are difficult to quantify the contribution of a single problem to the overall results in insufficient feature representation ability, low classification accuracy and lack of interpretability, especially when dealing with high-dimensional, sparse or unbalanced questionnaire data, resulting in inefficient identification of key influencing factors.

Method used

The Vision Transformer model is used to extract the feature fingerprint of the questionnaire data from the multi-layer encoder layer, and combined with the improved K-nearest neighbor algorithm, the feature information is blocked one by one through data ablation technology to quantify the impact of specific problems on classification results.

Benefits of technology

The feature characterization ability and classification accuracy of the questionnaire data are improved, key problems are accurately identified, the interpretability of questionnaire analysis is enhanced, and the impact of non-critical problems on the results is quantified.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120340073A_ABST
    Figure CN120340073A_ABST
Patent Text Reader

Abstract

The invention discloses a questionnaire data analysis method based on feature fingerprints, and the method comprises the steps: collecting filled questionnaire data samples, generating questionnaire data vectors, carrying out the matrix expansion, generating a questionnaire data set, and dividing the questionnaire data set into a training set and a test set; extracting features through a plurality of encoder layers of the model to obtain a decoder feature matrix so as to obtain feature fingerprints corresponding to the training set and the test set respectively; performing K-nearest neighbor calculation on the feature fingerprints of the test set data and the training set data to obtain a classification category of the test set data, and calculating first classification precision; shielding a certain selected feature information of test set data through data ablation, carrying out K-nearest neighbor calculation on a new test set questionnaire fingerprint and an original training set questionnaire fingerprint, obtaining a category to which a new test set belongs through weighted voting, calculating second classification precision, and carrying out K-nearest neighbor calculation on the first classification precision and the second classification precision; and obtaining the importance degree of the shielded feature information to the questionnaire result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data analysis, and in particular, to a method and system for questionnaire data analysis based on feature fingerprints, an electronic device, and a storage medium. Background Art

[0002] Questionnaire data analysis is an important basis for social science research and business decision-making. Its goal is to extract effective information from multi-dimensional issues such as user feedback and behavior preferences to support classification, attribution, or prediction tasks in a certain analysis objective.

[0003] Traditional questionnaire analysis methods mainly rely on manual statistics (such as frequency analysis, cross-validation) or shallow machine learning models (such as logistic regression, decision trees, etc.). These analysis methods have many limitations. For example, the feature representation ability is insufficient, and the manually designed statistical indicators are difficult to capture the complex correlations between questionnaire questions, especially the non-linear relationships of high-dimensional data; at the same time, the generalization ability is limited; and the shallow model is highly sensitive to the data distribution. When facing large-scale, sparse, or unbalanced questionnaire data, it is easy to have overfitting problems, resulting in an interpretability bottleneck.

[0004] Therefore, existing methods are difficult to quantify the contribution of a single question to the overall result, resulting in low efficiency in identifying key influencing factors.

[0005] In recent years, deep learning technology has provided new ideas for questionnaire analysis, such as feature extraction methods based on convolutional neural networks (CNNs). However, the local receptive field characteristics of CNNs make them more suitable for image data and have insufficient global semantic association modeling ability for structured or semi-structured data such as questionnaires. The Vision Transformer (ViT) model realizes global dependence modeling of input data through the self-attention mechanism and shows significant advantages in image classification tasks. However, its application in non-image data still has technical gaps. One is the data adaptation problem. Questionnaire data usually exists in the form of vectors or tables, which is not compatible with the image input format (such as a 224×224×3 matrix) of the ViT model, and specific data encoding and extension methods need to be designed; there is also a feature compression bottleneck. Traditional ViT directly uses classification tokens as output features, which may lose the interaction information between fine-grained questions and reduce the representation ability of fingerprints.

[0006] In addition, existing classification methods based on K-nearest neighbor (KNN) mostly rely on distance calculation in the original feature space and do not combine deep feature abstraction technology, resulting in sensitivity to noise and limited classification accuracy.

[0007] Therefore, there is an urgent need for an analysis method that integrates the efficient feature extraction ability of the ViT model and adapts to the structured characteristics of questionnaire data. Summary of the Invention

[0008] One of the objectives of the embodiments of the present invention is to address the deficiencies of the above-mentioned existing technologies, and propose a method for analyzing questionnaire data based on feature fingerprints, which improves the feature representation ability of questionnaire data, improves the classification accuracy, accurately identifies key questions, and at the same time shields the influence of non-key questions on the questionnaire analysis results, and improves the interpretability of the questionnaire analysis results.

[0009] To solve the above technical problems, on the first aspect, the present invention provides a method for analyzing questionnaire data based on feature fingerprints, and the method includes:

[0010] Collect the filled questionnaire data samples, generate questionnaire data vectors, expand the questionnaire data vectors into a matrix to generate a questionnaire data set, and divide the questionnaire data set into a training set and a test set of the questionnaire data;

[0011] Input the data matrix of the training set into the Vision Transformer model for training, extract features through multiple encoder layers of the model to obtain a decoder feature matrix, and convert the obtained decoder feature matrix into a one-dimensional vector to obtain the feature fingerprints of the training set;

[0012] Input the data matrix of the test set into the same Vision Transformer model, extract the feature fingerprints of the test set, perform K-nearest neighbor calculation on the feature fingerprints of the test set and the feature fingerprints of the training set data, obtain the classification category of the test set data, and calculate the first classification accuracy Acc full ;

[0013] By data ablation, shield the feature information of the test set data one by one, perform K-nearest neighbor calculation on the obtained new test set feature fingerprints and the feature fingerprints of the original training set data set, obtain the category to which the test set data with data ablation belongs through weighted voting, and calculate the second classification accuracy

[0014] Compare Acc full with to obtain the importance degree of the shielded feature information to the questionnaire results.

[0015] Preferably, the generation of the questionnaire data vectors and the expansion of the questionnaire data vectors into a matrix to generate a questionnaire data set specifically include:

[0016] First, encode the questionnaire data into a 1×n-dimensional vector, where n is the total number of questionnaire questions;

[0017] Copy the feature vector k row times along the row dimension, and the formula is:

[0018] G row= Repeat(V, k row ), where k row is the floor of 224 divided by n;

[0019] For the remaining number of rows r row = 224 mod n, pad it with zeros to make it up;

[0020] Copy the extended row vector along the column dimension to 224 columns, the formula is: G col = Repeat(G row , 224);

[0021] Copy it three times along the channel dimension to generate an RGB format matrix of 224×224×3, the formula is: G = Repeat(G col , 3).

[0022] Preferably, input the training set matrix into the Vision Transformer model, extract features through multiple encoder layers, and generate feature fingerprints specifically including:

[0023] The Vision Transformer model contains L encoder layers, each layer includes a multi-head self-attention mechanism and a feed-forward neural network;

[0024] For a given input matrix X, the formula of the multi-head self-attention mechanism is:

[0025] MHSA(X) = Concat(head1, …, head h )W O ;

[0026] Where is the j-th attention head, h is the number of heads; Q = XWQ, K = XWK, V = XWV are the query Query, key Key, and value Value matrices respectively;

[0027] WQ, WK, WV are the corresponding weight matrices; WO is the output weight matrix;

[0028] In feature extraction, the feed-forward neural network multi-layer perceptron contains two linear layers and an activation function:

[0029] MLP(X) = max(0, XW1 + b1)W2 + b2;

[0030] Where W1, W2 are weight matrices; b1, b2 are bias terms; max(0,.) is the ReLU activation function;

[0031] Each encoder layer also contains a residual connection and a layer normalization operation, and the operation formula is as follows:

[0032] EncoderLayer(X) = LayerNorm(X + MHSA(X));

[0033] EncoderLayer(X) = LayerNorm(EncoderLayer(X) + MLP(EncoderLayer(X)));

[0034] And the entire encoder is composed of multiple stacked layers as follows:

[0035] X output = Encoder(X input ) = EncoderLayer L (EncoderLayer L-1 (…EncoderLayer1(X input ))…));

[0036] Where L is the number of encoder layers, and the output Xoutput of the encoder is the decoder feature matrix, and the decoder feature matrix is the feature fingerprint of the questionnaire data.

[0037] Preferably, the specific steps of performing K-nearest neighbor calculation on the feature fingerprint of the test set and the feature fingerprint of the training set data to obtain the classification category of the test set data include:

[0038] The Euclidean distance calculation formula between the test set feature fingerprint y and the training set feature fingerprint xi is:

[0039]

[0040] Sort the distances from smallest to largest, select the K nearest training set samples, use the weighted voting method, assign a weight to each nearest neighbor sample, where the weight is set to the reciprocal of the distance, calculate the weighted votes for each category, and divide the feature fingerprint in the test set into the category with the most weighted votes.

[0041] Preferably, the specific steps of gradually masking the selected feature information of the test set data through data ablation include:

[0042] By masking each feature item by item, evaluate the impact of each feature on the classification result separately;

[0043] For each question j, define the mask vector M j ∈ {0, 1} n , and the masking mask vector M j is also a 1*n vector, where only the j-th bit is 0 and the rest are 1;

[0044] Use element-wise multiplication to implement the masking process:

[0045] V′ = V ⊙ M j ;

[0046] Among them, V represents a 1*n vector of the feature vectors of the questionnaire data test set, V′ is the vector after masking a selected feature information, and ⊙ represents element-wise multiplication.

[0047] Preferably, the comparison between Acc full and is carried out to obtain the specific maximum influencing factors for the final result of the questionnaire, including:

[0048] According to the first classification accuracy and the second classification accuracy, the importance score of the masked information is inferred. The calculation formula for the importance score of the masked information is:

[0049]

[0050] Among them, Acc full is the full-feature classification accuracy, is the accuracy after masking the j-th feature, and the importance score FX j reflects the influence degree of the j-th feature on the classification result.

[0051] To solve the technical problems of the present invention, in a second aspect, an embodiment of the present invention further provides a questionnaire data analysis system based on feature fingerprints, and the system includes:

[0052] A data partitioning unit, configured to collect filled questionnaire data samples, generate questionnaire data vectors, perform matrix expansion on the questionnaire data vectors to generate a questionnaire data set, and partition the questionnaire data set into a training set and a test set of the questionnaire data;

[0053] A training set feature extraction unit, which inputs the data matrix of the training set into the Vision Transformer model for training, extracts features through multiple encoder layers of the model to obtain a decoder feature matrix, and converts the obtained decoder feature matrix into a one-dimensional vector to obtain the feature fingerprint of the training set;

[0054] A test set feature extraction unit, which inputs the data matrix of the test set into the same Vision Transformer model to extract the feature fingerprint of the test set;

[0055] A first accuracy calculation unit, configured to perform K-nearest neighbor calculation on the feature fingerprint of the test set and the feature fingerprint of the training set data to obtain the classification category of the test set data, and calculate the first classification accuracy Acc full ;

[0056] A second-precision calculation unit, configured to shield the feature information of the test set data one by one through data ablation, perform K-nearest neighbor calculation on the obtained new test set feature fingerprint and the feature fingerprint of the original training set data set, and obtain the category to which the test set data with data ablation belongs through weighted voting, and calculate the second classification accuracy

[0057] A result analysis unit, configured to compare Acc full with to obtain the importance degree of the shielded feature information to the questionnaire result.

[0058] In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor and a memory, where the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method as described above.

[0059] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a processor or a calculator, the processor is caused to execute the method as described above.

[0060] Compared with the prior art, the method and system for questionnaire data analysis based on feature fingerprints provided by the embodiments of the present invention at least have the following beneficial effects:

[0061] The embodiments of the present invention can expand questionnaire data into matrix data and input it into the ViT model, and use the self-attention mechanism of the multi-layer encoder of the ViT model to realize the joint extraction of global and local features, generate highly discriminative feature fingerprints, and at the same time combine the deep feature fingerprints extracted by the ViT and the improved weighted KNN algorithm to improve the classification accuracy; in addition, the embodiments of the present invention also use data ablation experiments to shield each question information one by one, quantify the impact of specific questions on the classification results, accurately identify the key questions that have the greatest impact on the questionnaire results, and make the analysis of questionnaire data more accurate and the interpretability ability stronger. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] The above characteristics, technical features, advantages and their implementation manners of the present invention will be further described below in a clear and understandable manner in conjunction with the drawings and preferred embodiments.

[0063] Figure 1 It is a schematic flowchart of a method for questionnaire data analysis based on feature fingerprints according to an embodiment of the present invention;

[0064] Figure 2 It is a schematic diagram of a data ablation method for questionnaire data analysis based on feature fingerprints according to an embodiment of the present invention;

[0065] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed implementation manners

[0066] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will describe the specific implementation manners of the present invention with reference to the accompanying drawings. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings and other implementation manners can be obtained.

[0067] To make the drawings concise, only the parts related to the invention are schematically shown in each drawing, and they do not represent the actual structure of the product. In addition, to make the drawings concise and easy to understand, for components with the same structure or function in some drawings, only one of them is schematically shown, or only one of them is labeled. In this document, "one" not only means "only this one", but also means "more than one" situation.

[0068] The following mainly takes some specific embodiments as examples to detail the implementation manners of the technical solutions of the present invention.

[0069] As Figure 1 shown, in order to achieve the invention purpose of the present invention, a method for analyzing questionnaire data based on feature fingerprints provided by an embodiment of the present invention is particularly applicable to extracting the abstract feature representation (i.e., the feature fingerprint of the questionnaire) of questionnaire data through a deep learning model, combining an improved K-Nearest Neighbor (KNN) algorithm to achieve efficient question classification, and based on the data ablation analysis technology, quantifying the contribution degree of key questions to the classification result.

[0070] The embodiment of the present invention solves the problems of insufficient feature representation ability, low classification accuracy and lack of interpretability in traditional questionnaire analysis, and the applicable scope can be extended to any questionnaire survey scenario.

[0071] The embodiment of the present invention can be realized through the following technical solutions:

[0072] A method for analyzing questionnaire data based on feature fingerprints, comprising the following steps:

[0073] S1. Collect the filled questionnaire data samples, generate questionnaire data vectors, expand the questionnaire data vectors into a questionnaire data set through matrix expansion, and divide the questionnaire data set into a training set and a test set of the questionnaire data;

[0074] For the expansion of the questionnaire data vector, the questionnaire data vector can be expanded into a 224*224*3 matrix by copying. At the same time, after preprocessing all questionnaire data sets, the questionnaire data sets are divided into a training set and a test set according to 7:3 to obtain the data set to be processed;

[0075] S2. Input the data matrix of the training set into the Vision Transformer model for training, extract features through multiple encoder layers of the model to obtain a decoder feature matrix, and convert the obtained decoder feature matrix into a one-dimensional vector to obtain the feature fingerprint of the training set;

[0076] S3. Input the data matrix of the test set into the same Vision Transformer model, extract the feature fingerprint of the test set, perform K-nearest neighbor calculation on the feature fingerprint of the test set and the feature fingerprint of the training set data to obtain the classification category of the test set data, and calculate the first classification accuracy Acc full ;

[0077] S4. Shield the feature information of the test set data one by one through data ablation, perform K-nearest neighbor calculation on the obtained new test set feature fingerprint and the feature fingerprint of the original training set data set, and obtain the category to which the test set data with data ablation belongs through weighted voting, and calculate the second classification accuracy

[0078] S5. Compare Acc full with to obtain the importance degree of the shielded feature information to the questionnaire results.

[0079] In S1, first encode the questionnaire data into a 1×n-dimensional vector, where n is the total number of questionnaire questions, and then expand it into a 224×224×3 matrix through periodic extension and standardized filling. After preprocessing the matrix, divide it into a training set and a test set;

[0080] Shown in Figure 1 the steps in the extended data vector part, encode the questionnaire data into a 1×n-dimensional feature vector, where n is the total number of questionnaire questions, and expand it into a 224×224×3 matrix through the following steps:

[0081] Copy the feature vector k row times along the row dimension, G row =Repeat(V,k row ), where k row is the integer part of 224 divided by n;

[0082] (2) For the remaining number of rows r row =224 mod n, fill it up by zero value padding;

[0083] (3) Copy the extended row vector along the column dimension to 224 columns. The formula is: G col = Repeat(G row , 224);

[0084] (4) Copy three times along the channel dimension to generate a 224×224×3 RGB format matrix. The formula is: G = Repeat(G col , 3).

[0085] In S2, input the training set matrix into the ViT (Vision Transformer) model, and extract features through multiple encoder layers to generate feature fingerprints. Among them, the ViT model includes: L encoder layers, each layer includes a multi-head self-attention mechanism (MHSA) and a feed-forward neural network (MLP);

[0086] Shown in Figure 1 Preprocess the training set data and input it into the Vision Transformer model, and extract features through multiple encoder layers of the model. Each encoder layer is composed of a multi-head self-attention mechanism and a multi-layer perceptron. For a given input matrix X, the multi-head self-attention mechanism can be expressed as the following formula,[[]]

[0087] MHSA(X) = Concat(head1, …, head h )W O ;

[0088] where is the j-th attention head, h is the number of heads; Q = XWQ, K = XWK, V = XWV are the query, key, and value matrices respectively;

[0089] WQ, WK, WV are the corresponding weight matrices; WO is the output weight matrix used to combine the outputs of multiple heads.[[]]

[0090] During the feature extraction process, the multi-layer perceptron usually includes two linear layers and an activation function: MLP(X) = max(0, XW1 + b1)W2 + b2;

[0091] where W1, W2 are weight matrices; b1, b2 are bias terms; max(0,.) is the ReLU activation function.[[]]

[0092] In addition, each encoder layer usually includes a residual connection and a layer normalization operation. This operation can promote the information flow and model convergence during training. This process can be expressed by the following formula:[[]]

[0093] EncoderLayer(X) = LayerNorm(X + MHSA(X));

[0094] EncoderLayer(X) = LayerNorm(EncoderLayer(X) + MLP(EncoderLayer(X)));

[0095] And the entire encoder is stacked by multiple layers as follows:

[0096] X output = Encoder(X input ) = EncoderLayer L (EncoderLayer L-1 (…EncoderLayer1(X input ))…));

[0097] Where L is the number of encoder layers.

[0098] After these operations, finally, the output Xoutput of the encoder can be regarded as the decoder feature matrix, which contains the high-level feature representation of the input data.

[0099] In S3, the test set feature fingerprints are classified based on the K-Nearest Neighbor (KNN) algorithm, where the KNN algorithm adopts a weighted voting mechanism with the weight being the reciprocal of the distance. Here, the training set has known class labels during the model training phase, and the classification categories of the training set are known during the training process and do not need to be calculated.

[0100] Shown in Figure 1 the K-Nearest Neighbor algorithm process, as a further solution of the present invention:

[0101] The K-Nearest Neighbor (KNN) calculation process adopts an improved weighted voting mechanism based on Kernel Density Estimation (KDE). The Euclidean distance calculation formula between the test sample feature fingerprint y and the training sample feature fingerprint xi is:

[0102]

[0103] In S4, through the data ablation analysis technique, part of the problem data information is masked, and the masking importance score (FX j ) is calculated to quantify the contribution degree of each problem to the classification result.

[0104] Shown in Figure 2 the data ablation experiment, the data used in the embodiments of the present invention is a 1*n vector V representing the feature vector of questionnaire data, and a masking mask vector M jTo achieve the shielding of part of the information, we shield each feature one by one and evaluate the impact of each feature on the classification result separately.

[0105] In this process, the mask vector M is first defined j ∈{0,1} n , shielding mask vector M j It is also a 1*n vector, in which only the jth bit is 0 and the rest are 1. 0 means that the corresponding feature is masked (that is, the feature does not participate in subsequent calculations); 1 means that the corresponding feature is not masked (that is, the feature participates in subsequent calculations). The masking process is implemented using element-by-element multiplication (Hadamard product):

[0106] V′=V⊙M j ;

[0107] Where V′ is the vector after masking some information, and ⊙ represents element-by-element multiplication.

[0108] After preprocessing, V′ is input into the model to obtain a new feature fingerprint, which is then compared with the feature fingerprint of the training set to perform K-nearest neighbor calculation to predict its category. It is then compared with the actual category of the test set data to obtain a new accuracy rate to infer the importance of the shielded information. The formula can be used to judge the importance of the shielded information. The importance score formula of the shielded information is:

[0109]

[0110] Acc full is the classification accuracy of all features, The accuracy after masking the jth question, the importance score FX j Reflects the influence of this feature on the classification results.

[0111] Shield Importance Score FX j The value range of is [0,1]. The larger the value is, the more significant the impact of the j-th question on the questionnaire classification results is.

[0112] Specifically:

[0113] -When (FX j <0.1), the influence of the jth question on the classification result can be ignored;

[0114] -When (0.1≤FX j <0.5), the jth question has a greater impact on the classification results;

[0115] -When (FX j ≥0.5), the jth question has a significant impact on the classification results.

[0116] As a preferred solution of the embodiment of the present invention, the process of matrix expansion of the questionnaire data vector is as follows:

[0117] First, each questionnaire data is encoded into a 1×n-dimensional feature vector, where n is the total number of questionnaire questions;

[0118] The feature vector is copied along the row dimension through periodic extension until the target matrix number of rows (e.g., 224 rows) is reached. The number of copies k row is the integer part of 224 divided by n, and the remaining unfilled number of rows is filled up by zero-padding;

[0119] Subsequently, it is copied along the column dimension and extended to 224 columns to form a single-channel matrix of 224×224;

[0120] The single-channel matrix is copied three times along the channel dimension to generate an RGB-format matrix of 224×224×3 to adapt to the input requirements of the Vision Transformer;

[0121] For the case where the number of questionnaire questions n cannot evenly divide the target number of rows (224), the expansion process satisfies:

[0122] Total number of rows = k row ×n + r row , r row = 224 mod n;

[0123] where r row is the number of remaining rows, and dimension alignment is achieved through normalized zero-padding.

[0124] As a preferred solution of the present invention, the division of the questionnaire data set is specifically as follows:

[0125] The division process of the questionnaire data set is based on the principle of stratified random sampling;

[0126] Specifically, it is manifested as dividing the data set into a training set (70%) and a test set (30%) according to the original distribution ratio of the questionnaire label categories to ensure that the category distributions of the training set and the test set are consistent;

[0127] As a preferred solution of the embodiment of the present invention: the process of obtaining the decoder feature matrix is as follows:

[0128] Input the training set matrix into the ViT model, and extract global features through the self-attention mechanism of multiple layers of encoders;

[0129] Flatten the decoder feature matrix output by the encoder into a one-dimensional vector as the feature fingerprint of the questionnaire data.

[0130] Optionally, a fully connected layer is also used to reduce the dimension of the high-dimensional feature fingerprint to reduce the computational complexity.

[0131] As a preferred solution of the embodiment of the present invention, specifically converting the obtained decoder feature matrix into a one-dimensional vector is as follows:

[0132] Using the tensor flattening operation, which is implemented as using the.view function in PyTorch, to achieve dimension compression and ensure the uniqueness and distinctiveness of the fingerprint.

[0133] The pseudo-code example is as follows:

[0134] # Example of flattening the feature matrix

[0135] feature_matrix = encoder_output # Shape: [batch_size, 196, 768]

[0136] fingerprint = feature_matrix.view(batch_size, -1) # Shape: [batch_size, 150528]

[0137] As a preferred solution of the present invention: The process of performing K-nearest neighbor calculation is as follows:

[0138] For the feature fingerprint xN in the training set and the feature fingerprint yM in the test set, the Euclidean distance is used to calculate the distance between the two vectors;

[0139] Sort according to the distance from small to large, select the K nearest training set samples, use the weighted voting method, assign a weight to each nearest neighbor sample, where the weight is set to the reciprocal of the distance (that is, the closer the distance, the greater the weight), calculate the weighted votes for each category, and divide the feature fingerprint in the test set into the category with the most weighted votes.

[0140] As a further solution of the present invention: The process of performing the data ablation experiment is as follows:

[0141] For the feature vector V of the questionnaire data, use a masking mask vector M j to achieve data ablation. First, define the masking mask vector M j , M j is a vector with the same dimension as V, except that its elements take values of 0 or 1;

[0142] Among them, 0 indicates that the corresponding feature is masked (i.e., this feature does not participate in subsequent calculations); 1 indicates that the corresponding feature is not masked (i.e., this feature participates in subsequent calculations). The masking process is implemented using element-wise multiplication (Hadamard product). Optionally, to ensure the accuracy of experimental results, a data ablation experiment is conducted.

[0143] Mask the feature dimensions corresponding to specific problems through data ablation technology, and compare the classification accuracy (Acc full with ) before and after ablation, calculate the masking importance score (FX j ), and quantify the impact of each problem on the classification result.

[0144] In a second aspect, an embodiment of the present invention further provides a questionnaire data analysis system based on feature fingerprints. The system includes:

[0145] A data partitioning unit for collecting filled questionnaire data samples, generating questionnaire data vectors, matrix-expanding the questionnaire data vectors to generate a questionnaire data set, and partitioning the questionnaire data set into a training set and a test set of questionnaire data;

[0146] A training set feature extraction unit for inputting the data matrix of the training set into a Vision Transformer model for training, extracting features through multiple encoder layers of the model to obtain a decoder feature matrix, and converting the obtained decoder feature matrix into a one-dimensional vector to obtain the feature fingerprint of the training set;

[0147] A test set feature extraction unit for inputting the data matrix of the test set into the same Vision Transformer model to extract the feature fingerprint of the test set;

[0148] A first accuracy calculation unit for performing K-nearest neighbor calculation on the feature fingerprint of the test set and the feature fingerprint of the training set data to obtain the classification category of the test set data, and calculating the first classification accuracy Acc full ;

[0149] A second accuracy calculation unit for masking the feature information of the test set data one by one through data ablation, performing K-nearest neighbor calculation on the obtained new test set feature fingerprint and the feature fingerprint of the original training set data set, obtaining the category to which the test set data with data ablation belongs through weighted voting, and calculating the second classification accuracy

[0150] A result analysis unit for comparing Acc full with to obtain the importance degree of the masked feature information to the questionnaire result.

[0151] In the method embodiments, the implementation manners are the same as those of the system, and will not be elaborated one by one here.

[0152] In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a processor and a memory. The memory is used to store a computer program, and the computer program includes program instructions. The processor or calculator is configured to call the program instructions to execute the method as described above.

[0153] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor or calculator, the processor or calculator is caused to execute the method as described above.

[0154] As Figure 3 shown, an electronic device provided by an embodiment of the present application, the in-vehicle device 1000 includes a processor or calculator (not shown in the figure) 1001 and a memory 1002. The processor or calculator 1001 and the memory 1002 can be connected to each other through a communication bus 1003. The communication bus 1003 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus 1003 can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, the memory 1002 is used to store a computer program, and the computer program includes program instructions. The processor 1001 is configured to call the program instructions, and the above program includes part or all of the steps for executing the method described above.

[0155] The processor 1001 can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the above solutions.

[0156] The memory 1002 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or can also be an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc Read-Only Memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory can exist independently and be connected to the processor through a bus. The memory can also be integrated with the processor.

[0157] The electronic device 1000 may further include a communication module 1004 and a display 1005. The communication module 1004 can be communicatively connected to an optical tracking device. The communication module 1004 can be a wireless communication module (such as, a WiFi module, a Bluetooth module, etc.) or a wired communication module.

[0158] In addition, the electronic device 1000 may further include general components such as a communication interface (such as, a USB interface, a microphone interface, etc.), an antenna, etc., which will not be elaborated herein.

[0159] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0160] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For parts not elaborated in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0161] In several embodiments provided by this application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical or other forms.

[0162] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0163] In addition, each functional unit in the various embodiments of the application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software program modules.

[0164] If the above-mentioned integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. And the aforementioned memory includes: USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs and other media that can store program codes.

[0165] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program. This program can be stored in a computer-readable memory. The memory can include: flash drives, read-only memories, random access memories, magnetic disks, or optical discs, etc.

[0166] The above has introduced the embodiments of the present application in detail. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only for helping to understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.

[0167] It should be noted that the above embodiments can be freely combined as needed. The above are only the preferred implementation manners of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.

Claims

1. A method for analyzing questionnaire data based on feature fingerprints, characterized in that, The method includes: Collecting the filled questionnaire data samples, generating questionnaire data vectors, expanding the questionnaire data vectors into a questionnaire data set through matrix expansion, and dividing the questionnaire data set into a training set and a test set of the questionnaire data; Inputting the data matrix of the training set into the Vision Transformer model for training, extracting features through multiple encoder layers of the model to obtain a decoder feature matrix, and converting the obtained decoder feature matrix into a one-dimensional vector to obtain the feature fingerprint of the training set; Input the data matrix of the test set into the same Vision Transformer model to extract the feature fingerprints of the test set. Perform K-nearest neighbor calculation on the feature fingerprints of the test set and the feature fingerprints of the training set data to obtain the classification categories of the test set data, and calculate the first classification accuracy Acc full ; The feature information of the test set data is blocked one by one through data ablation. The K-nearest neighbor calculation is performed on the obtained new test set feature fingerprints and the feature fingerprints of the original training set data set. The category to which the test set data with data ablation belongs is obtained through weighted voting, and the second classification accuracy is calculated Compare Acc full with to obtain the importance degree of the blocked feature information to the questionnaire results.

2. The questionnaire data analysis method according to claim 1, wherein, The generating of the questionnaire data vectors and the expanding of the questionnaire data vectors into a questionnaire data set through matrix expansion specifically include: First, encoding the questionnaire data into a 1×n-dimensional vector, where n is the total number of questionnaire questions; Copy the feature vector k along the row dimension row times, and the formula is: G row = Repeat(V, k row ), where k row is the floor of 224 divided by n; For the remaining number of rows r row = 224 mod n, padded with zero values to make up; Copy the extended row vector along the column dimension to 224 columns. The formula is: G col = Repeat(G row , 224); Duplicate three times along the channel dimension to generate an RGB format matrix of 224×224×3. The formula is: Repeat(G col , 3).

3. The questionnaire data analysis method according to claim 1, wherein, Inputting the data matrix of the training set into the Vision Transformer model for training, extracting features through multiple encoder layers of the model to obtain a decoder feature matrix, and converting the obtained decoder feature matrix into a one-dimensional vector to obtain the feature fingerprint of the training set specifically includes: The Vision Transformer model contains L encoder layers, and each layer includes a multi-head self-attention mechanism and a feed-forward neural network; For a given input matrix X, the formula of the multi-head self-attention mechanism is: MHSA(X) = Concat(head1, …, head h )W O ; wherein, is the j-th attention head, h is the number of heads; Q = XW_Q, K = XW_K, V = XW_V are the query, key, and value matrices respectively; W_Q, W_K, W_V are the corresponding weight matrices; W_O is the output weight matrix; In the feature extraction, the feed-forward neural network multi-layer perceptron contains two linear layers and an activation function: MLP(X) = max(0, XW1 + b1)W2 + b2; where W1 and W2 are weight matrices; b1 and b2 are bias terms; max(0,.) is the ReLU activation function; Each encoder layer also contains a residual connection and a layer normalization operation, and the operation formulas are as follows: EncoderLayer(X) = LayerNorm(X + MHSA(X)); EncoderLayer(X) = LayerNorm(EncoderLayer(X) + MLP(EncoderLayer(X))); And the entire encoder is stacked by multiple layers as follows: X output = Encoder(X input ) = EncoderLayerL(EncoderLayer L-1 (…EncoderLayer1(X input ))…)); where L is the number of encoder layers, the output Xoutput of the encoder is the decoder feature matrix, and the decoder feature matrix is the feature fingerprint of the questionnaire data.

4. The questionnaire data analysis method according to claim 1, wherein The performing of K-nearest neighbor calculation on the feature fingerprint of the test set and the feature fingerprint of the training set data to obtain the classification category of the test set data specifically includes: The Euclidean distance calculation formula between the test set feature fingerprint y and the training set feature fingerprint xi is: Sorting according to the distances from small to large, selecting the K nearest training set samples, using the weighted voting method, assigning a weight to each nearest neighbor sample, where the weight is set to the reciprocal of the distance, calculating the weighted votes of each category, and dividing the feature fingerprint in the test set into the category with the most weighted votes.

5. The questionnaire data analysis method according to claim 1, wherein The specifically including of shielding the feature information of the test set data one by one through data ablation: For each problem j, define the mask vector M j ∈ {0, 1} n , to mask the mask vector M j is a 1*n vector, where only the j-th bit is 0 and the rest are 1; Using element-wise multiplication to implement the shielding process: V' = V ⊙ M j ; where V represents a 1*n vector of the feature vector of the questionnaire data test set, V' is the vector after shielding a selected feature information, and ⊙ represents element-wise multiplication.

6. The questionnaire data analysis method according to claim 1, wherein The above-mentioned Acc full is compared with to obtain the importance degree of the blocked features to the questionnaire results, specifically including: Infer the importance score of the masked information according to the first classification accuracy and the second classification accuracy. The calculation formula for the importance score of the masked information is as follows: Among them, Acc full is the full-feature classification accuracy, is the accuracy after masking the j-th feature, and the importance score FX j reflects the influence degree of the j-th feature on the classification result.

7. A questionnaire data analysis system based on feature fingerprints, characterized in that, The system includes: A data partitioning unit, configured to collect the filled questionnaire data samples, generate questionnaire data vectors, perform matrix expansion on the questionnaire data vectors to generate a questionnaire data set, and partition the questionnaire data set into a training set and a test set of the questionnaire data; A training set feature extraction unit, configured to input the data matrix of the training set into a Vision Transformer model for training, extract features through multiple encoder layers of the model to obtain a decoder feature matrix, and convert the obtained decoder feature matrix into a one-dimensional vector to obtain the feature fingerprint of the training set; A test set feature extraction unit, configured to input the data matrix of the test set into the same Vision Transformer model to extract the feature fingerprint of the test set; The first precision calculation unit is used to perform K-nearest neighbor calculation on the feature fingerprints of the test set and the feature fingerprints of the training set data to obtain the classification category of the test set data and calculate the first classification accuracy Acc full ; The second precision calculation unit is configured to shield the feature information of the test set data one by one through data ablation, perform K-nearest neighbor calculation on the obtained new test set feature fingerprints and the feature fingerprints of the original training set data set, obtain the category to which the test set data with data ablation belongs through weighted voting, and calculate the second classification precision Result analysis unit, used to compare Acc full with to obtain the importance degree of the masked feature information to the questionnaire results.

8. An electronic device, characterized in that, The electronic device includes a processor and a memory. The memory is used to store a computer program. The computer program includes program instructions. The processor is configured to call the program instructions to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, the processor or calculator is caused to execute the method according to any one of claims 1 to 6.