Big model personnel attribute identification method and device based on federal soft clustering
Through federated soft clustering technology, the large client model is divided into basic modules and fine-tuning modules, and soft clustering is used to perform cluster division and parameter weighting, which solves the problems of low accuracy of personnel attribute recognition and data privacy leakage in traditional methods. problem, achieving efficient and accurate training and performance improvement of the personnel attribute recognition model.
Patent Information
- Application Number
- CN202410677734.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-09-20
AI Technical Summary
Traditional person attribute recognition methods have low accuracy when faced with multi-target attributes, and traditional small-scale models are difficult to extract important information from massive monitoring data, and there is a risk of data privacy leakage. Existing federated learning methods perform poorly on the client. .
A large model personnel attribute identification method based on federated soft clustering is adopted. The large client model is divided into basic modules and fine-tuning modules through adaptive parameter decomposition. The language model is used to generate a description data set, and soft clustering is used to cluster the client. And weighted average parameters reduce hardware requirements and improve model performance.
It is possible to efficiently obtain a highly accurate person attribute recognition model while protecting data privacy, which significantly improves the performance of federated learning and the accuracy of the model.
Smart Images

Figure CN118673344A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of federated learning technology and large model technology, and in particular to a large model personnel attribute recognition method and device based on federated soft clustering. Background Art
[0002] Personnel attribute recognition is a technology that uses multi-target detection methods to obtain detailed attributes such as gender, clothing, and items carried by people in images. At present, the basic method of personnel attribute recognition is to use images as network input and output multiple labels representing attributes and their positions. In personnel attribute recognition, how to identify attributes of different granularities and scales, how to assist attribute recognition by extracting contextual information in the scene, and how to extract correlation information between different attributes are important research directions. However, traditional target detection networks cannot guarantee high accuracy when facing multi-target attributes. At the same time, facing massive monitoring data, traditional small-scale models are difficult to fully extract important information, and the training time is long. With the emergence of large models, their powerful reasoning ability and good generalization level have been reflected in various tasks in the fields of natural language processing and computer vision. Therefore, applying large models to attribute recognition is of great significance to improving the performance of this task.
[0003] In the actual scenario of personnel attribute recognition, the collection of data sets often involves privacy issues. Traditional deep learning methods collect personnel data sets from all parties for use, which poses a risk of privacy leakage and poses a huge challenge to the privacy security of the people and the stable and continuous work of the management. Federated learning can collaboratively train multi-terminal models under the premise of protecting data privacy, but due to data heterogeneity, the fusion model obtained by existing technologies performs poorly on the client. How to apply large models to the scenario of personnel attribute recognition and efficiently obtain high-accuracy models while ensuring the security of people's privacy data is an urgent problem to be solved in the context of the increasingly improved data element protection mechanism and the rapid development of large model technology. Summary of the invention
[0004] In view of the above problems, the present invention provides a large-model personnel attribute recognition method based on federated soft clustering, comprising the following steps:
[0005] S1: Obtain person images and external attribute texts, and generate descriptions of person attribute recognition through language models;
[0006] S2: Through adaptive parameter decomposition, the client large model is divided into a basic module and a fine-tuning module, and the fine-tuning module is used for parameter update;
[0007] S3: The client uploads the fine-tuning module parameters to build the client similarity matrix;
[0008] S4: The server uses soft clustering to cluster clients based on the similarity matrix;
[0009] S5: The server performs weighted averaging on the parameters in the cluster according to the cluster division results, and sends the merged parameters to the client;
[0010] S6: The client splices the basic module with the fine-tuning module to obtain a large model for personnel attribute recognition.
[0011] The large-model personnel attribute recognition method based on federated soft clustering described in the present invention, wherein the specific steps of obtaining personnel images and external attribute texts, and generating descriptions of personnel attribute recognition through a language model include: using a draft-based text generation model, taking multiple external feature attributes of a person as input, filling and adjusting according to a logical order into a sentence description of the person image, and obtaining a personnel attribute recognition data set corresponding to the image.
[0012] The method for identifying personnel attributes of a large model based on federated soft clustering of the present invention divides the client large model into a basic module and a fine-tuning module through adaptive parameter decomposition, and the specific steps of using the fine-tuning module for parameter updating include: loading the pre-trained parameters of the large model, and for the pre-trained full rank weight W 0 , using adaptive low-rank decomposition W 0 +ΔW=W 0 +θ, where W 0 is the basic module, θ is the fine-tuning module, and W 0 Freeze unchanged, θ iterative update, large model training optimization objective function Where P is the learner, Z = {x, y} is the input person image text pair, and the client only optimizes θ with fewer parameters when training a large model.
[0013] The method for identifying personnel attributes based on a large model of federated soft clustering of the present invention, wherein the client uploads fine-tuning module parameters for constructing a client similarity matrix, comprises the following specific steps: when the number of training rounds of the client x reaches a certain number, the model parameters are uploaded. The server receives from the client Then, the similarity matrix A = {a xy}, a xy Represents the similarity between clients x and y, through Calculated, where Indicates the parameter change of client x compared with the previous round.
[0014] The method for identifying personnel attributes of a large model based on federated soft clustering of the present invention comprises the following specific steps: using a local random walk algorithm to process the similarity matrix A, and obtaining a distance matrix D = {d xy}, the random walk index from node x to node y is Calculated, where k x represents the degree of node x, v xy represents the probability of going from node x to y, w(x) represents the sum of the weights of the edges of all neighbors of the node, and the normalized distance d between node x and node y xy =1-S xy , the distance matrix D is used for soft clustering to calculate the membership matrix U after dimension reduction mapping. The minimization goal of soft clustering is where u ij is the membership of the ith node to the jth cluster, x i -c j is the distance between the i-th node and the j-th cluster center, by updating the membership u ij and cluster center c j , iterative optimization soft clustering.
[0015] The large-model personnel attribute recognition method based on federated soft clustering described in the present invention, in which the server performs weighted averaging on the parameters within the cluster according to the cluster division result, and sends the fused parameters to the client, includes the following specific steps: according to the membership matrix U after soft clustering, using the membership of the cluster corresponding to the client as the weighted value, fusing the client model parameters within the same cluster, and sending the fused parameters to the corresponding client in the cluster.
[0016] A device for large-model personnel attribute recognition based on federated soft clustering includes a memory, a processor and a network communication module. The memory is used to store data and instructions executable by the processor, and stores any instruction and data for large-model personnel attribute recognition based on federated soft clustering; the processor is used to read data in the memory and execute instructions to realize large-model personnel attribute recognition based on federated soft clustering; the network communication module is used to receive and send data between a client and a server to realize model parameter transmission and iterative update in federated learning.
[0017] The present invention is a large-model personnel attribute recognition method based on federated soft clustering. It protects data privacy by using federated learning, uses a fine-tuning module to achieve efficient training of large models, improves the efficiency of federated learning and the performance of the aggregation model through federated soft clustering, and improves the accuracy of the personnel attribute recognition model. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A schematic flow chart of the large-model personnel attribute recognition method based on federated soft clustering provided by the present invention.
[0019] Figure 2 A schematic diagram of the flow of a large-model personnel attribute recognition method provided in an embodiment of the present invention.
[0020] Figure 3 A schematic diagram of the structure of a model fusion method based on federated soft clustering provided in an embodiment of the present invention.
[0021] Figure 4 A schematic diagram of the structure of a large-model personnel attribute recognition device based on federated soft clustering provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0022] When the inventors were studying large-model personnel attribute recognition, they found that the use of large-model full-scale fine-tuning technology for model training had the problems of high resource usage and high hardware requirements. At the same time, in order to achieve multi-terminal large-model collaborative training, the traditional technology of using distributed nodes for centralized training inevitably has the risk of data leakage. The collaborative training of large models in combination with federated learning can well solve the problem of data privacy. However, due to the heterogeneity of data distribution, the existing federated learning methods have the problem of poor performance of global models on the client. After research, the inventors found that by using a large-model training method based on adaptive decomposition, the training resource consumption can be effectively reduced while ensuring the performance of the large model, and the hardware requirement threshold of the large model in the personnel attribute recognition scenario can be reduced. At the same time, it was found that by using the federated soft clustering model fusion method, the accuracy of the model parameters fused within the cluster on the client can be improved, and the performance of federated learning can be significantly improved to obtain a high-precision large model for personnel attribute recognition.
[0023] like Figure 2 The present embodiment is a large-model personnel attribute recognition method, the goal of which is to construct a description data set for personnel attribute recognition, divide the model training network through adaptive parameter decomposition, and use the fine-tuning module for parameter update to achieve efficient training of a large model for personnel attribute recognition. Specifically, the following steps are included:
[0024] S1. Obtain person images and external attribute texts, and generate descriptions of person attribute recognition through a language model.
[0025] Using a draft-based text generation model, multiple external feature attributes such as people's clothing and gender are taken as keywords and input into the language model for text filling and adjustment according to the logical order. The text is completed into a sentence description of the person's image, and the corresponding person pictures are integrated to generate image-text pairs to obtain a person attribute recognition dataset.
[0026] S2. Through adaptive parameter decomposition, the client large model is divided into a basic module and a fine-tuning module, and the fine-tuning module is used for parameter update.
[0027] Use the pre-trained parameters of the large model to load the large model of personnel attribute recognition to initialize the network. 0 , using an adaptive low-rank decomposition W 0 +ΔW=W 0 +θ to obtain a fine-tuning module with reduced parameters, where W 0 is the basic module, θ is the fine-tuning module, and W 0 Freeze unchanged, θ iteratively update, the objective function of large model training is:
[0028]
[0029] Where P is the learner, Z = {x, y} is the input person image text pair, and when the client is training the large model, the encoder is used to process the image and text separately, and after modality alignment, they are input to the fine-tuning module θ, and the basic module W 0 Keep it frozen and only optimize θ with fewer parameters. When using a large model for the reasoning process of person attribute recognition, merge the fine-tuning module with the basic module to achieve iterative optimization of model performance.
[0030] like Figure 3 The present embodiment is a model fusion method based on federated soft clustering, the purpose of which is to use federated learning to protect data privacy. At the same time, the client nodes with similar characteristics are divided into the same cluster through the federated soft clustering method, and the model parameters are integrated within the cluster to improve the accuracy of the fusion model.
[0031] S3, the client uploads the fine-tuning module parameters to build the client similarity matrix.
[0032] When client x reaches a certain number of training rounds, upload the fine-tuning module parameters of the local large model The server receives from the client Then, the similarity matrix A = {a xy}, a xy Represents the similarity between clients x and y, calculated using the following formula:
[0033]
[0034] in, It represents the parameter change of client x compared with the previous round. This step is used to preliminarily establish the similarity relationship of client nodes.
[0035] S4. The server uses soft clustering to cluster the clients based on the similarity matrix.
[0036] Use the random walk algorithm to process the similarity matrix A and obtain the distance matrix D = {d xy}, the random walk index from node x to node y is obtained by the following formula:
[0037]
[0038] where k x represents the degree of node x, v xy represents the probability of going from node x to y, w(x) represents the sum of the weights of the edges of all neighbors of the node, and the normalized distance d between node x and node y xy =1-S xy , the distance matrix D is used for soft clustering to calculate the membership matrix U after dimensionality reduction mapping. The minimization target of soft clustering is the following formula:
[0039]
[0040] Among them, u ij is the membership of the ith node to the jth cluster, x i -c j is the distance between the i-th node and the j-th cluster center, by updating the membership u ij and cluster center c j , iteratively optimizes soft clustering, and finally the server obtains the clustering structure of the client.
[0041] S5. The server performs weighted averaging on the parameters within the cluster according to the cluster division results, and sends the fused parameters to the client.
[0042] According to the membership matrix U after soft clustering, the membership of the client corresponding to different clusters is used as the weighted value, and the overlapping client cluster structure is obtained through the soft clustering threshold. The client model parameters in the same cluster are fused, and the fused parameters are sent to the corresponding clients in the cluster.
[0043] S6. The client connects the basic module and the fine-tuning module to obtain a large model for personnel attribute recognition.
[0044] The client builds a large model for personnel attribute recognition for local downstream tasks by splicing the basic module with the fine-tuning module. The large model uses the pre-trained general knowledge provided by the basic module and the expertise of iterative optimization of the fine-tuning module to achieve a higher accuracy rate in personnel attribute recognition. During the model training phase, the fine-tuning module is iteratively updated using an efficient fine-tuning method.
[0045] like Figure 4The embodiment of the present invention provides a large-model personnel attribute recognition device based on federated soft clustering. It includes a memory, a processor and a network communication module. The memory is used to store any instruction and data of large-model personnel attribute recognition based on federated soft clustering, so that the processor can call data and execute related instructions. The processor is used to read data in the memory and execute instructions. When executed, each step in the large-model personnel attribute recognition method based on federated soft clustering can be implemented; the network communication module is used to receive and send data between the client and the server, realize the model parameter transmission in federated learning, and ensure that the client iteratively updates the model parameters and the server obtains data in time.
[0046] The present invention mainly realizes effective identification of personnel attributes based on a large-model personnel attribute identification method of federated soft clustering. Compared with the existing technical solutions, the present invention realizes efficient training of large models and reduction of computing resources through a fine-tuning method based on adaptive decomposition, and combines the federated soft clustering technology to realize privacy protection of multi-terminal collaborative training and performance improvement of clustering fusion models on the client.
[0047] The above implementation modes are only used to illustrate the present invention, but not to limit the present invention. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, all equivalent technical solutions also belong to the scope of the present invention. The patent protection scope of the present invention should be defined by the claims.
Claims
1. A large-model personnel attribute recognition method based on federated soft clustering, characterized by: S1: Obtain person images and external attribute texts, and generate descriptions of person attribute recognition through language models; S2: Through adaptive parameter decomposition, the client large model is divided into a basic module and a fine-tuning module, and the fine-tuning module is used for parameter update; S3: The client uploads the fine-tuning module parameters to build the client similarity matrix; S4: The server uses soft clustering to cluster clients based on the similarity matrix; S5: The server performs weighted averaging on the parameters in the cluster according to the cluster division results, and sends the merged parameters to the client; S6: The client splices the basic module with the fine-tuning module to obtain a large model for personnel attribute recognition.
2. The large-model personnel attribute recognition method based on federated soft clustering according to claim 1 is characterized in that The S1 acquires a person image and external attribute text, and generates a description of person attribute recognition through a language model; including: A draft-based text generation model is used to take multiple external feature attributes of a person as input, fill in and adjust them into sentence descriptions of the person's image according to the logical order, and obtain a person attribute recognition dataset corresponding to the image.
3. The large-model personnel attribute recognition method based on federated soft clustering according to claim 1 is characterized in that In the S2, the client large model is divided into a basic module and a fine-tuning module by adaptive parameter decomposition, and the fine-tuning module is used for parameter update; including: Load the pre-trained parameters of the large model. For the pre-trained full-rank weight W0, use the adaptive low-rank decomposition W0+ΔW=W0+θ, where W0 is the basic module and θ is the fine-tuning module. During the training process, W0 is frozen and unchanged, and θ is iteratively updated. The objective function of the large model training is: Where P is the learner, Z = {x, y} is the input person image text pair, and the client only optimizes θ with fewer parameters when training a large model.
4. The large-model personnel attribute recognition method based on federated soft clustering according to claim 1 is characterized in that The client uploads fine-tuning module parameters in S3, which are used to construct a client similarity matrix; including: When client x reaches a certain number of training rounds, upload the model parameters The server receives from the client Then, the similarity matrix A = {a xy }, a xy Represents the similarity between clients x and y, calculated using the following formula: in, Indicates the parameter change of client x compared with the previous round.
5. The large-model personnel attribute recognition method based on federated soft clustering according to claim 1 is characterized in that In the S4, the server uses soft clustering to cluster the clients based on the similarity matrix; including: Use the random walk algorithm to process the similarity matrix A and obtain the distance matrix D = {d xy }, the random walk index from node x to node y is obtained by the following formula: where k x represents the degree of node x, v xy represents the probability of going from node x to y, w(v) represents the sum of the weights of the edges of all neighbors of the node, and the normalized distance d between node x and node y xy =1-S xy , the distance matrix D is used for soft clustering to calculate the membership matrix U after dimensionality reduction mapping. The minimization target of soft clustering is the following formula: Among them, u ij is the membership of the ith node to the jth cluster, x i -c j is the distance between the i-th node and the j-th cluster center, by updating the membership u ij and cluster center c j , iterative optimization soft clustering.
6. The large-model personnel attribute recognition method based on federated soft clustering according to claim 1 is characterized in that In S5, the server performs weighted averaging on the parameters in the cluster according to the cluster division result, and sends the merged parameters to the client; including: According to the membership matrix U after soft clustering, the membership of the client's corresponding cluster is used as a weighted value to fuse the client model parameters in the same cluster, and the fused parameters are sent to the corresponding clients in the cluster.
7. A device for large-model personnel attribute recognition based on federated soft clustering, characterized in that: include: S1: a memory, used to store data and instructions executable by the processor, and to store any instruction and data for large-model personnel attribute recognition based on federated soft clustering; S2: processor: used to read data in the memory and execute instructions, which can implement the steps of any one of the methods described in claims 1-6 when executed; S3: Network communication module: used to receive and send data between the client and the server, and realize the model parameter transmission and iterative update in federated learning.
Citation Information
Patent Citations
Client selection federal learning method based on DBSCAN clustering
CN114819069A
Personalized federal learning method based on parameter layering
CN115587633A
Personalized federal learning method and system based on adaptive clustering layering
CN115840900A
Cluster federated learning method based on model similarity
CN116167452A
Cited By
Pilot physiological status quantitative analysis system based on machine learning
CN121479362A
