Privacy-enhanced detection method based on generative adversarial network

Through the GAN-based privacy enhancement detection method, the problem of sample data imbalance in privacy leakage detection of IoT devices is solved, the performance and accuracy of the detection model are improved, and more effective privacy data detection is achieved.

CN119312147BActive Publication Date: 2025-03-07HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411853904.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-03-07
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

The data security protection of IoT devices is relatively weak, resulting in a high risk of privacy leakage. The existing privacy leakage detection model has reduced detection accuracy due to the imbalance of sample data and low performance.

Method used

Using a privacy-enhanced detection method based on Generative Adversarial Network (GAN), by building a GAN containing multiple generators, a discriminator and a classifier, the parameters of the generator, discriminator and classifier are optimized, and the target pseudo-sample data is generated to expand the training data set to avoid the problem of data category imbalance.

Benefits of technology

It improves the performance and accuracy of the privacy leakage detection model, enhances the detection ability of privacy data of IoT devices, reduces class overlap between pseudo-sample data, and improves the sample generation performance of the generator.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119312147B_ABST
    Figure CN119312147B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a privacy enhancement detection method based on a generative adversarial network. In the embodiment of the present application, a GAN including multiple generators, a discriminator and a classifier is constructed, and the GAN is trained based on a training data set to obtain a target GAN; based on this, the present embodiment generates multiple target pseudo sample data by using each generator in the target GAN, so as to use each target pseudo sample data as the training sample data of the privacy leakage detection model, so as to expand the training data set of the privacy leakage detection model, so as to avoid the problem of imbalance in the number of sample data of different data categories in the training data set, thereby improving the performance of the privacy leakage detection model and improving the accuracy of privacy leakage detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security technology, and in particular to a privacy-enhancing detection method based on a generative adversarial network. Background Art

[0002] With the rapid development of the Internet of Things, the number of IoT devices is growing, and the scale of IoT data is also getting larger and larger. However, the data security protection of IoT devices is relatively weak, and there is a great risk of privacy leakage. Therefore, privacy leakage detection for IoT devices is very important.

[0003] At present, the network flows of IoT devices are usually collected as sample data to train the privacy leakage detection model for IoT privacy leakage detection. However, in the collected sample data, the number of sample data corresponding to the normal network flows without privacy data and the number of sample data corresponding to the privacy network flows containing privacy data are usually unbalanced. For example, the number of sample data corresponding to the privacy network flows is much less than the number of sample data corresponding to the normal network flows. Using such sample data to train the above privacy leakage detection model will affect the performance of the privacy leakage detection model, thereby reducing the accuracy of privacy leakage detection. Summary of the invention

[0004] In view of this, the present application provides a privacy enhancement detection method based on a generative adversarial network to improve the accuracy of privacy leakage detection.

[0005] The embodiment of the present application provides a privacy enhancement detection method based on a generative adversarial network, which is applied to an electronic device. The method includes:

[0006] Obtain the current training data set; the current training data set includes the following sample data: pseudo sample data generated by each generator in the current Generative Adversarial Network (GAN), and private sample data extracted from the stored private sample data set, and the private sample data is used as the real sample data compared with the pseudo sample data;

[0007] Classify the sample data in the current training data set based on the classifier in the current GAN to determine the classification loss value based on the classification result; and optimize the classifier parameters of the classifier using the classification loss value;

[0008] Based on the discriminator in the current GAN, the sample data in the current training data set is identified for authenticity, so as to determine the discrimination loss value based on the recognition result; the discriminator parameters of the discriminator are optimized using the discrimination loss value and the classification loss value;

[0009] For each generator in the current GAN, the generator parameters of the generator are optimized according to the classification loss value, the discrimination loss value, and the sample similarity loss value corresponding to the generator; the sample similarity loss value corresponding to the generator is determined based on the sample similarity between each pseudo sample data generated by the generator and each reference sample data corresponding to the pseudo sample data; the reference sample data corresponding to the pseudo sample data generated by any generator includes: at least one real sample data of the same data category as the pseudo sample data in the current training data set, and at least one pseudo sample data generated by other generators;

[0010] After optimizing the generator parameters of all generators, if the network iteration end condition is currently met, the current GAN is determined as the target GAN, otherwise, return to the step of obtaining the current training data set;

[0011] Among them, each generator in the target GAN is used to generate target pseudo sample data, and each target pseudo sample data is used to train a privacy leakage detection model; the privacy leakage detection model is used to perform IoT privacy leakage detection on network flows.

[0012] The embodiment of the present application also provides a privacy enhancement detection device based on a generative adversarial network, which is applied to an electronic device; the device includes:

[0013] The acquisition module is used to obtain the current training data set; the current training data set includes the following sample data: pseudo sample data generated by each generator in the current GAN, and private sample data extracted from the stored private sample data set, and the private sample data is used as the real sample data compared with the pseudo sample data;

[0014] A first optimization module is used to classify sample data in the current training data set based on the classifier in the current GAN, so as to determine a classification loss value based on the classification result; and optimize the classifier parameters of the classifier using the classification loss value;

[0015] The second optimization module is used to identify the authenticity of sample data in the current training data set based on the discriminator in the current GAN, so as to determine the discrimination loss value based on the recognition result; and optimize the discriminator parameters of the discriminator using the discrimination loss value and the classification loss value;

