A sample library consistency determination method, device, medium and computing equipment

By dividing and training the sample library multiple times, the ratio of the recognition ratio to the true ratio is calculated, which solves the problem of ignoring the consistency of the sample library in the existing technology, provides a more accurate method for evaluating the consistency of the sample library, and supports the optimized design of the classification network.

CN114417985BActive Publication Date: 2026-07-31PEKING UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PEKING UNIV
Filing Date
2022-01-10
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies ignore the consistency of the sample database when determining the performance of classification networks, resulting in unstable performance of classification networks on different datasets and making it difficult to perform targeted optimization based on the feature differences of the sample database.

Method used

By selecting all samples of two categories from the sample library to form a sample set, and dividing it into a training set and a test set, consistency evaluation is performed using a classification network that has been divided and trained multiple times. The ratio of the recognition ratio to the true ratio is calculated to determine the consistency of the sample categories.

Benefits of technology

It achieves consistency evaluation based on the feature dimensions of the sample library itself, which can more accurately reflect the difficulty of distinguishing each category in the sample library and guide the design and optimization of classification networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114417985B_ABST
    Figure CN114417985B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, medium, and computing device for determining the consistency of a sample library. The method includes: acquiring a sample library and labeling all samples in the sample library with sample categories; based on any sample category to be determined in the sample library, and other sample categories in the sample library, selecting all samples from two categories to form a sample set; dividing the sample set into a training set and a test set; and determining the consistency of any sample category to be determined in the sample library based on the training set and the test set. This solution can evaluate the sample library and determine the consistency of each category. The consistency results of each category are evaluated based on the feature dimensions of each sample in the sample library itself, which is more in line with the recognition logic of deep learning algorithms for classification networks. After knowing the consistency level of each category in the sample library to be determined, the classification network can be designed and optimized accordingly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of deep learning, and in particular to a method, apparatus, medium, and computing device for determining the consistency of a sample library. Background Technology

[0002] In computer vision, classification networks are used for image classification. These networks need to be trained using a sample database to learn the relationship between features and categories in order to classify images. For the training sample database, higher consistency means the samples are easier to distinguish, and the required classification network is simpler. Conversely, lower consistency means a more complex classification network. Currently, determining the performance of classification networks mostly starts with the network's algorithm itself, using predefined metrics to evaluate the dataset and derive the network's stability, accuracy, and other characteristics. Summary of the Invention

[0003] The main objective of this invention is to provide a method, apparatus, medium, and computing device for determining the consistency of a sample library, aiming to solve the problems mentioned in the background art.

[0004] To achieve the above objectives, this invention proposes a method for determining the consistency of a sample library, comprising:

[0005] Obtain the sample library;

[0006] A sample set is formed by randomly selecting all samples from two categories from the sample library;

[0007] The sample set is divided into a training set and a test set, and the consistency of samples of a certain category to be determined in the sample library is determined based on the training set and the test set.

[0008] In one embodiment of this implementation, a sample set is formed by randomly selecting all samples from two categories in the sample library, including:

[0009] Based on any sample category to be determined in the sample library, multiple sample sets are formed together with all other sample categories in the sample library.

[0010] In one embodiment of this implementation, the sample set is divided into a training set and a test set, and the consistency of any sample category to be determined in the sample library is determined based on the training set and the test set, including:

[0011] Select any sample set from the multiple sample sets corresponding to the sample category to be determined;

[0012] The sample set is divided into a training set and a test set according to a preset number of times;

[0013] Based on multiple training and test sets divided into multiple partitions, the consistency of the sample category to be determined after each partition is determined.

[0014] The consistency result of the sample category to be determined in the selected sample set is determined based on the consistency result after each partition.

[0015] In one embodiment of this implementation, after obtaining the consistency result after each partition, the method further includes:

[0016] Determine if the preset number of divisions has been reached.

[0017] If so, then iterate through the multiple sample sets corresponding to the sample category to be determined, and obtain the consistency results of the sample category to be determined in the multiple corresponding sample sets.

[0018] Based on the consistency results of the sample category to be determined in the corresponding multiple sample sets, the consistency result of the sample category to be determined in the sample library is obtained.

[0019] In one embodiment of this implementation, determining the consistency result of the sample category to be determined after each partitioning, based on the training set and test set formed each time, includes:

[0020] The classification network is trained using the training set divided each time, and the training set is used to classify the test set corresponding to the training set based on the trained classification network to obtain the classification result;

[0021] Based on the classification results, the consistency of the sample category to be determined after each division is determined.

[0022] In one embodiment of this implementation, the classification network is trained using the training set divided each time, and the training network is used to classify the test set corresponding to the training set to obtain the classification result, including:

[0023] The training set is divided into portions each time and input into the classification network to train and obtain the weight parameters of the classification network.

[0024] The classification network is used to classify the test set according to the weight parameters to obtain the classification result.

[0025] In one embodiment of this implementation, the consistency result of the sample category to be determined after each partition is determined by the following method:

[0026] In each partition, the proportion of the sample category to be determined identified by the trained classification network on the test set is calculated, as well as the true proportion of that category of samples in the test set.

