A method, system and storage medium for constructing a Bayesian classification model
By leveraging the collaborative interaction of the initiator, labeler, and feature provider devices, and utilizing unintentional transmission protocols and privacy set intersection processing, the problem of constructing a Bayesian classification model under training data splitting was solved, achieving model stability and accuracy while ensuring data security and privacy.
Patent Information
- Application Number
- CN202310707560.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-14
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-06-14
AI Technical Summary
In scenarios where training data is split, how can we build a Bayesian classification model, especially when the label and feature data stored on different devices are inconsistent, and how can we achieve model stability and classification accuracy while ensuring data privacy and security?
By leveraging the collaborative interaction of the initiating device, the tagging device, and the feature-generating device, and utilizing the unintentional transmission protocol for data encryption/decryption and privacy set intersection processing, a Bayesian classification model is constructed.
In scenarios involving training data splitting, the model's stability and classification accuracy are improved, while ensuring data security while achieving data privacy.
Smart Images

Figure CN116881805B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine learning technology, and in particular to a method, system and storage medium for constructing a Bayesian classification model. Background Technology
[0002] Bayesian classification models, based on Bayes' theorem and the assumption of conditional independence of features, have wide applications in spam filtering, text classification, and spell correction, and are considered one of the classic algorithms in machine learning. However, in reality, the training data for Bayesian classification models is often fragmented. For example, the devices storing label data and the devices storing feature data may be different, and the feature data stored on different devices may also be different from each other. Therefore, how to construct a Bayesian classification model in scenarios with fragmented training data becomes a technical problem that those skilled in the art need to consider. Summary of the Invention
[0003] In view of this, embodiments of this application provide a method, system, and storage medium for constructing a Bayesian classification model, which can construct a Bayesian classification model in scenarios where training data is split.
[0004] A first aspect of this application provides a method for constructing a Bayesian classification model. This method is applied to a label-based device storing label data for training the Bayesian classification model. The method includes:
[0005] If the labeling device is not the initiating device that needs to build a Bayesian classification model, after receiving the data acquisition request sent by the initiating device, the labeling device sends the label data to at least one feature-side device that stores feature data for training the Bayesian classification model. This instructs the feature-side device to calculate the feature conditional probability based on the label data and feature data, and then send the feature conditional probability to the initiating device so that the initiating device can build a Bayesian classification model based on the feature conditional probability.
[0006] In this embodiment, the training data for the Bayesian classification model is stored in a split manner. The labeling device stores label data, and each feature-side device stores feature data. The device that needs to build the Bayesian classification model is called the initiating device. First, the initiating device sends a data acquisition request to the labeling device. Then, the labeling device sends its label data to each feature-side device. Each feature-side device calculates its feature conditional probability based on the received label data and its own stored feature data, and sends the calculated feature conditional probability to the initiating device. Finally, the initiating device constructs the corresponding Bayesian classification model based on the received feature conditional probability. Therefore, this embodiment utilizes the collaborative interaction of the initiating device, labeling device, and feature-side devices to combine data from multiple devices and construct a Bayesian classification model in a scenario where training data is split. Moreover, the constructed Bayesian classification model can acquire a wider range of different data features from multiple devices, thereby improving the model's stability and classification accuracy. Furthermore, storing the training data on different devices from multiple parties further ensures data security while maintaining data privacy. In one implementation of this application, sending label data to at least one feature-side device storing feature data for training a Bayesian classification model, to instruct the feature-side device to calculate feature conditional probabilities based on the label data and feature data, and sending the feature conditional probabilities to the initiating device so that the initiating device can construct a Bayesian classification model based on the feature conditional probabilities, may include:
[0007] Generate m-1 sets of obfuscated labels based on the label data, where m is an integer greater than 2;
[0008] Package the label data and m-1 sets of obfuscated labels into m sets of label information;
[0009] m sets of tag information are sent to the feature party device to instruct the feature party device to calculate m sets of feature condition probabilities based on m sets of tag information and feature data. The joint initiator device encrypts the m sets of feature condition probabilities according to the order of m sets of tag information based on the unintentional transmission protocol to obtain m sets of encrypted information, and sends the m sets of encrypted information to the initiator device.
[0010] The first sorting information of the tag data in m groups of tag information is sent to the initiating device to instruct the initiating device to decrypt the received m groups of encrypted information based on the unintentional transmission protocol and the first sorting information, so as to obtain the first decrypted data of a group of encrypted information corresponding to the tag data in the m groups of encrypted information, and to construct a Bayesian classification model based on the first decrypted data.
[0011] In one implementation of this application, the method may further include:
[0012] If the labeling device is the initiating device that needs to build a Bayesian classification model, the labeling device sends the label data to the feature-side device, instructing the feature-side device to calculate the feature conditional probability based on the label data and feature data, and then send the feature conditional probability to the labeling device so that the labeling device can build a Bayesian classification model based on the feature conditional probability.
[0013] Furthermore, the step of sending the label data to the feature-side device to instruct the feature-side device to calculate the feature conditional probability based on the label data and feature data, and then sending the feature conditional probability to the label-side device so that the label-side device can construct a Bayesian classification model based on the feature conditional probability, may include:
[0014] Generate n-1 sets of obfuscated labels based on the label data, where n is an integer greater than 2;
[0015] Package the tag data and n-1 sets of obfuscated tags into n sets of tag information;
[0016] The n sets of tag information are sent to the feature party device to instruct the feature party device to calculate the n sets of feature condition probabilities based on the n sets of tag information and feature data. The joint coordinating party device encrypts the n sets of feature condition probabilities according to the order of the n sets of tag information based on the unintentional transmission protocol to obtain n sets of encrypted information, and sends the n sets of encrypted information to the coordinating party device.
[0017] The second sorting information of the tag data in the n sets of tag information is sent to the coordinating device, so as to instruct the coordinating device to decrypt the received n sets of encrypted information based on the unintentional transmission protocol and the second sorting information, to obtain the second decrypted data of the set of encrypted information corresponding to the tag data in the n sets of encrypted information, and send the second decrypted data to the tag device, so that the tag device can build a Bayesian classification model based on the second decrypted data.
[0018] In one implementation of this application, the tagging device also stores feature data for training a Bayesian classification model, and the feature spaces of the feature data of the tagging device and the feature data of the feature-splitting device are different; after receiving a data acquisition request sent by the initiating device, the tagging device may further include:
[0019] The collaborative feature-side device performs privacy set intersection processing on the feature data to ensure that both the tag-side device and the feature-side device have the same amount of feature datasets under the same data identifier field.
[0020] Based on the label data and the amount of data, the label category probability is calculated;
[0021] Based on the feature dataset and the amount of data of the tagging device, the feature category probability of the tagging device is calculated;
[0022] Based on the tag category probability and feature category probability, the feature conditional probability of the tag-own device is calculated;
[0023] The characteristic conditional probability of the tagging device is sent to the initiating device.
[0024] A second aspect of this application provides a method for constructing a Bayesian classification model. This method is applied to an initiating device that needs to construct a Bayesian classification model. The method includes:
[0025] If the labeling device that holds the label data used to train the Bayesian classification model is not the initiating device, the initiating device sends a data acquisition request to the labeling device, instructing the labeling device to send the label data to at least one feature-side device that holds the feature data used to train the Bayesian classification model after receiving the data acquisition request, so that the feature-side device can calculate the feature conditional probability based on the label data and the feature data, and send the feature conditional probability to the initiating device.
[0026] A Bayesian classification model is constructed based on feature conditional probabilities.
[0027] A third aspect of this application provides a method for constructing a Bayesian classification model. This method is applied to a feature square device storing feature data for training the Bayesian classification model. The method includes:
[0028] If the labeling device, which contains the label data used to train the Bayesian classification model, is not the initiating device that needs to build the Bayesian classification model, then after receiving the label data sent by the labeling device, the feature-side device calculates the feature conditional probability based on the label data and feature data, and sends the feature conditional probability to the initiating device, so that the initiating device can build the Bayesian classification model based on the feature conditional probability; wherein, the label data is sent by the labeling device to the feature-side device after receiving the data acquisition request sent by the initiating device;
[0029] If the tagging device is the initiating device that needs to build a Bayesian classification model, the feature-side device, after receiving the tag data sent by the tagging device, calculates the feature conditional probability based on the tag data and feature data, and sends the feature conditional probability to the tagging device so that the tagging device can build a Bayesian classification model based on the feature conditional probability.
[0030] A fourth aspect of this application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a method for constructing a Bayesian classification model as provided in the first aspect of this application, or implements a method for constructing a Bayesian classification model as provided in the second aspect of this application, or implements a method for constructing a Bayesian classification model as provided in the third aspect of this application.
[0031] A fifth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements a method for constructing a Bayesian classification model as provided in the first aspect of this application, or implements a method for constructing a Bayesian classification model as provided in the second aspect of this application, or implements a method for constructing a Bayesian classification model as provided in the third aspect of this application.
[0032] A sixth aspect of this application provides a computer program product that, when run on a terminal device, causes the terminal device to execute a method for constructing a Bayesian classification model as provided in the first aspect of this application, or a method for constructing a Bayesian classification model as provided in the second aspect of this application, or a method for constructing a Bayesian classification model as provided in the third aspect of this application.
[0033] A seventh aspect of this application provides a system for constructing a Bayesian classification model, including an initiator device for constructing a Bayesian classification model, a labeling device storing label data for training the Bayesian classification model, and at least one feature-side device storing feature data for training the Bayesian classification model.
[0034] The initiating device is used to send a data acquisition request to the tagging device, receive the feature conditional probabilities sent by the feature-based device, and construct a Bayesian classification model based on the feature conditional probabilities.
[0035] The tag-side device is used to send tag data to the feature-side device after receiving a data acquisition request;
[0036] The feature-side device is used to calculate the feature conditional probability based on the tag data and feature data after receiving the tag data, and then send the feature conditional probability to the initiator device.
[0037] An eighth aspect of the present application provides a system for constructing a Bayesian classification model, including a coordinator device, a labeling device that needs to construct a Bayesian classification model and stores label data for training the Bayesian classification model, and at least one feature-side device that stores feature data for training the Bayesian classification model.
[0038] The labeling device generates m-1 sets of obfuscated labels based on the label data, where m is an integer greater than 2. It packages the label data and m-1 sets of obfuscated labels into m sets of label information and sends them to the feature-side device. It also sends the sorting information of the label data in the m sets of label information to the coordinating device. After receiving the decrypted data sent by the coordinating device, it constructs a Bayesian classification model based on the decrypted data.
[0039] The feature-side device is used to calculate m sets of feature condition probabilities based on the m sets of tag information and feature data after receiving m sets of tag information. The joint coordinating device encrypts the m sets of feature condition probabilities according to the order of the m sets of tag information based on the unintentional transmission protocol to obtain m sets of encrypted information, and sends the m sets of encrypted information to the coordinating device.
[0040] The coordinating device, upon receiving sorting information and m sets of encrypted information, decrypts the received m sets of encrypted information based on the unintentional transmission protocol and sorting information, obtains the decrypted data of a set of encrypted information corresponding to the tag data in the m sets of encrypted information, and sends the decrypted data to the tag-side device.
[0041] It is understood that the beneficial effects of aspects two through eight above can be found in the relevant descriptions in aspect one above, and will not be repeated here. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of this application, 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 this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 This is a schematic diagram of a Bayesian classification model construction system provided in an embodiment of this application;
[0044] Figure 2 This is a schematic diagram of another Bayesian classification model construction system provided in the embodiments of this application;
[0045] Figure 3 This is a schematic diagram showing the distribution of training data for the Bayesian classification model provided in the embodiments of this application;
[0046] Figure 4 This is a flowchart of a method for constructing a Bayesian classification model provided in an embodiment of this application;
[0047] Figure 5 This is a flowchart of another method for constructing a Bayesian classification model provided in the embodiments of this application;
[0048] Figure 6 This is a schematic diagram of the device interaction process in the scenario where the initiating device starts a task, provided in an embodiment of this application.
[0049] Figure 7 This is a schematic diagram of the device interaction process in the tag device initiation task scenario provided in the embodiments of this application;
[0050] Figure 8 This is a schematic diagram of a terminal device provided in an embodiment of this application. Detailed Implementation
[0051] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail. Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance.
[0052] Bayesian classification is a general term for a class of classification algorithms, with Naive Bayes being the most common. It is both simple and efficient in many scenarios. However, in reality, the training data for Bayesian classification models is often fragmented, meaning it is stored on different devices and the data is not shared between them. Therefore, how to construct a Bayesian classification model in scenarios with fragmented training data becomes a technical problem that those skilled in the art need to consider. In view of this, embodiments of this application provide a method, system, and storage medium for constructing a Bayesian classification model, capable of constructing a Bayesian classification model even in scenarios with fragmented training data.
[0053] Figure 1 This is a schematic diagram of a Bayesian classification model construction system provided in an embodiment of this application. Figure 1 The system includes an initiator device, a tagger device, and at least one feature-based device. Figure 1The diagram shows N feature-side devices. The initiating device is the device that initiates the construction of the Bayesian classification model; it does not store any training data for the Bayesian classification model, i.e., it has no label data or feature data. The label-side device stores label data used to train the Bayesian classification model, and may also store feature data used for training the Bayesian classification model. The feature-side devices store feature data used to train the Bayesian classification model, but do not store label data used for training the Bayesian classification model. The initiating device, label-side device, and each feature-side device can communicate with each other via various wired or wireless methods. Figure 1 In the system shown, the task of building the Bayesian classification model is initiated by the initiating device. By combining the training data from the labeling device and each feature device, the modeling of the Bayesian classification model is finally completed on the initiating device side.
[0054] Figure 2 This is a schematic diagram of a system for constructing another Bayesian classification model provided in an embodiment of this application. Figure 2 The system includes a coordinating device, a tagging device, and at least one feature-specific device. Figure 2 (N feature devices are shown in the figure). Figure 2 In this scenario, the labeling device, acting as the initiator of building the Bayesian classification model, stores label data for training the model and may also store feature data for the same purpose. The feature-side device stores feature data for training the model but not label data. The coordinating device does not store any training data for the Bayesian classification model; its primary role is to assist in data encryption and decryption, acting as a coordinator during data transmission. The coordinating device, labeling device, and feature-side devices can communicate with each other via various wired or wireless methods. Figure 2 In the system shown, the task of building the Bayesian classification model is initiated by the labeling device. By combining the training data of the labeling device and various feature-side devices, and with the assistance of the coordinating device, the modeling of the Bayesian classification model is finally completed on the labeling device side.
[0055] It should be understood that Figure 1 and Figure 2The initiating device, tagging device, feature-specific device, and coordinating device in the illustrated system can all be various types of terminal devices, such as mobile phones, tablets, wearable devices, learning machines, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), large-screen TVs, etc. This application embodiment does not impose any restrictions on the specific type of terminal device. Regarding... Figure 1 and Figure 2 For the specific working principle of the system shown, please refer to the method embodiment described below.
[0056] like Figure 3 The diagram shown illustrates the distribution of training data for the Bayesian classification model provided in this embodiment. Figure 3 It can be seen that the tag-side device (Party A) stores both tag data and feature data, while the various feature-side devices (Party B, Party C, ..., Party N) only store feature data. The feature data of the tag-side device and each feature-side device can have different feature spaces; for example, the i-th party (the tag-side device or a certain feature-side device) has its own feature space. q represents the number of features possessed by the i-th party, and j = {1, 2, ..., q} represents a certain feature in the feature space. in This represents the feature f of the i-th side. j i Specific classification data, where k represents feature f j i The number of possible values for feature f. For example, suppose feature f j i It represents "age", and Let f represent "old", "middle", and "young" respectively, then we can write "age" = {"old", "middle", "young"}. Alternatively, let's assume feature f j i This represents the "monthly income range," while Representing "0-5000", "5000-10000", "10000-20000", "20000-50000", and "50000+" respectively, this can be represented as "Monthly Income Range" = {"0-5000", "5000-10000", "10000-20000", "20000-50000", "50000+"}. As for the tag data, it can be represented as... Where y represents the label. This represents the specific label data for label y, and k represents the number of possible values for label y. For example, suppose label y is "health condition". If the labels represent "healthy", "sick", and "serious illness" respectively, then the label data can be represented as "physical condition" = {"healthy", "sick", "serious illness"}.
[0057] In general, each feature or label can have multiple different features in its feature space, each feature can have a different range of feature data, and each feature or label can have a large number of feature data (e.g., 10,000), but the value of each feature data falls within the feature data range. For example, for B, its feature space is {age, monthly income range, ...}, where the age data range is {old, middle-aged, young}, and the monthly income range is {"0-5000", "5000-10000", "10000-20000", "20000-50000", "50000+"}. Assuming B has 10,000 age data points, then the value of each of these 10,000 age data points is one of {old, middle-aged, young}. For the tag-handling device, there can be multiple tags, and each tag has a corresponding range of values. For example, the tag "health condition" = {"healthy", "sick", "serious illness"}. Assuming that the tag-handling device has 2000 "health condition" tag data, then the value of each tag data is one of {"healthy", "sick", "serious illness"}.
[0058] Please see Figure 4 This paper illustrates a method for constructing a Bayesian classification model according to an embodiment of this application, including:
[0059] 401. The initiating device sends a data acquisition request to the tag-based device;
[0060] It should be understood that Figure 4 The method shown can be applied to, for example Figure 1 The system shown is for building a Bayesian classification model. In this case, the label-side device is not the initiator device that needs to build the Bayesian classification model, and the real initiator device does not store the label data and feature data used to train the Bayesian classification model.
[0061] The task of building a Bayesian classification model is initiated by the initiating device. First, the initiating device sends a data acquisition request to the labeling device, informing it that the task has begun. Additionally, the initiating device can also send requests to each feature device, informing them that the task has started. For example, assuming the initiating device is X, the labeling device is A, and the feature devices are B, C, ... N, then X will send requests to A, B, C, ... N respectively.
[0062] 402. After receiving a data acquisition request, the labeling device sends the label data to at least one feature-side device that stores feature data for training a Bayesian classification model.
[0063] After receiving a data acquisition request from the initiating device, the tag-side device will send the stored tag data to each feature-side device so that each feature-side device can calculate the feature conditional probability based on its own feature data and the received tag data.
[0064] In one implementation of this application, the tagging device also stores feature data for training a Bayesian classification model, and the feature spaces of the tagging device's feature data and the feature data of the feature-splitting device are different; after receiving a data acquisition request sent by the initiating device, the tagging device may further include:
[0065] (1) The tagging device and the feature-side device perform privacy set intersection processing on the feature data so that the tagging device and the feature-side device have the same amount of feature dataset under the same data identifier field;
[0066] (2) The tag-handling device calculates the tag category probability based on the tag data and the amount of data;
[0067] (3) The tagging device calculates the feature category probability of the tagging device based on the feature dataset and the amount of data it has;
[0068] (4) The label-making device calculates the feature conditional probability of the label-making device based on the label category probability and the feature category probability;
[0069] (5) The tag device sends the characteristic conditional probability of the tag device to the initiator device.
[0070] For step (1) above, since the feature spaces of the feature data of the tagging device and each feature-sharing device are different, it will be inconvenient to calculate the feature conditional probability. This can be solved by Private Set Intersection (PSI). Specifically, the tagging device will collaborate with each feature-sharing device to perform private set intersection processing on the feature data, thereby ensuring that both the tagging device and the feature-sharing device have the same amount of feature dataset under the same data identifier field. For example, suppose the tagging device has health data, which includes the fields {"Phone number", "Age", "Height", "Health condition"}, where "Phone number" is the ID, i.e., a unique identifier, the feature data is {"Age", "Height"}, and the tag data is "Health condition". A certain feature-sharing device has financial data, which includes the fields {"Phone number", "Monthly income", "Credit rating"}, where "Phone number" is the ID, i.e., a unique identifier, and the feature data is {"Monthly income", "Credit rating"}. The tagging device and the feature-generating device then perform a privacy set intersection process, using "telephone" as the ID (i.e., the same data identifier field). This process filters out identical phone numbers and retains them as a new feature dataset for subsequent modeling training. The specific principle of the privacy set intersection process can be found in existing technologies and will not be elaborated here. For a larger number of feature-generating devices, the privacy set intersection process can be performed in the same manner as the example above, ultimately achieving a feature dataset where each tagging device and each feature-generating device has the same amount of data (e.g., data size = n) under the same data identifier field (e.g., "telephone").
[0071] For step (2) above, the tag-handling device can calculate the tag category probability based on the stored tag data and the amount of data. For example, assuming the tag-handling device stores tag data in the form of "health status" = {"healthy", "sick", "serious illness"}, with a data volume n = 10, where 3 data entries are "healthy" = {"healthy"}, 5 data entries are "sick" = {"sick"}, and 2 data entries are "sick" = {"serious illness"}, then the tag data can be represented as a vector: n y = [3, 5, 2], then the label category probability can be expressed as: p(y) = n y / n = [0.3, 0.5, 0.2], which means that the label category probability can also be represented as a vector.
[0072] For step (3) above, the tagging device can calculate the feature class probability of the tagging device based on its feature dataset and the amount of data. It can be understood that both the tagging device and any feature-based device can calculate their respective feature class probabilities using their respective feature datasets and the amount of data. For example, the i-th party (the tagging device or a certain feature-based device) possesses a feature space. q represents the number of features possessed by the i-th party, and j = {1, 2, ..., q} represents a certain feature in the feature space. Then the i-th power can be obtained using the formula Calculate the probability of its own feature category, where p(f j i ) represents a certain feature f possessed by the i-th party. j i Feature category probability, Let represent the number of data points (vector form) for the j-th feature of the i-th side, and n represent the number of data points. For example, suppose the j-th feature of the i-th side is "age", and its data points are 3 data points for "old", 4 data points for "middle-aged", and 3 data points for "young". Obviously, if the i-th side has q features, then the probabilities of the q feature categories can be calculated. These q feature category probabilities can be called the probabilities of all feature categories of the i-th side.
[0073] Regarding step (4) above, after calculating the tag category probability and feature category probability, the tag-handling device can further calculate the feature conditional probability of the tag-handling device. Specifically, this can be achieved using the formula... Calculate the characteristic conditional probability of the tag-side device, where, Let p(y) represent the characteristic conditional probability of the tagging device, where the superscript A indicates the tagging device (A-side), p(y) represents the tag category probability, and n represents the amount of data. The j-th joint tag and feature data of the tagging device is essentially a matrix. For example, in the example of step (3) above, if the "health status" of 0 data points is "healthy", 1 data point is "sick", and 2 data points are "seriously ill", then in the example of step (3) above, if the "health status" of 4 data points is "moderate", 2 data points are "healthy", 1 data point is "sick", and 1 data point is "seriously ill", and in the example of step (3) above, if the "health status" of 3 data points is "young", 3 data points are "healthy", 0 data points are "sick", and 0 data points are "seriously ill", then... Obviously, a feature can yield a matrix, and then a feature conditional probability can be calculated. If the tagging device has j features, then j matrices can be obtained, and then j feature conditional probabilities can be calculated. These j feature conditional probabilities can be called the conditional probabilities of all features of the tagging device.
[0074] In step (5) above, after calculating its own feature conditional probability, the tagging device will also send the feature conditional probability to the initiating device. Subsequently, the initiating device will combine the feature conditional probabilities of the tagging data and the feature conditional probabilities of each feature-generating device to construct the corresponding Bayesian classification model.
[0075] In one implementation of this application, the tagging device sends tag data to at least one feature-side device storing feature data for training a Bayesian classification model, which may include:
[0076] (1) The tag-side device generates m-1 sets of obfuscated tags based on the tag data, where m is an integer greater than 2;
[0077] (2) The tag-side device packages the tag data and m-1 sets of confused tags into m sets of tag information;
[0078] (3) The tag-agent device sends m sets of tag information to the feature-agent device.
[0079] In certain situations, to protect the privacy and security of data from all parties, such as preventing the feature-spotting device from knowing the real tag data, a data encryption / decryption mechanism can be introduced. This application, considering the simplicity and effectiveness of encryption / decryption operations, proposes a data transmission method based on an unwitting transmission protocol. Specifically, the tag-spotting device can generate m-1 sets of obfuscated tags based on the real tag data, where m is an integer greater than 2. A larger m results in a higher security level (i.e., it is more difficult for the feature-spotting device to deduce which set of tag data is the tag-spotting device's real tag data), but a larger m also requires a larger amount of data to be transmitted. Therefore, m should not be set too large while meeting security requirements. For example, suppose the real tag data of the tag-spotting device is n as described above. y = [3, 5, 2], then m-1 vectors different from [3, 5, 2] can be generated randomly to serve as m-1 sets of obfuscation labels; the amount of data in each obfuscation label is the same as that of the real label, but the data of a single label is fake, for example, for the real label n y =[3, 5, 2], which can generate m-1 obfuscation tags n′ y= [x1, x2, x3], where none of the data is true, but it must be guaranteed that x1 + x2 + x3 = 10, and x1, x2, and x3 are all positive integers. After generating m-1 sets of obfuscated tags, the tag-handling device packages these m-1 sets of obfuscated tags and the real tag data into m sets of tag information, and records the position of the real tag data in these m sets of tag information, i.e., the sorting information. Finally, the tag-handling device sends these m sets of tag information to the feature-handling device. If there are multiple feature-handling devices, each feature-handling device will receive the m sets of tag information sent by the tag-handling device.
[0080] It should be noted that the number of tag information sent by the tag-agent device to different feature-agent devices can also be different. It is only necessary to record the sorting information of the actual tag data in the multiple sets of tag information corresponding to each feature-agent device. For example, assuming there are feature-side device B and feature-side device C, the tag-side device can package the real tag data with 19 sets of obfuscated tags into 20 sets of tag information (assuming the sorting information of the real tag data in these 20 sets of tag information is 3), and send these 20 sets of tag information to feature-side device B. The tag-side device also locally records the identifier of feature-side device B and the sorting information 3 of the real tag data. Note that the sorting information is not sent to feature-side device B, so feature-side device B does not know which of the 20 sets of tag information received is the real tag data. The tag-side device can also package the real tag data with 29 sets of obfuscated tags into 30 sets of tag information (assuming the sorting information of the real tag data in these 30 sets of tag information is 8), and send these 30 sets of tag information to feature-side device C. The tag-side device also locally records the identifier of feature-side device C and the sorting information 8 of the real tag data. Note that the sorting information is not sent to feature-side device C, so feature-side device C does not know which of the 30 sets of tag information received is the real tag data, and so on.
[0081] On the other hand, the tag-handling device will also send the sorting information of the actual tag data in the m groups of tag information to the initiating device. This sorting information is represented by the first sorting information. For example, in the above example, the tag-handling device will bind and send the identifier and sorting information 3 of the locally recorded feature-handling device B to the initiating device, and bind and send the identifier and sorting information 8 of the locally recorded feature-handling device C to the initiating device.
[0082] 403. The feature-based device calculates the feature conditional probability based on the tag data and feature data, and sends the feature conditional probability to the initiating device;
[0083] After the tag-agent device sends the stored tag data to each feature-agent device, each feature-agent device can calculate its own feature conditional probability based on the tag data and its own stored feature data, and then send the calculated feature conditional probability to the initiator device.
[0084] In one implementation of this application, the feature-sending device calculates the feature conditional probability based on tag data and feature data, and sends the feature conditional probability to the initiating device, which may include:
[0085] (1) The feature-based device calculates m sets of feature condition probabilities based on m sets of label information and feature data;
[0086] (2) The feature-initiating device and the feature-initiating device jointly encrypt the m sets of feature condition probabilities according to the order of the m sets of tag information based on the unintentional transmission protocol to obtain m sets of encrypted information;
[0087] (3) The feature device sends m sets of encrypted information to the initiator device.
[0088] If a data encryption / decryption mechanism is introduced, each feature-side device receives not a single set of tag data, but m sets of tag information containing obfuscated tags (of course, the number of tag information received by each feature-side device can be different; the specific processing method is the same, only the final amount of encrypted information differs). Each feature-side device calculates its own m sets of feature conditional probabilities based on these m sets of tag information and its stored feature data. If a feature-side device has j features, it calculates m sets of j feature conditional probabilities (i.e., a total of m*j feature conditional probabilities). In the specific calculation, the principle of how tag-side devices calculate feature conditional probabilities can be referred to in the previous description; the only difference is that here, the feature data stored by the feature-side devices is used, and because there are m sets of tag information, m sets of feature conditional probabilities are calculated.
[0089] Next, the feature-sending device, in conjunction with the initiating device, encrypts the m sets of feature conditional probabilities according to the order of the m sets of tag information based on an unintentional transmission protocol, resulting in m sets of encrypted information. Each feature-sending device performs this operation; for example, feature-sending device B will perform this operation in conjunction with the initiating device, feature-sending device C will perform this operation in conjunction with the initiating device, and so on. The working principle of unintentional transmission protocols, such as the Simplest OT protocol, can be found in existing technologies and will not be elaborated upon here. The m sets of encrypted information generated by the feature-sending device can be represented as follows: any one of them All information is encrypted and obfuscated after unintentional transmission processing. The order (position) of the real tags serves as the encryption / decryption key. It should be noted that the generation order of these m sets of encrypted information follows the arrangement order of the m sets of tag information. That is, if the real tag data is ordered as 3 in the m sets of tag information, then the encrypted information corresponding to the feature conditional probability calculated based on the real tag data will also be ordered as 3 in the m sets of encrypted information. And so on. After generating their own m sets of encrypted information, each feature-contributing device sends its respective m sets of encrypted information to the initiating device.
[0090] 404. The initiating device constructs a Bayesian classification model based on feature conditional probabilities.
[0091] After receiving the feature conditional probabilities (which may also include those from the tagging devices) sent by various feature-sending devices, the initiating device can train a model based on these probabilities to construct a corresponding Bayesian classification model. The initiating device can then combine this Bayesian classification model with local data to perform classification prediction and other operations.
[0092] In one implementation of this application, the initiating device constructs a Bayesian classification model based on feature conditional probabilities, which may include:
[0093] (1) The initiating device decrypts the received m sets of encrypted information based on the unintentional transmission protocol and the first sorting information to obtain the first decrypted data of a set of encrypted information corresponding to the tag data in the m sets of encrypted information;
[0094] (2) The initiating device constructs a Bayesian classification model based on the first decrypted data.
[0095] If a data encryption / decryption mechanism is introduced, the initiating device receives the sorting information of the actual tag data sent by the tag-generating devices (i.e., the first sorting information) and m sets of encrypted information sent by each feature-generating device. The initiating device can decrypt the received m sets of encrypted information based on the unintentional transmission protocol and this sorting information, obtaining the decrypted data of the set of encrypted information corresponding to the actual tag data, denoted as the first decrypted data. Finally, the Bayesian classification model can be constructed using this first decrypted data. For example, suppose the initiating device receives the m sets of encrypted information as follows: If the received sorting information is 3, then based on the unintentional transmission protocol and this sorting information 3, it can be decrypted to obtain... The true feature conditional probability (i.e., the feature conditional probability calculated based on the true label data) is the first decrypted data.
[0096] In summary, the feature condition probabilities of each tag-holder device can be directly sent to the initiator without the need for encryption / decryption via an unintentional transmission protocol. Encryption of the feature condition probabilities of each tag-holder device using the unintentional transmission protocol yields m sets of feature condition probabilities, but each tag-holder device is unaware of which set represents the true feature condition probability. By sending the actual tag sorting information from the tag-holder device to the initiator device, the initiator device can use this sorting information as a key to decrypt and obtain the true feature condition probabilities of each tag-holder device.
[0097] In this embodiment, the training data for the Bayesian classification model is stored in a split manner. The labeling device stores label data, and each feature-side device stores feature data. The device that needs to build the Bayesian classification model is called the initiating device. First, the initiating device sends a data acquisition request to the labeling device. Then, the labeling device sends its label data to each feature-side device. Each feature-side device calculates its feature conditional probability based on the received label data and its own stored feature data, and sends the calculated feature conditional probability to the initiating device. Finally, the initiating device constructs the corresponding Bayesian classification model based on the received feature conditional probability. Therefore, this embodiment utilizes the collaborative interaction of the initiating device, labeling device, and feature-side devices to combine data from multiple devices and construct a Bayesian classification model in a scenario where training data is split. Moreover, the constructed Bayesian classification model can acquire a wider range of different data features from multiple devices, thereby improving the model's stability and classification accuracy. Furthermore, storing the training data on different devices from multiple parties further ensures data security while maintaining data privacy.
[0098] Please see Figure 5 This illustrates another method for constructing a Bayesian classification model provided in an embodiment of this application. This method can be applied to, for example... Figure 2 The system shown is for building a Bayesian classification model. In this case, the labeling device is the initiating device that needs to build the Bayesian classification model, that is, the initiating device has the label data.
[0099] 501. The tag provider sends the tag data to the feature provider.
[0100] As the initiator of the task, the tag-agent device can first send a task invitation to each feature-agent device, and send the stored tag data to each feature-agent device respectively, so that each feature-agent device can complete the calculation of feature conditional probability based on its own feature data and the received tag data.
[0101] Assuming that the feature spaces of the feature data from the tagging device and each feature-sharing device are different, a privacy set intersection step can be added here. That is, the tagging device can collaborate with each feature-sharing device to perform privacy set intersection processing on the feature data, thereby ensuring that the tagging device and each feature-sharing device have the same amount of feature dataset under the same data identifier field.
[0102] and Figure 4 Similar to the scenario shown, the labeling device can also calculate the label category probability and the probabilities of all feature categories, and then calculate the feature conditional probability of the labeling device. This feature conditional probability can also be used to train a Bayesian classification model. Additionally, each feature-side device can also calculate its own probabilities of all feature categories and then send these probabilities to the labeling device. The labeling device can then use these feature category probabilities when performing classification predictions on local data using a Bayesian classification model.
[0103] In one implementation of this application embodiment, the tag-side device sending tag data to the feature-side device may include:
[0104] (1) The tag-generating device generates n-1 sets of obfuscated tags based on the tag data, where n is an integer greater than 2;
[0105] (2) The tag-side device packages the tag data and n-1 sets of confused tags into n sets of tag information;
[0106] (3) The tag-side device sends n sets of tag information to the feature-side device.
[0107] Similarly, for scenarios where the tagging device acts as the task initiator, a data encryption / decryption mechanism can be introduced. That is, the tagging device can also generate multiple sets of obfuscated tags, package these obfuscated tags with the real tag data into multiple sets of tag information, and then send these multiple sets of tag information to each feature-generating device. The tagging device will also send the sorting information of the tag data within the multiple sets of tag information (represented by a second sorting information) to the coordinating device. The specific operational principle of generating obfuscated tags and packaging them into multiple sets of tag information can be found in the previous text.
[0108] 502. The feature-side device calculates the feature conditional probability based on the tag data and feature data, and sends the feature conditional probability to the tag-side device;
[0109] After the tag-agent device sends the stored tag data to each feature-agent device, each feature-agent device can calculate its own feature conditional probability based on the tag data and its own stored feature data, and then send the calculated feature conditional probability to the initiator device.
[0110] In one implementation of this application, the feature-side device calculates the feature conditional probability based on tag data and feature data, and sends the feature conditional probability to the tag-side device, which may include:
[0111] (1) The feature-based device calculates n sets of feature condition probabilities based on n sets of label information and feature data;
[0112] (2) The feature-side equipment and the coordinating-side equipment encrypt the n sets of feature condition probabilities according to the order of the n sets of tag information based on the unintentional transmission protocol to obtain n sets of encrypted information;
[0113] (3) The feature device sends n sets of encrypted information to the coordinator device.
[0114] Similarly, if a data encryption / decryption mechanism is introduced, each feature-side device receives not a single set of tag data, but multiple sets of tag information containing obfuscated tags. Each feature-side device encrypts multiple sets of feature conditional probabilities according to the order of the received multiple sets of tag information based on an unintentional transmission protocol, resulting in multiple sets of encrypted information. The specific operational principle can be found in the previous text. There is a slight difference here compared to the previous text. In the previous text, each feature-side device collaborated with the initiating device when performing the encryption operation of the unintentional transmission protocol, sending the obtained multiple sets of encrypted information to the initiating device. However, here there is no additional initiating device (the tag-side device acts as the task initiator). Therefore, a coordinating device is needed to act as a coordinator in the encryption and decryption process of data transmission. When each feature-side device collaborates with the coordinating device when performing the encryption operation of the unintentional transmission protocol, the obtained multiple sets of encrypted information are sent to the coordinating device.
[0115] After receiving the sorting information (i.e., the second sorting information) of the real tag data sent by the tag-side device and the various sets of encrypted information sent by each feature-side device, the coordinating device can decrypt the received sets of encrypted information based on the unintentional transmission protocol and the sorting information. This decrypted data, designated as the second decrypted data, is obtained from the set of encrypted information corresponding to the real tag data and is then sent to the tag-side device. For example, suppose the coordinating device receives the following sets of encrypted information: If the received sorting information is 8, then based on the unintentional transmission protocol and this sorting information 8, it can be decrypted to obtain... The true feature conditional probability (i.e., the feature conditional probability calculated based on the true label data) is the second decryption data.
[0116] 503. The labeling device constructs a Bayesian classification model based on feature conditional probabilities.
[0117] After receiving the second decrypted data sent by the coordinator device, the tagging device can obtain the conditional probabilities of the true features, and then construct the corresponding Bayesian classification model based on the conditional probabilities of the true features. Subsequently, the tagging device can combine local data and use the Bayesian classification model to complete classification prediction and other operations.
[0118] In this embodiment, the training data for the Bayesian classification model is stored in a split manner. The labeling device stores label data, and each feature-side device stores feature data. The labeling device is responsible for constructing the Bayesian classification model. First, the labeling device sends the label data to each feature-side device. Then, each feature-side device calculates its own feature conditional probability based on the received label data and its stored feature data, and sends its feature conditional probability to the labeling device. Finally, the labeling device constructs the corresponding Bayesian classification model based on the received feature conditional probabilities. Furthermore, with the assistance of a coordinating device, a data encryption / decryption mechanism can be introduced to improve data security.
[0119] To facilitate understanding of the method for constructing the Bayesian classification model provided in the embodiments of this application, the following descriptions will cover the device interaction processes in two different scenarios.
[0120] like Figure 6 The diagram shown illustrates the device interaction process in a scenario where the initiating device starts a task.
[0121] exist Figure 6 In the process, the initiating device first sends a task request to the tagging device and the feature-generating device (only one feature-generating device is shown in the diagram; the operation method of each feature-generating device is the same). Upon receiving the task request, the feature-generating device first collaborates with the tagging device to perform privacy set intersection processing on the feature data. In subsequent processes, the tagging device sequentially calculates its own label category probability, the probabilities of all feature categories, and the conditional probabilities of all features, while the feature-generating device calculates its own probability of all feature categories. Then, the tagging device generates m-1 sets of obfuscated labels, packages them with the real label data to form m sets of label information, and sends the m sets of label information to the feature-generating device. Additionally, the tagging device sends the position information of the real label data within the m sets of label information to the initiating device. Upon receiving the m sets of label information, the feature-generating device calculates the corresponding m sets of feature conditional probabilities, and then, in conjunction with the initiating device, encrypts the m sets of feature conditional probabilities according to the order of the m sets of label information using an unintentional transmission protocol, obtaining m sets of encrypted information, which is then sent to the initiating device. Finally, the initiating device decrypts the m sets of encrypted information based on the received location information to obtain the decrypted data of a set of encrypted information corresponding to the real label data, thereby obtaining the real feature conditional probability, and then the corresponding Bayesian classification model can be constructed.
[0122] like Figure 7 The diagram shown illustrates the device interaction process in a scenario where the tag-side device initiates a task.
[0123] exist Figure 7 First, the tagging device sends a task request to the feature-side device (only one feature-side device is shown in the diagram; the operation method of each feature-side device is the same). Upon receiving the task request, the feature-side device first collaborates with the tagging device to perform privacy set intersection processing on the feature data. In subsequent processes, the tagging device sequentially calculates its own tag category probability, the probabilities of all feature categories, and the conditional probabilities of all features, while the feature-side device calculates its own probability of all feature categories and sends the calculated probability of all feature categories to the tagging device. Then, the tagging device generates n-1 sets of obfuscated tags, packages them with the real tag data to form n sets of tag information, and sends the n sets of tag information to the feature-side device. Additionally, the tagging device sends the position information of the real tag data within the n sets of tag information to the coordinating device. After receiving the n sets of tag information, the feature-side device calculates the corresponding n sets of feature conditional probabilities, and then, in conjunction with the coordinating device, encrypts the n sets of feature conditional probabilities according to the order of the n sets of tag information using an unintentional transmission protocol, obtaining n sets of encrypted information, which is then sent to the coordinating device. Next, the coordinating device can decrypt the n sets of encrypted information based on the received location information to obtain the decrypted data of the encrypted information corresponding to the real label data, thereby obtaining the true feature conditional probability. Finally, the coordinating device sends this true feature conditional probability to the labeling device, which can then construct the corresponding Bayesian classification model.
[0124] In summary, this application proposes a method for training a Bayesian classification model by combining data from multiple sources while protecting the security of the multi-source dataset. This method has a simple implementation process and strong data security.
[0125] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0126] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the method for constructing a Bayesian classification model executed by an initiating device as described in any of the above embodiments, or implements the method for constructing a Bayesian classification model executed by a labeling device as described in any of the above embodiments, or implements the method for constructing a Bayesian classification model executed by a feature-side device as described in any of the above embodiments.
[0127] This application also provides a computer program product that, when run on a terminal device, causes the terminal device to execute the method for constructing a Bayesian classification model executed by the initiating device as described in any of the above embodiments, or to implement the method for constructing a Bayesian classification model executed by the labeling device as described in any of the above embodiments, or to implement the method for constructing a Bayesian classification model executed by the feature-side device as described in any of the above embodiments.
[0128] Figure 8 This is a schematic diagram of a terminal device provided in an embodiment of this application. For example... Figure 8 As shown, the terminal device 8 in this embodiment includes: a processor 80, a memory 81, and a computer program 82 stored in the memory 81 and executable on the processor 80. When the processor 80 executes the computer program 82, it implements the steps performed by the initiating device, the labeling device, or the feature-based device in the construction methods of the various Bayesian classification models described above.
[0129] The computer program 82 can be divided into one or more modules / units, which are stored in the memory 81 and executed by the processor 80 to complete this application. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 82 in the terminal device 8.
[0130] The processor 80 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0131] The memory 81 can be an internal storage unit of the terminal device 8, such as a hard disk or memory of the terminal device 8. The memory 81 can also be an external storage device of the terminal device 8, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the terminal device 8. Furthermore, the memory 81 can include both internal and external storage units of the terminal device 8. The memory 81 is used to store the computer program and other programs and data required by the terminal device. The memory 81 can also be used to temporarily store data that has been output or will be output.
[0132] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0133] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0134] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0135] Those skilled in the art will 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, or a combination of computer software and electronic hardware. 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.
[0136] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.
[0137] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.
[0138] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0139] If the integrated unit 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, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0140] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for constructing a Bayesian classification model, applied to a label-based device storing label data for training the Bayesian classification model, characterized in that, The method includes: If the labeling device is not the initiating device that needs to build a Bayesian classification model, after receiving the data acquisition request sent by the initiating device, the labeling device sends the label data to at least one feature-side device that stores feature data for training a Bayesian classification model, so that the feature-side device calculates the feature conditional probability based on the label data and the feature data, and sends the feature conditional probability to the initiating device, so that the initiating device can build a Bayesian classification model based on the feature conditional probability; The step of sending the label data to at least one feature-side device storing feature data for training a Bayesian classification model, to instruct the feature-side device to calculate a feature conditional probability based on the label data and the feature data, and to send the feature conditional probability to the initiating device, so that the initiating device can construct a Bayesian classification model based on the feature conditional probability, includes: Based on the label data, generate m-1 sets of obfuscated labels, where m is an integer greater than 2; The tag data and the m-1 sets of obfuscated tags are packaged into m sets of tag information; The m sets of tag information are sent to the feature-party device to instruct the feature-party device to calculate m sets of feature conditional probabilities based on the m sets of tag information and the feature data, and to encrypt the m sets of feature conditional probabilities according to the order of the m sets of tag information based on the unintentional transmission protocol, in conjunction with the initiating device, to obtain m sets of encrypted information, and to send the m sets of encrypted information to the initiating device. The tag data is sent to the initiating device with the first sorting information in the m groups of tag information, so as to instruct the initiating device to decrypt the received m groups of encrypted information based on the unintentional transmission protocol and the first sorting information, to obtain the first decrypted data of a group of encrypted information corresponding to the tag data in the m groups of encrypted information, and to construct a Bayesian classification model based on the first decrypted data. If the labeling device is the initiating device that needs to build a Bayesian classification model, then the labeling device sends the label data to the feature-side device to instruct the feature-side device to calculate the feature conditional probability based on the label data and the feature data, and send the feature conditional probability to the labeling device so that the labeling device can build a Bayesian classification model based on the feature conditional probability. The step of sending the label data to the feature-side device to instruct the feature-side device to calculate the feature conditional probability based on the label data and the feature data, and then sending the feature conditional probability to the label-side device so that the label-side device can construct a Bayesian classification model based on the feature conditional probability, includes: Based on the label data, generate n-1 sets of obfuscated labels, where n is an integer greater than 2; The tag data and the n-1 sets of obfuscated tags are packaged into n sets of tag information; The n sets of tag information are sent to the feature party device to instruct the feature party device to calculate n sets of feature condition probabilities based on the n sets of tag information and the feature data. The joint coordinating party device encrypts the n sets of feature condition probabilities according to the order of the n sets of tag information based on the unintentional transmission protocol to obtain n sets of encrypted information, and sends the n sets of encrypted information to the coordinating party device. The second sorting information of the tag data in the n sets of tag information is sent to the coordinating device to instruct the coordinating device to decrypt the received n sets of encrypted information based on the unintentional transmission protocol and the second sorting information, to obtain the second decrypted data of a set of encrypted information corresponding to the tag data in the n sets of encrypted information, and send the second decrypted data to the tag device so that the tag device can construct a Bayesian classification model based on the second decrypted data.
2. The method as described in claim 1, characterized in that, The labeling device also stores feature data for training a Bayesian classification model, and the feature space of the feature data of the labeling device is different from that of the feature-side device. After receiving the data acquisition request sent by the initiating device, the tag-side device further includes: The feature-side device performs privacy set intersection processing on the feature data in collaboration with the feature-side device, so that both the tag-side device and the feature-side device have the same amount of feature datasets under the same data identifier field; The label category probability is calculated based on the label data and the amount of data. Based on the feature dataset and the amount of data possessed by the tagging device, the feature category probability of the tagging device is calculated; Based on the tag category probability and the feature category probability, the feature conditional probability of the tag-handling device is calculated; The characteristic conditional probability of the tag-side device is sent to the initiating device.
3. A method for constructing a Bayesian classification model, applied to an initiating device that needs to construct a Bayesian classification model, characterized in that, The method includes: If the labeling device that stores the label data used to train the Bayesian classification model is not the initiating device, the initiating device sends a data acquisition request to the labeling device, instructing the labeling device to send the label data to at least one feature-side device that stores feature data used to train the Bayesian classification model after receiving the data acquisition request, so that the feature-side device can calculate the feature conditional probability based on the label data and the feature data, and send the feature conditional probability to the initiating device; A Bayesian classification model is constructed based on the conditional probabilities of the aforementioned features. The step of sending the label data to at least one feature-side device that stores feature data for training a Bayesian classification model, so that the feature-side device calculates a feature conditional probability based on the label data and the feature data, and sends the feature conditional probability to the initiating device, includes: The tagging device generates m-1 sets of obfuscated tags based on the tag data, where m is an integer greater than 2. It packages the tag data and the m-1 sets of obfuscated tags into m sets of tag information and sends the m sets of tag information to the feature-based device. This instructs the feature-based device to calculate m sets of feature conditional probabilities based on the m sets of tag information and the feature data. The feature-based device, in conjunction with the initiating device, encrypts the m sets of feature conditional probabilities according to the order of the m sets of tag information using an unintentional transmission protocol to obtain m sets of encrypted information. The encrypted information is then sent to the initiating device. After receiving the tag data sent by the tag sender device in the first sorting information of the m groups of tag information, the initiating device decrypts the received m groups of encrypted information based on the unintentional transmission protocol and the first sorting information to obtain the first decrypted data of a group of encrypted information corresponding to the tag data in the m groups of encrypted information. The Bayesian classification model constructed based on the conditional probabilities of the features includes: A Bayesian classification model is constructed based on the first decrypted data; If the tagging device is the initiating device, the tagging device sends the tag data to the feature-based device to instruct the feature-based device to calculate the feature conditional probability based on the tag data and the feature data, and then sends the feature conditional probability to the tagging device so that the tagging device can construct a Bayesian classification model based on the feature conditional probability. The tagging device sends the tag data to the feature-based device, instructing the feature-based device to calculate a feature conditional probability based on the tag data and the feature data, and then sends the feature conditional probability to the tagging device, so that the tagging device can construct a Bayesian classification model based on the feature conditional probability, including: The tagging device generates n-1 sets of obfuscated tags based on the tag data, where n is an integer greater than 2. It packages the tag data and the n-1 sets of obfuscated tags into n sets of tag information and sends the n sets of tag information to the feature-based device. This instructs the feature-based device to calculate n sets of feature conditional probabilities based on the n sets of tag information and the feature data. The coordinating device then encrypts the n sets of feature conditional probabilities according to the order of the n sets of tag information using an unintentional transmission protocol, resulting in n sets of encrypted information. Finally, the coordinating device sends the n sets of encrypted information to the coordinating device. The tagging device sends the tag data to the coordinating device via the second sorting information in the n sets of tag information. This instructs the coordinating device to decrypt the received n sets of encrypted information based on the unintentional transmission protocol and the second sorting information. The coordinating device then obtains the second decrypted data of the encrypted information corresponding to the tag data in the n sets of encrypted information and sends the second decrypted data to the tagging device. This enables the tagging device to construct a Bayesian classification model based on the second decrypted data.
4. A method for constructing a Bayesian classification model, applied to a feature square device storing feature data for training the Bayesian classification model, characterized in that, The method includes: If the labeling device containing the label data for training the Bayesian classification model is not the initiating device that needs to build the Bayesian classification model, then after receiving the label data sent by the labeling device, the feature-side device calculates the feature conditional probability based on the label data and the feature data, and sends the feature conditional probability to the initiating device, so that the initiating device can build the Bayesian classification model based on the feature conditional probability; wherein, the label data is sent by the labeling device to the feature-side device after receiving the data acquisition request sent by the initiating device; After receiving the tag data sent by the tag-side device, the feature-side device calculates a feature conditional probability based on the tag data and the feature data, and sends the feature conditional probability to the initiating device, so that the initiating device can construct a Bayesian classification model based on the feature conditional probability, including: The tag-agent device generates m-1 sets of obfuscated tags based on the tag data, where m is an integer greater than 2. It then packages the tag data and the m-1 sets of obfuscated tags into m sets of tag information and sends the m sets of tag information to the feature-agent device. The feature-side device calculates m sets of feature conditional probabilities based on the m sets of tag information and the feature data, and, together with the initiating device, encrypts the m sets of feature conditional probabilities according to the order of the m sets of tag information based on the unintentional transmission protocol to obtain m sets of encrypted information, and sends the m sets of encrypted information to the initiating device. The tagging device sends the tag data to the initiating device via the first sorting information of the m groups of tag information, thereby instructing the initiating device to decrypt the received m groups of encrypted information based on the unintentional transmission protocol and the first sorting information, to obtain the first decrypted data of a group of encrypted information corresponding to the tag data in the m groups of encrypted information, and to construct a Bayesian classification model based on the first decrypted data. If the labeling device is the initiating device that needs to build a Bayesian classification model, then after receiving the label data sent by the labeling device, the feature-side device calculates the feature conditional probability based on the label data and the feature data, and sends the feature conditional probability to the labeling device so that the labeling device can build a Bayesian classification model based on the feature conditional probability. Wherein, after receiving the tag data sent by the tag-side device, the feature-side device calculates a feature conditional probability based on the tag data and the feature data, and sends the feature conditional probability to the tag-side device, so that the tag-side device can construct a Bayesian classification model based on the feature conditional probability, including: The tag-agent device generates n-1 sets of obfuscated tags based on the tag data, where n is an integer greater than 2. It then packages the tag data and the n-1 sets of obfuscated tags into n sets of tag information and sends the n sets of tag information to the feature-agent device. The feature-side device calculates n sets of feature conditional probabilities based on the n sets of tag information and the feature data, and the joint coordinating device encrypts the n sets of feature conditional probabilities according to the order of the n sets of tag information based on the unintentional transmission protocol to obtain n sets of encrypted information, and sends the n sets of encrypted information to the coordinating device. The tagging device sends the tag data to the coordinating device via the second sorting information in the n sets of tag information. This instructs the coordinating device to decrypt the received n sets of encrypted information based on the unintentional transmission protocol and the second sorting information. The coordinating device then obtains the second decrypted data of the encrypted information corresponding to the tag data in the n sets of encrypted information and sends the second decrypted data to the tagging device. This enables the tagging device to construct a Bayesian classification model based on the second decrypted data.
5. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for constructing a Bayesian classification model as described in claim 1 or 2, or the method for constructing a Bayesian classification model as described in claim 3, or the method for constructing a Bayesian classification model as described in claim 4.
6. A system for constructing a Bayesian classification model, characterized in that, It includes an initiating device that needs to build a Bayesian classification model, a labeling device that stores label data for training the Bayesian classification model, and at least one feature-side device that stores feature data for training the Bayesian classification model. The tag-agent device is configured to, upon receiving a data acquisition request sent by the initiating device, generate m-1 sets of obfuscated tags based on the tag data, where m is an integer greater than 2; package the tag data and the m-1 sets of obfuscated tags into m sets of tag information; send the m sets of tag information to the feature-agent device, and send the first sorting information of the tag data in the m sets of tag information to the initiating device; The feature-side device is configured to, after receiving the m sets of tag information, calculate m sets of feature conditional probabilities based on the m sets of tag information and the feature data, and, together with the initiating device, encrypt the m sets of feature conditional probabilities according to the order of the m sets of tag information based on the unintentional transmission protocol to obtain m sets of encrypted information, and send the m sets of encrypted information to the initiating device. The initiating device is used to send the data acquisition request to the tagging device. After receiving the first sorting information and the m sets of encrypted information, it decrypts the m sets of encrypted information based on the unintentional transmission protocol and the first sorting information to obtain the first decrypted data of a set of encrypted information corresponding to the tag data in the m sets of encrypted information, and constructs a Bayesian classification model based on the first decrypted data.
7. A system for constructing a Bayesian classification model, characterized in that, It includes a coordinator device, a labeler device that needs to build a Bayesian classification model and stores label data for training the Bayesian classification model, and at least one featureer device that stores feature data for training the Bayesian classification model. The tagging device is configured to generate m-1 sets of obfuscated tags based on the tag data, where m is an integer greater than 2; package the tag data and the m-1 sets of obfuscated tags into m sets of tag information and send them to the feature-side device; send the sorting information of the tag data in the m sets of tag information to the coordinating device; and after receiving the decrypted data sent by the coordinating device, construct a Bayesian classification model based on the decrypted data. The feature-side device is configured to, after receiving the m sets of tag information, calculate m sets of feature conditional probabilities based on the m sets of tag information and the feature data, and, together with the coordinating device, encrypt the m sets of feature conditional probabilities according to the order of the m sets of tag information based on an unintentional transmission protocol to obtain m sets of encrypted information, and send the m sets of encrypted information to the coordinating device. The coordinating device is configured to, upon receiving the sorting information and the m sets of encrypted information, decrypt the received m sets of encrypted information based on the unintentional transmission protocol and the sorting information, to obtain the decrypted data of a set of encrypted information corresponding to the tag data in the m sets of encrypted information, and send the decrypted data to the tag device.
Citation Information
Patent Citations
Data label distribution determination method and device, computer equipment and storage medium
CN113362048A
Federal learning code generation method and device, electronic equipment and storage medium
CN114282257A
