Movatterモバイル変換


[0]ホーム

URL:


CN119883886A - Adaptive test case optimization and selection method based on deep neural network - Google Patents

Adaptive test case optimization and selection method based on deep neural network
Download PDF

Info

Publication number
CN119883886A
CN119883886ACN202411768279.8ACN202411768279ACN119883886ACN 119883886 ACN119883886 ACN 119883886ACN 202411768279 ACN202411768279 ACN 202411768279ACN 119883886 ACN119883886 ACN 119883886A
Authority
CN
China
Prior art keywords
selection
similarity
test case
dnn
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411768279.8A
Other languages
Chinese (zh)
Inventor
张智轶
孟焕泽
黄志球
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University of Aeronautics and Astronautics
Original Assignee
Nanjing University of Aeronautics and Astronautics
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing University of Aeronautics and AstronauticsfiledCriticalNanjing University of Aeronautics and Astronautics
Priority to CN202411768279.8ApriorityCriticalpatent/CN119883886A/en
Publication of CN119883886ApublicationCriticalpatent/CN119883886A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本发明公开了一种基于深度神经网络的自适应测试用例优化与选择方法,对于用于N分类任务的DNN模型,首先将测试用例集合输入到DNN模型中,根据输出结果将其划分为N个集合,然后基于预测置信度对每个集合划分为选择集合、候选集合和去除集合。其次,通过计算候选集中图像与选择集中图像的相似度得到的选择集和候选集作为初始集合来进行选择,保证选择集中测试用例分布均衡,返回最后得到的选择集合。本发明基于测试用例均匀分布的思想和模型不确定性对测试用例进行选择,仅标记选择得到的测试用例,不但可以节约测试用例标记成本、提高DNN模型测试效率,也可以使用选择后的测试用例重训练DNN模型,提高DNN模型的鲁棒性。

The present invention discloses an adaptive test case optimization and selection method based on a deep neural network. For a DNN model used for N classification tasks, a test case set is first input into the DNN model, and it is divided into N sets according to the output results. Then, each set is divided into a selection set, a candidate set, and a removal set based on the prediction confidence. Secondly, the selection set and the candidate set obtained by calculating the similarity between the image in the candidate set and the image in the selection set are used as the initial set for selection to ensure that the test cases in the selection set are evenly distributed, and the final selection set is returned. The present invention selects test cases based on the idea of uniform distribution of test cases and model uncertainty, and only marks the selected test cases. It can not only save the test case marking cost and improve the DNN model testing efficiency, but also use the selected test cases to retrain the DNN model to improve the robustness of the DNN model.

Description