[0027] The ratio of the minimum to the maximum value of the identification ratio and the true ratio in each division is taken as the consistency result of the sample category to be determined in each division.

[0028] In one embodiment of this implementation, the ratio of the two types of samples in the training set is the same as the ratio of the two types of samples in the test set.

[0029] The present invention also proposes a sample library consistency determination device, comprising:

[0030] The acquisition module is used to acquire the sample library;

[0031] The classification module is used to select any two categories of all samples from the sample library to form a sample set;

[0032] An evaluation module is used to divide the sample set into a training set and a test set, and to determine the consistency of a certain sample category to be determined in the sample library based on the training set and the test set.

[0033] In one embodiment of this implementation, the classification module is configured as follows:

[0034] Based on any sample category to be determined in the sample library, multiple sample sets are formed together with all other sample categories in the sample library.

[0035] In one embodiment of this implementation, the evaluation module includes:

[0036] The loop module is used to select any sample set from the multiple sample sets corresponding to the sample category to be determined;

[0037] The partitioning module is used to divide the sample set into a training set and a test set according to a preset number of times;

[0038] The calculation module is used to determine the consistency result of the sample category to be determined after each partition, based on the training set and test set that are partitioned each time.

[0039] The judgment module determines the consistency result of the sample category to be determined in the selected sample set based on the consistency result after each partition.

[0040] In one embodiment of this implementation, the loop module is further configured to: when the judgment module determines that the consistency result after a certain partition is stable, select another sample set from the multiple sample sets corresponding to the sample category to be determined, until the multiple sample sets corresponding to the sample category to be determined are traversed.

[0041] The calculation module is further configured to: calculate the consistency results of the sample category to be determined in the corresponding multiple sample sets, and obtain the consistency result of the sample category to be determined in the sample library based on the consistency results of the sample category to be determined in the corresponding multiple sample sets.

[0042] In one embodiment of this implementation, the evaluation module further includes:

[0043] The training module is configured to train the classification network using the training set that is divided each time;

[0044] The testing module is configured to classify the test set corresponding to the training set based on the trained classification network to obtain the classification result;

[0045] The calculation module is also configured to determine the consistency of the sample category to be determined after each division based on the classification result.

[0046] In one embodiment of this implementation, the training module is further configured to: input the training set divided each time into the classification network, and train to obtain the weight parameters of the classification network;

[0047] The testing module is further configured to: classify the test set using the classification network according to the weight parameters to obtain the classification result.

[0048] In one embodiment of this implementation, the computing module is further configured as follows:

[0049] In each partition, the proportion of the sample category to be determined identified by the trained classification network on the test set is calculated, as well as the true proportion of that category of samples in the test set.

[0050] The ratio of the minimum to the maximum value of the identification ratio and the true ratio in each division is taken as the consistency result of the sample category to be determined in each division.

[0051] In one embodiment of this implementation, the partitioning module is configured to maintain the same ratio of the two classes of samples in the training set as the ratio of the two classes of samples in the test set.

[0052] The present invention also proposes a medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements the method described in any of the preceding claims.

[0053] The present invention also proposes a computing device comprising a processor for executing a computer program stored in a memory to implement the method described in any of the preceding claims.

[0054] The technical solution provided by this invention can evaluate the consistency of the sample library and determine the consistency of each category in the sample library. Moreover, the consistency results of each category are determined based on the feature dimensions of each sample in the sample library itself. Determining the consistency based on the feature dimensions of each category of samples is more in line with the recognition logic of the deep learning algorithm of the classification network. After knowing the consistency level of each category in the sample library, the classification network can be designed and optimized in a targeted manner. Attached Figure Description

[0055] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.

[0056] Figure 1 This is a step diagram of an embodiment of the sample library consistency determination method of the present invention;

[0057] Figure 2 This is a flowchart of the sample library consistency evaluation of the present invention;

[0058] Figure 3 This is a block diagram of an embodiment of the sample library consistency determination device of the present invention;

[0059] Figure 4 This is a schematic diagram of the structure of a medium according to an embodiment of the present invention;

[0060] Figure 5 This is a schematic diagram of the structure of an embodiment of a computing device according to the present invention.

[0061] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0062] The principles and spirit of the invention will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are given merely to enable those skilled in the art to better understand and implement the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art.

[0063] Those skilled in the art will recognize that embodiments of the present invention can be implemented as an apparatus, device, method, or computer program product. Therefore, this disclosure can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0064] According to an embodiment of the present invention, a method, apparatus, medium, and computing device for determining the consistency of a sample library are proposed. Invention Overview

[0066] The inventors discovered that classification networks are based on deep learning algorithms to classify images or photos. Deep learning algorithms require a sample database to learn the relationship between features and categories, thus establishing a mapping between features and categories. Therefore, the features and categories of each sample in the sample database used to train the classification network play a crucial role. Samples of the same category in the sample database often share the same or similar features, allowing them to be distinguished from other samples. The degree of similarity among samples of the same category varies across different sample databases. For sample databases with high consistency (high similarity among samples of the same category), differentiation is relatively easy, and the required deep learning algorithm is simpler. Conversely, for sample databases with low consistency (low similarity among samples of the same category), differentiation is relatively difficult, and the required deep learning algorithm is more complex.

