A data set similarity comparison method based on binary classification model
Through the data set similarity comparison method based on the binary classification model, the model is trained using the binary cross entropy loss function to calculate the accuracy to measure the similarity between data sets, solving the problem of data set similarity detection in the prior art, and achieving effective detection of multiple types of data sets.
Patent Information
- Application Number
- CN202410192992.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-21
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-02-21
AI Technical Summary
The prior art is difficult to effectively detect similarities between data sets, especially in the face of data noise and multiple types of data sets, and cannot be applied to image data sets.
The data set similarity comparison method based on binary classification model is used to construct the training set and test set through random sampling and hierarchical random sampling, and the model is trained using binary cross entropy loss function to calculate the accuracy of the model on the test set to measure the similarity between data sets.
It effectively solves the problem that traditional similarity detection methods are affected by data noise. It is suitable for many types of data sets, including image data, improves the discrimination ability of similar data sets and reduces the misjudgment rate.
Smart Images

Figure CN118247527B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence and data analysis, and in particular relates to a data set similarity comparison method based on a binary classification model. Background Art
[0002] Data is the cornerstone of artificial intelligence algorithms, and more and more companies regard data as their valuable assets. Companies can make data into data sets for training or sell to peers. It is of great significance to determine whether two data sets are similar. On the one hand, in the large-scale data factor market, due to the widespread use and circulation of data, the risk of data plagiarism also increases, which damages the value of enterprises and research institutions. Assessing the similarity between data sets has become a key step to ensure the originality and compliance of data; on the other hand, it is also of great value in data selection, training and generalization in artificial intelligence tasks, which helps to quickly discover and expand available data sets.
[0003] In order to improve efficiency and performance, many companies and research institutions frequently use data sets provided by third parties. However, this also lays the hidden danger of data plagiarism. Having a preliminary method to detect whether the other party's data set is plagiarized has become a necessary means to protect one's own intellectual property rights.
[0004] Through similarity detection methods, the degree of similarity between different data sets can be effectively identified. This helps to discover potential cases of plagiarism, protect the uniqueness of the original data set, and thus protect the legitimate rights and interests of the companies that provide data. By conducting similarity detection regularly, the timeliness of discovering plagiarism can be improved and intellectual property risks can be reduced. At the same time, similarity detection can help companies that need data to select appropriate data sets to expand the amount or diversity of data, thereby improving the generalization ability of the model.
[0005] Nowadays, the data factor market is an integral part of the data economy, and data is the foundation of the data factor market. How to detect the similarity between data sets has become an urgent problem to be solved. Solving this problem will help promote the further resolution of problems such as data plagiarism, data expansion, and data pricing.
[0006] The traditional Jaccard similarity coefficient focuses on the intersection between two data sets, which is easily affected by the addition of data noise. This leads to data plagiarism. Cosine similarity cannot handle negative weights and does not consider the importance of features, so it is not suitable for images. Similarly, conventional feature selection is only applicable to tabular data and is also not applicable to images. Summary of the invention
[0007] In view of the shortcomings of the prior art, the present invention provides a data set similarity comparison method based on a binary classification model, which can help discover potential data plagiarism and data infringement, and can also provide support for expanding data sets.
[0008] The present invention provides a data set similarity comparison method based on a binary classification model, the method comprising the following steps:
[0009] (1) For a given dataset A and dataset B, determine the number of data items in the training set and the number of data items in the test set required for model training according to the amount of data in the dataset A and dataset B;
[0010] (2) Data preprocessing: For unlabeled datasets, randomly sample data from datasets A and B to form training and test sets. For labeled datasets, first analyze the number and distribution of samples in each category. Perform stratified random sampling on the dataset to ensure that samples in each category are fully represented. Then merge the sampled datasets according to the previous operations.
[0011] (3) Model training: Use binary cross entropy loss as the loss function of the model. Through training, the model can determine whether each image comes from a certain dataset. The training is stopped after a certain number of rounds of training or when a stable state is reached.
[0012] (4) Prediction: For the trained model, use the test set to perform classification and obtain the accuracy ε;
[0013] (5) Repeat the experiment N times to obtain the accuracy list P[p1,p1,...,p n-1 ,p n ];
[0014] (6) Similarity calculation: Design a similarity function s and use p as the accuracy on the test set to measure the overall similarity between the two data sets; finally calculate the similarity S of the model final .
[0015] Furthermore, in step (1), the ratio of the number of data items in the training set to the number of data items in the test set is 2:8.
[0016] Furthermore, the data in the training set and the test set of step (2) come from data set A and data set B in a ratio of 50% each, and the label of the data from data set A is set to 0, and the label of the data from data set B is set to 1.
[0017] Furthermore, the loss function expression of step (3) is as follows:
[0018]
[0019] Among them, y represents the real source of the data, Represents the prediction of the data source, y i Indicates the true source of the i-th data. Indicates the predicted source of the i-th data, and N is the total number of data.
[0020] Furthermore, the step (4) is specifically as follows: when the two data sets differ in distribution and image content so that the model cannot determine which data set the image comes from, then the model's accuracy rate p for determining which data set the data comes from is 50%; when the difference in image distribution between the two data sets causes the model to tend to attribute a certain type of image to the data set with more images of this type; this will lead to an increase in the accuracy of that type, and ultimately to an increase in the overall accuracy; similarly, differences between the content of images of the same type will also be used as features to be learned by the model, thereby improving the accuracy of classification.
[0021] Furthermore, the expression of the similarity function s in step (6) is as follows:
[0022]
[0023] When the accuracy on the test set is 0.5, the similarity between the two data sets is 1; when the accuracy is higher than 0.5 or lower than 0.5, the similarity will decrease accordingly.
[0024] Furthermore, the similarity S of the model calculated in step (6) is final The expression is as follows:
[0025]
[0026] Among them, p i is the accuracy of the ith time, and N is the number of repeated experiments.
[0027] The beneficial effects of the present invention are as follows:
[0028] First, the present invention successfully solves the problem of data noise in traditional similarity detection methods by adopting a data set similarity comparison method based on a binary classification model. At the same time, it is applicable to various types of data sets, including image data, effectively improving the ability to distinguish similar data sets and reducing the misjudgment rate. Secondly, the similarity formula of similar data sets is defined by the accuracy of model resolution, which provides a criterion for the similarity of data. The method of the present invention can not only be used to discover data plagiarism and infringement problems, but also provides strong support for the selection, training and generalization of data sets, which helps to promote the development of the data factor market, improve the generalization ability of the model and the protection level of intellectual property rights, and has broad application prospects. These technical effects make the present invention of great significance in the field of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0030] Figure 1 It is a schematic diagram of the algorithm flow of the present invention;
[0031] Figure 2 It is a schematic diagram of the similarity formula of the present invention. DETAILED DESCRIPTION
[0032] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.
[0033] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0034] The following is combined with Figure 1 and 2 As shown, the present invention is further described by way of examples, but the scope of the present invention is not limited in any way.
[0035] Embodiment 1:
[0036] S1: This example uses two iris flower csv data sets as examples. The data includes sepal length, sepal width, petal length, petal width, and species. File A has 10,000 data items, and file B has 10,000 data items. Each data set is set to provide 4,000 training data items and 1,000 test data items.
[0037] S2: Stratified random sampling is performed according to the distribution in the data set to provide 4000 training data and 1000 test data, and the data from A is labeled 0, and the data from B is labeled 1. After merging, a training set containing 8000 data and a test set containing 2000 data are obtained.
[0038] S3: Due to the small number of features in the dataset, only an 8-layer neural network is used in the model selection. The number of hidden units in each layer is as follows [8, 32, 128, 128, 256, 512, 256, 32], and the ReLU function is used to improve the nonlinear fitting ability of the model. Finally, the binary classification is implemented based on the sigmoid function. The training parameters of the model are as follows: learning rate = 0.001, batch size = 32, iteration rounds are 1000, loss function is CrossEntropy, optimizer Adam.
[0039] S4: After training, use the test set to test and repeat the above steps 50 times. Get the accuracy list P: [0.5123, 0.5003, 0.4920, ....., 0.5102, 0.4957].
[0040] S5: Finally, the similarity of the data sets calculated by the model is 99.53%.
[0041] Embodiment 2:
[0042] S1: This example uses the Arabic numeral set as an example, where dataset A is a picture of handwritten numerals by primary school students, and dataset B is also a handwritten dataset, but the collection of numerals is from people of different ages. There are 5,000 pictures in dataset A and dataset B, 500 pictures for each type of numeral.
[0043] S2: Provide 2000 training data and 500 test data from the distribution stratified random sampling in each data set, and label the data from A with 0 and the data from B with 1. After merging, a training set with 4000 data and a test set with 1000 data are obtained.
[0044] S3: Select the ResNet50 model to learn features. Finally, binary classification is implemented based on the sigmoid function. The training parameters of the model are as follows: learning rate = 0.001, batch size = 32, iteration rounds are 1000, loss function is CrossEntropy, optimizer Adam.
[0045] S4: After training, use the test set to test and repeat the above steps 50 times. Get the accuracy list P: [0.6222, 0.6133, 0.6272, ....., 0.6291, 0.6320].
[0046] S5: Finally, the similarity of the data sets calculated by the model is 93.53%.
[0047] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the contents disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0048] It will be appreciated that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
Claims
1. A data set similarity comparison method based on a binary classification model, characterized in that: The method comprises the following steps: (1) For a given dataset A and dataset B, determine the number of data items in the training set and the number of data items in the test set required for model training according to the amount of data in the dataset A and dataset B; (2) Data preprocessing: For unlabeled datasets, randomly sample data from datasets A and B to form training and test sets. For labeled datasets, first analyze the number and distribution of samples in each category. Perform stratified random sampling on the dataset to ensure that samples in each category are fully represented. Then merge the sampled datasets according to the previous operations. (3) Model training: Use binary cross entropy loss as the loss function of the model. Through training, the model can determine whether each image comes from a certain dataset. The training is stopped after a certain number of rounds of training or when a stable state is reached. (4) Prediction: For the trained model, use the test set to perform classification and obtain the accuracy ε; (5) Repeat the experiment N times to obtain the accuracy list P[p1,p1,...,p n-1 ,p n ]; (6) Similarity calculation: Design a similarity function s and use p as the accuracy on the test set to measure the overall similarity between the two data sets; finally calculate the similarity S of the model final .
2. According to claim 1, a data set similarity comparison method based on a binary classification model is characterized in that: In step (1), the ratio of the number of data items in the training set to the number of data items in the test set is 2:
8.
3. According to the method for comparing similarity of data sets based on a binary classification model according to claim 1, it is characterized in that: The data in the training set and test set of step (2) come from dataset A and dataset B in a ratio of 50% each, and the label of the data from dataset A is set to 0, and the label of the data from dataset B is set to 1.
4. According to claim 1, a data set similarity comparison method based on a binary classification model is characterized in that: The loss function expression of step (3) is as follows: Among them, y represents the real source of the data, Represents the prediction of the data source, y i Indicates the true source of the i-th data. Indicates the predicted source of the i-th data, and N is the total number of data.
5. The method for comparing similarity of data sets based on a binary classification model according to claim 1, characterized in that: The step (4) is specifically as follows: when the two data sets differ in distribution and image content so that the model cannot determine which data set the image comes from, then the model's accuracy rate p for determining which data set the data comes from is 50%; when the difference in image distribution between the two data sets causes the model to tend to assign a certain type of image to the data set with more images of this type; this will lead to an increase in the accuracy of that type, and ultimately to an increase in the overall accuracy; similarly, differences between the content of images of the same type will also be used as features to be learned by the model, thereby improving the accuracy of classification.
6. The method for comparing similarity of data sets based on a binary classification model according to claim 1, characterized in that: The expression of the similarity function s in step (6) is as follows: When the accuracy on the test set is 0.5, the similarity between the two data sets is 1; when the accuracy is higher than 0.5 or lower than 0.5, the similarity will decrease accordingly.
7. The method for comparing similarity of data sets based on a binary classification model according to claim 1, characterized in that: The similarity S of the model calculated in step (6) final The expression is as follows: Among them, p i is the accuracy of the ith time, and N is the number of repeated experiments.
Citation Information
Patent Citations
Artificial intelligence (AI) method for cleaning data to train (AI) model
CN115699208A
Systems, methods, and apparatuses for implementing a self-supervised chest x-ray image analysis machine-learning model utilizing transferable visual words
US20210150710A1