[0016] A third optimization module is used to optimize the generator parameters of each generator in the current GAN according to the classification loss value, the discrimination loss value, and the sample similarity loss value corresponding to the generator; the sample similarity loss value corresponding to the generator is determined based on the sample similarity between each pseudo sample data generated by the generator and each reference sample data corresponding to the pseudo sample data; the reference sample data corresponding to the pseudo sample data generated by any generator includes: at least one real sample data of the same data category as the pseudo sample data in the current training data set, and at least one pseudo sample data generated by other generators;

[0017] A detection module is used to determine the current GAN as the target GAN after optimizing the generator parameters of all generators, if the network iteration end condition is currently met, otherwise, return to the step of obtaining the current training data set;

[0018] Among them, each generator in the target GAN is used to generate target pseudo sample data, and each target pseudo sample data is used to train a privacy leakage detection model; the privacy leakage detection model is used to perform IoT privacy leakage detection on network flows.

[0019] The present application also provides an electronic device, the electronic device comprising:

[0020] Processor; and

[0021] A computer-readable storage medium stores computer program instructions, which, when executed by a processor, cause the processor to execute the steps of the above method.

[0022] An embodiment of the present application further provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps in the above method.

[0023] It can be seen from the above technical scheme that in the embodiment of the present application, a GAN including multiple generators, a discriminator and a classifier is constructed, and the GAN is trained based on the training data set to obtain the target GAN; based on this, this embodiment generates multiple target pseudo-sample data by utilizing each generator in the target GAN, and uses each target pseudo-sample data as the training sample data of the privacy leakage detection model, so as to expand the training data set of the privacy leakage detection model to avoid the problem of unbalanced number of sample data of different data categories in the training data set, thereby improving the performance of the privacy leakage detection model and improving the accuracy of privacy leakage detection.

[0024] Furthermore, in the training process of GAN, the embodiment of the present application utilizes the classification loss value of the classifier and the discriminant loss value of the discriminator to jointly optimize the discriminator parameters of the discriminator in GAN, which can effectively improve the discrimination performance of the discriminator; the embodiment optimizes the generator parameters by the classification loss value and the discriminator loss value, which can improve the feature learning ability of the generator for the real sample data of the corresponding data category, so as to effectively improve the quality of the pseudo sample data generated by the generator, and also optimizes the generator parameters by the sample similarity loss value, which can not only effectively reduce the class overlap between pseudo sample data of different data categories and improve the clarity of classification boundaries, but also improve the sample similarity between the pseudo sample data generated by the generator and the real sample data of the same data category. Based on this, the embodiment optimizes the generator parameters of the generator by comprehensively utilizing the classification loss value, the discriminant loss value and the sample similarity loss value corresponding to the generator, which can effectively improve the sample generation performance of the generator. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The accompanying drawings, which are incorporated in the specification and constitute a part of this application, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.

[0026] Figure 1 A flow chart of the method provided in an embodiment of the present application.

[0027] Figure 2 Another method flow chart provided for an embodiment of the present application.

[0028] Figure 3 Another method flow chart provided for an embodiment of the present application.

[0029] Figure 4 A schematic diagram of the device structure provided in an embodiment of the present application.

[0030] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.

[0032] See also Figure 1 , Figure 1The flowchart of the method provided in the embodiment of the present application. The method is applied to an electronic device. As an embodiment, the electronic device may be, for example, a training server or an IoT device, which is not specifically limited in this embodiment. The IoT device here may be, for example, a smart home device, a smart monitoring device, which is not specifically limited in this embodiment. Figure 1 As shown, the process may include the following steps:

[0033] Step 101, obtain the current training data set; the current training data set includes the following sample data: pseudo sample data generated by each generator in the current GAN, and private sample data extracted from the stored private sample data set, and the private sample data is used as real sample data compared with the pseudo sample data.

[0034] In this embodiment, the above-mentioned privacy sample data set is prepared in advance based on actual application requirements and stored in the designated storage space of this electronic device; as for how to prepare the privacy sample data set specifically, it will be described by examples below and will not be elaborated here.

[0035] In this embodiment, the generator is used to generate pseudo-sample data of a specified data category, that is, the pseudo-sample data generated by the same generator has the same data category. In this embodiment, the pseudo-sample data generated by each generator has different data categories, that is, the data category of the pseudo-sample data generated by any generator is different from the data category of the pseudo-sample data generated by other generators. Among them, the above-mentioned specified data category refers to a data category associated with privacy; for example, it may include but is not limited to a device identification category, an identity information category, a location information category, and a login key category, etc., which are not specifically limited here.

[0036] Based on this, as an embodiment, the current training data set is obtained in this step. In the specific implementation, for example, it can be: first use each generator in the current GAN to generate at least one pseudo sample data as candidate sample data; then, each candidate sample data and at least one privacy sample data extracted from the stored privacy sample data set are used as the current training data set.

[0037] Step 102, classify the sample data in the current training data set based on the classifier in the current GAN to determine the classification loss value based on the classification result; and use the classification loss value to optimize the classifier parameters of the classifier.

[0038] In this embodiment, the classifier is used to classify the input sample data, that is, the classifier is used to identify the data category of the input sample data. The classification result of any sample data at least indicates the predicted data category of the sample data and the predicted probability that the sample data belongs to the predicted data category. Based on this, as an embodiment, the classification loss value is determined based on the classification result in this step. In the specific implementation, for example, it may include: calculating the classification results of each sample data in the current training data set and the data category label corresponding to each sample data through a pre-constructed classification loss function to obtain the classification loss value. As for the classification loss function here, it can be constructed in advance based on actual needs, such as a cross entropy loss function, a least squares loss function, etc., which is not specifically limited in this embodiment.

