A method and system for federated learning of speech recognition based on private parameters
By adopting the division and update mechanism of private parameters and shared parameters in speech recognition federated learning, combined with supervised and semi-supervised training, the problem of client data distribution differences is solved, the performance of the speech recognition model is improved, and the error recognition rate is reduced.
Patent Information
- Application Number
- CN202210326775.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-30
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-03-30
AI Technical Summary
Existing federated learning methods for speech recognition fail to effectively consider the data distribution differences of each client, resulting in insufficient speech recognition model performance and high false recognition rates.
Using a speech recognition federated learning method based on private parameters, the seed model is obtained through supervised training at the center, private parameters and shared parameters are divided, semi-supervised training is performed on the client, and the shared parameters are updated using the shared parameters of multiple clients. Achieve personalized modeling.
Through personalized modeling, the performance of the speech recognition model on each client is significantly improved and the error recognition rate is reduced.
Smart Images

Figure CN114783425B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of speech recognition, and specifically to a speech recognition federated learning method and system based on private parameters. Background Art
[0002] The speech recognition model can realize the function of converting speech into text. The traditional centralized intelligent speech system needs to aggregate all client speech samples to the central end for centralized training. However, in the centralized training paradigm, since the customer speech samples need to be transmitted to the central end, this process may cause data leakage and lead to threats to data information security.
[0003] Federated learning methods can use all client voice samples for federated learning without transmitting voice samples to the central end by transmitting non-original data between the client and the central end. In real-world scenarios, the distribution of voice data of each client is usually different, but existing federated learning methods for speech recognition usually do not consider the distribution differences of each client. Summary of the invention
[0004] The purpose of the embodiment of the present application is to effectively improve the performance of the speech recognition model according to the distribution differences of each client to reduce the error recognition rate.
[0005] To achieve the above-mentioned objectives, in the first aspect, an embodiment of the present application provides a private parameter-based speech recognition federated learning method, which is applied to the central end, and the method includes: using local annotated speech samples to perform supervised training on a speech recognition model to obtain a seed model of the speech recognition model; determining a first private parameter and a first shared parameter based on the seed model; updating the first shared parameter based on multiple second shared parameters; the multiple second shared parameters are obtained by uploading multiple clients; and passing the updated first shared parameter to each of the multiple clients.
[0006] As a feasible implementation method, the supervised training of the speech recognition model using the local annotated speech samples includes: taking the annotated speech samples as input and taking the first loss function as the learning target, and performing supervised training on the speech recognition model, wherein the first loss function is:
[0007]
[0008] Where x is the annotated speech sample, y is the text annotation corresponding to the annotated speech sample, p(x) is the distribution function of the annotated speech sample, θ t is the model parameter at the tth training iteration, which is divided into the first private parameter and the first shared parameter; a(·) is the spectrum data enhancement function.
[0009] As a feasible implementation mode, determining the first private parameter and the first shared parameter based on the seed model includes: taking the parameters of all normalized layers in the seed model as the first private parameters, and the parameters of other layers as the first shared parameters; or taking some of the underlying parameters in the seed model as the first private parameters, and the other parameters as the first shared parameters.
[0010] As a feasible implementation manner, updating the first shared parameter according to multiple second shared parameters includes: determining an average parameter value according to parameters uploaded by each client among multiple clients; and updating the first shared parameter according to the average parameter value.
[0011] An embodiment of the present application provides a private parameter-based speech recognition federated learning method, which is applied to a client, and the method includes: obtaining a seed model of a speech recognition model; the seed model is a trained seed model transmitted from a central end; using a local speech sample to perform semi-supervised training on the seed model to determine a second private parameter and a second shared parameter; retaining the second private parameter locally on the client and uploading the second shared parameter to the central end; updating the model parameters of the speech recognition model according to the first shared parameter to obtain a trained speech recognition model, wherein the first shared parameter is a parameter transmitted from the central end and updated according to the second shared parameter of each of a plurality of clients.
[0012] As a feasible implementation, the semi-supervised training of the seed model using the local speech sample includes: taking the local speech sample as input and a second loss function as a learning target, and performing semi-supervised training on the speech recognition model, wherein the second loss function is:
[0013]
[0014] Among them, x1 is the local voice sample, and y1 is the pseudo label.
[0015] As a feasible implementation, the pseudo-label for:
[0016]
[0017] in, are the teacher model parameters, the second private parameters, and the second shared parameters at the tth training iteration.
[0018] As a feasible implementation, the teacher model parameters The value of is the exponential sliding average of the student model parameters of the tth iteration and the previous teacher model parameters:
[0019]
[0020] Among them, the model parameters is the student model parameter at the tth training iteration, and α is the decay coefficient.
[0021] In the second aspect, an embodiment of the present application provides a speech recognition federated learning system based on private parameters, characterized in that the system includes: a central end, used to use local annotated speech samples to perform supervised training of a speech recognition model to obtain a seed model of the speech recognition model; determine a first private parameter and a first shared parameter based on the seed model; update the first shared parameter based on multiple second shared parameters; the multiple second shared parameters are obtained by uploading from multiple clients; pass the updated first shared parameter to each of the multiple clients; multiple clients, each of the multiple clients is used to obtain a seed model of the speech recognition model; the seed model is a trained seed model transmitted from the central end; semi-supervised training is performed on the seed model using local speech samples to determine a second private parameter and a second shared parameter; the second private parameter is retained locally on the client, and the second shared parameter is uploaded to the central end; the model parameters of the speech recognition model are updated according to the first shared parameter to obtain a trained speech recognition model, and the first shared parameter is a parameter transmitted from the central end and updated according to the second shared parameter of each of the multiple clients.
[0022] The embodiment of the present application utilizes private parameters in the model to achieve personalized modeling for each client, so that personalized speech recognition models for multiple clients can be generated through one training, effectively improving the performance of the speech recognition model on each client. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the multiple embodiments disclosed in this specification, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only the multiple embodiments disclosed in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 A schematic diagram of a speech recognition model proposed in an embodiment of the present application;
[0025] Figure 2 This is an architecture diagram of a speech recognition federated learning system based on private parameters according to an embodiment of the present application;
[0026] Figure 3A schematic diagram of a learning scenario of a speech recognition federated learning method based on private parameters proposed in an embodiment of the present application;
[0027] Figure 4 This is a flow chart of the private parameter-based speech recognition federated learning method proposed in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0029] In the description of the embodiments of the present application, words such as "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a concrete way.
[0030] In the description of the embodiments of the present application, the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the term "multiple" means two or more. For example, multiple systems refers to two or more systems, and multiple terminals refers to two or more terminals.
[0031] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprises", "has" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0032] In the following description, the numbers representing the steps, such as S110, S120, etc., do not necessarily mean that the steps must be executed in this manner. If permitted, the order of the previous and next steps can be interchanged, or they can be executed simultaneously.
[0033] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0034] An embodiment of the present application proposes a speech recognition federated learning method based on private parameters, which performs supervised training of a speech recognition model at a central end using labeled speech samples at the central end; divides the parameters of the speech recognition model into private parameters and shared parameters; performs a round of semi-supervised training on the speech recognition model at each client using the speech samples of the client; after each client completes a round of semi-supervised training, retains the private parameters locally on the client, uploads the shared parameters to the central end for parameter aggregation and then returns them to the client; updates the shared parameters at the client to obtain a personalized speech recognition model 10.
[0035] Figure 1 Schematic diagram of a speech recognition model 10 based on private parameters proposed in an embodiment of the present application. Figure 1 As shown, the speech recognition model 10 includes private parameters and shared parameters.
[0036] The speech recognition model proposed in the embodiment of the present application can be applied to a client, which can be an intelligent device in the fields of smart terminals, smart homes, smart security, and autonomous driving. It provides a voice user interface (VUI) on clients such as smart phones, speakers, and smart vehicle terminals (electronic control units, ECUs), and converts the voice information input by the user into text.
[0037] Exemplarily, smart devices include smart TVs, smart speakers, robots, smart air conditioners, smart smoke alarms, smart fire extinguishers, smart car terminals, mobile phones, tablets, laptops, desktop computers, all-in-one computers, etc.
[0038] Figure 2 This is a system architecture diagram of a personalized federated learning method for speech recognition based on private parameters according to an embodiment of the present application. Figure 2 As shown, the system includes a central terminal 21 and multiple clients 22. A personalized speech recognition model for each of the multiple clients is generated through federated learning of the central terminal 21 and the multiple clients 22, thereby effectively improving the performance of the speech recognition model.
[0039] Figure 3 Schematic diagram of the learning scenario of the speech recognition federated learning method based on private parameters proposed in the embodiment of the present application. Figure 3 As shown, in this learning scenario, a central terminal 21 and a client terminal 22 are included.
[0040] The central end 21 uses local annotated speech samples to perform supervised training of the speech recognition model to obtain a seed model of the speech recognition model; determines a first private parameter and a first shared parameter based on the seed model; updates the first shared parameter based on multiple second shared parameters; the multiple second shared parameters are obtained by uploading multiple clients; and transmits the updated first shared parameter to each client 22 among the multiple clients.
[0041] Each client 22 among multiple clients obtains a seed model of a speech recognition model; the seed model is a trained seed model transmitted from the central end 21; the seed model is semi-supervisedly trained using local speech samples to determine a second private parameter and a second shared parameter; the second private parameter is retained locally on the client, and the second shared parameter is uploaded to the central end 21; the model parameters of the speech recognition model are updated according to the first shared parameter to obtain a trained speech recognition model, where the first shared parameter is a parameter transmitted from the central end 21 and updated according to the second shared parameter of each client 22 among multiple clients.
[0042] Figure 4 This is a flow chart of the speech recognition federated learning method based on private parameters proposed in the embodiment of this application. Figure 4 As shown, the process includes the following steps 101-107.
[0043] Step 101: The center uses local annotated speech samples to supervise the training of the speech recognition model to obtain a seed model of the speech recognition model.
[0044] In an achievable implementation, the central end can input any one or more annotated speech samples in the local training set into the speech recognition model 10 for supervised training and calculate the connectionist temporal classification loss. Values:
[0045]
[0046] Among them, x is a locally annotated speech sample, y is the corresponding text annotation, p(x) is the distribution function of the speech sample, θ t is the model parameter at the tth training iteration, and a(·) is the spectrum data enhancement method. Recorded as the first loss function value.
[0047] When the first loss function value When the value reaches or is less than the set threshold, or when the set number of iterations t is reached, the training is terminated and the seed model of the speech recognition model 10 is obtained. The model parameter of the seed model is θ t .
[0048] Step 102: Determine private parameters based on the seed model and shared parameters You can use private parameters Recorded as the first private parameter, the shared parameter Recorded as the first shared parameter.
[0049] In an achievable implementation, the model parameter θ of the seed model of the speech recognition model may be t Divide into private parameters and shared parameters
[0050] In one feasible implementation, all normalized layers in the seed model may be classified as first private parameters, and other layer parameters may be classified as first shared parameters.
[0051] In a feasible implementation, some underlying parameters in the seed model may be used as first private parameters, and other parameters may be used as first shared parameters.
[0052] Step 103: The center transmits the trained seed model to each of the multiple clients.
[0053] In one feasible implementation, each of the multiple clients obtains a seed model of the speech recognition model; the seed model is a trained seed model transmitted from the center.
[0054] Step 104: Each of the multiple clients 22 uses the speech samples in the local personalized training set to perform semi-supervised training on the seed model of the speech recognition model to determine the second private parameters and the second shared parameters of the speech recognition model.
[0055] In an achievable implementation, the client 22 can input any speech sample x1 in the local personalized training set into the seed model of the speech recognition model 10 and output a pseudo label y1. In this process, the connectionist temporal classification loss is calculated. Values:
[0056]
[0057] Different from step 101, in formula (2), the text annotation y corresponding to the speech sample x1 is not available, so a pseudo label is used Instead, the pseudo-label The generation method is:
[0058]
[0059] In formula (3), is the teacher model parameter at the tth training iteration, which is the exponential sliding average of the student model parameter at the tth iteration and the previous teacher model parameter:
[0060]
[0061] In formula (4), the model parameter θ t is the student model parameter at the tth training iteration, including the second private parameter and the second shared parameter; α is the attenuation coefficient, which is taken as a constant of 0.99 in this patent. Recorded as the second loss function value.
[0062] Step 105 , after each client 22 completes a round of semi-supervised training, the second private parameters are retained locally on the client, and the second shared parameters are uploaded to the central end 21 .
[0063] It can be understood that one round includes multiple iterations, and each iteration selects some samples from the training set for training. This selection is non-repetitive. One round of training means that the entire training set is used once.
[0064] Step 106: the central end 21 updates the first shared parameter according to the multiple second shared parameters; wherein the multiple second shared parameters are obtained by uploading from the multiple clients; and sends the updated first shared parameter to each of the multiple clients.
[0065] In a feasible implementation, the central end 21 aggregates a plurality of second shared parameters provided by a plurality of clients 22 to update the first shared parameter, and transmits the updated first shared parameter to each client 22 .
[0066] In a feasible implementation, the central end 21 may obtain the average value of the second shared parameter of each client 22 by calculation, and use the average value of the second shared parameter to update the first shared parameter.
[0067] The above steps 103 to 106 are iterated and trained multiple times, and the first shared parameter is updated using the parameters of the trained speech recognition model.
[0068] Step 107: Each of the multiple clients updates the model parameters of the speech recognition model according to the first shared parameter to obtain a trained speech recognition model, wherein the first shared parameter is a parameter transmitted by the central end and updated according to the second shared parameter of each of the multiple clients.
[0069] The rationality and effectiveness of the speech recognition system based on the embodiment of the present application have been verified in the actual system. In the experimental verification, the center has annotated speech samples including 6919 hours of English speech in different styles. There are three clients, each of which contains 100 hours of additional accented English speech. The accents of the three clients are Australian accent, British accent and Indian accent respectively. The experimental platform uses a graphics card V100 with a core frequency of 5012MHZ, a video memory of 3*32GB, a host equipped with 440GB memory, and a CPU of 2.70GHz.
[0070] In step 102, there are two methods for dividing private parameters: 1. taking all normalized layers in the model as private parameters; 2. taking some underlying parameters in the model as private parameters. Therefore, these two methods are respectively referred to as "embodiment 1 of the present application" and "embodiment 2 of the present application" below. As shown in Table 1.
[0071] Table 1
[0072]
[0073] The experimental results are shown in Table 1, and it can be seen that the method of the embodiment of the present application can effectively reduce the error recognition rate.
[0074] The embodiment of the present application utilizes private parameters in the model to achieve personalized modeling for each client, so that personalized speech recognition models for multiple clients can be generated through one training, effectively improving the performance of the speech recognition model on each client.
[0075] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those of ordinary skill in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0076] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented by hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0077] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above description is only the specific implementation method of the embodiments of the present application and is not intended to limit the protection scope of the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.
Claims
1. A speech recognition federated learning method based on private parameters, applied to the central end, characterized in that: The method comprises: Using local annotated speech samples to train a speech recognition model in a supervised manner to obtain a seed model of the speech recognition model; including: using the annotated speech samples as input and a first loss function as a learning target to perform supervised training on the speech recognition model, wherein the first loss function is: Where x is the annotated speech sample, y is the text annotation corresponding to the annotated speech sample, p(x) is the distribution function of the annotated speech sample, θ t is the model parameter at the tth training iteration, which is divided into the first private parameter and the first shared parameter; a(●) is the spectrum data enhancement function; Determining the first private parameter and the first shared parameter according to the seed model; including: taking the parameters of all normalized layers in the seed model as the first private parameters, and the parameters of other layers as the first shared parameters; or taking some bottom-layer parameters in the seed model as the first private parameters, and the other parameters as the first shared parameters; Updating the first shared parameter according to a plurality of second shared parameters; the plurality of second shared parameters are obtained by being uploaded by a plurality of clients; comprising: determining an average parameter value according to the parameters uploaded by each of the plurality of clients; and updating the first shared parameter according to the average parameter value; The updated first sharing parameter is transmitted to each of the plurality of clients.
2. A speech recognition federated learning method based on private parameters, applied to the client, characterized in that: The method comprises: Obtaining a seed model of a speech recognition model; the seed model is a trained seed model transmitted from a central end; The seed model is semi-supervisedly trained using a local speech sample to determine a second private parameter and a second shared parameter; including: taking the local speech sample as input and a second loss function as a learning target, and performing semi-supervised training on the speech recognition model, wherein the second loss function is: Wherein, x1 is the local voice sample, is a pseudo label; the pseudo label for: in, is the teacher model parameter at the tth training iteration, including the second private parameter and the second shared parameter; Keeping the second private parameter locally on the client, and uploading the second shared parameter to the central end; The model parameters of the speech recognition model are updated according to the first shared parameters to obtain a trained speech recognition model, wherein the first shared parameters are parameters transmitted by the central end and updated according to the second shared parameters of each of the multiple clients.
3. The method according to claim 2, characterized in that The teacher model parameters The value of is the exponential sliding average of the student model parameters of the tth iteration and the previous teacher model parameters: Among them, the model parameters is the student model parameter at the tth training iteration, and α is the decay coefficient.
4. A speech recognition federated learning system based on private parameters, characterized in that: Based on the method described in any one of claims 1 to 3, the system comprises: The central end is used to use the local annotated speech samples to perform supervised training on the speech recognition model to obtain the seed model of the speech recognition model, including: taking the annotated speech samples as input and taking the first loss function as the learning target to perform supervised training on the speech recognition model, wherein the first loss function is: Where x is the annotated speech sample, y is the text annotation corresponding to the annotated speech sample, p(x) is the distribution function of the annotated speech sample, θ t is the model parameter at the t-th training iteration, which is divided into a first private parameter and a first shared parameter; a(·) is a spectrum data enhancement function; determining the first private parameter and the first shared parameter according to the seed model, including: taking the parameters of all normalized layers in the seed model as the first private parameters, and the parameters of other layers as the first shared parameters; or taking some underlying parameters in the seed model as the first private parameters, and the other parameters as the first shared parameters; updating the first shared parameter according to a plurality of second shared parameters, including: determining an average parameter value according to the parameters uploaded by each of a plurality of clients; updating the first shared parameter according to the average parameter value; the plurality of second shared parameters are obtained by being uploaded by a plurality of clients; and transmitting the updated first shared parameter to each of the plurality of clients; A plurality of clients, each of the plurality of clients is used to obtain a seed model of a speech recognition model; the seed model is a trained seed model transmitted by a central end; a local speech sample is used to perform semi-supervised training on the seed model to determine a second private parameter and a second shared parameter, including: taking the local speech sample as input and a second loss function as a learning target, performing semi-supervised training on the speech recognition model, wherein the second loss function is: Wherein, x1 is the local voice sample, is a pseudo label; the pseudo label for: in, The teacher model parameters at the t-th training iteration include a second private parameter and a second shared parameter; the second private parameter is retained locally on the client, and the second shared parameter is uploaded to the central end; the model parameters of the speech recognition model are updated according to the first shared parameter to obtain a trained speech recognition model, wherein the first shared parameter is a parameter transmitted from the central end and updated according to the second shared parameter of each of the multiple clients.
