IP Library Granted Patent US 12688322
Granted Patent B2
US 12688322 · App. 18/837,078 · Granted Jul 21, 2026

Method and apparatus for protecting data, and device and medium

Inventors: Jiankai Sun (Los Angeles, CA); Xin Yang (Los Angeles, CA); Yuanshun Yao (Los Angeles, CA); Junyuan Xie (Beijing, CN); Chong Wang (Los Angeles, CA)
Assignee: Lemon Inc.
G06F21/6218
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12688322
App. No.
18/837,078
Granted
Jul 21, 2026
Kind
B2
Abstract

A method and apparatus for protecting data, and a device and a medium are provided. The method comprises acquiring, by a first device, a feature representation generated by a second device on the basis of sample data and according to a second model, wherein the first device has label information for the sample data; and the first device and the second device are used for jointly training a first model at the first device and the second model at the second device. The method further comprises generating, by the first device, a prediction label for the sample data on the basis of the feature representation and according to the first model. The method further comprises determining, by the first device and on the basis of the feature representation, the label information and the predicted label, a total loss value used for training the first model and the second model.

Claims (49)

1 . A method for protecting data, comprising:

acquiring, by a first device, a feature representation generated by a second device based on sample data and according to a second model, the first device having label information for the sample data, and the first device and the second device being configured to jointly train a first model at the first device and the second model at the second device;

generating, by the first device based on the feature representation and according to the first model, a predicted label for the sample data; and

determining, by the first device based on the feature representation, the label information and the predicted label, a total loss value for training the first model and the second model, wherein determining the total loss value comprises:

determining a first loss based on the label information and the predicted label, wherein the first loss denotes a degree of difference between the predicted label and the label information;

determining a second loss based on the feature representation and the label information, wherein the second loss denotes a degree of correlation between the feature representation and the label information; and

determining the total loss value based on the first loss and the second loss.

2 . The method according to claim 1 , wherein determining the total loss value comprises:

determining a weighted sum of the first loss and the second loss as the total loss value.

3 . The method according to claim 1 , wherein determining the second loss comprises:

determining a distance correlation coefficient of the feature representation and the label information as the second loss.

4 . The method according to claim 1 , further comprising:

determining a parameter of the first model by determining a minimum total loss value from the total loss value and at least one other total loss value, wherein the at least one other total loss value is previously or subsequently determined by the first device.

5 . The method according to claim 1 , further comprising:

determining, by the first device, a gradient of the total loss value with respect to the feature representation; and

transmitting the gradient to the second device, to cause the second device to determine a parameter of the second model according to the gradient.

6 . The method according to claim 1 , wherein the label information comprises sensitive data of a processing process of the sample data by a user.

7 . The method according to claim 1 , wherein the second device has no label information.

8 . An electronic device, comprising:

at least one processing unit; and

at least one memory, wherein the at least one memory is coupled to the at least one processing unit and stores an instruction for execution by the at least one processing unit, and the instruction, when executed by the at least one processing unit, causes the electronic device to execute actions comprising:

acquiring, by the electronic device, a feature representation generated by a second device based on sample data and according to a second model, the electronic device having label information for the sample data, and the electronic device and the second device being configured to jointly train a first model at the electronic device and the second model at the second device;

generating, based on the feature representation and according to the first model, a predicted label for the sample data; and

determining, based on the feature representation, the label information and the predicted label, a total loss value for training the first model and the second model, wherein determining the total loss value comprises:

determining a first loss based on the label information and the predicted label, wherein the first loss denotes a degree of difference between the predicted label and the label information;

determining a second loss based on the feature representation and the label information, wherein the second loss denotes a degree of correlation between the feature representation and the label information; and

determining the total loss value based on the first loss and the second loss.

9 . The electronic device according to claim 8 , wherein determining the total loss value comprises:

determining a weighted sum of the first loss and the second loss as the total loss value.

10 . The electronic device according to claim 8 , wherein determining the second loss comprises:

determining a distance correlation coefficient of the feature representation and the label information as the second loss.

11 . The electronic device according to claim 8 , wherein the actions further comprise:

determining a parameter of the first model by determining a minimum total loss value from the total loss value and at least one other total loss value, wherein the at least one other total loss value is previously or subsequently determined by the electronic device.

12 . The electronic device according to claim 8 , wherein the actions further comprise:

determining, by a first device, a gradient of the total loss value with respect to the feature representation; and

transmitting the gradient to the second device, to cause the second device to determine a parameter of the second model according to the gradient.

13 . The electronic device according to claim 8 , wherein the label information comprises sensitive data of a processing process of the sample data by a user.

14 . The electronic device according to claim 8 , wherein the second device has no label information.

15 . A non-transitory computer-readable storage medium, having a computer program stored thereon, wherein the program, when executed by a processor, implements a method comprising:

acquiring, by a first device, a feature representation generated by a second device based on sample data and according to a second model, the first device having label information for the sample data, and the first device and the second device being configured to jointly train a first model at the first device and the second model at the second device;

generating, by the first device based on the feature representation and according to the first model, a predicted label for the sample data; and

determining, by the first device based on the feature representation, the label information and the predicted label, a total loss value for training the first model and the second model, wherein determining the total loss value comprises:

determining a first loss based on the label information and the predicted label, wherein the first loss denotes a degree of difference between the predicted label and the label information;

determining a second loss based on the feature representation and the label information, wherein the second loss denotes a degree of correlation between the feature representation and the label information; and

determining the total loss value based on the first loss and the second loss.

16 . The non-transitory computer-readable storage medium according to claim 15 , wherein determining the total loss value comprises:

determining a weighted sum of the first loss and the second loss as the total loss value.

17 . The non-transitory computer-readable storage medium according to claim 15 , wherein determining the second loss comprises:

determining a distance correlation coefficient of the feature representation and the label information as the second loss.