[0039] In this embodiment, as an embodiment, in this step, the classifier parameters of the classifier are optimized by using the classification loss value. In a specific implementation, for example, the classifier parameters of the classifier are optimized based on the above classification loss value using a preset gradient descent algorithm. As for the gradient descent algorithm here, for example, it can be a batch gradient descent algorithm, a stochastic gradient descent algorithm, etc., which is not specifically limited in this embodiment.

[0040] Step 103, based on the discriminator in the current GAN, the sample data in the current training data set is identified as true or false, so as to determine the discrimination loss value based on the recognition result; and the discriminator parameters of the discriminator are optimized using the discrimination loss value and the classification loss value.

[0041] In this embodiment, the discriminator is used to identify the authenticity of the input sample data, that is, the discriminator is used to identify whether the input sample data is real sample data or fake sample data. The recognition result of any sample data at least indicates the probability that the sample data belongs to the real sample data. Based on this, as an embodiment, the discrimination loss value is determined based on the recognition result in this step. In the specific implementation, for example, it may include: calculating the recognition result of each sample data in the current training data set and the sample label corresponding to each sample data indicating the authenticity of the sample data through a pre-constructed discrimination loss function to obtain a discrimination loss value. As for the discrimination loss function here, it can be constructed in advance based on actual needs, such as a cross entropy loss function, a contrast loss function, etc., which is not specifically limited in this embodiment.

[0042] In this embodiment, as an embodiment, in this step, the discriminant parameters of the discriminator are optimized by using the discriminant loss value and the classification loss value. In a specific implementation, for example, the first target loss value for optimizing the discriminator parameters is first determined based on the discriminant loss value and the classification loss value; then, the discriminator parameters of the discriminator are optimized based on the first target loss value using a preset gradient descent algorithm. As for the gradient descent algorithm here, please refer to the above-mentioned related description, which will not be repeated here.

[0043] As an embodiment, there are many specific implementation methods for determining the first target loss value for optimizing the discriminator parameters based on the discriminant loss value and the classification loss value. For example, the mean of the discriminant loss value and the classification loss value is determined as the first target loss value; for another example, the weighted sum of the discriminant loss value and the classification loss value is determined as the first target loss value; and so on.

[0044] Step 104, for each generator in the current GAN, optimize the generator parameters of the generator according to the classification loss value, the discrimination loss value, and the sample similarity loss value corresponding to the generator.

[0045] In this embodiment, the sample similarity loss value corresponding to any generator is determined based on the sample similarity between each pseudo sample data generated by the generator and each reference sample data corresponding to the pseudo sample data. The reference sample data corresponding to the pseudo sample data generated by any generator includes: at least one real sample data of the same data category as the pseudo sample data in the current training data set, and at least one pseudo sample data generated by other generators. As for how to determine the sample similarity loss value corresponding to any generator, the following will be described by example, and will not be repeated here.

[0046] In this embodiment, as an embodiment, in this step, the generator parameters of the generator are optimized based on the classification loss value, the discrimination loss value, and the sample similarity loss value corresponding to the generator. In the specific implementation, for example, the second target loss value for optimizing the generator parameters is first determined based on the classification loss value, the discrimination loss value, and the sample similarity loss value corresponding to the generator; then, the generator parameters of the generator are optimized based on the second target loss value using a pre-set gradient descent algorithm. As for the gradient descent algorithm here, please refer to the above-mentioned related description, which will not be repeated here.

[0047] As an embodiment, there are many specific implementation methods based on the classification loss value, the discrimination loss value, and the sample similarity loss value corresponding to the generator. For example, the average of the classification loss value, the discrimination loss value, and the sample similarity loss value corresponding to the generator is determined as the second target loss value; for another example, the weighted sum of the classification loss value, the discrimination loss value, and the sample similarity loss value corresponding to the generator is determined as the second target loss value; and so on.

[0048] Step 105, after optimizing the generator parameters of all generators, if the network iteration end condition is currently met, the current GAN is determined as the target GAN, otherwise, return to the step of obtaining the current training data set; wherein each generator in the target GAN is used to generate target pseudo sample data, and each target pseudo sample data is used to train the privacy leakage detection model; the privacy leakage detection model is used to perform IoT privacy leakage detection on the network flow.

[0049] In this embodiment, as an embodiment, after optimizing the generator parameters of all generators, the recorded number of GAN iterations can be increased by a set value. The number of GAN iterations refers to the number of updates of the network parameters of the GAN, where the network parameters of the GAN include the generator parameters of each generator in the GAN, the classifier parameters of the classifier, and the discriminator parameters of the discriminator. The set value can be, for example, 1, which is not specifically limited in this embodiment.

[0050] Based on the above description, as an embodiment, determining whether the network iteration end condition is currently met in this step specifically includes: checking whether the recorded number of GAN iterations reaches a set number threshold, if yes, determining that the network iteration end condition is currently met, if not, determining that the network iteration end condition is not currently met.

[0051] In this embodiment, after obtaining the target GAN, each generator in the target GAN can be used to generate at least one target pseudo sample data, so as to form a new training data set for training the privacy leakage detection model based on each target pseudo sample data and the original training data set prepared in advance. Based on this, as an embodiment, after training the privacy leakage detection model using the new training data set, the trained privacy leakage detection model can be stored in at least one detection device for privacy leakage detection, so that when any detection device needs to detect any network flow, the detection device can perform IoT privacy leakage detection on the network flow based on the trained privacy leakage detection model.