Adaptive test case optimization and selection method based on deep neural network
Technical Field
The invention belongs to the technical field of testing in software engineering, and particularly relates to a self-adaptive test case selection and optimization method based on a deep neural network.
Background
Deep Learning (DL) has made rapid progress over the last decades and has become a critical technology in various fields. In the field of computer vision, DNN models have revolutionized the task of image recognition, object detection, image segmentation, and the like. Through a large amount of image data training, the models can accurately identify objects, faces, scenes and the like in pictures, and are applied to various fields of automatic driving automobiles, monitoring systems, medical image analysis and the like. Like conventional software, neural network (DNN) model-based software also suffers from drawbacks and errors, e.g., the tesla Autopilot system fails to identify specific obstacles in the traffic environment or dangerous proximity to other vehicles in some cases, resulting in collision accidents. Therefore, the security, reliability and interpretability of intelligent software guided by DNN models and their decision making processes have attracted widespread attention and discussion.
Traditional software testing and intelligent software testing based on DNN model guidance have a great difference in the problem of finding errors. Therefore, how to test intelligent software efficiently and accurately becomes a hot topic in the field of software testing. Intelligent software based on DNN model can continuously adapt to new programming mode and Bug type through continuous learning, whereas traditional method may need to manually update rules to adapt to new situation. Theoretically, DNN model-based methods can provide higher accuracy and efficiency, but the success of such methods depends largely on a large amount of high quality training data and test data. Furthermore, the DNN model is a complex machine learning framework that can model and learn very complex nonlinear relationships by taking advantage of the powerful combining ability of millions to billions of neurons. Thus resulting in insufficient interpretability of the DNN model, making it difficult for a developer to understand the specific reasons for the model to make a particular decision. In practical applications, developers often need to collect a large amount of data from an application scene to retrain the DNN model, so as to correct the misprediction of the DNN model to improve the accuracy of the model. In the process of collecting data, a great deal of labor is employed to mark the data, consuming a great deal of time and effort from the developer.
In order to alleviate the problem of marking cost, one possible solution is to select unlabeled test cases and select test cases that may cause a misprediction of DNN, and we can only mark the selected test cases, which not only saves marking cost, but also improves efficiency of DNN testing.
Disclosure of Invention
The invention aims to provide a self-adaptive test case selection and optimization method based on a deep neural network, which can provide a test case set with more uniform distribution so as to highlight the specific gravity mispredicted by a DNN model, and the test cases obtained by selection are marked by the method, so that the marking cost can be saved, the DNN test efficiency can be improved, and the robustness of the DNN model can be improved by guiding retraining.
The technical scheme is that the adaptive test case optimizing and selecting method based on the deep neural network is used for processing a test case of a DNN model for N classification tasks as follows:
S1, inputting unmarked test case sets to be selected into a DNN model, dividing the unlabeled test case sets into N sets according to DNN prediction results and image classification targets, and dividing each divided set into a selection set, a candidate set and a removal set through prediction confidence variance;
S2, calculating the similarity degree between any two images by an image similarity calculation method based on model uncertainty aiming at image data sets in a selection set and a candidate set, wherein the method specifically comprises the following steps of:
S21, predicting, namely selecting one picture from the selection set and the candidate set, marking the picture as a picture a and a picture b, inputting the pictures into a DNN model for classified prediction, wherein probability vectors P and Q output by the DNN model represent the prediction probabilities of the picture a and the picture b respectively;
s22, reorganizing and extracting, namely randomly selecting 3 prediction probability values from the probability vectors P and Q respectively, thereby reorganizing the vectors P and Q into vectorsThree-dimensional sub-vectors;
s23, calculating the similarity of images, namely marking any three-dimensional sub-vectors of the vectors P and Q after recombination as P '(Pi,pj,pk) and Q' (Qi,qj,qk), then regarding the two vectors as coordinate points in a three-dimensional space, and projecting the coordinate points on a plane where the Pi and Qi are positioned, so as to obtain three-dimensional coordinate points P 'and Q', forming an angle with an origin 0 according to the points P ', Q', marking the angle as an angle alpha, and then calculating sin (alpha) by using coordinates corresponding to the P 'and Q', and simultaneously obtaining the absolute value of the difference between the Pi and the Qi;
Similarly, the two-dimensional coordinate points P 'and Q' are projected onto planes where Pj, Qj、pk and Qk are located respectively to perform angle beta, angle beta and sine calculation, including absolute values;
On the basis, a formula for measuring the similarity of probability vectors P and Q is defined, and the formula is used for the information of angles and differences obtained in the process, and is as follows:
similarity(i,j,k)=sin(α)*(|pi-qi|)+sin(β)*(|pj-qj|)+sin(γ)*(|pk-qk|)
s24, accumulating the similarity, and recombining to obtainThe similarity of the individual vectors is accumulated, and for a particular image input x1 and x2, the similarity between images x1 and x2 is calculated by the formula when performing the classification tasks for n categories:
Similarity(x1,x2)=∑similarity(i,j,k);
S3, taking the selection set and the candidate set optimized in the step S2 as an initial set, selecting by calculating the similarity between the images in the candidate set and the images in the selection set, and returning to the final selection set.
Further, in step S1, the test case set C is divided into N subsets according to the prediction result output by the DNN model, the test cases in each set Ci are predicted by DNN to be in the same category, then a prediction confidence variance is calculated for the test cases in each subset Ci, the test cases in the subset Ci are ranked according to the prediction confidence variance and the test cases, and then the test case sets are divided into an initial selection set, an initial candidate set and an exclusion set according to the number requirement of target test cases.
Further, the prediction confidence variance is calculated as follows:
In the image classification task, given an input test case x, the predicted output of the DNN model is a vector of n values, denoted as p= < P1,p2,...,pn >, where each Pi represents the probability that the input x is predicted to be the i-th class, andOrdering the vector P results in a vector P ' = < P '1,p′2,...,p′n >, where P '1≥p′2≥...≥p′n' and the probability difference between the n prediction probabilities is defined as follows:
Confidence variance:
Further, step S23 is to evaluate the similarity between each test case x in the candidate set and all test cases in the selection set by using an image similarity calculation method, and to select the test case corresponding to the maximum value in the shortest distance from the test case x in the candidate set to the selection set in the direction after obtaining the minimum similarity values, so as to ensure the uniform distribution of the selected test cases in the set.
The method is based on the idea of test case distribution balance and the uncertainty of the model, a test case set with balanced distribution can be selected, the test case category of the set is distributed uniformly, meanwhile, the probability that the test case induces the DNN model to generate misprediction is higher, the defects of DNN are more likely to be revealed, and the help for improving DNN robustness is larger through retraining. The beneficial effects of the invention include the following three points:
(1) According to the method, the image similarity calculation method is adopted, so that the testing efficiency of the DNN model can be effectively improved;
(2) Through designing a test case selection method based on the idea of test case distribution balance and the uncertainty of the model, the defect detection rate of DNN can be improved, and meanwhile, only the test cases obtained through selection are marked, so that the marking cost can be saved, and the DNN model is optimized;
(3) According to the method, the test cases with higher probability of generating the misprediction by the DNN model are preferentially selected, and then the DNN is retrained by marking the test cases and adding the original training set, so that the robustness of the DNN can be remarkably improved.
Drawings
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
The main technologies used by the invention are a deep neural network (Deep Neural Network) and an adaptive test case selection technology respectively. The following presents a method flow and details of implementation and specific implementation steps of various techniques used in the present invention.
Deep Neural Network (DNN) is an artificial neural network, and comprises an input layer, a plurality of hidden layers and an output layer, wherein the DNN is applied to the field of image recognition processing. The hidden layer internally comprises a convolution layer, a pooling layer, a full connection layer and the like. The main functions of the convolution layers are to extract features from input data, different convolution kernels can be used for capturing different feature information, after a plurality of convolution layers, a pooling layer is usually added, which helps to reduce the total parameter amount of the neural network and also helps to prevent the overfitting phenomenon of the neural network, and the function of the full connection layer is to convert the extracted feature information into a label space of a sample, and then the data is transferred to the output layer. After the convolutional layer and the fully-connected layer, an activation function, such as ReLU or Sigmoid, is typically applied to enhance the representation capabilities of the neural network.
In general, a deep neural network is used to map input image data x (test cases) onto output results y. For example, an N classification task is given to a test case x, after DNN internal neuron processing, an N-dimensional vector p= { P1,p2,p3,...,pN }, and then a softmax function normalization processing is used, so that a set of probability vectors p= { P1,p2,p3,...,pN},pi are obtained to represent the probability that the picture is predicted as the i-th class by the neural network, and the final prediction result of DNN is the class corresponding to the value with the largest probability in P.
The function of the deep neural network is to convert the input data x into an output result y. Taking the N classification task as an example, for a given test input x, the data is processed through multiple layers of neural networks, and finally an N-dimensional vector v= { V1,v2,v3,...,vN } is formed at the output layer. Next, a set of probability vectors p= { P1,p2,p3,...,pN }, where each Pi represents the probability that the neural network predicted input x belongs to the i-th class, is generated by normalizing this vector by applying a softmax function. The final prediction result of the neural network is the class in the vector P with the highest probability value.
Further, the test case selection is a hot research problem in the field of software testing, and how to select test data with better quality from a large amount of data becomes a key of intelligent software testing. The error prediction behavior of the DNN model can be corrected by only marking the test data with better quality obtained by selection, so that the robustness and the reliability of the model are improved. The previous test case selection methods are basically divided into two types, namely a test case selection method based on neuron coverage guidance and a test case selection method based on priority.
Neuron coverage guidance based test case selection method the neuron coverage based method is selected by utilizing neuron coverage in a deep neural network model to guide the selection of test cases. Such methods typically employ greedy algorithms that guide the selection of the next input by using the previous neuron activation value as feedback.
The method for selecting the test cases based on the priority comprises the steps that a plurality of efficient test case selection methods adopt a guiding strategy based on the priority, a group of priority rules are defined, data are ordered according to the priority rules, and data which are ordered in front are selected. Most of the strategies are based on uncertainty of the model, and high-quality test cases are selected according to the predicted behavior of the DNN model.
Based on the above, we further introduce the test case selection method provided by the present invention.
According to the adaptive test case optimizing and selecting method based on the deep neural network, the greater the specific gravity of DNN misprediction is, the more DNN misprediction categories are covered, and the robustness of a DNN model can be effectively improved through retraining the DNN model. For a trained DNN model for N classification tasks, the method comprises the steps of firstly inputting unlabeled test case sets to be selected into the DNN model, dividing the unlabeled test case sets into N sets according to DNN prediction results, further providing a Prediction Confidence (PCV) method, optimizing each set by adopting the method, and dividing each set into a selection set, a candidate set and a removal set. Secondly, the selection set and the candidate set are further processed, namely an image similarity calculation method based on model uncertainty is provided, and the similarity between two images can be calculated. And finally, taking the optimized selection set and the candidate set as an initial set, selecting by calculating the similarity between the images in the candidate set and the images in the selection set, ensuring the distribution balance of the test cases in the selection set, and returning to the final selection set.
Specifically, the adaptive test case optimizing and selecting method based on the deep neural network comprises the following steps:
and step 1, optimizing the test case set.
Firstly, based on the processing of a DNN model on unlabeled test sets, aiming at each subset of N classification tasks of images and N sets output by the DNN model, the calculation of prediction confidence variance (PVC) is introduced, test cases in the sets are ordered according to PCV coefficients, and the test cases are divided into three types, namely a selection set, a candidate set and a removal set. The process is preliminary selection, i.e., the initial selection set is composed of a selection set and a candidate set, the initial selection set includes those test cases that cause a higher probability of model misprediction, and the exclusion set includes those test cases that reduce the probability of model misprediction.
In this process, we introduce a new index, called Prediction Confidence Variance (PCV), for classifying test cases according to the uncertainty of model predictions. The Prediction Confidence Variance (PCV) partitions the set of test cases based on the uncertainty of the model predictions. In the image classification task, given an input x, the predicted output of the DNN model is a vector p= < P1,p2,...,pn > with n values, where each Pi represents the probability that the input x is predicted to be the i-th class, andOrdering vector P results in vector P ' = < P '1,p′2,...,p′n >, where P '1≥p′2≥...≥p′n >. The PCV measures the probability difference between the n predicted probabilities. The definition is as follows:
And 2, calculating the similarity of the images.
This step considers that the selected test cases can maintain the uniformity of the distribution, and therefore we have devised an image similarity evaluation method based on directionality and uncertainty. The image similarity is a set of data images used in the candidate set and the selection set in step 1, i.e., a preliminary set of test cases. The specific method comprises the following steps:
2.1, prediction.
And respectively selecting a picture from the data sets contained in the selection set and the candidate set, namely a picture a and a picture b, and inputting the pictures into a DNN model for classification prediction. If a data set containing 10 classes is selected, the DNN model outputs a probability vector containing 10 elements for each picture, representing the prediction probability of the picture belonging to each class. Let the two probability vectors be p= < P1,p2,...,P10 > and q= < Q1,q2,...,q10 >, respectively, where vector P represents the classification prediction result of picture a and vector Q represents the classification prediction result of picture b. The elements pi and qi in each vector represent the prediction probabilities that picture a and picture b belong to the corresponding categories, respectively.
2.2, Recombination and extraction.
Recombining vectors P and Q intoEach vector contains 3 predicted probability values after reorganization, which are denoted as vectors P 'and Q', both of which existThe resulting sub-vectors are arranged in combinations.
2.3 Image similarity calculation.
For the vector P ', either one of which is denoted as P ' (Pi,pj,pk) and Q ' (Qi,qj,qk), then the two vectors are regarded as coordinate points in three-dimensional space, and projected onto a plane where Pi and Qi are located, thereby obtaining three-dimensional coordinate points P ' and Q ', according to which the points P ', Q ' form an angle with the origin 0, denoted as an angle α, and then sin (α) is calculated using coordinates corresponding to P ' and Q ', while obtaining the absolute value of the difference between Pi and Qi;
Similarly, the two-dimensional coordinate points P 'and Q' are projected onto planes where Pj, Qj、pk and Qk are located respectively to perform angle beta, gamma and sine calculation, including absolute values;
On the basis, a formula for measuring the similarity of probability vectors P and Q is defined, and the formula is used for the information of angles and differences obtained in the process, and is as follows:
similarity(i,j,k)=sin(α)*(|pi-qi|)+sin(β)*(|pj-qj|)+sin(γ)*(|pk-qk|)
Further by way of example, if one of the amounts P and Q is set to A (P1,p2,p3) and B (Q1,q2,q3), respectively. Then, the coordinates of a and B are projected onto the horizontal planes corresponding to p3 and q3, resulting in two-dimensional coordinate points a 'and B'. Accordingly, points A ', B' form an angle with origin 0, denoted as angle α. Using the coordinates of A 'and B', we can calculate sin (α). At the same time we can get the absolute value of the difference between p3 and q3. Similarly, we can project a and B onto the horizontal planes corresponding to p2 and q2 and p1 and q1, resulting in angles β and β. On this basis, we define a formula for measuring the similarity of vectors P and Q, which integrates the information of angles and differences obtained in the above process.
similarity(1,2,3)=sin(α)*(|p3-q3|)+sin(β)
*(|p2-q2|)+sin(β)*(|p1-q1|)
Starting from vectors < p1,p2,p3 > and < q1,q2,q3 >, and so on.
And 2.4, accumulating the similarity.
Similarity accumulation, i.e. recombining to obtainThe similarity of the individual vectors is accumulated, and for a particular image input x1 and x2, the similarity between images x1 and x2 is calculated by the formula when performing the classification tasks for n categories:
Similarity(x1,x2)=∑similarity(i,j,k);
The examples in step 2.3 were pooled and recombined to giveThe similarity of the individual vectors is accumulated. For specific image inputs x1 and x2, when performing the classification task for n categories, we define the following formula to calculate the similarity between images x1 and x2:
Similarity(x1,x2)=similarity(1,2,3)+similarity(1,2,4)+...+similarity(n-2,n-1,n)
And 3, selecting an adaptive test case.
According to step 1, an original selection set and a candidate set are obtained. In the process of selecting test cases, an image similarity calculation method is adopted to evaluate the similarity between each test case x in the candidate set and all test cases in the selection set. Specifically, the minimum similarity between x and any test case in the selection set will be focused on, i.e., the shortest distance of x to the selection set is calculated. After these minimum similarity values are obtained, the maximum of them will be selected to ensure even distribution of the selected test cases in the collection.
And 4, evaluating the self-adaptive test case selection method by using four common data sets and four DNN models, retraining the DNN models by using the selected test case set, and improving the robustness of the models.
The following describes the specific implementation steps of the present invention by way of specific examples:
(1) Data set and model
Four classical data sets, namely MNIST, CIFAR-10, fashion and SVHN, are selected. Meanwhile, four DNN models which are widely applied and different in scale aiming at the picture classification task are selected and respectively are LeNet-1, leNet-5, resNet-20 and VGG-16. Two different DNN models are provided for each data set to conduct experiments, so that the stability of experimental results is ensured, and the experimental results are shown in a table I. The MNIST dataset is a large database of handwritten numbers, typically used to train various image processing systems. The dataset contained 70,000 images of handwritten numbers (0 to 9), each being a greyscale image of 28x 28 pixels in size. CIFAR10 is a reference dataset widely used in machine learning and computer vision research, containing 60,000 color images of 32x32 pixels, and the dataset is divided into 50,000 training images and 10,000 test images. The Fashion-MNIST dataset is intended to provide a dataset that more closely approximates a real-world problem. It contains 70,000 gray scale images from 10 classes, of which 60,000 samples are used to train the model and the remaining 10,000 samples are used to evaluate the performance and generalization ability of the model. SVHN the dataset is a large-scale dataset for digital identification, the source of which is google street view data. SVHN contains over 60 tens of thousands of color images, divided into a training set, a test set and an additional dataset, wherein the training set contains 73,257 images, the test set contains 26,032 images, and the additional dataset contains 531,131 images.
Table 1 dataset and DNN model
(2) And (3) optimizing the test cases, namely inputting test set data into a DNN model after training, and dividing the test set data into 10 sets C= { C1,C2,C3,...,C10 } according to a DNN prediction result, namely predicting the test cases in each set Ci (i E [1,10 ]) into the same category by DNN. Then we calculate PCV coefficients for the test cases in set Ci, sort the test cases in the set according to the PCV coefficients, and divide the test cases into three categories, initial selection set, initial candidate set and exclusion set. The initial selection set includes those test cases that give rise to a higher probability of model misprediction, while the exclusion set includes those test cases that lower the probability of model misprediction. The remaining test cases are classified into candidate sets.
(3) Test case selection process. And (3) reserving the selection set and the candidate set obtained after optimization in the step (2) as an initial selection set and an initial candidate set in the selection process. Firstly, we set the end condition of the selection flow, this condition is that when the number of test cases selected reaches the target set by us, the algorithm stops running and returns the selected test case set. Next, in each prediction classification category, we calculate the minimum image similarity from each test case x in the candidate test case set to the selected test case set in that category, and store this minimum image similarity value into the corresponding similarity queue. Finally, we sort the similarity queues in descending order and then reorder the candidate sets according to this sort order. Next, the first batch elements are selected from the candidate set and added to the selection set. And returning to the test case set after the number of the test cases in the test case set reaches the target number.