[0067] On the other hand, the inventors found that for the same sample, the classification by deep learning algorithms and manual classification are not entirely the same. Some samples are easy to classify manually, but more difficult for deep learning algorithms. Some samples are difficult to classify manually, but easier for deep learning algorithms.

[0068] Therefore, when using a classification network to partition a sample set, it is necessary to know whether the sample set is easy for deep learning algorithms to partition or difficult for deep learning algorithms to partition. In other words, it is necessary to know the consistency of the sample set, so as to choose the direction of deep learning algorithm development based on the consistency.

[0069] Currently, determining the performance of classification networks mostly starts with the network's algorithm itself, using predefined metrics to evaluate the dataset and derive the network's stability, accuracy, and so on. However, these methods overlook the fact that classification networks perform differently on different datasets. This is because classification networks cannot always learn enough parameters from a limited sample library to predict the test set effectively. Furthermore, datasets differ; some are easy to classify, while others have significant intra-class variability and are difficult to categorize. Therefore, before determining the performance of a deep learning algorithm, it is necessary to ensure the consistency of the sample library used to train the deep learning model.

[0070] After introducing the basic principles of the present invention, various non-limiting embodiments of the present invention will be described in detail below.

[0071] Exemplary methods

[0072] Please refer to the reference. Figure 1 and Figure 2 This exemplary embodiment proposes a method for determining the consistency of a sample library, including the following steps:

[0073] Step S100: Obtain the sample library.

[0074] In this step, the obtained sample library is used to train the classification network. The sample library contains multiple detection samples, which can be a photo, an image, etc. The sample library can be a photo set or an image set, etc.

[0075] The sample library can be prepared in advance and then provided according to a preset interface or upload method. For example, it can be prepared in advance by the user for the classification network he / she wants to evaluate.

[0076] After obtaining the sample library, each sample in the sample library can be labeled with a category, such as manually labeling the category of each sample. Generally, each sample in the sample library has its own category label. If the sample in the obtained sample library already has a category label, then no further labeling is needed. If the sample in the obtained sample library does not have a category label, then it is necessary to label it with a category.

[0077] Step S200: Select all samples from two categories in the sample library to form a sample set. Since the categories of all samples in the sample library have been known in the previous step, in this step, for each category, select all samples from two categories to form a sample set. For example, in an exemplary embodiment, assuming that the sample library is labeled with four categories A, B, C, and D, then the sample set can be formed by selecting all samples from any two categories (A, B, C, and D) based on the category to be determined (e.g., category A) and the other three categories (B, C, and D). For example, all samples from category A and all samples from category B, or all samples from category A and all samples from category C, or all samples from category A and all samples from category C. Of course, if the category to be evaluated is category B, then the sample set is formed by selecting all samples from one of the other three categories (A, C, and D) based on all samples from category B.

[0078] Step S300: Divide the sample set into a training set and a test set, and determine the consistency of any sample category to be determined in the sample library based on the training set and the test set. The method of obtaining the sample set has been described in step S200. In this step, the evaluation is performed on the category to be evaluated in the previous step and the sample set selected for that category. The sample set selected in the previous step can be divided into a training set and a test set. Then, the consistency of the category to be evaluated is determined using the divided training set and the test set. For example, to determine the consistency of category B, all samples of categories B and C can be selected to form a sample set in step S200. In step S300, the sample set of categories B and C is divided into a training set and a test set. Then, the consistency of category B samples is determined using the divided training set and the test set. It should be noted that when determining the consistency of category B, samples from category B and any other category, such as category C, are first selected. The training set and test set are then divided based on samples from categories B and C. In other words, training and testing are based on the feature dimensions of categories B and C themselves. This evaluation method that utilizes feature dimensions is more in line with the recognition logic of deep learning algorithms for classification networks.

[0079] In another embodiment of this exemplary implementation, for step S200, multiple sample sets can be formed based on any sample category in the sample library, together with all other sample categories in the sample library. Taking the sample library containing four categories (A, B, C, and D) after the above category labeling as an example, in this embodiment, the following sample sets can first be obtained from the sample library:

[0080] Based on category A: A+B sample set, A+C sample set, A+D sample set;

[0081] Based on category B: B+A sample set, B+C sample set, B+D sample set;

[0082] Based on category C: C+A sample set, C+B sample set, C+D sample set;

[0083] Based on category D: D+A sample set, D+B sample set, D+C sample set.

[0084] For example, in one embodiment, two samples can be randomly selected from four categories A, B, C, and D, such as samples from category C and samples from category D to form a sample set, which is then divided into a training set and a test set. Based on the training set and the test set, the consistency of category C or category D can be determined.

[0085] For example, in another embodiment, two samples can be randomly selected from four categories A, B, C, and D, such as samples from category C and samples from category D to form a sample set. Then, the sample set can be divided into multiple training sets and test sets. Based on the multiple training sets and test sets, the consistency of category C or category D can be determined.