[0052] So far, completed Figure 1 The process shown.

[0053] pass Figure 1It can be seen from the shown process that in the embodiment of the present application, a GAN including multiple generators, a discriminator and a classifier is constructed, and the GAN is trained based on the training data set to obtain a target GAN; based on this, the present embodiment generates multiple target pseudo-sample data by utilizing each generator in the target GAN, and uses each target pseudo-sample data as the training sample data of the privacy leakage detection model, so as to expand the training data set of the privacy leakage detection model to avoid the problem of unbalanced number of sample data of different data categories in the training data set, thereby improving the performance of the privacy leakage detection model and improving the accuracy of privacy leakage detection.

[0054] Furthermore, in the training process of GAN, the embodiment of the present application utilizes the classification loss value of the classifier and the discriminant loss value of the discriminator to jointly optimize the discriminator parameters of the discriminator in GAN, which can effectively improve the discrimination performance of the discriminator; the embodiment optimizes the generator parameters by the classification loss value and the discriminator loss value, which can improve the feature learning ability of the generator for the real sample data of the corresponding data category, so as to effectively improve the quality of the pseudo sample data generated by the generator, and also optimizes the generator parameters by the sample similarity loss value, which can not only effectively reduce the class overlap between pseudo sample data of different data categories and improve the clarity of classification boundaries, but also improve the sample similarity between the pseudo sample data generated by the generator and the real sample data of the same data category. Based on this, the embodiment optimizes the generator parameters of the generator by comprehensively utilizing the classification loss value, the discriminant loss value and the sample similarity loss value corresponding to the generator, which can effectively improve the sample generation performance of the generator.

[0055] The following describes how to prepare the privacy sample dataset in step 101 above:

[0056] In this embodiment, there are many specific implementation methods for preparing the privacy sample data set. For example, as an embodiment, first, multiple network flows are obtained to form an initial privacy sample data set based on each network flow; then, the initial privacy sample data set is preprocessed according to a specified preprocessing method to obtain the above-mentioned privacy sample data set.

[0057] In this embodiment, as an embodiment, the above-mentioned acquisition of multiple network flows can be implemented in detail as follows: first, a business function containing privacy data on the IoT device is triggered to obtain the network flow initiated when the business function is triggered; then, a check is made as to whether the number of obtained network flows reaches a set number threshold, if so, stop obtaining the network flow, if not, return to the step of triggering the business function containing privacy data on the IoT device.

[0058] Among them, the above-mentioned network flow refers to the network data flow based on the Internet of Things communication protocol (such as HTTP protocol, HTTPS protocol, etc.); there is no specific limitation on the data format of the network flow here, for example, the data format of the network flow can include text format, video format and style sheet format, etc.

[0059] The above-mentioned business functions refer to the business service functions provided by the IoT devices. This embodiment does not specifically limit the business functions containing privacy data. For example, as an embodiment, the business functions containing privacy data may include but are not limited to user login business functions, location sharing business functions, payment transaction business functions, and video stream extraction business functions. Correspondingly, the data content of the network flow initiated when different business functions are triggered is different; for example, the data content of the network flow initiated when the user login business function is triggered may include login key information, etc.; the data content of the network flow initiated when the location sharing business function is triggered may include device information and location information, etc.; this embodiment does not specifically limit this.

[0060] In this embodiment, the initial privacy sample data set is preprocessed in a specified preprocessing manner to obtain the above-mentioned privacy sample data set. There are many ways to implement it in specific implementation. For example, as an embodiment, first, in order to clean up the network flows that may not contain privacy data and improve data quality, the network flows with data formats in the specified data format in the initial privacy sample data set can be cleared to obtain the clearing results corresponding to the initial privacy sample data set; here, the network flows with data formats in the specified data format can refer to network flows that do not contain privacy data determined based on prior knowledge.

[0061] Then, for each network flow in the above clearing results, feature extraction is performed on the network flow based on the specified feature extraction method to obtain a first network flow feature vector corresponding to the network flow, the non-data value data in the first network flow feature vector corresponding to the network flow is converted into numerical data through a specified encoding method to obtain a second network flow feature vector corresponding to the network flow, and then the second network flow feature vector corresponding to the network flow is normalized to obtain a third network flow feature vector corresponding to the network flow.

[0062] The present embodiment does not specifically limit the above-mentioned specified feature extraction method and the specified encoding method, and can be flexibly set based on actual application requirements. The above-mentioned normalization processing refers to scaling the data to a specified range, where the specified range can be, for example, a range greater than or equal to 0 and less than or equal to 1.

[0063] Afterwards, for each of the third network flow feature vectors corresponding to the network flow, a dimension reduction process is performed on the third network flow feature vector using a specified dimension reduction method to obtain a fourth network flow feature vector corresponding to the network flow.

[0064] The present embodiment does not specifically limit the designated dimensionality reduction method adopted above, and can be set based on actual application requirements, for example, it can be a nonlinear data dimensionality reduction method such as Kernel Principal Component Analysis (KPCA).

[0065] Finally, for the fourth network flow feature vector corresponding to each of the above-mentioned network flows, determine whether the fourth network flow feature vector corresponding to the network flow is a network flow feature vector containing an abnormal feature value according to the specified abnormal value judgment method. If so, delete the fourth network flow feature vector corresponding to the network flow. After judging all the fourth network flow feature vectors, the above-mentioned privacy sample data set is constructed based on the remaining fourth network flow feature vectors.