Claims (4)

Translated fromChinese
1.一种基于深度神经网络的自适应测试用例优化与选择方法,其特征在于,该方法针对用于N分类任务的DNN模型的测试例做如下的处理:1. An adaptive test case optimization and selection method based on deep neural network, characterized in that the method performs the following processing on the test case of the DNN model for N classification tasks:S1、将未标记的待选择的测试用例集合输入到DNN模型中,根据DNN预测结果和图像分类目标将其划分为N个集合,然后针对所划分的每个集合,通过预测置信方差将其划分为选择集合、候选集合和去除集合;S1. Input the unlabeled test case set to be selected into the DNN model, divide it into N sets according to the DNN prediction results and the image classification target, and then divide each divided set into a selection set, a candidate set and a removal set by predicting the confidence variance;S2、针对选择集合和候选集合中的图像数据集,基于模型不确定性的图像相似度计算方法计算任意两张图像之间的相似程度,具体包括:S2. For the image datasets in the selection set and the candidate set, the similarity between any two images is calculated using an image similarity calculation method based on model uncertainty, specifically including:S21、预测:从选择集合和候选集合中分别任选一张图片,记为图片a和图片b,并将它们输入到DNN模型进行分类预测,DNN模型输出的概率向量P和Q分别代表图片a和图片b的预测概率;S21, prediction: select one picture from the selection set and the candidate set respectively, denoted as picture a and picture b, and input them into the DNN model for classification prediction. The probability vectors P and Q output by the DNN model represent the prediction probabilities of picture a and picture b respectively;S22、重组和提取:从概率向量P和Q中分别任意选择3个预测概率值,由此将向量P和Q分别重组为个三维子向;S22, reorganization and extraction: arbitrarily select three predicted probability values from the probability vectors P and Q, thereby reorganizing the vectors P and Q into Three-dimensional sub-directions;S23、计算图像相似度:将向量P和Q重组后的任意一组三维子向量记为P’(pi,pj,pk)和Q’(qi,qj,qk),然后将这两个向量视为在三维空间中的坐标点,并且将其投影定到pi和qi所在的平面上,进而得到三维维坐标点p′和Q′,据此点p′、Q′与原点O形成一个角,记为角α,接着使用P′和Q′对应的坐标计算sin(α),同时得到pi和qi之差的绝对值;S23. Calculate image similarity: record any set of three-dimensional subvectors after reorganization of vectors P and Q as P'(pi ,pj ,pk ) and Q'(qi ,qj ,qk ), then regard these two vectors as coordinate points in three-dimensional space, and project them onto the plane wherepi andqi are located, and then obtain three-dimensional coordinate points p' and Q'. Points p' and Q' form an angle with the origin O, recorded as angle α, and then use the coordinates corresponding to P' and Q' to calculate sin(α), and at the same time obtain the absolute value of the difference betweenpi andqi ;同理,还包括将上述二维坐标点P′和Q′分别投影到pj和qj、pk和qk所在的平面上进行角度β和γ和正弦计算,包括绝对值;Similarly, it also includes projecting the above two-dimensional coordinate points P′ and Q′ onto the planes where pj and qj , pk and qk are located, respectively, to calculate the angles β and γ and the sine, including the absolute value;在此基础上,定义一个衡量概率向量P和Q相似度的公式,用于上述过程中获得的角度和差异的信息,表达式如下:On this basis, a formula to measure the similarity of probability vectors P and Q is defined for the angle and difference information obtained in the above process. The expression is as follows:similarity(i,j,k)=sin(α)*(|pi-qi|)+sin(β)*(|pj-qj|)+sin(γ)*(|pk-qk|)similarity(i,j,k) =sin(α)*(|pi -qi |)+sin(β)*(|pj -qj |)+sin(γ)*(|pk -qk |)S24、相似度累加:将重组得到个向量的相似度进行累加,对于特定图像输入x1和x2,在进行n个类别的分类任务时,通过公式来计算图像x1和x2之间的相似度:S24, similarity accumulation: recombining The similarity of the vectors is accumulated. For specific image inputsx1 andx2 , when performing n-category classification tasks, the similarity between imagesx1 andx2 is calculated by the formula:Similarity(x1,x2)=∑similartty(i,j,k)Similarity(x1 ,x2 )=∑similartty(i,j,k) ;S3、将经过步骤S2优化后的选择集和候选集作为初始集合,通过计算候选集中图像与选择集中图像的相似度来进行选择,返回最后得到的选择集合。S3. The selection set and candidate set optimized in step S2 are used as the initial set, and the selection is performed by calculating the similarity between the images in the candidate set and the images in the selection set, and the final selection set is returned.2.根据权利要求1所述的基于深度神经网络的自适应测试用例优化与选择方法,其特征在于,步骤S1中,根据DNN模型输出的预测结果将测试例集合C划分为N个子集合,每个集合Ci中的测试用例被DNN预测为相同的类别,然后针对每个子集合Ci中的测试用例计算预测置信方差,根据预测置信方差和对该子集合Ci内的测试用例进行排序,进而根据目标测试例的数量需求将测试用集合例分为初始选择集、初始候选集和排除集。2. According to the adaptive test case optimization and selection method based on deep neural network in claim 1, it is characterized in that, in step S1, the test case set C is divided into N subsets according to the prediction results output by the DNN model, and the test cases in each setCi are predicted by the DNN to be of the same category, and then the prediction confidence variance is calculated for the test cases in each subsetCi , and the test cases in the subsetCi are sorted according to the prediction confidence variance, and then the test set cases are divided into an initial selection set, an initial candidate set and an exclusion set according to the quantity requirement of the target test cases.3.根据权利要求1或2所述的基于深度神经网络的自适应测试用例优化与选择方法,其特征在于,预测置信方差的计算如下:3. The method for adaptive test case optimization and selection based on deep neural network according to claim 1 or 2, characterized in that the prediction confidence variance is calculated as follows:在图像分类任务中,给定输入测试用例x,DNN模型的预测输出为具有n个值的向量,表示为P=<p1,p2,…,pn>,其中每个pi表示输入x被预测为第i个类别的概率,并且对向量P进行排序可得到向量P′=<p′1,p′2,...,p′n>,其中p′1≥p′2≥...≥p′n,;n个预测概率之间的概率差异定义如下:In the image classification task, given an input test case x, the predicted output of the DNN model is a vector with n values, denoted as P = <p1 ,p2 ,…,pn >, where eachpi represents the probability that the input x is predicted to be the i-th category, and Sorting the vector P yields a vector P′=<p′1 ,p′2 ,...,p′n >, where p′1 ≥p′2 ≥...≥p′n ; the probability difference between the n predicted probabilities is defined as follows:置信方差:Confidence variance:4.根据权利要求1所述的基于深度神经网络的自适应测试用例优化与选择方法,其特征在于,步骤S23是通过图像相似度计算方法来评估候选集中每个测试用例x与选择集中所有测试用例之间的相似度,通过候选集中的测试用例x到选择集的最短距离,在获得这些最小相似度值之后,方向选择其中的最大值所对应的测试用例,以确保所选测试用例在集合中的均匀分布。4. According to the adaptive test case optimization and selection method based on deep neural network in claim 1, it is characterized in that step S23 is to evaluate the similarity between each test case x in the candidate set and all test cases in the selection set by using an image similarity calculation method, and through the shortest distance from the test case x in the candidate set to the selection set, after obtaining these minimum similarity values, the test case corresponding to the maximum value is selected to ensure the uniform distribution of the selected test cases in the set.
CN202411768279.8A2024-12-042024-12-04Adaptive test case optimization and selection method based on deep neural networkPendingCN119883886A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202411768279.8ACN119883886A (en)2024-12-042024-12-04Adaptive test case optimization and selection method based on deep neural network

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202411768279.8ACN119883886A (en)2024-12-042024-12-04Adaptive test case optimization and selection method based on deep neural network