[0086] For example, in another embodiment, consistency of category A can be determined based on any one of the four categories A, B, C, and D, such as determining the consistency of category A. Then, sample sets A+B, A+C, and A+D are selected respectively, and each of these sample sets is divided. Based on the training and test sets formed by each sample set, the consistency results of category A in sample sets A+B, A+C, and A+D are determined respectively. Finally, the consistency results of category A in the sample library are obtained by combining the three consistency results.

[0087] For example, in another embodiment, consistency of category A can be determined based on any one of the four categories A, B, C, and D, such as determining the consistency of category A. Then, sample sets A+B, A+C, and A+D are selected respectively, and these sample sets are divided multiple times. Based on the training and test sets formed by these multiple divisions, the consistency results of category A in sample sets A+B, A+C, and A+D are determined respectively. Finally, the consistency results of category A in the sample library are obtained by combining the three consistency results.

[0088] In another embodiment of this exemplary implementation, step S300 further includes the following steps:

[0089] Step S310: Select any sample set from the multiple sample sets corresponding to the sample category to be determined. Taking the above embodiment as an example, the four categories A, B, C, and D each include three sample sets. In this case, for the category to be determined, one sample set can be selected from the three sample sets corresponding to that category. For example, to determine the consistency of category A, one can be selected from the A+B sample set, the A+C sample set, and the A+D sample set; to determine category D, one can be selected from the D+A sample set, the D+B sample set, and the D+C sample set, and so on.

[0090] Step S320: Divide the sample set into a training set and a test set according to a preset number of times. Assuming that the consistency of the samples of category A is determined and the A+B sample set is selected in step S310, then in this step, the A+B sample set is divided into a training set and a test set a preset number of times. The specific number of division rounds can be preset.

[0091] In one embodiment, random partitioning can be adopted.

[0092] Step S330: Based on the training and test sets generated in each partition, determine the consistency result of the sample category to be determined after each partition, and determine the consistency result of the sample category to be determined in the selected sample set based on the consistency result after each partition. In step S320, the A+B sample set will be partitioned multiple times a preset number of times. In this step, the consistency of samples of category A is evaluated based on the training and test sets generated in each partition, and the consistency result of category A after each partition is obtained. In a single partition, the training and test sets may not be balanced due to partitioning errors, and the calculated consistency may also contain random errors. In this embodiment, a preset number of partitions is set according to empirical values. After a preset number of partitions, the random errors caused by a single partition are avoided. After the preset number of partitions is reached, the random errors are small. The consistency result of the sample set is determined by calculating the weight of the consistency result obtained after each partition in the total consistency results obtained from all partitions. For example, in the A+B sample set, the consistency results were 80% in six of them, 98% in one, 20% in one, and 70% in one. It can be seen that 80% has the largest weight, so it can be determined that the consistency result of category A samples in the A+B sample set is 80%.

[0093] In this embodiment, consistency evaluation can be performed in the following manner:

[0094] First, the classification network is trained using the training set from each partition. Based on the trained network, the corresponding test set is classified to obtain the classification result. For example, the training set from each partition is input into the classification network to train and obtain the weight parameters. The classification network is then used to classify the test set according to the weight parameters to obtain the classification result. Then, based on the classification result, the consistency of the sample category to be determined after each partition is determined. For example, in each partition, the proportion of the sample category to be determined identified by the trained classification network on the test set in the test set, and the true proportion of that category in the test set are calculated. The ratio of the minimum to the maximum value of the identification proportion and the true proportion in each partition is taken as the consistency result of the sample category to be determined in each partition.

[0095] Suppose the A+B sample set contains 10 photos of category A and 10 photos of category B. After one split, the training set contains 6 A photos and 4 B photos, and the test set contains 4 A photos and 6 B photos. For category A, the actual proportion in the test set is 2 / 3. If the classification network trained on the training set is used to classify the test set, the proportion of category A photos identified is 1 / 2. Then the consistency result of category A in this round is min(2 / 3, 1 / 2) / max(2 / 3, 1 / 2) = 75%.

[0096] In another embodiment of this exemplary implementation, the following steps are included after step S330:

[0097] Step S340: After obtaining the consistency results after each partition, determine whether the partitioning has reached the preset number of times. If so, traverse the multiple sample sets corresponding to the sample category to be determined, and obtain the consistency results of the sample category to be determined in each of the multiple corresponding sample sets. In step S330, the A+B sample set is partitioned a preset number of times, and the consistency results in each round are obtained. Each partition is recorded once until the preset number of partitions is reached. After reaching the preset number of partitions, another sample set corresponding to category A is selected for partitioning, until all sample sets corresponding to category A are traversed, and the consistency results of category A in other sample sets are obtained. For example, if the consistency results of category A in the A+B sample set are obtained in step S330, then the consistency results of category A in the A+C sample set and the consistency results in the A+D sample set need to be obtained at this time. The specific method is the same as step S330, and will not be described in detail here.