[0066] In this embodiment, the above-mentioned method of judging whether the fourth network flow feature vector corresponding to the network flow is a network flow feature vector containing abnormal feature values ​​according to the specified abnormal value judgment method can be specifically implemented as follows: for each feature value in the fourth network flow feature vector, first calculate the mean between the feature value and the feature value in the other fourth network flow feature vectors with the same feature position as the feature value; then, calculate the feature value and the mean based on the specified deviation degree value calculation method to obtain the deviation degree value corresponding to the feature value, and the deviation degree value corresponding to the feature value indicates the degree of deviation of the feature value relative to the mean; if the deviation degree value is greater than the set deviation threshold, the feature value is determined to be an abnormal feature value, otherwise, the feature value is determined to be a normal feature value; finally, if it is determined that the fourth network flow feature vector contains at least one abnormal feature value, the fourth network flow feature vector is determined to be a network flow feature vector containing abnormal feature values. Among them, the feature position of any feature value refers to the position of the feature value in the corresponding network flow feature vector.

[0067] This completes the description of how to prepare the privacy sample data set in step 101. The following describes how the generator generates pseudo sample data in step 101:

[0068] In this embodiment, there are many specific implementations of the generator generating pseudo sample data; for example, as an embodiment, see Figure 2 As shown, any generator generating corresponding pseudo sample data may include the following steps in specific implementation:

[0069] Step 201 , randomly sampling from a noise space that conforms to a Gaussian distribution to obtain random noise data.

[0070] In this embodiment, as an embodiment, each generator can share the same noise space that conforms to the Gaussian distribution; or, a corresponding noise space that conforms to the Gaussian distribution is configured for each generator, and the noise space corresponding to each generator is different; this embodiment does not specifically limit this.

[0071] Step 202: input random noise data into the generator to obtain corresponding pseudo sample data.

[0072] The following describes how to determine the sample similarity loss value corresponding to the generator in the above step 104:

[0073] In this embodiment, there are many specific implementation methods for determining the sample similarity loss value corresponding to any generator. For example, as an embodiment, see Figure 3 As shown, determining the sample similarity loss value corresponding to the generator may include the following steps in specific implementation:

[0074] Step 301, for each pseudo sample data generated by the current generator, similarity calculation is performed based on the feature vector of the pseudo sample data and the feature vector of each real sample data in the reference sample data corresponding to the pseudo sample data, so as to obtain a first sample similarity between the pseudo sample data and each real sample data in the reference sample data corresponding to the pseudo sample data.

[0075] In this embodiment, the feature vector of any sample data in the current training data set is extracted from the hidden layer of the classifier by the trained feature extractor after the sample data is input into the classifier in the current GAN. Here, the feature vector of the sample data extracted from the hidden layer of the classifier has better feature representation performance than the original feature vector of the sample data (that is, the feature vector corresponding to the sample data before it is input into the classifier), which can improve the accuracy of the calculated sample similarity.

[0076] Step 302, for each pseudo sample data generated by the current generator, similarity calculation is performed based on the feature vector of the pseudo sample data and the feature vector of each pseudo sample data in the reference sample data corresponding to the pseudo sample data, so as to obtain a second sample similarity between the pseudo sample data and each pseudo sample data in the reference sample data corresponding to the pseudo sample data.

[0077] Step 303, performing loss value calculation on the mean of each first sample similarity obtained and the mean of each second sample similarity obtained according to a specified loss value calculation method, so as to obtain a sample similarity loss value corresponding to the generator.

[0078] In this embodiment, the first sample similarity represents the sample similarity between the pseudo sample data generated by the generator and the real sample data of the same data category as the pseudo sample data; based on this, the mean of each first sample similarity can be used to measure the degree of closeness of the feature distribution between the pseudo sample data generated by the generator and the real sample data of the same data category as the pseudo sample data; it can be understood that the higher the degree of closeness, the closer the pseudo sample data generated by the generator is to the real sample data of the same data category, that is, the higher the pseudo sample data generation performance of the generator.

[0079] Correspondingly, the second sample similarity represents the sample similarity between the pseudo sample data generated by the generator and the pseudo sample data generated by other generators (that is, pseudo sample data with a data category different from that of the pseudo sample data); based on this, the mean of each second sample similarity can be used to measure the degree of feature overlap between the pseudo sample data generated by the generator and other pseudo sample data with a data category different from that of the pseudo sample data; it can be understood that the lower the degree of feature overlap, the higher the clarity of the classification boundary between the pseudo sample data generated by the generator and other pseudo sample data with a data category different from that of the pseudo sample data, which also indicates that the pseudo sample data generation performance of the generator is higher.

[0080] Based on the above description, this embodiment determines the sample similarity loss value corresponding to the generator by utilizing the mean of each first sample similarity and the mean of each second sample similarity obtained, so as to optimize the generator parameters of the generator. This can not only effectively reduce the class overlap between pseudo sample data of different data categories and improve the clarity of classification boundaries, but also improve the sample similarity between the pseudo sample data generated by the generator and the real sample data of the same data category, thereby effectively improving the sample generation performance of the generator.