Publications (1)

Publication NumberPublication Date
CN119883886Atrue CN119883886A (en)2025-04-25

Family

ID=95421404

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202411768279.8APendingCN119883886A (en)2024-12-042024-12-04Adaptive test case optimization and selection method based on deep neural network

Country Status (1)

CountryLink
CN (1)CN119883886A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2019154262A1 (en)*2018-02-072019-08-15腾讯科技(深圳)有限公司Image classification method, server, user terminal, and storage medium
CN112488205A (en)*2020-11-302021-03-12桂林电子科技大学Neural network image classification and identification method based on optimized KPCA algorithm
CN116303088A (en)*2023-04-172023-06-23南京航空航天大学Test case ordering method based on deep neural network cross entropy loss
CN117093496A (en)*2023-09-072023-11-21重庆大学Automatic test case generation method for deep neural network fuzzy test

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2019154262A1 (en)*2018-02-072019-08-15腾讯科技(深圳)有限公司Image classification method, server, user terminal, and storage medium
CN112488205A (en)*2020-11-302021-03-12桂林电子科技大学Neural network image classification and identification method based on optimized KPCA algorithm
CN116303088A (en)*2023-04-172023-06-23南京航空航天大学Test case ordering method based on deep neural network cross entropy loss
CN117093496A (en)*2023-09-072023-11-21重庆大学Automatic test case generation method for deep neural network fuzzy test

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
李鸣;张鸿;: "基于深度特征分析的双线性图像相似度匹配算法", 计算机应用, no. 10, 10 October 2016 (2016-10-10)*
黄伟;杨金凤;: "基于神经网络的回归测试用例优化研究", 现代电子技术, no. 19, 1 October 2015 (2015-10-01)*