[0098] Step S350: Based on the consistency results of the sample category to be determined in the corresponding multiple sample sets, obtain the consistency result of the sample category to be determined in the sample library. After step S340, the consistency of category A with each of the other sample sets is obtained. At this time, combining the consistency results, the consistency result of category A in the entire sample library can be obtained. For example, the largest consistency result of category A in each of the other sample sets can be taken as the consistency result of category A in the entire sample library. According to the above method, the consistency of category A with the other three categories B, C, and D can be obtained separately. Then, the consistency result of category A in the entire sample library can be obtained. Then, it can be clear whether the classification network can easily distinguish between category A samples and the other three categories B, C, and D samples. Moreover, this result is based on the feature dimensions of category A samples and the other three categories B, C, and D samples themselves for training and testing. This method is more in line with the recognition logic of deep learning algorithms. Therefore, the consistency result obtained by this method is more convincing.

[0099] In another embodiment of this exemplary implementation, the ratio of the two types of samples in the training set is the same as the ratio of the two types of samples in the test set. Specifically, when dividing the selected sample set in step S320, the same ratio of the two types of samples can be used. For example, for a sample set of A+B, if the ratio of A samples to B samples in the training set is set to 2:1, then the ratio of A samples to B samples in the test set will also be maintained at 2:1, ensuring that the training set and the test set have the same ratio of the two types of samples, thereby avoiding the impact on the ratio of a certain type of sample during the training and testing process of the deep learning network.

[0100] Additionally, the training set A+B needs to be partitioned a predetermined number of times. Each partition can be randomized. For example, the first partition might be 70% A + 70% B in the training set and 30% A + 30% B in the test set; the second partition might be 60% A + 60% B in the training set and 40% A + 40% B in the test set; and the third partition might be 30% A + 30% B in the training set and 70% A + 70% B in the test set. Although the number of A and B samples in the training and test sets may differ in each partition, the ratio of A to B samples in both sets remains the same. It should be noted that the random partitioning of A samples here refers to:

[0101] First, the 70% proportion can be determined randomly, for example, the training set can be divided into 5%, 18%, and 33% of sample A.

[0102] Second, the 5%, 18%, and 33% of A samples can be randomly selected from all A samples.

[0103] The above partitioning method can reduce the impact of random partitioning errors on deep learning.

[0104] The technical solution provided by this invention can evaluate the consistency of a sample library, determining the consistency of each category within the library. Furthermore, the consistency results for each category are evaluated based on the feature dimensions of each sample within the library itself. Evaluating consistency based on the feature dimensions of each category aligns better with the recognition logic of deep learning algorithms in classification networks. Once the consistency level of each category in the sample library is known, the classification network can be designed and optimized accordingly. For example, if the consistency of each category in the sample library is high, it indicates that the samples in each category are relatively easy to distinguish, allowing for the selection of a more lightweight deep learning algorithm. If the consistency of a particular category in the sample library is low, then there may be erroneous samples in that category, facilitating targeted checks. If no errors are found, it indicates that this category is relatively more difficult to identify compared to other categories. Therefore, the sample library can be compared, and the classification network can be designed and optimized in a targeted manner based on the difficulty of identifying different categories.

[0105] Exemplary device

[0106] After introducing the method of exemplary embodiments of the present invention, the following will refer to... Figure 3 An exemplary embodiment of the present invention provides a sample library consistency determination apparatus, the apparatus comprising:

[0107] Module 100 is used to acquire the sample library;

[0108] The classification module 200 is used to select any two categories of all samples from the sample library to form a sample set;

[0109] The determination module 300 is used to divide the sample set into a training set and a test set, and determine the consistency of any sample category to be determined in the sample library based on the training set and the test set.

[0110] In this exemplary embodiment, the classification module 200 is configured to: based on any sample category to be determined in the sample library, form multiple sample sets with all other sample categories in the sample library.

[0111] In this exemplary embodiment, the determining module 300 includes:

[0112] The loop module 310 is used to select any sample set from the multiple sample sets corresponding to the sample category to be determined;

[0113] The partitioning module 320 is used to partition the sample set into a training set and a test set according to a preset number of times;

[0114] The calculation module 350 is used to determine the consistency result of the sample category to be determined after each division based on the training set and test set divided each time.

[0115] The judgment module 360 ​​is used to judge whether the consistency result after each partition is stable, and to take the stable consistency result as the consistency result of the sample category to be determined in the selected sample set.

[0116] In this exemplary embodiment, the loop module 310 is further configured to: when the judgment module 360 ​​determines that the consistency result after a certain partition is stable, select another sample set from the multiple sample sets corresponding to the sample category to be determined, until the multiple sample sets corresponding to the sample category to be determined are traversed.

[0117] The calculation module 350 is further configured to: calculate the consistency results of the sample category to be determined in the corresponding plurality of sample sets, and obtain the consistency result of the sample category to be determined in the sample library based on the consistency results of the sample category to be determined in the corresponding plurality of sample sets.

[0118] In this exemplary embodiment, the determining module 300 further includes:

[0119] Training module 330 is configured to train the classification network using the training set that is divided each time;

[0120] Test module 340 is configured to classify the test set corresponding to the training set based on the trained classification network to obtain the classification result;

[0121] The calculation module 350 is also configured to determine the consistency of the sample category to be determined after each division based on the classification result.

[0122] In this exemplary embodiment, the training module 330 is further configured to: input the training set divided each time into the classification network, and train to obtain the weight parameters of the classification network;

[0123] The test module 340 is further configured to: classify the test set using the classification network according to the weight parameters to obtain a classification result.