[0081] In this embodiment, as an embodiment, the above-mentioned loss value calculation is performed on the mean of the obtained first sample similarities and the mean of the obtained second sample similarities according to the specified loss value calculation method to obtain the sample similarity loss value corresponding to the generator. There are many ways in specific implementation; for example, the weighted sum of the mean of the first sample similarities and the mean of the obtained second sample similarities is determined as the sample similarity loss value corresponding to the generator; for another example, the weighted mean of the mean of the first sample similarities and the mean of the obtained second sample similarities is determined as the sample similarity loss value corresponding to the generator; and so on.

[0082] The following further describes how each target pseudo sample data in step 105 is used to train the privacy leakage detection model:

[0083] In this embodiment, in order to further ensure the data quality of the sample data used for training the privacy leakage detection model and improve the performance of the privacy leakage detection model, each target pseudo sample data can also be screened by the classifier in the target GAN to filter out noise samples with low data quality. Based on this, as an embodiment, after obtaining each target pseudo sample data, this embodiment first classifies the target pseudo sample data based on the classifier in the target GAN to obtain the classification result of the target pseudo sample data; wherein, as described above, it can be known that the classification result of the target pseudo sample data at least includes the predicted data category of the target pseudo sample data and the predicted probability that the target pseudo sample data belongs to the predicted data category;

[0084] Afterwards, check whether the predicted probability that the target pseudo sample data belongs to the predicted data category is greater than or equal to the set probability threshold, if yes, determine the target pseudo sample data as candidate sample data, if no, determine the target pseudo sample data as a noise sample and remove it;

[0085] Finally, after checking all the target pseudo-sample data, at least one candidate sample data is determined to be used to train the privacy leakage detection model; in this way, using the high-quality sample data obtained after screening to train the privacy leakage detection model can effectively improve the performance of the privacy leakage detection model, thereby improving the accuracy of privacy leakage detection.

[0086] At this point, the description of the method provided in the embodiment of the present application is completed. The following is a description of the device provided in the embodiment of the present application:

[0087] As an embodiment, this embodiment also provides a privacy enhancement detection device based on a generative adversarial network. Figure 4 , Figure 4 A schematic diagram of the device structure provided in an embodiment of the present application.

[0088] like Figure 4 As shown, the device 400 is applied to an electronic device, and the device 400 includes an acquisition module 401, a first optimization module 402, a second optimization module 403, a third optimization module 404 and a detection module 405;

[0089] Wherein, the obtaining module 401 is used to obtain the current training data set; the current training data set includes the following sample data: pseudo sample data generated by each generator in the current GAN, and private sample data extracted from the stored private sample data set, and the private sample data is used as the real sample data compared with the pseudo sample data;

[0090] The first optimization module 402 is used to classify the sample data in the current training data set based on the classifier in the current GAN, so as to determine the classification loss value based on the classification result; and optimize the classifier parameters of the classifier using the classification loss value;

[0091] The second optimization module 403 is used to identify the authenticity of sample data in the current training data set based on the discriminator in the current GAN, so as to determine the discrimination loss value based on the recognition result; and optimize the discriminator parameters of the discriminator using the discrimination loss value and the classification loss value;

[0092] The third optimization module 404 is used to optimize the generator parameters of each generator in the current GAN according to the classification loss value, the discrimination loss value, and the sample similarity loss value corresponding to the generator; the sample similarity loss value corresponding to the generator is determined based on the sample similarity between each pseudo sample data generated by the generator and each reference sample data corresponding to the pseudo sample data; the reference sample data corresponding to the pseudo sample data generated by any generator includes: at least one real sample data of the same data category as the pseudo sample data in the current training data set, and at least one pseudo sample data generated by other generators;

[0093] A detection module 405 is used to determine the current GAN as the target GAN after optimizing the generator parameters of all generators if the network iteration end condition is currently met, otherwise, return to the step of obtaining the current training data set;

[0094] Among them, each generator in the target GAN is used to generate target pseudo sample data, and each target pseudo sample data is used to train a privacy leakage detection model; the privacy leakage detection model is used to perform IoT privacy leakage detection on network flows.

[0095] As an embodiment, the sample similarity loss value corresponding to any generator is determined in the following manner:

[0096] For each pseudo sample data generated by the current generator, similarity calculation is performed based on the feature vector of the pseudo sample data and the feature vector of each real sample data in the reference sample data corresponding to the pseudo sample data, so as to obtain a first sample similarity between the pseudo sample data and each real sample data in the reference sample data corresponding to the pseudo sample data; the feature vector of any sample data in the current training data set is extracted from the hidden layer of the classifier by the trained feature extractor after the sample data is input into the classifier in the current GAN;

[0097] For each pseudo sample data generated by the current generator, similarity calculation is performed based on the feature vector of the pseudo sample data and the feature vector of each pseudo sample data in the reference sample data corresponding to the pseudo sample data, so as to obtain a second sample similarity between the pseudo sample data and each pseudo sample data in the reference sample data corresponding to the pseudo sample data;

[0098] The loss value is calculated for the average of the obtained first sample similarities and the average of the obtained second sample similarities according to the specified loss value calculation method to obtain the sample similarity loss value corresponding to the generator.

[0099] As an embodiment, the detection module 405 is further used to: after optimizing the generator parameters of all generators, increase the recorded number of GAN iterations by a set value.

[0100] The network iteration termination condition is currently met including: if the recorded number of GAN iterations reaches a set number threshold, it is determined that the network iteration termination condition is currently met.

[0101] As an embodiment, the detection module 405 is further used to: after obtaining each target pseudo sample data, the method further includes:

[0102] For each target pseudo sample data, classify the target pseudo sample data based on the classifier in the target GAN to obtain a classification result of the target pseudo sample data; the classification result of any target pseudo sample data at least includes the predicted data category of the target pseudo sample data and the predicted probability that the target pseudo sample data belongs to the predicted data category; check whether the predicted probability that the target pseudo sample data belongs to the predicted data category is greater than or equal to a set probability threshold, and if so, determine the target pseudo sample data as candidate sample data;

[0103] The at least one determined candidate sample data is used to train a privacy leakage detection model.

[0104] As an embodiment, the data categories of the pseudo sample data generated by any generator in the current GAN are the same;

[0105] The data category of the pseudo sample data generated by any generator in the current GAN is different from the data category of the pseudo sample data generated by other generators.

[0106] As an embodiment, the pseudo sample data generated by any generator in the current GAN is determined in the following manner:

[0107] Random sampling is performed from a noise space that conforms to a Gaussian distribution to obtain random noise data, and the random noise data is input into the generator to obtain corresponding pseudo sample data.

[0108] So far, completed Figure 4 Structural description of the device shown.

[0109] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0110] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying creative labor.

[0111] See also Figure 5 , is a schematic diagram of the hardware structure of an electronic device provided by an exemplary embodiment of the present application. The electronic device may include a processor 501, a communication interface 502, a computer-readable storage medium 503 and a communication bus 504. The processor 501, the communication interface 502 and the computer-readable storage medium 503 communicate with each other through the communication bus 504. Among them, computer program instructions are stored on the computer-readable storage medium 503; the processor 501 can execute the steps of the method described in the above embodiment by executing the computer program instructions stored on the computer-readable storage medium 503. The electronic device may also include other hardware according to the actual function of the electronic device, which will not be described in detail.

[0112] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, on which a number of computer program instructions are stored. When the computer program instructions are executed by a processor, the method disclosed in the above example of the present application can be implemented.

[0113] Exemplarily, the computer-readable storage medium may be any electronic, magnetic, optical or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the computer-readable storage medium may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as optical disk, DVD, etc.), or similar storage medium, or a combination thereof. The processor and memory may be supplemented by or incorporated into a dedicated logic circuit.

[0114] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A privacy enhancement detection method based on generative adversarial network, characterized in that: The method is applied to electronic equipment; the method comprises: Obtain a current training data set; the current training data set includes the following sample data: pseudo sample data generated by each generator in the current generative adversarial network GAN, and private sample data extracted from a stored private sample data set, wherein the private sample data is used as real sample data compared with the pseudo sample data; Classify the sample data in the current training data set based on the classifier in the current GAN to determine a classification loss value based on the classification result; and optimize the classifier parameters of the classifier using the classification loss value; Based on the discriminator in the current GAN, the sample data in the current training data set is identified as true or false, so as to determine the discrimination loss value based on the recognition result; and the discriminator parameters of the discriminator are optimized using the discrimination loss value and the classification loss value; For each generator in the current GAN, the generator parameters of the generator are optimized according to the classification loss value, the discrimination loss value, and the sample similarity loss value corresponding to the generator; the sample similarity loss value corresponding to the generator is determined based on the sample similarity between each pseudo sample data generated by the generator and each reference sample data corresponding to the pseudo sample data; the reference sample data corresponding to the pseudo sample data generated by any generator includes: at least one real sample data of the same data category as the pseudo sample data in the current training data set, and at least one pseudo sample data generated by other generators; After optimizing the generator parameters of all generators, if the network iteration end condition is currently met, the current GAN is determined as the target GAN, otherwise, return to the step of obtaining the current training data set; Among them, each generator in the target GAN is used to generate target pseudo sample data, and each target pseudo sample data is used to train a privacy leakage detection model; the privacy leakage detection model is used to perform Internet of Things privacy leakage detection on network flows.

2. The method according to claim 1, characterized in that: The sample similarity loss value corresponding to any generator is determined as follows: For each pseudo sample data generated by the current generator, similarity calculation is performed based on the feature vector of the pseudo sample data and the feature vector of each real sample data in the reference sample data corresponding to the pseudo sample data, so as to obtain a first sample similarity between the pseudo sample data and each real sample data in the reference sample data corresponding to the pseudo sample data; the feature vector of any sample data in the current training data set is extracted from the hidden layer of the classifier by the trained feature extractor after the sample data is input into the classifier in the current GAN; For each pseudo sample data generated by the current generator, similarity calculation is performed based on the feature vector of the pseudo sample data and the feature vector of each pseudo sample data in the reference sample data corresponding to the pseudo sample data, so as to obtain a second sample similarity between the pseudo sample data and each pseudo sample data in the reference sample data corresponding to the pseudo sample data; The loss value is calculated for the average of the obtained first sample similarities and the average of the obtained second sample similarities according to the specified loss value calculation method to obtain the sample similarity loss value corresponding to the generator.

3. The method according to claim 1, characterized in that After optimizing the generator parameters of all generators, the method further includes: increasing the recorded number of GAN iterations by a set value; The currently satisfying the network iteration termination condition includes: if the recorded number of GAN iterations reaches a set number threshold, determining that the currently satisfying network iteration termination condition is met.

4. The method according to claim 1, characterized in that After obtaining the pseudo sample data of each target, the method further comprises: For each target pseudo sample data, classify the target pseudo sample data based on the classifier in the target GAN to obtain a classification result of the target pseudo sample data; the classification result of any target pseudo sample data at least includes a predicted data category of the target pseudo sample data and a predicted probability that the target pseudo sample data belongs to the predicted data category; check whether the predicted probability that the target pseudo sample data belongs to the predicted data category is greater than or equal to a set probability threshold, and if so, determine the target pseudo sample data as candidate sample data; The at least one determined candidate sample data is used to train a privacy leakage detection model.

