A method, apparatus, device and medium for generating pseudo row data
By considering the classification task and data distribution rules of machine learning in the generation of pseudo-row data, pseudo-row data that meets the requirements is constructed, which solves the problem of pseudo-row data interfering with machine learning and improves the classification accuracy of the model.
Patent Information
- Application Number
- CN202211434565.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-16
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2042-11-16
AI Technical Summary
Existing pseudo-row data generation algorithms introduce noise into machine learning classification tasks, resulting in poor or even unusable model classification performance, and cannot effectively reduce the impact of pseudo-row data on machine learning.
For machine learning-based classification tasks, class labels are determined. Based on the configuration ratio of pseudo-row data and the distribution of class labels in the original data, pseudo-row data is constructed. Combined with the distribution of data in each column and the generation rules, pseudo-row data that meets the requirements of machine learning is generated.
By setting appropriate pseudo-row classification labels and data generation rules, the impact of pseudo-row data on machine learning classification can be reduced, ensuring that pseudo-row data does not interfere with the distribution of the original data and improving the model's classification performance.
Smart Images

Figure CN115712851B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data security technology, and in particular to a method, apparatus, device and computer-readable storage medium for generating pseudo-data. Background Technology
[0002] In the era of big data, data has become an increasingly valuable resource, containing immense social and economic value. With the ever-increasing demand for network data sharing and exchange, data breaches have become more frequent in recent years. As the value and monetization capabilities of data increase, the black market for data has become increasingly rampant, with the dark web seeing daily transactions of various leaked data. Source tracing is key to eradicating the black market and data breach problems at their source. Source tracing can help companies understand weaknesses in their internal security management and technical measures; on the other hand, it can have a psychological deterrent effect on perpetrators of criminal acts, thereby effectively reducing the occurrence of similar incidents.
[0003] Data watermarking uses algorithms to embed watermarks into raw data, ensuring the normal use of distributed data. Watermarked data is highly available, highly transparent, and highly concealed, making it difficult for external parties to detect or crack. Upon discovering an information leak, the watermark identifier can be extracted from the leaked data immediately. By reading the watermark identifier code, the leaking entity and responsible person can be accurately located, enabling precise accountability for data leaks and improving the security and traceability of data transmission.
[0004] For structured data stored in a database, common data watermarking algorithms include adding pseudo-rows, adding pseudo-columns, de-identifying watermarks, and adding invisible characters. Among these, adding pseudo-rows refers to adding manually generated entire rows of information when adding watermarks to some output data.
[0005] Fake row data typically consists of multiple data types. Currently, there are three main implementation methods for fake row watermarking algorithms. The first method constructs the data for each type using the contents of a corresponding built-in dictionary. The second method randomly constructs forged data of each type using internal generation logic based on the composition rules of each data type, thus completing the construction of the entire row data. The third method directly and randomly selects data of the same data type from the original data to forge the row data. These three implementation methods have strong randomness, do not consider subsequent data analysis scenarios, and introduce noise that affects machine learning classification tasks, resulting in poor model classification performance or even unusable models.
[0006] It is evident that how to reduce the impact of pseudo-data on machine learning classification is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0007] The purpose of this application is to provide a method, apparatus, device, and computer-readable storage medium for generating pseudo-line data, which can reduce the impact of pseudo-line data on machine learning classification.
[0008] To address the aforementioned technical problems, embodiments of this application provide a method for generating pseudo-line data, comprising:
[0009] The classification task is based on machine learning, which determines the classification labels; each row of data in the original data has a corresponding classification label.
[0010] Based on the set pseudo-row data configuration ratio and the type distribution of all the classification labels contained in the original data, set the pseudo-row classification label corresponding to each pseudo-row data;
[0011] Based on the pseudo-row classification labels, the distribution of each column of data in the original data, and the data generation rules corresponding to each column of data, pseudo-row data is constructed.
[0012] Optionally, setting the pseudo-row classification label corresponding to each pseudo-row data according to the set pseudo-row data configuration ratio and the type distribution of all the classification labels contained in the original data includes:
[0013] The number of pseudo rows in the pseudo row data is determined based on the set pseudo row data configuration ratio and the number of rows in the original data.
[0014] Based on the type distribution of all the classification labels contained in the original data, determine the proportion of each type of classification label;
[0015] Based on the proportion of each type of category label and the number of pseudo-rows, the pseudo-row category label corresponding to each pseudo-row data is determined.
[0016] Optionally, constructing pseudo-row data based on the pseudo-row classification labels, the distribution of data in each column of the original data, and the data generation rules corresponding to each column of data includes:
[0017] Based on the pseudo-row classification labels, determine the constraints corresponding to each column of data in each pseudo-row;
[0018] Based on the distribution of each column of data in the original data, the data generation rules corresponding to each column of data, and the constraints corresponding to each column of data in the pseudo-row data, each pseudo-column data is generated.
[0019] The pseudo-column data are arranged according to the order of the columns in the original data to obtain the pseudo-row data.
[0020] Optionally, generating each pseudo-column data based on the distribution of each column of data in the original data, the data generation rules corresponding to each column of data, and the constraints corresponding to each column of data in the pseudo-row data includes:
[0021] In the case where the original data includes column data with numerical attributes, the probability density function is estimated for the target column data with numerical attributes that have the same target classification label in the original data; wherein, the target column data is any column data among all the column data of the numerical attributes;
[0022] Based on the number of target pseudo-row classification labels that are the same as the target classification labels, the estimated probability density function is sampled to obtain the target pseudo-column data.
[0023] Optionally, generating each pseudo-column data based on the distribution of each column of data in the original data, the data generation rules corresponding to each column of data, and the constraints corresponding to each column of data in the pseudo-row data includes:
[0024] When the original data includes column data of category attributes, the distribution probability of the target column data of the category attributes in the original data is calculated; wherein, the target column data is any one of the column data of all the category attributes.
[0025] Based on the probability distribution of the target column data and the constraints of the category attributes to which the target column data belongs, target pseudo-column data is generated.
[0026] Optionally, generating each pseudo-column data based on the distribution of each column of data in the original data, the data generation rules corresponding to each column of data, and the constraints corresponding to each column of data in the pseudo-row data includes:
[0027] In the case where the original data includes column data of business type, the target column data is divided into target data of numerical attributes and target data of category attributes;
[0028] Generate pseudo data for the numerical attributes according to the data generation rules and constraints corresponding to the column data of the numerical attributes;
[0029] Generate pseudo data for the category attributes according to the data generation rules and constraints corresponding to the column data of the category attributes;
[0030] The pseudo-data of the numerical attribute and the pseudo-data of the category attribute are merged to form the pseudo-column data of the business type.
[0031] Optionally, after constructing the pseudo-row data based on the pseudo-row classification labels, the distribution of each column of data in the original data, and the data generation rules corresponding to each column of data, the method further includes:
[0032] The pseudo-line data is embedded with a watermark and then inserted into the original data.
[0033] Optionally, embedding the pseudo-line data with a watermark and then inserting it into the original data includes:
[0034] Watermarks are embedded in the pseudo-line data;
[0035] The pseudo-row data with embedded watermarks is added to the original data in a uniform distribution.
[0036] Optionally, before constructing the pseudo-row data based on the pseudo-row classification labels, the distribution of each column of data in the original data, and the data generation rules corresponding to each column of data, the method further includes:
[0037] The data columns that meet the correlation requirements with the classification labels are used as the watermark columns to be embedded.
[0038] Accordingly, constructing pseudo-row data based on the pseudo-row classification labels, the distribution of data in each column of the original data, and the data generation rules corresponding to each column of data includes:
[0039] Based on the pseudo-row classification labels, the distribution of the watermark columns to be embedded in the original data, and the data generation rules corresponding to each watermark column to be embedded, pseudo-row data is constructed.
[0040] This application also provides a device for generating pseudo-line data, including a determining unit, a setting unit, and a constructing unit;
[0041] The determining unit is used to determine the classification label based on a machine learning classification task; wherein each row of data in the original data has a corresponding classification label.
[0042] The setting unit is used to set the pseudo row classification label corresponding to each pseudo row data according to the set pseudo row data configuration ratio and the type distribution of all the classification labels contained in the original data;
[0043] The construction unit is used to construct pseudo-row data based on the pseudo-row classification labels, the distribution of each column of data in the original data, and the data generation rules corresponding to each column of data.
[0044] Optionally, the setting unit includes a pseudo-row number determination subunit, a percentage determination subunit, and a label determination subunit;
[0045] The pseudo-row number determination subunit is used to determine the pseudo-row number of pseudo-row data based on the set pseudo-row data configuration ratio and the number of rows of data in the original data.
[0046] The proportion determination subunit is used to determine the proportion of each type of classification label based on the type distribution of all the classification labels contained in the original data;
[0047] The label determination subunit is used to determine the pseudo-row classification label corresponding to each pseudo-row data based on the proportion of each type of classification label and the number of pseudo-rows.
[0048] Optionally, the construction unit includes a condition determination subunit, a generation subunit, and an arrangement subunit;
[0049] The condition determination subunit is used to determine the constraint conditions corresponding to each column of data in each pseudo-row based on the pseudo-row classification label.
[0050] The generation subunit is used to generate pseudo-column data based on the distribution of each column of data in the original data, the data generation rules corresponding to each column of data, and the constraints corresponding to each column of data in the pseudo-row data.
[0051] The arrangement subunit is used to arrange the pseudo-column data according to the order of the column data in the original data to obtain the pseudo-row data.
[0052] Optionally, the generating subunit is used to estimate the probability density function of target column data with the same target classification label in the original data when the original data includes column data of numerical attributes; wherein, the target column data is any column data among all the column data of the numerical attributes;
[0053] Based on the number of target pseudo-row classification labels that are the same as the target classification labels, the estimated probability density function is sampled to obtain the target pseudo-column data.
[0054] Optionally, the generating subunit is used to calculate the distribution probability of the target column data of the category attributes in the original data when the original data includes column data of category attributes; wherein, the target column data is any one column of data among all the column data of the category attributes;
[0055] Based on the probability distribution of the target column data and the constraints of the category attributes to which the target column data belongs, target pseudo-column data is generated.
[0056] Optionally, the generating subunit is used to divide the target column data into target data with numerical attributes and target data with categorical attributes when the original data includes column data of business type;
[0057] Generate pseudo data for the numerical attributes according to the data generation rules and constraints corresponding to the column data of the numerical attributes;
[0058] Generate pseudo data for the category attributes according to the data generation rules and constraints corresponding to the column data of the category attributes;
[0059] The pseudo-data of the numerical attribute and the pseudo-data of the category attribute are merged to form the pseudo-column data of the business type.
[0060] Optionally, it also includes an insertion unit;
[0061] The insertion unit is used to embed the pseudo-line data with a watermark and then insert it into the original data.
[0062] Optionally, the insertion unit includes an embedding subunit and an adding subunit;
[0063] The embedding subunit is used to embed a watermark into the pseudo-line data;
[0064] The adding subunit is used to add the watermarked pseudo-line data to the original data in a uniformly distributed manner.
[0065] Optionally, it also includes units;
[0066] The unit is used to select data columns that meet the correlation requirements with the classification label as watermark columns to be embedded.
[0067] Accordingly, the construction unit is used to construct pseudo-row data based on the pseudo-row classification labels, the distribution of the watermark columns to be embedded in the original data, and the data generation rules corresponding to each watermark column to be embedded.
[0068] This application also provides an electronic device, including:
[0069] Memory, used to store computer programs;
[0070] A processor for executing the computer program to implement the steps of the method for generating pseudo-line data as described above.
[0071] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described method for generating pseudo-line data.
[0072] As can be seen from the above technical solution, a classification label is determined based on the machine learning classification task; each row of data in the original data has a corresponding classification label. The classification label can be regarded as the classification result corresponding to the classification task. Based on the set configuration ratio of pseudo-row data and the type distribution of all classification labels contained in the original data, pseudo-row classification labels are set for each pseudo-row data. A pseudo-row data consists of multiple elements, each element being a data point in a column. Different types of column data have their own corresponding data generation rules. Pseudo-row classification labels can contain at least two types, and the columns of data they depend on will be different for each type of classification label. To reduce the impact of pseudo-row data on machine learning, the distribution of each column of data in the original data can be fully considered when constructing pseudo-row data. Therefore, in this application, pseudo-row data can be constructed based on the pseudo-row classification labels, the distribution of each column of data in the original data, and the data generation rules corresponding to each column of data. In this technical solution, the classification task targeted in machine learning is fully considered, thereby reasonably setting the pseudo-row classification labels. Furthermore, by combining the distribution of each column of data in the original data, pseudo-row data is constructed so that the pseudo-row data will not have much impact on the distribution of the original data, thereby reducing the impact of pseudo-row data on machine learning classification. Attached Figure Description
[0073] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0074] Figure 1 A flowchart illustrating a method for generating pseudo-line data provided in this application embodiment;
[0075] Figure 2 A flowchart illustrating a method for constructing pseudo-line data provided in this application embodiment;
[0076] Figure 3 A schematic diagram of a device for generating pseudo-line data provided in an embodiment of this application;
[0077] Figure 4 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0078] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0079] The terms “comprising” and “having” in the specification, claims, and accompanying drawings of this application, and any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may include steps or units not listed.
[0080] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0081] Next, a method for generating pseudo-row data provided in the embodiments of this application will be described in detail. Figure 1 A flowchart illustrating a method for generating pseudo-line data provided in this application embodiment, the method comprising:
[0082] S101: A machine learning-based classification task to determine classification labels.
[0083] Each row of data in the original data has a corresponding category label.
[0084] Category labels can be viewed as the classification results corresponding to a classification task. Category labels can contain at least two types.
[0085] For example, a classification task might involve categorizing data based on whether a loan has been taken out. In credit data, "loan status" could be specified as a classification label. Classification labels could include two types: "loan" and "no loan."
[0086] S102: Based on the set pseudo-row data configuration ratio and the type distribution of all classification labels contained in the original data, set the pseudo-row classification label corresponding to each pseudo-row data.
[0087] If there are too many fake rows, it will greatly affect the distribution of the original data and make it easy to detect that they are fake rows. If there are too few fake rows, they will not provide much protection for the original data. Therefore, in this embodiment, a fake row configuration ratio can be set.
[0088] In practical applications, a specific numerical value can be set as the pseudo-row data configuration ratio. Alternatively, a numerical range can be set as the pseudo-row data configuration ratio range. When constructing pseudo-row data, users can select a value from the pseudo-row data configuration ratio range based on their actual needs. The pseudo-row data configuration ratio range can be set between 10% and 50%.
[0089] In this embodiment of the application, the number of pseudo rows of pseudo row data is determined based on the set pseudo row data configuration ratio and the number of rows of data in the original data.
[0090] For example, the pseudo-row data configuration ratio can be 10%, meaning that the number of newly added pseudo-row data rows accounts for 10% of the total number of rows in the original data. Assuming the original data has 100 rows, then 100 * 10% = 10 pseudo-row data rows can be added. That is, the pseudo-row data count is 10.
[0091] After determining the number of pseudo-rows, it is necessary to determine the category label corresponding to each pseudo-row. To easily distinguish it from the category labels of each row in the original data, the label corresponding to the pseudo-row can be called the pseudo-row category label.
[0092] In practice, the proportion of each type of category label can be determined based on the type distribution of all category labels contained in the original data; and the category label corresponding to each pseudo row can be determined based on the proportion of each type of category label and the number of pseudo rows.
[0093] For example, taking the category label "Loan Status" as an example, assuming the original data has 80 rows belonging to "Loan" and 20 rows belonging to "No Loan", 10 pseudo-rows need to be set. In order for the pseudo-rows to still match the proportion of each category label in the original data, the category label of 8 pseudo-rows can be set to "Loan", and the category label of 2 pseudo-rows can be set to "No Loan".
[0094] S103: Construct pseudo-row data based on the pseudo-row classification labels, the distribution of data in each column of the original data, and the data generation rules corresponding to each column.
[0095] A pseudo-row of data consists of multiple elements, and each element is a data point in a column of data.
[0096] Different types of column data have their own corresponding data generation rules. Pseudo-row classification labels can contain at least two types, and the column data they depend on will be different for each type of classification label. In order to reduce the impact of pseudo-row data on machine learning, the distribution of each column data in the original data can be fully considered when constructing pseudo-row data. Therefore, in this application, pseudo-row data can be constructed based on pseudo-row classification labels, the distribution of each column data in the original data, and the data generation rules corresponding to each column data.
[0097] Each column of data has its corresponding distribution. Each element in each column of data has its corresponding category label, and the distribution of each column of data reflects the proportion of each element belonging to different category labels.
[0098] The generation rules record how the data is generated, and new data can be constructed based on the generation rules.
[0099] Figure 2 A flowchart of a method for constructing pseudo-line data provided in this application embodiment, the method comprising:
[0100] S201: Based on the pseudo-row classification labels, determine the constraints corresponding to each column of data in each pseudo-row.
[0101] Different pseudo-row category labels result in different constraints for each column of data in the pseudo-row data.
[0102] Taking the category label "Loan or not" as an example, an important factor influencing whether a user "takes a loan" is their annual income. Assuming that in the original data, data with an annual income below "100,000 yuan" belong to the category label "No loan," and data with an annual income above "100,000 yuan" belong to the category label "Loan," then in the pseudo-data, if the pseudo-data category label is "No loan," the constraint condition for the annual income factor included in this pseudo-data can be "less than 100,000 yuan." If the pseudo-data category label is "Loan," then the constraint condition for the annual income factor included in this pseudo-data can be "greater than or equal to 100,000 yuan."
[0103] S202: Generate pseudo-column data based on the distribution of each column of data in the original data, the data generation rules corresponding to each column of data, and the constraints corresponding to each column of data in the pseudo-row data.
[0104] The pseudo-row data consists of multiple elements, each of which can be considered a single column of data. If each column of data can be forged, then the pseudo-row data can be obtained. Therefore, this application embodiment will describe how to generate each pseudo-column of data.
[0105] In this embodiment, to reduce the impact of pseudo-row data on machine learning, the distribution of each column in the original data can be fully considered when constructing pseudo-row data. When the distribution of each column in the pseudo-row data is the same as or similar to the distribution of each column in the original data, the pseudo-row data is not considered an interfering factor. Therefore, inserting pseudo-row data into the original data will have almost no impact on the classification results when performing classification tasks based on machine learning.
[0106] The raw data contains various types of column data, and the data generation rules differ for each type of column data. Common types of column data can be categorized as numerical attribute data, categorical attribute data, and business type data.
[0107] Numerical attribute data refers to data that is in numerical form and whose values do not exhibit regularity, such as annual income and height.
[0108] Category attribute data is a limited number of fixed types, such as province, city, district, etc.
[0109] Business type data is generated according to arrangement rules, such as ID card number, mobile phone number, etc.
[0110] Taking numerical attribute data as an example, when the original data includes columns of numerical attributes, numerical attribute data can be fabricated based on the mean of the original data corresponding to each category label. Alternatively, the probability density function can be estimated for target columns of numerical attributes in the original data that share the same target category label; where the target column is any column of data among all numerical attribute columns; based on the number of target pseudo-row category labels that are identical to the target category label, the estimated probability density function is sampled to obtain the target pseudo-column data.
[0111] Taking the category label "loan status" as an example, the target column data of the numerical attribute is "annual income". Each "annual income" in the column data has its corresponding category label. In practical applications, the column data of "annual income" belonging to "loan" can be used as one type of target column data, and the column data belonging to "no loan" can be used as another type of target column data.
[0112] Suppose that among all the pseudo-row data to be constructed, 8 pseudo-row data need to be labeled with the category label "loan". Then, the column data in the "annual income" column of the original data that belongs to "loan" can be used as the target column data. Calculate the probability density function of the target column data, and then select 8 annual income values from the probability density function as elements in the 8 pseudo-row data.
[0113] Taking categorical attribute data as an example, if the original data includes columns of categorical attributes, categorical attribute data can be fabricated based on the categorical attribute data with the highest proportion under each category label in the original data. Alternatively, the distribution probability of the target column data of the categorical attributes in the original data can be statistically analyzed; where the target column data is any column of data among all categorical attribute columns; based on the distribution probability of the target column data and the constraints of the category attribute to which the target column data belongs, target pseudo-column data can be generated.
[0114] Assuming the category attribute data is provinces, and the provinces included in the whole country are fixed information, then all the provinces included in the whole country are a constraint condition. That is, the province included in a constructed pseudo row of data must be one of the provinces included in the whole country.
[0115] Taking the category label "Loan Status" as an example, the target column data for the category attribute is "Province". Each "Province" in the column data has a corresponding category label. In practical applications, the "Province" column data can be divided into those belonging to "Loan" and those belonging to "No Loan". Assume that all "Provinces" belonging to "Loan" are Province A, and all "Provinces" belonging to "No Loan" are Province B. Assume that 8 rows of pseudo-row data need to be set with the category label "Loan" in all the required constructed pseudo-row data; then Province A can be used as the element in these 8 pseudo-row data rows.
[0116] Taking business type data as an example, when the original data includes column data of business type, the target column data is divided into target data of numerical attributes and target data of category attributes; according to the data generation rules and constraints corresponding to the column data of numerical attributes, pseudo data of numerical attributes is generated; according to the data generation rules and constraints corresponding to the column data of category attributes, pseudo data of category attributes is generated; the pseudo data of numerical attributes and the pseudo data of category attributes are merged into pseudo column data of business type.
[0117] Taking "Mobile Number" as an example, the first 3 digits are the network identification number, digits 4-7 are the area code (HLR), and digits 8-11 are the user number (randomly assigned). The first 3 digits are category attribute data, digits 4-7 (area code) are category attribute data, and digits 8-11 are numerical attribute data. For mobile numbers, digits 8-11 can be generated using a random assignment method.
[0118] The data in a single column of business type can be divided into numerical attribute data and category attribute data. For specific methods of forgery, please refer to the methods of forgery of numerical attribute data and category attribute data introduced above, which will not be repeated here.
[0119] S203: Arrange the pseudo-column data according to the order of the columns in the original data to obtain the pseudo-row data.
[0120] Taking the category label "Loan Status" as an example, assuming that each row of data in the original data contains elements of the types "Name," "Gender," "Mobile Number," "Employer," "Annual Income," and "Fixed Assets," the data in each column can be determined sequentially according to the order of "Name," "Gender," "Mobile Number," "Employer," "Annual Income," and "Fixed Assets." Alternatively, after determining the pseudo-column data for "Name," "Gender," "Mobile Number," "Employer," "Annual Income," and "Fixed Assets," they can be arranged in the order of "Name," "Gender," "Mobile Number," "Employer," "Annual Income," and "Fixed Assets" to obtain pseudo-row data.
[0121] After obtaining the pseudo-line data, the pseudo-line data can be embedded with a watermark and then inserted into the original data.
[0122] In practice, a watermark can be embedded in the pseudo-row data first; then the watermarked pseudo-row data can be added to the original data in a uniform distribution.
[0123] For example, if the original data contains 100 rows and the pseudo-row data contains 10 rows, then one pseudo-row data can be inserted every 10 rows of the original data.
[0124] In addition to adding pseudo-line data to the original data in a uniformly distributed manner, pseudo-line data can also be directly inserted at the end of the original data. In this embodiment, the method of inserting pseudo-line data is not limited.
[0125] As can be seen from the above technical solution, a classification label is determined based on the machine learning classification task; each row of data in the original data has a corresponding classification label. The classification label can be regarded as the classification result corresponding to the classification task. Based on the set configuration ratio of pseudo-row data and the type distribution of all classification labels contained in the original data, pseudo-row classification labels are set for each pseudo-row data. A pseudo-row data consists of multiple elements, each element being a data point in a column. Different types of column data have their own corresponding data generation rules. Pseudo-row classification labels can contain at least two types, and the columns of data they depend on will be different for each type of classification label. To reduce the impact of pseudo-row data on machine learning, the distribution of each column of data in the original data can be fully considered when constructing pseudo-row data. Therefore, in this application, pseudo-row data can be constructed based on the pseudo-row classification labels, the distribution of each column of data in the original data, and the data generation rules corresponding to each column of data. In this technical solution, the classification task targeted in machine learning is fully considered, thereby reasonably setting the pseudo-row classification labels. Furthermore, by combining the distribution of each column of data in the original data, pseudo-row data is constructed so that the pseudo-row data will not have much impact on the distribution of the original data, thereby reducing the impact of pseudo-row data on machine learning classification.
[0126] Considering that in practical applications, row data packets contain multiple elements, and not all elements are related to the category label, in this embodiment, pseudo-column data can be generated only for elements related to the category label in the manner described in S202 above, while pseudo-column data for elements unrelated to the category label can be generated in the traditional way.
[0127] In practical implementation, data columns that meet the relevance requirements of the classification labels can be used as the columns to be embedded with watermarks. Accordingly, based on the pseudo-row classification labels, the distribution of data in each column of the original data, and the data generation rules corresponding to each column, the pseudo-row data can be constructed as follows:
[0128] Taking the category label "Loan Status" as an example, the row data includes five elements: "Name", "Gender", "Mobile Number", "Employer", "Annual Income", and "Fixed Assets". Among them, "Name", "Gender", "Mobile Number" and "Loan Status" are almost unrelated. The pseudo column data corresponding to "Name", "Gender", and "Mobile Number" can be forged in the traditional way; the pseudo column data corresponding to "Employer", "Annual Income", and "Fixed Assets" can be forged in the way described in S202.
[0129] By filtering the columns of data to be embedded with watermarks based on the correlation between each column of data and the category label, only the columns of data that are related to the category label can be forged in the manner set in this application. The columns of data that are not related to the category label can be randomly generated in the traditional way, which reduces the amount of computation required to construct pseudo column data in this application and improves the generation efficiency of pseudo column data.
[0130] Figure 3 A schematic diagram of a pseudo-line data generation device provided in an embodiment of this application includes a determining unit 31, a setting unit 32, and a constructing unit 33;
[0131] Unit 31 is used for machine learning-based classification tasks to determine classification labels; wherein, each row of data in the original data has a corresponding classification label;
[0132] Setting unit 32 is used to set the pseudo row classification label corresponding to each pseudo row data according to the set pseudo row data configuration ratio and the type distribution of all classification labels contained in the original data;
[0133] Construction unit 33 is used to construct pseudo-row data based on pseudo-row classification labels, the distribution of data in each column of the original data, and the data generation rules corresponding to each column of data.
[0134] Optionally, the setting unit includes a pseudo-row number determination sub-unit, a percentage determination sub-unit, and a label determination sub-unit;
[0135] The pseudo-row number determination subunit is used to determine the pseudo-row number of pseudo-row data based on the set pseudo-row data configuration ratio and the number of rows of data in the original data.
[0136] The percentage determination sub-unit is used to determine the percentage of each type of category label based on the type distribution of all category labels contained in the original data;
[0137] The label determination sub-unit is used to determine the pseudo-row category label corresponding to each pseudo-row data based on the proportion of each type of category label and the number of pseudo-rows.
[0138] Optionally, the construction unit includes a condition-determining sub-unit, a generation sub-unit, and an arrangement sub-unit;
[0139] The condition determination sub-unit is used to determine the constraint conditions corresponding to each column of data in each pseudo-row based on the pseudo-row classification label;
[0140] The generation sub-unit is used to generate pseudo-column data based on the distribution of each column of data in the original data, the data generation rules corresponding to each column of data, and the constraints corresponding to each column of data in the pseudo-row data.
[0141] The arrangement sub-unit is used to arrange the pseudo-column data according to the order of the columns in the original data to obtain the pseudo-row data.
[0142] Optionally, the generating sub-unit is used to estimate the probability density function of the target column data with the same target classification label in the original data, when the original data includes column data with numerical attributes; wherein, the target column data is any column data among all column data with numerical attributes;
[0143] Based on the number of target pseudo-row classification labels that are the same as the target classification labels, the estimated probability density function is sampled to obtain the target pseudo-column data.
[0144] Optionally, the generating sub-unit is used to calculate the distribution probability of the target column data of the category attributes in the original data, when the original data includes column data of category attributes; wherein, the target column data is any column data of all category attributes.
[0145] Based on the probability distribution of the target column data and the constraints of the category attribute to which the target column data belongs, target pseudo-column data is generated.
[0146] Optionally, the generating sub-unit is used to divide the target column data into target data with numerical attributes and target data with categorical attributes when the original data includes column data of business type;
[0147] Generate pseudo data for the numerical attributes according to the data generation rules and constraints corresponding to the column data of the numerical attributes;
[0148] Generate pseudo data for the category attributes according to the data generation rules and constraints corresponding to the column data of the category attributes;
[0149] The pseudo-data of numerical attributes and pseudo-data of category attributes are merged into pseudo-column data of business type.
[0150] Optionally, it also includes an insertion unit;
[0151] An insertion unit is used to embed pseudo-line data into the watermark and then insert it into the original data.
[0152] Optionally, the insertion unit includes embedded sub-units and added sub-units;
[0153] Embedded subunits are used to embed watermarks into pseudo-line data;
[0154] Add a sub-unit to add the watermarked pseudo-row data to the original data in a uniform distribution.
[0155] Optionally, it also includes units;
[0156] As a unit, it is used to select data columns that meet the relevance requirements of the classification label as columns to be embedded with watermarks;
[0157] Correspondingly, the construction unit is used to construct pseudo-row data based on the pseudo-row classification labels, the distribution of the watermark columns to be embedded in the original data, and the data generation rules corresponding to each watermark column to be embedded.
[0158] Figure 3 For a description of the features in the corresponding embodiments, please refer to Figure 1 and Figure 2 The relevant descriptions of the corresponding embodiments will not be repeated here.
[0159] As can be seen from the above technical solution, a classification label is determined based on the machine learning classification task; each row of data in the original data has a corresponding classification label. The classification label can be regarded as the classification result corresponding to the classification task. Based on the set configuration ratio of pseudo-row data and the type distribution of all classification labels contained in the original data, pseudo-row classification labels are set for each pseudo-row data. A pseudo-row data consists of multiple elements, each element being a data point in a column. Different types of column data have their own corresponding data generation rules. Pseudo-row classification labels can contain at least two types, and the columns of data they depend on will be different for each type of classification label. To reduce the impact of pseudo-row data on machine learning, the distribution of each column of data in the original data can be fully considered when constructing pseudo-row data. Therefore, in this application, pseudo-row data can be constructed based on the pseudo-row classification labels, the distribution of each column of data in the original data, and the data generation rules corresponding to each column of data. In this technical solution, the classification task targeted in machine learning is fully considered, thereby reasonably setting the pseudo-row classification labels. Furthermore, by combining the distribution of each column of data in the original data, pseudo-row data is constructed so that the pseudo-row data will not have much impact on the distribution of the original data, thereby reducing the impact of pseudo-row data on machine learning classification.
[0160] Figure 4 A structural diagram of an electronic device provided in an embodiment of this application, such as... Figure 4 As shown, the electronic device includes: a memory 20 for storing computer programs;
[0161] The processor 21 is used to implement the steps of the pseudo-line data generation method as described in the above embodiments when executing a computer program.
[0162] The electronic devices provided in this embodiment may include, but are not limited to, smartphones, tablets, laptops, or desktop computers.
[0163] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0164] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the pseudo-row data generation method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the pseudo-row data configuration ratio, the data generation rules corresponding to each column of data, etc.
[0165] In some embodiments, the electronic device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
[0166] Those skilled in the art will understand that Figure 4 The structures shown do not constitute a limitation on electronic devices and may include more or fewer components than those shown.
[0167] It is understood that if the method for generating pseudo-data in the above embodiments is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes: USB flash drive, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk, or optical disk, and other media capable of storing program code.
[0168] Based on this, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described method for generating pseudo-line data.
[0169] The foregoing has provided a detailed description of a method, apparatus, device, and computer-readable storage medium for generating pseudo-line data according to embodiments of this application. The various embodiments are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0170] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0171] The foregoing has provided a detailed description of a method, apparatus, device, and computer-readable storage medium for generating pseudo-line data provided in this application. Specific examples have been used to illustrate the principles and implementation methods of the invention. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of the invention. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from the principles of the invention, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A method for generating pseudo-row data, characterized in that, include: The classification task is based on machine learning, which determines the classification labels; each row of data in the original data has a corresponding classification label. Based on the set pseudo-row data configuration ratio and the type distribution of all the classification labels contained in the original data, set the pseudo-row classification label corresponding to each pseudo-row data; Based on the pseudo-row classification labels, the distribution of each column of data in the original data, and the data generation rules corresponding to each column of data, pseudo-row data is constructed. The construction of pseudo-row data based on the pseudo-row classification labels, the distribution of each column of data in the original data, and the data generation rules corresponding to each column of data includes: Based on the pseudo-row classification labels, determine the constraints corresponding to each column of data in each pseudo-row; Based on the distribution of each column of data in the original data, the data generation rules corresponding to each column of data, and the constraints corresponding to each column of data in the pseudo-row data, each pseudo-column data is generated. The pseudo-column data are arranged according to the order of the columns in the original data to obtain the pseudo-row data. The step of generating pseudo-column data based on the distribution of each column of data in the original data, the data generation rules corresponding to each column of data, and the constraints corresponding to each column of data in the pseudo-row data includes: In the case where the original data includes column data with numerical attributes, the probability density function is estimated for the target column data with numerical attributes that have the same target classification label in the original data; wherein, the target column data is any column data among all the column data of the numerical attributes; Based on the number of target pseudo-row classification labels that are the same as the target classification labels, the estimated probability density function is sampled to obtain the target pseudo-column data; The process of constructing pseudo-row data based on the pseudo-row classification labels, the distribution of data in each column of the original data, and the data generation rules corresponding to each column of data further includes: The pseudo-line data is embedded with a watermark and then inserted into the original data.
2. The method for generating pseudo-row data according to claim 1, characterized in that, The step of setting the pseudo-row classification label corresponding to each pseudo-row data according to the set pseudo-row data configuration ratio and the type distribution of all the classification labels contained in the original data includes: The number of pseudo rows in the pseudo row data is determined based on the set pseudo row data configuration ratio and the number of rows in the original data. Based on the type distribution of all the classification labels contained in the original data, determine the proportion of each type of classification label; Based on the proportion of each type of category label and the number of pseudo-rows, the pseudo-row category label corresponding to each pseudo-row data is determined.
3. The method for generating pseudo-row data according to claim 1, characterized in that, The process of generating pseudo-column data based on the distribution of each column of data in the original data, the data generation rules corresponding to each column of data, and the constraints corresponding to each column of data in the pseudo-row data includes: When the original data includes column data of category attributes, the distribution probability of the target column data of the category attributes in the original data is calculated; wherein, the target column data is any one of the column data of all the category attributes. Based on the probability distribution of the target column data and the constraints of the category attributes to which the target column data belongs, target pseudo-column data is generated.
4. The method for generating pseudo-row data according to claim 1, characterized in that, The process of generating pseudo-column data based on the distribution of each column of data in the original data, the data generation rules corresponding to each column of data, and the constraints corresponding to each column of data in the pseudo-row data includes: In the case where the original data includes column data of business type, the target column data is divided into target data of numerical attributes and target data of category attributes; Generate pseudo data for the numerical attributes according to the data generation rules and constraints corresponding to the column data of the numerical attributes; Generate pseudo data for the category attributes according to the data generation rules and constraints corresponding to the column data of the category attributes; The pseudo-data of the numerical attribute and the pseudo-data of the category attribute are merged to form the pseudo-column data of the business type.
5. The method for generating pseudo-row data according to any one of claims 1 to 4, characterized in that, Before constructing the pseudo-row data based on the pseudo-row classification labels, the distribution of each column of data in the original data, and the data generation rules corresponding to each column of data, the following steps are included: The data columns that meet the correlation requirements with the classification labels are used as the watermark columns to be embedded. Accordingly, constructing pseudo-row data based on the pseudo-row classification labels, the distribution of data in each column of the original data, and the data generation rules corresponding to each column of data includes: Based on the pseudo-row classification labels, the distribution of the watermark columns to be embedded in the original data, and the data generation rules corresponding to each watermark column to be embedded, pseudo-row data is constructed.
6. A device for generating pseudo-row data, characterized in that, This includes defining units, setting units, constructing units, and inserting units; The determining unit is used to determine the classification label based on a machine learning classification task; wherein each row of data in the original data has a corresponding classification label. The setting unit is used to set the pseudo row classification label corresponding to each pseudo row data according to the set pseudo row data configuration ratio and the type distribution of all the classification labels contained in the original data; The construction unit is used to construct pseudo-row data based on the pseudo-row classification labels, the distribution of each column of data in the original data, and the data generation rules corresponding to each column of data. The insertion unit is used to embed the pseudo-line data with a watermark and then insert it into the original data; The construction unit includes a condition determination subunit, a generation subunit, and an arrangement subunit; The condition determination subunit is used to determine the constraint conditions corresponding to each column of data in each pseudo-row based on the pseudo-row classification label. The generation subunit is used to generate pseudo-column data based on the distribution of each column of data in the original data, the data generation rules corresponding to each column of data, and the constraints corresponding to each column of data in the pseudo-row data. The arrangement subunit is used to arrange each pseudo-column data according to the order of each column data in the original data to obtain each pseudo-row data; The generating subunit is used to estimate the probability density function of target column data with the same target classification label in the original data when the original data includes column data with numerical attributes; wherein the target column data is any column data among all the column data of the numerical attributes. Based on the number of target pseudo-row classification labels that are the same as the target classification labels, the estimated probability density function is sampled to obtain the target pseudo-column data; The device for generating pseudo-line data further includes: An insertion unit is used to embed the pseudo-line data with a watermark and then insert it into the original data.
7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the method for generating pseudo-line data as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method for generating pseudo-line data as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Watermark processing and data traceability method based on false lines and false rows
CN107992726A
Data anti-counterfeiting and tracing method and system, medium and computer equipment
CN110414195A