[0124] In this exemplary embodiment, the computing module 350 is further configured to:

[0125] In each partition, the proportion of the sample category to be determined identified by the trained classification network on the test set is calculated, as well as the true proportion of that category of samples in the test set.

[0126] The ratio of the minimum to the maximum value of the identification ratio and the true ratio in each division is taken as the consistency result of the sample category to be determined in each division.

[0127] In this exemplary embodiment, the partitioning module 320 is configured to maintain the same ratio of the two classes of samples in the training set as the ratio of the two classes of samples in the test set.

[0128] Exemplary media

[0129] After introducing the methods and apparatus of exemplary embodiments of the present invention, the following references are made. Figure 4 A computer-readable storage medium according to an exemplary embodiment of the present invention will be described.

[0130] Please refer to Figure 4 The computer-readable storage medium shown is an optical disc 70, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it implements the steps described in the above method implementation, such as: acquiring a sample library and labeling all samples in the sample library with sample categories; based on any sample category to be determined in the sample library and other sample categories in the sample library, selecting all samples of two categories from the sample library to form a sample set; dividing the sample set into a training set and a test set, and determining the consistency of any sample category to be determined in the sample library based on the training set and the test set; the specific implementation of each step will not be repeated here.

[0131] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media, which will not be elaborated here.

[0132] Exemplary computing device

[0133] After introducing the methods, apparatus, and media of exemplary embodiments of the present invention, the following references are made. Figure 5 A computing device 80 according to an exemplary embodiment of the present invention will be described.

[0134] Figure 5A block diagram is shown of an exemplary computing device 80 suitable for implementing embodiments of the present invention, which may be a computer system or a server. Figure 5 The computing device 80 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.

[0135] like Figure 5 As shown, the components of the computing device 80 may include, but are not limited to: one or more processors or processing units 801, system memory 802, and bus 803 connecting different system components (including system memory 802 and processing unit 801).

[0136] The computing device 80 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computing device 80, including volatile and non-volatile media, removable and non-removable media.

[0137] System memory 802 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 8021 and / or cache memory 8022. Computing device 70 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, ROM 8023 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 5 Not shown in the image (usually referred to as a "hard drive"). Although not shown in Figure 5 The diagram illustrates that disk drives for reading and writing to removable non-volatile disks (e.g., "floppy disks") and optical disc drives for reading and writing to removable non-volatile optical discs (e.g., CD-ROMs, DVD-ROMs, or other optical media) can be provided. In these cases, each drive can be connected to bus 803 via one or more data media interfaces. System memory 802 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.

[0138] A program / utility 8025 having a set (at least one) of program modules 8024 may be stored, for example, in system memory 802, and such program modules 8024 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment. Program modules 8024 typically perform the functions and / or methods described in the embodiments of the present invention.

[0139] The computing device 80 can also communicate with one or more external devices 804 (such as a keyboard, pointing device, display, etc.). This communication can be performed through an input / output (I / O) interface. Furthermore, the computing device 80 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 806. Figure 5 As shown, network adapter 806 communicates with other modules of computing device 80 (such as processing unit 801) via bus 803. It should be understood that, although... Figure 5 As not shown, it can be used in conjunction with computing device 80 with other hardware and / or software modules.

[0140] The processing unit 801 executes various functional applications and data processing by running programs stored in the system memory 802. For example, it acquires a sample library and labels all samples in the sample library with sample categories; based on any sample category to be determined in the sample library, and other sample categories in the sample library, it selects all samples from two categories to form a sample set; it divides the sample set into a training set and a test set, and determines the consistency of any sample category to be determined in the sample library based on the training set and the test set. The specific implementation methods of each step will not be repeated here. It should be noted that although several units / modules or sub-units / sub-modules of the sample library consistency determination device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.

[0141] Furthermore, although the operations of the method of the present invention are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0142] While the spirit and principles of the invention have been described with reference to several specific embodiments, it should be understood that the invention is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for ease of description. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

[0143] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural transformations made using the contents of the present invention's specification and drawings under the inventive concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.

[0144] Based on the above description, the embodiments of the present invention provide the following technical solutions, but are not limited thereto:

[0145] 1. A method for determining the consistency of a sample library, comprising:

[0146] Obtain the sample library;

[0147] A sample set is formed by randomly selecting all samples from two categories from the sample library;

[0148] The sample set is divided into a training set and a test set, and the consistency of a certain category of samples in the sample library is determined based on the training set and the test set.

[0149] 2. The sample library consistency determination method as described in technical solution 1, wherein, a sample set is formed by randomly selecting all samples of two categories from the sample library, including:

[0150] Based on any sample category to be determined in the sample library, multiple sample sets are formed together with all other sample categories in the sample library.

[0151] 3. The sample library consistency determination method as described in technical solution 1 or 2, wherein dividing the sample set into a training set and a test set, and determining the consistency of samples of a certain sample category in the sample library based on the training set and the test set, includes:

[0152] Select any sample set from the multiple sample sets corresponding to the sample category to be determined;

[0153] The sample set is divided into a training set and a test set according to a preset number of times;

[0154] Based on the training set and test set divided each time, determine the consistency result of the sample category to be determined after each division;

[0155] The consistency result of the sample category to be determined in the selected sample set is determined based on the consistency result after each partition.

[0156] 4. The sample library consistency determination method as described in any one of technical solutions 1-3, wherein after obtaining the consistency result after each partition, it further includes:

[0157] Determine if the preset number of divisions has been reached.

[0158] If so, then iterate through the multiple sample sets corresponding to the sample category to be determined, and obtain the consistency results of the sample category to be determined in the multiple corresponding sample sets.

[0159] Based on the consistency results of the sample category to be determined in the corresponding multiple sample sets, the consistency result of the sample category to be determined in the sample library is obtained.

[0160] 5. The sample library consistency determination method as described in any one of technical solutions 1-4, wherein determining the consistency result of the sample category to be determined after each partitioning based on the training set and test set formed each time includes:

[0161] The classification network is trained using the training set divided each time, and the training set is used to classify the test set corresponding to the training set based on the trained classification network to obtain the classification result;

[0162] Based on the classification results, the consistency of the sample category to be determined after each division is determined.

[0163] 6. The sample library consistency determination method as described in any one of technical solutions 1-5, wherein the classification network is trained using the training set divided each time, and the test set corresponding to the training set is classified based on the trained classification network to obtain the classification result, including:

[0164] The training set is divided into portions each time and input into the classification network to train and obtain the weight parameters of the classification network.

[0165] The classification network is used to classify the test set according to the weight parameters to obtain the classification result.

[0166] 7. The sample library consistency determination method as described in any one of technical solutions 1-6, wherein the consistency result of the sample category to be determined after each partition is determined by the following method:

[0167] In each partition, the proportion of the sample category to be determined identified by the trained classification network on the test set is calculated, as well as the true proportion of that category of samples in the test set.

[0168] The ratio of the minimum to the maximum value of the identification ratio and the true ratio in each division is taken as the consistency result of the sample category to be determined in each division.

[0169] 8. The sample library consistency determination method as described in any one of technical solutions 1-7, wherein the ratio of the two types of samples in the training set is the same as the ratio of the two types of samples in the test set.

[0170] 9. A sample library consistency determination device, comprising:

[0171] The acquisition module is used to acquire the sample library;

[0172] The classification module is used to select any two categories of all samples from the sample library to form a sample set;

[0173] An evaluation module is used to divide the sample set into a training set and a test set, and determine the consistency of a certain sample category in the sample library based on the training set and the test set.

[0174] 10. The sample library consistency determination device as described in technical solution 9, wherein the classification module is configured as follows:

[0175] Based on any sample category to be determined in the sample library, multiple sample sets are formed together with all other sample categories in the sample library.

[0176] 11. The sample library consistency determination device as described in technical solution 9 or 10, wherein the evaluation module includes:

[0177] The loop module is used to select any sample set from the multiple sample sets corresponding to the sample category to be determined;

[0178] The partitioning module divides the sample set into a training set and a test set according to a preset number of times;

[0179] The calculation module is used to determine the consistency result of the sample category to be determined after each partition, based on the training set and test set that are partitioned each time.

[0180] The judgment module determines the consistency result of the sample category to be determined in the selected sample set based on the consistency result after each partition.

[0181] 12. The sample library consistency determination device as described in any one of technical solutions 9-11, wherein the loop module is further configured to: when the judgment module determines that the consistency result after a certain partition is stable, select another sample set from the multiple sample sets corresponding to the sample category to be determined, until the multiple sample sets corresponding to the sample category to be determined are traversed.

[0182] The calculation module is further configured to: calculate the consistency results of the sample category to be determined in the corresponding multiple sample sets, and obtain the consistency result of the sample category to be determined in the sample library based on the consistency results of the sample category to be determined in the corresponding multiple sample sets.

[0183] 13. The sample library consistency determination apparatus as described in any one of technical solutions 9-12, wherein the evaluation module further includes:

[0184] The training module is configured to train the classification network using the training set that is divided each time;

[0185] The testing module is configured to classify the test set corresponding to the training set based on the trained classification network to obtain the classification result;

[0186] The calculation module is also configured to determine the consistency of the sample category to be determined after each division based on the classification result.

[0187] 14. The sample library consistency determination device as described in any one of technical solutions 9-13, wherein,

[0188] The training module is further configured to: input the training set divided each time into the classification network, and train to obtain the weight parameters of the classification network;

[0189] The testing module is further configured to: classify the test set using the classification network according to the weight parameters to obtain the classification result.

[0190] 15. The sample library consistency determination apparatus as described in any one of technical solutions 9-14, wherein the calculation module is further configured to:

[0191] In each partition, the proportion of the sample category to be determined identified by the trained classification network on the test set is calculated, as well as the true proportion of that category of samples in the test set.

[0192] The ratio of the minimum to the maximum value of the identification ratio and the true ratio in each division is taken as the consistency result of the sample category to be determined in each division.

[0193] 16. The sample library consistency determination apparatus as described in any one of technical solutions 9-15, wherein the partitioning module is configured to: keep the ratio of the two types of samples in the training set the same as the ratio of the two types of samples in the test set.

