Data processing method and system, electronic equipment and nonvolatile storage medium
By adding differential privacy noise and performing denoising processing in the AIoT collaborative reasoning process, the risk that characteristic data communicated between end-side devices and servers may be reconstructed into model input samples, leading to leakage of user privacy information, is solved. Effective protection of user privacy information and effectiveness of the collaborative reasoning process.
Patent Information
- Application Number
- CN202411449652.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-10-16
AI Technical Summary
In AIoT scenarios, the characteristic data of communication between the end-side device and the server may be reconstructed into model input samples, resulting in the risk of leakage of user privacy information.
By adding differential privacy noise during the synergy reasoning process and noise processing on the server side to ensure that data does not leak user privacy during transmission and processing. Specific steps include the intermediate output feature matrix with differential privacy noise of the end -side side device. The server is processed to obtain the characteristic matrix after the noise, and the reasoning is based on it.
The user's privacy information is effectively protected, and the characteristics of the characteristic data are restructured as a model input sample, which reduces the risk of privacy leakage, while ensuring the effectiveness of the collaborative reasoning process.
Smart Images

Figure CN119337423A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data security technology, and in particular, to a data processing method, system, electronic device and non-volatile storage medium. Background Art
[0002] AIoT (Artificial Intelligence & Internet of Things) scenarios involve a large number of sensor devices and edge nodes, and the data collected by these devices needs to be inferred and processed in real time or near real time. For edge devices, limited computing power and bandwidth are difficult to meet the processing of huge amounts of data. Therefore, collaborative reasoning is needed to reduce data transmission and computing power requirements. Collaborative reasoning refers to splitting the neural network model according to a certain strategy, and then distributing it to the IoT edge devices and cloud servers for joint reasoning and calculation.
[0003] However, in the related technology, the characteristic data communicated between the edge device and the server may be reconstructed into model input samples after being received by the server, which may lead to the risk of leakage of AIoT user privacy information.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a data processing method, system, electronic device and non-volatile storage medium to at least solve the technical problem that the characteristic data communicated between the edge device and the server in the related technology may be reconstructed into model input samples after being received by the server, resulting in the risk of leakage of user privacy information.
[0006] According to one aspect of an embodiment of the present application, a data processing method is provided, including: obtaining a first feature matrix sent by an edge-side device, wherein a first sub-model in a collaborative reasoning model is provided in the edge-side device, the first feature matrix is an intermediate output feature matrix with differential privacy noise, and the intermediate output feature matrix is obtained by the edge-side device after reasoning with the first sub-model on sample data to be inferred; denoising the first feature matrix to obtain a second feature matrix, wherein the second feature matrix is an intermediate output feature matrix obtained after denoising by the denoising model, and the denoising is used to remove differential privacy noise; using the second sub-model in the collaborative reasoning model, reasoning according to the second feature matrix to obtain a reasoning result, and returning the reasoning result to the edge-side device.
[0007] Optionally, the collaborative reasoning model includes: a first sub-model and a second sub-model, wherein the first sub-model is a model including the model structure located before the target division position in the collaborative reasoning model, and the second sub-model is a model including the model structure located after the target division position in the collaborative reasoning model, and the target division position is determined based on the model structure of the collaborative reasoning model to be trained and the characteristics of the corresponding training data set. When the collaborative reasoning model to be trained is a neural network model, the target division position is the position between two hidden layers of the neural network model.
[0008] Optionally, the first sub-model is set in the end-side device, and the second sub-model and the denoising model are set in the server; wherein, the training steps of the collaborative reasoning model and the denoising model include: obtaining a training data set, wherein the training data set includes: multiple training samples, and reasoning results corresponding to the training samples; using the first sub-model in the collaborative reasoning model to be trained, determining the intermediate output feature matrix corresponding to the training samples, and adding differential privacy noise to the intermediate output feature matrix to obtain a first feature matrix; using the denoising model to be trained, denoising the first feature matrix to obtain a second feature matrix, and using the second sub-model in the collaborative reasoning model to be trained, determining the reasoning results corresponding to the second feature matrix; determining a loss function based on the first error and the second error, and updating the model parameters of the collaborative reasoning model and the denoising model based on the loss function, repeating the above training steps until the value of the loss function is less than a preset error threshold, and obtaining a trained collaborative reasoning model and denoising model, wherein the first error is used to characterize the error between the reasoning result determined by the collaborative reasoning model and the reasoning result corresponding to the training sample in the training data set, and the second error is used to characterize the error between the intermediate output feature matrix and the second feature matrix.
[0009] Optionally, adding differential privacy noise to the intermediate output feature matrix to obtain the first feature matrix includes: determining an upper limit value of privacy loss and a tolerance for privacy protection, wherein the smaller the upper limit value and the tolerance are, the stronger the privacy protection for the data is; determining a target noise variance based on the upper limit value and the tolerance, and generating a random noise sample that obeys a Gaussian distribution with a mean of 0 and a variance equal to the target noise variance; and adding the random noise sample to the intermediate output feature matrix to obtain the first feature matrix.
[0010] Optionally, determining the loss function based on the first error and the second error includes: determining the cross entropy between the inference result determined by the collaborative reasoning model and the inference result corresponding to the training sample in the training data set, and determining the cross entropy as the first error; calculating the mean square error between each element in the intermediate output feature matrix and each element in the corresponding second feature matrix, and determining the mean square error as the second error; determining the weight coefficients corresponding to the first error and the second error respectively, and determining the loss function based on the first error, the second error, and the weight coefficient.
[0011] Optionally, updating the model parameters of the collaborative reasoning model and the denoising model based on the loss function includes: calculating the gradient of the loss function with respect to the model parameters by performing gradient backpropagation on the loss function, wherein the model parameters include: a first model parameter corresponding to the collaborative reasoning model, and a second model parameter corresponding to the denoising model; and updating the model parameters based on the gradient and the learning rate corresponding to the model parameters.
[0012] Optionally, the denoising model includes: an upsampling neural network and a downsampling neural network, wherein the upsampling neural network and the downsampling neural network are connected through a fully connected layer, and each of the upsampling neural network and the downsampling neural network includes multiple network groups, each network group includes multiple convolutional layers, and each network group in the downsampling neural network is connected through a pooling layer, and each network group in the upsampling neural network is connected through a deconvolution layer. The convolutional layer in the downsampling neural network is used to increase the number of channels of the intermediate output feature matrix, and the convolutional layer in the upsampling neural network is used to reduce the number of channels of the intermediate output feature matrix.
[0013] According to another aspect of an embodiment of the present application, a data processing method is also provided, including: obtaining sample data to be inferred, and using a first sub-model in a collaborative reasoning model to perform reasoning based on the sample data to be inferred to obtain an intermediate output feature matrix; adding differential privacy noise to the intermediate output feature matrix to obtain a first feature matrix, and sending the first feature matrix to a server, wherein the server is used to perform denoising on the first feature matrix to obtain a second feature matrix, the second feature matrix being the intermediate output feature matrix obtained after denoising by the denoising model, and the denoising is used to remove differential privacy noise; receiving an inference result corresponding to the first feature matrix returned by the server, wherein the inference result is obtained by the server using the second sub-model in the collaborative reasoning model to perform reasoning based on the second feature matrix.
[0014] According to another aspect of an embodiment of the present application, a data processing system is also provided, including: an edge-side device and a server, wherein the edge-side device is used to obtain sample data to be inferred, and use the first sub-model in the collaborative reasoning model to perform reasoning based on the sample data to be inferred to obtain an intermediate output feature matrix; and, add differential privacy noise to the intermediate output feature matrix to obtain a first feature matrix, and send the first feature matrix to the server; the server is used to receive the first feature matrix, and perform denoising on the first feature matrix to obtain a second feature matrix; and, use the second sub-model in the collaborative reasoning model to perform reasoning based on the second feature matrix to obtain an reasoning result, and return the reasoning result to the edge-side device, wherein the second feature matrix is the intermediate output feature matrix obtained after denoising by the denoising model, and the denoising is used to remove differential privacy noise.
[0015] According to another aspect of the embodiments of the present application, there is further provided an electronic device, including: a memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the data processing method is executed when the program is run.
[0016] According to another aspect of the embodiments of the present application, a non-volatile storage medium is provided, the non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the data processing method by running the computer program.
[0017] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the data processing method are implemented.
[0018] In an embodiment of the present application, a first feature matrix sent by an edge device is obtained, wherein a first sub-model in a collaborative reasoning model is provided in the edge device, and the first feature matrix is an intermediate output feature matrix with differential privacy noise, and the intermediate output feature matrix is obtained by the edge device after reasoning with the first sub-model on the sample data to be inferred; the first feature matrix is denoised to obtain a second feature matrix, wherein the second feature matrix is an intermediate output feature matrix obtained after denoising by the denoising model, and the denoising is used to remove differential privacy noise; the second sub-model in the collaborative reasoning model is used to reason according to the second feature matrix to obtain an inference result, and the inference result is returned to the edge device. By adding differential privacy noise and denoising in the collaborative reasoning process, the purpose of protecting the privacy information of the edge device in the collaborative reasoning process is achieved, thereby solving the technical problem that the feature data communicated between the edge device and the server in the related technology may be reconstructed as a model input sample after being received by the server, resulting in the risk of leakage of user privacy information. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0020] Figure 1 It is a hardware structure block diagram of a computer terminal (or electronic device) for implementing a data processing method provided in an embodiment of the present application;
[0021] Figure 2 It is a schematic diagram of a data processing method flow provided according to an embodiment of the present application;
[0022] Figure 3 It is a schematic diagram of a method flow of collaborative reasoning based on denoising differential privacy provided according to an embodiment of the present application;
[0023] Figure 4 is a schematic diagram of a network structure of a denoising model provided according to an embodiment of the present application;
[0024] Figure 5 is a schematic diagram of a synchronous training provided according to an embodiment of the present application;
[0025] Figure 6 is a schematic diagram of the timing of a reasoning process provided according to an embodiment of the present application;
[0026] Figure 7 is a schematic diagram of another data processing method flow provided according to an embodiment of the present application;
[0027] Figure 8 It is a structural diagram of a data processing system provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] In order to facilitate those skilled in the art to better understand the embodiments of the present application, some technical terms or nouns involved in the embodiments of the present application are explained as follows:
[0031] AIoT: Integrating artificial intelligence technology and Internet of Things technology, the Internet of Things generates and collects massive amounts of data from different dimensions and stores them in the cloud and edge. Through big data analysis, a higher form of artificial intelligence is formed to realize the technology of digitizing and intelligently connecting all things.
[0032] Differential privacy: A method based on rigorous mathematical proof that uses a randomized response method to ensure that the impact of a single record on a dataset is always below a certain threshold when outputting information, making it impossible for a third party to determine the change or addition or deletion of a single record (differential attack) based on the change in the output. It is considered to be the most secure method among the current perturbation-based privacy protection methods.
[0033] AIoT scenarios involve a large number of sensor devices and edge nodes, and the data collected by these devices needs to be inferred and processed in real time or near real time. However, there are many limitations in the AIoT environment, and edge nodes have limited computing resources, communication bandwidth, etc. The environmental data collected by sensors in AIoT may be very large. For edge devices, limited computing power and bandwidth make it impossible to process this data locally and difficult to transmit it to the server through the network. Therefore, collaborative reasoning is needed to reduce data transmission and computing power requirements.
[0034] Collaborative reasoning refers to splitting the neural network model according to a certain strategy, and then distributing it to the IoT edge devices and cloud servers for joint reasoning calculations. By choosing a reasonable split location, the computing power of edge cloud devices can be fully utilized while reducing communication overhead, thereby reducing reasoning overhead. Improvements in collaborative reasoning in related technologies mainly focus on designing differential schemes that are more efficient in data transmission and computing performance overhead. However, some studies have shown that the feature data of the communication between the edge devices and the server may be reconstructed into model input samples after being received by the server, posing a risk of leaking AIoT user privacy information. There is also a lack of effective defense measures against these risks.
[0035] In view of this, how to ensure that the user's privacy data is fully protected during the collaborative reasoning process without having much impact on the model's reasoning ability has become an important issue that technical personnel in this field need to solve.
[0036] In order to solve the problem that the collaborative reasoning technology in the related art is insufficient in protecting the privacy of edge devices, a relevant solution is provided in the embodiments of the present application, which is described in detail below.
[0037] According to an embodiment of the present application, an embodiment of a method for data processing is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0038] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or electronic device) for implementing a data processing method. Figure 1 As shown, the computer terminal 10 (or electronic device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0039] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or electronic device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0040] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the data processing method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned data processing method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0041] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0042] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or electronic device).
[0043] Under the above-mentioned operating environment, an embodiment of the present application provides a data processing method. Specifically, the application scenario in the embodiment of the present application includes a group of AIoT edge devices (such as AI cameras, etc.) and corresponding server devices, and the two can communicate with each other in a specific manner.
[0044] Among them, edge devices usually collect relatively large amounts of data, but have fewer computing resources, and are subject to strict restrictions on network bandwidth and power consumption. Some intelligent applications cannot complete reasoning independently, and it is difficult to transmit the full amount of collected data to the cloud server. In addition, the data collected by these devices also have some privacy protection requirements. Server devices are deployed in the cloud and have more powerful computing power, but they cannot be fully trusted by users. Directly uploading the data collected by edge devices or the characteristics of the data to the cloud may bring some privacy risks.
[0045] In view of the problem of insufficient performance of AIoT mid-end side devices and the need for user data privacy protection, the embodiments of the present application provide relevant solutions. Figure 2 is a schematic diagram of a method flow for data processing on the server side that can be applied to the above scenario according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:
[0046] Step S202: obtaining a first feature matrix sent by the edge device, wherein the edge device is provided with a first sub-model in the collaborative reasoning model, and the first feature matrix is an intermediate output feature matrix with differential privacy noise, and the intermediate output feature matrix is obtained by the edge device after reasoning the sample data to be inferred using the first sub-model;
[0047] Step S204, performing denoising processing on the first feature matrix to obtain a second feature matrix, wherein the second feature matrix is an intermediate output feature matrix obtained after denoising processing by the denoising model, and the denoising processing is used to remove differential privacy noise;
[0048] Step S206: Use the second sub-model in the collaborative reasoning model to perform reasoning according to the second feature matrix to obtain a reasoning result, and return the reasoning result to the edge device.
[0049] Through the above steps, by adding differential privacy noise and denoising in the collaborative reasoning process, the purpose of protecting the privacy information of the end-side device in the collaborative reasoning process is achieved, thereby solving the technical problem of the risk of leakage of user privacy information caused by the feature data of the communication between the end-side device and the server in the related technology being reconstructed as model input samples after being received by the server.
[0050] The data processing method in steps S202 to S206 of the embodiment of the present application is further introduced below.
[0051] Figure 3 is a schematic diagram of a method flow of collaborative reasoning based on denoising differential privacy provided in an embodiment of the present application, such as Figure 3As shown, in terms of the training of the collaborative reasoning model and the denoising model, we can first select a reasonable position (target division position) to divide the neural network model based on the specific business type, the structure of the model to be trained, and the characteristics of the training data set to obtain a construction plan for the collaborative reasoning model; and select and build a denoising model; by adding differential privacy noise during the training process, the collaborative reasoning model and the denoising model are trained synchronously, and finally a converged and effective network model is obtained; after that, the front and back halves of the collaborative reasoning model (i.e., the first sub-model and the second sub-model) can be deployed on the edge device and the server respectively, and the denoising model can be deployed on the server.
[0052] On the other hand, after the model is deployed, the collaborative reasoning model and the denoising model can be used for reasoning. Specifically, the front-layer network of the model (i.e., the first sub-model) is first run on the edge device, and the obtained intermediate output feature matrix is added with differential privacy noise in the same way as training and transmitted to the server; the server receives the noisy intermediate output feature matrix (i.e., the first feature matrix) and denoises it using the denoising model; the server uses the denoised intermediate output feature matrix (i.e., the second feature matrix) as input, and performs reasoning in the second half of the collaborative reasoning model (i.e., the second sub-model) to obtain the reasoning result; the server returns the reasoning result to the edge device.
[0053] The following describes in detail the above-mentioned model training and deployment process, as well as the process of using the model for collaborative reasoning. First, the model training and deployment process is introduced.
[0054] In some embodiments of the present application, the collaborative reasoning model includes: a first sub-model and a second sub-model, wherein the first sub-model is a model including a model structure located before a target division position in the collaborative reasoning model, and the second sub-model is a model including a model structure located after a target division position in the collaborative reasoning model. The target division position is determined based on the model structure of the collaborative reasoning model to be trained and the characteristics of the corresponding training data set. When the collaborative reasoning model to be trained is a neural network model, the target division position is the position between two hidden layers of the neural network model.
[0055] Specifically, based on the specific business type, the structure of the model to be trained, and the characteristics of the training data set, a reasonable location (i.e., the target partitioning location) can be selected to partition (collaborative reasoning model) and obtain a construction plan for the collaborative reasoning model.
[0056] The above-mentioned reasonable position can be selected based on the specific situation. In the embodiment of the present application, the above-mentioned collaborative reasoning model to be trained can be a neural network model, which contains more hidden layers and is used to complete specific business functions through reasoning. In the case where the collaborative reasoning model to be trained is a neural network model, the target division position can be the position between two hidden layers in the model to be trained. The position before this position is the front layer network model (i.e., the first sub-model), and the position after this position is the second half of the model (i.e., the second sub-model). According to the collaborative reasoning scheme, they are deployed to the end-side device and the server device respectively. The model deployed according to the scheme is the collaborative reasoning model.
[0057] At the same time, the embodiment of the present application also needs to construct a denoising model, as follows.
[0058] In some embodiments of the present application, the denoising model includes: an upsampling neural network and a downsampling neural network, wherein the upsampling neural network and the downsampling neural network are connected through a fully connected layer, and each of the upsampling neural network and the downsampling neural network includes multiple network groups, each network group includes multiple convolutional layers, and the network groups in the downsampling neural network are connected through a pooling layer, and the network groups in the upsampling neural network are connected through a deconvolution layer. The convolution layer in the downsampling neural network is used to increase the number of channels of the intermediate output feature matrix, and the convolution layer in the upsampling neural network is used to reduce the number of channels of the intermediate output feature matrix.
[0059] Specifically, in this embodiment, the denoising model is illustrated by taking the U-Net neural network model as an example, and its input is an intermediate output feature matrix with differential privacy noise, that is, the above-mentioned first feature matrix, and the output is a feature matrix with the same dimension as the input feature matrix but with noise removed, that is, the above-mentioned second feature matrix; wherein, the intermediate output feature matrix is the feature matrix output by the front-layer collaborative reasoning model (first sub-model), which contains information related to the business function of the collaborative reasoning model; differential privacy noise refers to the random noise added to the intermediate output feature matrix during the collaborative reasoning process in order to protect the privacy of user data.
[0060] The above intermediate output feature matrix can be a three-order matrix with three dimensions: length, width, and number of channels. The product of length and width is called the resolution of the intermediate output feature. The intermediate output feature matrix can also be referred to as the intermediate feature. In this embodiment, the U-Net denoising model is a symmetrical U-shaped structure, such as Figure 4 As shown in the figure, it is composed of a downsampling neural network and an upsampling neural network in sequence, and these two parts of the network are connected through a fully connected layer.
[0061] Among them, both the upsampling neural network and the downsampling neural network are divided into n network groups. The resolution of the intermediate features input to each network group is the same. The network group of the up / down sampling neural network is composed of several convolutional layers. The convolutional layers in the downsampling neural network group will increase the number of channels of the intermediate features, and the groups are connected through the pooling layer to reduce the resolution of the intermediate features. The convolutional layers in the upsampling neural network group will reduce the number of channels of the intermediate features, and the groups are connected through the deconvolution layer to increase the resolution of the intermediate features.
[0062] In addition, there are direct connections between corresponding groups of up / down sampling neural networks, which can bypass the intermediate layers and improve the effect of the denoising model.
[0063] It should be noted that the denoising model can also be replaced by any machine learning model that can achieve similar functions, such as a reversible neural network, without any restriction.
[0064] After the collaborative reasoning model and denoising model to be trained are constructed, the collaborative reasoning model and the denoising model can be trained synchronously. The specific steps are as follows.
[0065] In some embodiments of the present application, the first sub-model is set in the edge device, and the second sub-model and the denoising model are set in the server; wherein the training steps of the collaborative reasoning model and the denoising model include the following steps: obtaining a training data set, wherein the training data set includes: multiple training samples, and reasoning results corresponding to the training samples; using the first sub-model in the collaborative reasoning model to be trained, determining the intermediate output feature matrix corresponding to the training samples, and adding differential privacy noise to the intermediate output feature matrix to obtain a first feature matrix; using the denoising model to be trained, denoising the first feature matrix to obtain a second feature matrix, and using the second sub-model in the collaborative reasoning model to be trained, determining the reasoning results corresponding to the second feature matrix; determining a loss function based on the first error and the second error, and updating the model parameters of the collaborative reasoning model and the denoising model based on the loss function, repeating the above training steps until the value of the loss function is less than a preset error threshold, and obtaining the trained collaborative reasoning model and the denoising model, wherein the first error is used to characterize the error between the reasoning result determined by the collaborative reasoning model and the reasoning result corresponding to the training sample in the training data set, and the second error is used to characterize the error between the intermediate output feature matrix and the second feature matrix.
[0066] like Figure 5 As shown in the figure, first obtain the training data set, randomly extract n training samples x from the training data set D, and obtain their corresponding annotations y (that is, the reasoning results corresponding to the training samples); then, take the training samples x as input, and pass the front-layer collaborative reasoning model (the first sub-model) f edgePerform inference and obtain the intermediate output feature matrix v = f edge (x);
[0067] Afterwards, differential privacy noise is added to the intermediate output feature matrix. The specific steps are as follows.
[0068] In some embodiments of the present application, adding differential privacy noise to the intermediate output feature matrix to obtain a first feature matrix includes the following steps: determining an upper limit value of privacy loss and a tolerance for privacy protection, wherein the smaller the upper limit value and the tolerance, the stronger the privacy protection for the data; determining a target noise variance based on the upper limit value and the tolerance, and generating a random noise sample that obeys a Gaussian distribution with a mean of 0 and a variance equal to the target noise variance; adding the random noise sample to the intermediate output feature matrix to obtain a first feature matrix.
[0069] Specifically, Gaussian differential privacy noise is added to the output intermediate features, that is, Where v′ is the intermediate output feature matrix with (Gaussian) differential privacy noise, that is, the first feature matrix mentioned above, which satisfies (∈,δ)-differential privacy. The smaller ∈ and δ are, the stronger the privacy protection effect of this method is. σ 2 That is, the above target noise variance, s is the data range or the maximum value of the data value, δ is the tolerance of privacy protection, the smaller δ is, the stronger the privacy protection is, ∈ is the upper limit of privacy loss, the smaller ∈ is, the stronger the privacy protection is, It means that the mean is 0 and the variance is σ 2 k-dimensional Gaussian distributed random noise samples of I, k is the dimension of the output intermediate features, and I is a unit vector of dimension k.
[0070] It should be noted that the differential privacy mechanism in this step can be replaced by any effective differential privacy mechanism, such as the Laplace mechanism, etc., and the embodiments of the present application are not limited to this.
[0071] After obtaining the first feature matrix v′, the denoising model g is used to denoise the intermediate output feature matrix (first feature matrix) v′ with differential privacy noise, that is, in is the intermediate output feature of denoising, that is, the second feature matrix mentioned above, with the same dimension as v; then, the intermediate output feature of denoising, that is, the second feature matrix As input, through the second half of the collaborative reasoning model (the second sub-model) f cloud Perform inference and obtain inference results
[0072] After that, the inference results can be calculated The loss between the sample annotation y (i.e., the first error), and the denoised intermediate output feature The loss between the output intermediate feature v (i.e., the second error), where l y and and y are positively correlated, l v and The difference between and v is also positively correlated. The specific steps are as follows.
[0073] In some embodiments of the present application, determining the loss function based on the first error and the second error includes the following steps: determining the cross entropy between the inference result determined by the collaborative reasoning model and the inference result corresponding to the training sample in the training data set, and determining the cross entropy as the first error; calculating the mean square error between each element in the intermediate output feature matrix and each element in the corresponding second feature matrix, and determining the mean square error as the second error; determining the weight coefficients corresponding to the first error and the second error, respectively, and determining the loss function based on the first error, the second error, and the weight coefficient.
[0074] Specifically, if the collaborative inference model is a classifier model, the loss is calculated by the mean square error Among them, |v| is the dimension of the intermediate feature, v i and is the denoising intermediate output feature (second feature matrix) And the i-th observation (element) of the output intermediate feature matrix v; and the loss is calculated by the cross entropy loss function Where M is the number of categories in the collaborative reasoning model, and y is the one-hot encoding of the sample annotation, that is, the reasoning result corresponding to the training sample in the training dataset. If the category of the sample is labeled as c, then y c =1, otherwise y c =0, is the confidence of the inference result on category c.
[0075] The loss function can be constructed based on the first error and the second error, and the gradient descent algorithm is used to minimize the loss function to perform model training. The specific steps are as follows.
[0076] In some embodiments of the present application, updating the model parameters of the collaborative reasoning model and the denoising model according to the loss function includes the following steps: calculating the gradient of the loss function with respect to the model parameters by performing gradient backpropagation on the loss function, wherein the model parameters include: a first model parameter corresponding to the collaborative reasoning model and a second model parameter corresponding to the denoising model; updating the model parameters according to the gradient and the learning rate corresponding to the model parameters.
[0077] Specifically, the stochastic gradient descent algorithm is used to minimize the loss function As the goal, update the collaborative reasoning model once and the parameters θ of the denoising model f With θ g , where α is a hyperparameter (weight coefficient). The larger α is, the greater the weight of the denoising model in training.
[0078] Specifically, we can first perform gradient backpropagation on the loss function J through the collaborative inference model f and the denoising model g to calculate the gradient Then use the gradient to update the model parameters Among them, θ f,i ,θ g,i is the parameter of the model in the i-th round, and η is the learning rate. In addition, the model can also be updated using improved stochastic gradient descent algorithms such as AdaGrad and Adam.
[0079] The above steps of synchronously training the collaborative reasoning model and the denoising model are continuously repeated until the collaborative reasoning model f and the denoising model g converge, so as to obtain the trained collaborative reasoning model and the denoising model. For the trained collaborative reasoning model and the denoising model, in this embodiment, the front-layer collaborative reasoning model (that is, the first sub-model in the same reasoning model) can be deployed on the end-side device; the second half of the collaborative reasoning model (that is, the second sub-model in the same reasoning model) and the denoising model can be deployed on the server device, waiting for the user's reasoning needs.
[0080] The embodiment of the present application synchronously trains the collaborative reasoning model and the denoising model, which ensures that both the trained collaborative reasoning model and the denoising model have high effectiveness and makes the two models more adaptable in the reasoning process, thereby improving the denoising effect.
[0081] After the model is trained and deployed, the model can be used for denoising differential privacy collaborative reasoning. The specific process is as follows: Figure 6 As shown, a detailed introduction is given below.
[0082] When there is a need for inference (sample data to be inferred), the edge device will perform inference and add differential privacy noise. Specifically, the sample x0 to be inferred is used as input, and the front-layer collaborative inference model (the first sub-model) f edge Perform inference and obtain the intermediate output feature matrix v0=f edge (x0), then add Gaussian differential privacy noise to the intermediate output feature matrix v0 to obtain the first feature matrix, that is, The value of σ should be consistent with the σ set when adding differential privacy noise during model training.
[0083] Then, the intermediate output feature matrix with differential privacy noise, that is, the first feature matrix v ′ 0 is transmitted to the server device in a feature manner. The embodiment of the present application adds Gaussian noise to the intermediate output feature matrix v0 to obfuscate sensitive information that may exist in the feature matrix, making it difficult for malicious attackers to reconstruct private data from the feature matrix, thereby achieving the effect of protecting the privacy of the edge side.
[0084] The server device receives the first feature matrix v ′ 0, the denoising model g is used as the intermediate output feature matrix v with differential privacy noise ′ 0 denoising, and obtain the second feature matrix, that is, In the embodiment of the present application, the intermediate output feature matrix (first feature matrix) v with differential privacy noise is ′ 0 denoising reduces the impact of the differential privacy mechanism on the reasoning effect of the collaborative reasoning model, ensuring the availability of the model while protecting privacy data.
[0085] Afterwards, the server device outputs the denoised intermediate features (the second feature matrix) As input, through the second half of the collaborative reasoning model (the second sub-model) f cloud Perform inference and obtain inference results And the reasoning results of the collaborative reasoning model f The data is sent back to the end-side device.
[0086] This application scheme solves the problem that the end-side device data is completely transparent to the server during the collaborative reasoning process and lacks privacy protection by introducing a differential privacy mechanism into the collaborative reasoning, and makes the degree of data protection in the collaborative reasoning system quantifiable. At the same time, denoising is performed through the denoising model on the server side, solving the problem that the collaborative reasoning effect is seriously reduced due to the use of only differential privacy mechanisms to protect the privacy of end-side data, so that collaborative reasoning can have relatively high availability under the condition of low privacy risk.
[0087] According to an embodiment of the present application, another embodiment of a data processing method is also provided. Figure 7 is a schematic diagram of a method flow for data processing that can be applied to a terminal-side device according to an embodiment of the present application, such as Figure 7 As shown, the method comprises the following steps:
[0088] Step 702, obtaining sample data to be inferred, and using the first sub-model in the collaborative reasoning model to perform reasoning based on the sample data to be inferred, to obtain an intermediate output feature matrix;
[0089] Step 704: Add differential privacy noise to the intermediate output feature matrix to obtain a first feature matrix, and send the first feature matrix to the server, wherein the server is used to perform denoising on the first feature matrix to obtain a second feature matrix, where the second feature matrix is the intermediate output feature matrix obtained after denoising by the denoising model, and the denoising is used to remove the differential privacy noise;
[0090] Step 706: Receive the inference result corresponding to the first feature matrix returned by the server, wherein the inference result is obtained by the server using the second sub-model in the collaborative reasoning model to perform reasoning based on the second feature matrix.
[0091] It should be noted that the data processing method provided in this embodiment is Figure 2 The data processing method shown corresponds to an embodiment, therefore, the relevant explanations and descriptions of the above data processing method are also applicable to the embodiments of the present application and will not be repeated here.
[0092] According to an embodiment of the present application, an embodiment of a data processing system is also provided. Figure 8 Schematic diagram of a data processing system provided according to an embodiment of the present application. Figure 8 As shown, the system includes:
[0093] The end-side device 80 is used to obtain sample data to be inferred, and use the first sub-model in the collaborative reasoning model to perform reasoning based on the sample data to be inferred to obtain an intermediate output feature matrix; and add differential privacy noise to the intermediate output feature matrix to obtain a first feature matrix, and send the first feature matrix to the server;
[0094] The server 82 is used to receive the first feature matrix, and perform denoising on the first feature matrix to obtain a second feature matrix; and use the second sub-model in the collaborative reasoning model to perform reasoning based on the second feature matrix to obtain a reasoning result, and return the reasoning result to the end-side device, wherein the second feature matrix is an intermediate output feature matrix obtained after denoising by the denoising model, and the denoising is used to remove differential privacy noise.
[0095] It should be noted that the various modules in the above-mentioned data processing system can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.
[0096] It should be noted that the data processing system provided in this embodiment can be used to execute Figure 2 or Figure 7The data processing method shown, therefore, the relevant explanations and instructions on the above data processing method are also applicable to the embodiments of the present application and will not be repeated here.
[0097] An embodiment of the present application also provides a non-volatile storage medium, the non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the following data processing method by running the computer program: obtaining a first feature matrix sent by an edge-side device, wherein a first sub-model in a collaborative reasoning model is provided in the edge-side device, the first feature matrix is an intermediate output feature matrix with differential privacy noise, and the intermediate output feature matrix is obtained by the edge-side device after reasoning on sample data to be inferred using the first sub-model; denoising the first feature matrix to obtain a second feature matrix, wherein the second feature matrix is an intermediate output feature matrix obtained after denoising by the denoising model, and the denoising is used to remove differential privacy noise; using the second sub-model in the collaborative reasoning model, reasoning is performed according to the second feature matrix to obtain a reasoning result, and the reasoning result is returned to the edge-side device.
[0098] Alternatively, obtain sample data to be inferred, and use the first sub-model in the collaborative reasoning model to perform reasoning based on the sample data to be inferred to obtain an intermediate output feature matrix; add differential privacy noise to the intermediate output feature matrix to obtain a first feature matrix, and send the first feature matrix to the server, wherein the server is used to perform denoising on the first feature matrix to obtain a second feature matrix, which is the intermediate output feature matrix obtained after denoising by the denoising model, and the denoising is used to remove differential privacy noise; receive the inference result corresponding to the first feature matrix returned by the server, wherein the inference result is obtained by the server using the second sub-model in the collaborative reasoning model to perform reasoning based on the second feature matrix.
[0099] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the data processing method described in each embodiment of the present application: obtaining a first feature matrix sent by an edge device, wherein a first sub-model in a collaborative reasoning model is provided in the edge device, and the first feature matrix is an intermediate output feature matrix with differential privacy noise, and the intermediate output feature matrix is obtained by the edge device after reasoning on the sample data to be inferred using the first sub-model; denoising the first feature matrix to obtain a second feature matrix, wherein the second feature matrix is an intermediate output feature matrix obtained after denoising by the denoising model, and the denoising is used to remove differential privacy noise; using the second sub-model in the collaborative reasoning model, reasoning is performed according to the second feature matrix to obtain a reasoning result, and the reasoning result is returned to the edge device.
[0100] Alternatively, obtain sample data to be inferred, and use the first sub-model in the collaborative reasoning model to perform reasoning based on the sample data to be inferred to obtain an intermediate output feature matrix; add differential privacy noise to the intermediate output feature matrix to obtain a first feature matrix, and send the first feature matrix to the server, wherein the server is used to perform denoising on the first feature matrix to obtain a second feature matrix, which is the intermediate output feature matrix obtained after denoising by the denoising model, and the denoising is used to remove differential privacy noise; receive the inference result corresponding to the first feature matrix returned by the server, wherein the inference result is obtained by the server using the second sub-model in the collaborative reasoning model to perform reasoning based on the second feature matrix.
[0101] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0102] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0103] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0104] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0105] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0106] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0107] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A data processing method, characterized in that: include: Obtaining a first feature matrix sent by an edge-side device, wherein a first sub-model in a collaborative reasoning model is provided in the edge-side device, the first feature matrix is an intermediate output feature matrix with differential privacy noise, and the intermediate output feature matrix is obtained by the edge-side device after reasoning the sample data to be inferred using the first sub-model; Performing denoising processing on the first feature matrix to obtain a second feature matrix, wherein the second feature matrix is an intermediate output feature matrix obtained after denoising processing by a denoising model, and the denoising processing is used to remove the differential privacy noise; The second sub-model in the collaborative reasoning model is used to perform reasoning according to the second feature matrix to obtain a reasoning result, and the reasoning result is returned to the end-side device.
2. The data processing method according to claim 1, characterized in that: The collaborative reasoning model includes: the first sub-model and the second sub-model, wherein the first sub-model is a model including the model structure located before the target division position in the collaborative reasoning model, and the second sub-model is a model including the model structure located after the target division position in the collaborative reasoning model, and the target division position is determined based on the model structure of the collaborative reasoning model to be trained and the characteristics of the corresponding training data set. When the collaborative reasoning model to be trained is a neural network model, the target division position is the position between two hidden layers of the neural network model.
3. The data processing method according to claim 2, characterized in that: The first sub-model is set in the edge-side device, and the second sub-model and the denoising model are set in the server; wherein the training steps of the collaborative reasoning model and the denoising model include: Acquire a training data set, wherein the training data set includes: a plurality of training samples and inference results corresponding to the training samples; Using the first sub-model in the collaborative reasoning model to be trained, determining the intermediate output feature matrix corresponding to the training sample, and adding differential privacy noise to the intermediate output feature matrix to obtain the first feature matrix; Using the denoising model to be trained, denoising the first feature matrix to obtain the second feature matrix, and using the second sub-model in the collaborative reasoning model to be trained to determine the reasoning result corresponding to the second feature matrix; Based on the first error and the second error, a loss function is determined, and based on the loss function, model parameters of the collaborative reasoning model and the denoising model are updated, and the above training steps are repeated until the value of the loss function is less than a preset error threshold, thereby obtaining the trained collaborative reasoning model and the denoising model, wherein the first error is used to characterize the error between the inference result determined by the collaborative reasoning model and the inference result corresponding to the training sample in the training data set, and the second error is used to characterize the error between the intermediate output feature matrix and the second feature matrix.
4. The data processing method according to claim 3, characterized in that: Adding differential privacy noise to the intermediate output feature matrix to obtain the first feature matrix includes: Determine an upper limit value of privacy loss and a tolerance for privacy protection, wherein the smaller the upper limit value and the tolerance are, the stronger the privacy protection of the data is; Determine the target noise variance according to the upper limit value and the tolerance, and generate a random noise sample that obeys a Gaussian distribution with a mean of 0 and a variance equal to the target noise variance; The random noise samples are added to the intermediate output feature matrix to obtain the first feature matrix.
5. The data processing method according to claim 3, characterized in that: Determining the loss function according to the first error and the second error includes: Determine a cross entropy between the inference result determined by the collaborative inference model and the inference result corresponding to the training sample in the training data set, and determine the cross entropy as the first error; Calculating a mean square error between each element in the intermediate output feature matrix and each corresponding element in the second feature matrix, and determining the mean square error as the second error; Determine weight coefficients corresponding to the first error and the second error respectively, and determine the loss function based on the first error, the second error, and the weight coefficients.
6. The data processing method according to claim 3, characterized in that: According to the loss function, updating the model parameters of the collaborative reasoning model and the denoising model includes: By performing gradient back propagation on the loss function, the gradient of the loss function with respect to the model parameters is calculated, wherein the model parameters include: a first model parameter corresponding to the collaborative reasoning model and a second model parameter corresponding to the denoising model; The model parameters are updated according to the gradient and the learning rate corresponding to the model parameters.
7. The data processing method according to claim 1, characterized in that: The denoising model includes: an upsampling neural network and a downsampling neural network, wherein the upsampling neural network and the downsampling neural network are connected through a fully connected layer, the upsampling neural network and the downsampling neural network each include multiple network groups, each of the network groups includes multiple convolutional layers, the network groups in the downsampling neural network are connected through a pooling layer, the network groups in the upsampling neural network are connected through a deconvolution layer, the convolutional layer in the downsampling neural network is used to increase the number of channels of the intermediate output feature matrix, and the convolutional layer in the upsampling neural network is used to reduce the number of channels of the intermediate output feature matrix.
8. A data processing method, characterized in that: include: Acquire sample data to be inferred, and use the first sub-model in the collaborative reasoning model to perform reasoning based on the sample data to be inferred to obtain an intermediate output feature matrix; Adding differential privacy noise to the intermediate output feature matrix to obtain a first feature matrix, and sending the first feature matrix to a server, wherein the server is used to perform denoising processing on the first feature matrix to obtain a second feature matrix, where the second feature matrix is the intermediate output feature matrix obtained after denoising processing by a denoising model, and the denoising processing is used to remove the differential privacy noise; Receive the inference result corresponding to the first feature matrix returned by the server, wherein the inference result is obtained by the server using the second sub-model in the collaborative reasoning model to perform reasoning according to the second feature matrix.
9. A data processing system, characterized in that: include: Devices and servers on the edge, including: The end-side device is used to obtain sample data to be inferred, and use the first sub-model in the collaborative reasoning model to perform reasoning based on the sample data to be inferred to obtain an intermediate output feature matrix; and add differential privacy noise to the intermediate output feature matrix to obtain a first feature matrix, and send the first feature matrix to the server; The server is used to receive the first feature matrix and perform denoising on the first feature matrix to obtain a second feature matrix; and, using the second sub-model in the collaborative reasoning model, perform reasoning based on the second feature matrix to obtain a reasoning result, and return the reasoning result to the edge device, wherein the second feature matrix is an intermediate output feature matrix obtained after denoising by the denoising model, and the denoising is used to remove the differential privacy noise.
10. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the data processing method according to any one of claims 1 to 7 when running.
11. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the data processing method according to any one of claims 1 to 8 by running the computer program.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the data processing method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Model training method and system for privacy protection
CN113011587A
Small sample image generation method and system based on diffusion model
CN116957964A
Private data publishing method based on diffusion denoising model
CN118194357A
Face privacy protection security identification method and system based on diffusion model
CN118570886A
Generative models of machine learning for privacy-preserving synthetic data generation using diffusion
DE102023125923A1
Cited By
Task processing method and device, storage medium and electronic equipment
CN122019061A