5. The method according to claim 1, characterized in that: The data categories of the pseudo sample data generated by any generator in the current GAN are the same; The data category of the pseudo sample data generated by any generator in the current GAN is different from the data category of the pseudo sample data generated by other generators.

6. The method according to claim 1, characterized in that The pseudo sample data generated by any generator in the current GAN is determined in the following way: Random sampling is performed from a noise space that conforms to a Gaussian distribution to obtain random noise data, and the random noise data is input into the generator to obtain corresponding pseudo sample data.

7. A privacy enhancement detection device based on a generative adversarial network, characterized in that: The device is applied to electronic equipment; the device comprises: An acquisition module is used to obtain a current training data set; the current training data set includes the following sample data: pseudo sample data generated by each generator in the current generative adversarial network GAN, and private sample data extracted from a stored private sample data set, wherein the private sample data is used as real sample data compared with the pseudo sample data; A first optimization module is used to classify sample data in a current training data set based on a classifier in a current GAN, so as to determine a classification loss value based on the classification result; and optimize a classifier parameter of the classifier using the classification loss value; A second optimization module is used to identify the authenticity of sample data in the current training data set based on the discriminator in the current GAN, so as to determine a discrimination loss value based on the recognition result; and optimize the discriminator parameters of the discriminator using the discrimination loss value and the classification loss value; A third optimization module is used to optimize the generator parameters of each generator in the current GAN according to the classification loss value, the discrimination loss value, and the sample similarity loss value corresponding to the generator; the sample similarity loss value corresponding to the generator is determined based on the sample similarity between each pseudo sample data generated by the generator and each reference sample data corresponding to the pseudo sample data; the reference sample data corresponding to the pseudo sample data generated by any generator includes: at least one real sample data of the same data category as the pseudo sample data in the current training data set, and at least one pseudo sample data generated by other generators; A detection module, configured to, after optimizing the generator parameters of all generators, determine the current GAN as the target GAN if the network iteration end condition is currently met, otherwise, return to the step of obtaining the current training data set; Among them, each generator in the target GAN is used to generate target pseudo sample data, and each target pseudo sample data is used to train a privacy leakage detection model; the privacy leakage detection model is used to perform Internet of Things privacy leakage detection on network flows.

8. The device according to claim 7, characterized in that The sample similarity loss value corresponding to any generator is determined in the following manner: for each pseudo sample data generated by the current generator, similarity calculation is performed based on the feature vector of the pseudo sample data and the feature vector of each real sample data in the reference sample data corresponding to the pseudo sample data, so as to obtain the first sample similarity between the pseudo sample data and each real sample data in the reference sample data corresponding to the pseudo sample data; the feature vector of any sample data in the current training data set is extracted from the hidden layer of the classifier by a trained feature extractor after the sample data is input into the classifier in the current GAN; for each pseudo sample data generated by the current generator, similarity calculation is performed based on the feature vector of the pseudo sample data and the feature vector of each pseudo sample data in the reference sample data corresponding to the pseudo sample data, so as to obtain the second sample similarity between the pseudo sample data and each pseudo sample data in the reference sample data corresponding to the pseudo sample data; the loss value is calculated for the average of the obtained first sample similarities and the average of the obtained second sample similarities according to the specified loss value calculation method, so as to obtain the sample similarity loss value corresponding to the generator; and / or, The detection module is further used to increase the recorded number of GAN iterations by a set value after optimizing the generator parameters of all generators; The currently satisfying network iteration termination condition includes: if the recorded number of GAN iterations reaches a set number threshold, then determining that the currently satisfying network iteration termination condition is met; and / or, The detection module is further used for, after obtaining each target pseudo sample data, classifying the target pseudo sample data based on the classifier in the target GAN to obtain a classification result of the target pseudo sample data; the classification result of any target pseudo sample data at least includes the predicted data category of the target pseudo sample data and the predicted probability that the target pseudo sample data belongs to the predicted data category; checking whether the predicted probability that the target pseudo sample data belongs to the predicted data category is greater than or equal to a set probability threshold, and if so, determining the target pseudo sample data as candidate sample data; wherein at least one determined candidate sample data is used to train a privacy leakage detection model; and / or, The data categories of the pseudo sample data generated by any generator in the current GAN are the same; the data categories of the pseudo sample data generated by any generator in the current GAN are different from the data categories of the pseudo sample data generated by other generators; and / or, The pseudo sample data generated by any generator in the current GAN is determined in the following manner: random sampling is performed from a noise space that conforms to a Gaussian distribution to obtain random noise data, and the random noise data is input into the generator to obtain corresponding pseudo sample data.

9. An electronic device, characterized in that: The electronic device includes: Processor; and A computer-readable storage medium, wherein computer program instructions are stored in the computer-readable storage medium, and when the computer program instructions are executed by the processor, the processor executes the steps in any one of the methods of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, which, when executed by a processor, enable the processor to perform the steps of any one of the methods of claims 1 to 6.

Citation Information

Patent Citations

  • Cross-domain pedestrian re-identification method and system based on deep mutual learning

    CN114863485A

  • Method and device for enhancing partial discharge defect sample of power equipment

    CN116484184A