[0194] 17. A medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of claims 1-8.

[0195] 18. A computing device comprising a processor for executing a computer program stored in a memory to implement the method as described in any one of claims 1-8.

Claims

1. A method for determining the consistency of a sample library, applied in the field of image classification, the method comprising: Obtain a sample library, which is used to train the classification network; the sample library is an image set. Each sample image in the sample library is labeled with a category; A sample set is formed by randomly selecting all sample images from two categories from the sample library; The sample set is divided into a training set and a test set, and the consistency of features of a certain category of sample images in the sample library is determined based on the training set and the test set. The sample set is composed of all sample images from two randomly selected categories in the sample library, including: Based on any sample image category to be determined in the sample library, multiple sample sets are formed by combining each sample image category with all other sample image categories in the sample library. The step of dividing the sample set into a training set and a test set, and determining the consistency of features of a certain category of sample images in the sample library based on the training set and the test set, includes: Select any sample set from the multiple sample sets corresponding to the sample image category to be determined; The sample set is divided into a training set and a test set according to a preset number of times; The training set is input into the classification network for each partitioning to train and obtain the weight parameters of the classification network. The classification network is then used to classify the test set according to the weight parameters to obtain the classification result. In each partitioning, the recognition ratio of the sample image category to be determined identified by the trained classification network on the test set and the true proportion of that category of samples in the test set are calculated. The ratio of the minimum to the maximum value of the recognition ratio and the true proportion in each partitioning is taken as the consistency result of the sample image category to be determined in each partitioning. The consistency result of the sample image category to be determined in the selected sample set is determined based on the consistency result after each partition. After the consistency result stabilizes after a certain partition, another sample set is selected from the multiple sample sets corresponding to the sample image category to be determined, until the multiple sample sets corresponding to the sample image category to be determined are traversed. Calculate the consistency results of the sample image category to be determined in the corresponding multiple sample sets, and based on the consistency results of the sample image category to be determined in the corresponding multiple sample sets, obtain the consistency result of the sample image category to be determined in the sample library.

2. The sample library consistency determination method as described in claim 1, wherein, After obtaining the consistency results after each partition, the following is also included: Determine if the preset number of partitions has been reached. If so, then iterate through multiple sample sets corresponding to the sample image category to be determined, and obtain the consistency results of the sample image category to be determined in the multiple corresponding sample sets. Based on the consistency results of the sample image category to be determined in the corresponding multiple sample sets, the consistency result of the sample image category to be determined in the sample library is obtained.

3. The sample library consistency determination method as described in any one of claims 1-2, wherein, The ratio of the two types of sample images in the training set is the same as the ratio of the two types of sample images in the test set.

4. A sample library consistency determination device, applied in the field of image classification, comprising: The acquisition module is used to acquire a sample library, which is used to train a classification network, and the sample library is an image set. The classification module is used to label the category of each sample image in the sample library; to form a sample set by selecting all samples of two categories from the sample library; and to form multiple sample sets based on any sample image category to be determined in the sample library, respectively, and all other sample image categories in the sample library. The evaluation module is used to divide the sample set into a training set and a test set, and to determine the consistency of a certain sample image category in the sample library based on the training set and the test set. The evaluation module includes: The loop module is used to select any sample set from the multiple sample sets corresponding to the sample image category to be determined; The partitioning module divides the sample set into a training set and a test set according to a preset number of times; The calculation module is used to determine the consistency result of the sample image category to be determined after each division, based on the training set and test set divided each time. The judgment module determines the consistency result of the sample image category to be determined in the selected sample set based on the consistency result after each division. The training module is configured to train the classification network using the training set that is divided each time; The testing module is configured to classify the test set corresponding to the training set using the trained classification network to obtain the classification result; The calculation module is also configured to determine the consistency result of the sample image category to be determined after each division based on the classification result; The training module is further configured to: input the training set divided each time into the classification network, and train to obtain the weight parameters of the classification network; The testing module is further configured to: classify the test set using the classification network according to the weight parameters to obtain a classification result; The computing module is also configured to: In each partition, the proportion of the sample image category to be determined identified by the trained classification network on the test set is calculated, as well as the true proportion of that category of samples in the test set. The ratio of the minimum to the maximum value of the recognition ratio and the true ratio in each division is taken as the consistency result of the sample image category to be determined in each division. The loop module is further configured to: when the judgment module determines that the consistency result after a certain partition is stable, select another sample set from the multiple sample sets corresponding to the sample image category to be determined, until the multiple sample sets corresponding to the sample image category to be determined are traversed. The calculation module is further configured to: calculate the consistency results of the sample image category to be determined in the corresponding multiple sample sets, and obtain the consistency result of the sample image category to be determined in the sample library based on the consistency results of the sample image category to be determined in the corresponding multiple sample sets.

5. The sample library consistency determination device as described in claim 4, wherein, The partitioning module is configured to maintain the same ratio of the two types of sample images in the training set as the ratio of the two types of sample images in the test set.

6. A medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-3.

7. A computing device, characterized in that, The computing device includes a processor for implementing the method as described in any one of claims 1-3 when executing a computer program stored in a memory.