Similar Documents

PublicationPublication DateTitle
CN111709311B (en)Pedestrian re-identification method based on multi-scale convolution feature fusion
CN110188827B (en)Scene recognition method based on convolutional neural network and recursive automatic encoder model
CN110689081B (en)Weak supervision target classification and positioning method based on bifurcation learning
CN111191732A (en) A target detection method based on fully automatic learning
Silva-Rodriguez et al.Self-learning for weakly supervised gleason grading of local patterns
CN111476285B (en) A training method for an image classification model, an image classification method, and a storage medium
CN114492581B (en) A method based on transfer learning and attention mechanism meta-learning applied to small sample image classification
Wang et al.An unequal deep learning approach for 3-D point cloud segmentation
CN112633382A (en)Mutual-neighbor-based few-sample image classification method and system
CN113761259A (en)Image processing method and device and computer equipment
CN114067155B (en)Image classification method, device, product and storage medium based on meta learning
CN113486902B (en) Automatic selection method of 3D point cloud classification algorithm based on meta-learning
CN116051479B (en)Textile defect identification method integrating cross-domain migration and anomaly detection
Yamada et al.Guiding labelling effort for efficient learning with georeferenced images
Rezatofighi et al.Learn to predict sets using feed-forward neural networks
CN112115996B (en)Image data processing method, device, equipment and storage medium
CN117079049A (en)Small sample fine granularity image classification method based on double-metric network
CN114462479B (en) Model training methods, retrieval methods, models, devices, and media
SadiqImproving cbir techniques with deep learning approach: An ensemble method using nasnetmobile, densenet121, and vgg12
CN118569260B (en) Small-sample named entity recognition method for joint operation of reservoir groups
Iqbal et al.Improved open world object detection using class-wise feature space learning
CN117152550B (en) A neuron coverage guided testing method for autonomous driving systems
CN119883886A (en)Adaptive test case optimization and selection method based on deep neural network
CN112733067B (en)Data set selection method for robot target detection algorithm
Dai et al.Self-supervised pairing image clustering and its application in cyber manufacturing

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp