Quantization method of speaker verification model, electronic device and storage medium
By employing static and adaptive quantization strategies, combined with weight regularization techniques, the computational resource consumption and performance degradation issues of deep learning speaker verification models on mobile devices are addressed, enabling efficient deployment and performance improvement of a lightweight speaker verification system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AISPEECH CO LTD
- Filing Date
- 2023-06-08
- Publication Date
- 2026-05-08
AI Technical Summary
Existing technologies for deploying deep learning speaker verification models on mobile devices suffer from high computational resource consumption and performance degradation, making it difficult to meet the requirements of practical applications.
We propose two novel quantization methods: static quantization and adaptive quantization. By maintaining information entropy through weight regularization, we dynamically determine binary weights to match the distribution of real-valued weights.
While keeping the model size essentially unchanged, the performance of the speaker verification system was significantly improved, enabling efficient deployment on mobile devices with a performance improvement of 38% to 30%.
Smart Images

Figure CN116705041B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of neural network technology, and in particular to a quantization method, electronic device, and storage medium for a speaker verification model. Background Technology
[0002] In related technologies, speaker verification (SV) involves determining whether registered audio and test audio were spoken by the same person. The paradigm for SV systems has evolved from traditional i-vectors and probabilistic linear discriminant analysis (PLDA) to speaker embedding learning using deep learning techniques. Recently, the performance of SV systems has been significantly improved by utilizing deeper and larger neural networks. For example, some related techniques have proposed depth-first versions of the ResNet model, significantly increasing the network depth to 2^33. Other techniques have further pushed the ResNet model depth to 2^93, achieving impressive performance gains. While large models have yielded promising results, they typically consume significant storage and computational resources, hindering deployment on mobile devices. Developing lightweight speaker verification systems tailored for mobile devices is a challenging and demanding task.
[0003] Previous research has explored several methods for miniaturizing speaker verification systems, including knowledge distillation and efficient architecture design. Knowledge distillation is a commonly used compression method that transfers knowledge from the teacher network to the student network. While it is possible to improve the performance of the student network without increasing the model size, deploying these networks on mobile devices remains challenging due to the considerable number of parameters involved. On the other hand, much effort has been made to manually design more efficient computational operators and network architectures. To reduce computational costs, researchers have focused on using lightweight convolutional operations to replace computationally intensive ones and introducing more efficient architectures suitable for embedded use cases. While the number of parameters and computational complexity are significantly reduced, severe performance degradation occurs, making it almost unusable for real-world speaker verification applications. Summary of the Invention
[0004] This invention provides a method for quantifying a speaker verification model, an electronic device, and a storage medium to at least solve one of the aforementioned technical problems.
[0005] In a first aspect, embodiments of the present invention provide a quantization method for a speaker verification model, comprising: obtaining real-valued weights for all layers of the speaker verification model; mapping the real-valued weights of all layers to a fixed set of integers; or dynamically determining the binary weights corresponding to the real-valued weights of each layer to better match the distribution of real-valued weights.
[0006] In a second aspect, embodiments of the present invention provide an electronic device comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the quantization method of any of the speaker verification models described above.
[0007] Thirdly, embodiments of the present invention provide a storage medium storing one or more programs including execution instructions, the execution instructions being readable and executable by electronic devices (including but not limited to computers, servers, or network devices, etc.) to perform the quantization method of any of the speaker verification models described above.
[0008] Fourthly, embodiments of the present invention also provide a computer program product, the computer program product including a computer program stored on a storage medium, the computer program including program instructions, which, when executed by a computer, cause the computer to execute any of the above-described speaker verification model quantization methods.
[0009] The method described in this application proposes two novel quantization strategies: static quantization and adaptive quantization. Furthermore, for static quantization, this application proposes a weight regularization technique to maintain maximum information entropy and reduce information loss. Further, this application also proposes an adaptive quantization scheme that can dynamically determine the optimal binary values for each layer to achieve better alignment with the real-valued weight distribution. Attached Figure Description
[0010] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 A flowchart illustrating a method for quantifying a speaker verification model according to an embodiment of the present invention;
[0012] Figure 2 An overview of static and adaptive binary quantization provided for one embodiment of the present invention;
[0013] Figure 3 The pre-trained weight distribution of the first and last convolutional layers in a ResNet model 34 speaker verification system provided in an embodiment of the present invention is as follows:
[0014] Figure 4 EER and MinDCF results of a previous miniaturized speaker verification system provided for an embodiment of the present invention, and b-vector proposed in this application on the Voxceleb1 dataset;
[0015] Figure 5 The distribution of pre-trained real-valued weights and binarized weights in the first and last convolutional layers provided in an embodiment of the present invention;
[0016] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Please refer to Figure 1 The diagram shows a flowchart of a quantization method for a speaker verification model provided in an embodiment of the present invention.
[0019] like Figure 1 As shown, in step 101, the real-valued weights of all layers of the speaker verification model are obtained;
[0020] In step 102, the real-valued weights of all layers are mapped to a fixed set of integers; or
[0021] In step 103, the binary weights corresponding to the real weights of each layer are dynamically determined to better match the distribution of real weights.
[0022] The method described in this application proposes two novel quantization strategies: static quantization and adaptive quantization. Furthermore, for static quantization, this application proposes a weight regularization technique to maintain maximum information entropy and reduce information loss. Further, this application also proposes an adaptive quantization scheme that can dynamically determine the optimal binary values for each layer to achieve better alignment with the real-valued weight distribution.
[0023] In some alternative embodiments, mapping the real-valued weights of all layers to a fixed set of integers includes: establishing a fixed set of integers for quantization and a corresponding scaling factor for each layer of the speaker verification model, wherein the fixed set of integers is {-1, +1}.
[0024] In a further optional embodiment, after mapping the real-valued weights of all layers to a fixed set of integers, the method further includes: using a weight regularizer to preserve the maximum entropy and minimize the information loss of the quantized weights.
[0025] In a further optional embodiment, the real-valued weights are normalized using the following formula: Among them, W r′ W represents the real-valued weights for regularization. r Let W represent the real-valued weight matrix. r | represents the number of entries in the matrix, ||W r || l1 The L1 criterion for representing a matrix.
[0026] In a further optional embodiment, mapping the real-valued weights of all layers to a fixed set of integers includes binarizing the regularized real-valued weights using the following formula:
[0027]
[0028] Q = α × q;
[0029] Here, clip represents a function that clips values between -1 and 1, round represents a function that maps values to the nearest integer, α represents a scaling factor, q represents the set of integers, and Q represents the set of real values.
[0030] In some alternative embodiments, the dynamic determination of the binary weights corresponding to the real weights of each layer includes: aligning the center β of the binary weights with the average value of the real weight distribution; determining the standard deviation of the real weight matrix as the distance α from the boundary to the center; and determining the binary weights {β-α, β+α} of each layer based on the center β of the binary weights and the distance α from the boundary to the center, wherein α and β can be dynamically updated together with the real weights during the training process of each layer.
[0031] In a further optional embodiment, the dynamic determination of the binary weights corresponding to the real-valued weights of each layer includes: using KL divergence to measure the distributional similarity between the binary weights and the real-valued weights.
[0032] Among related technologies, knowledge distillation-based techniques employ a teacher model to teach knowledge to a student model, enabling the student model to achieve similar performance to the teacher model. Lightweight architecture design methods, on the other hand, use manual design to propose more lightweight operators and network architectures.
[0033] The drawback of these techniques is that while the number of model parameters and computational complexity are significantly reduced, severe performance degradation may occur, making it difficult to meet the requirements of real-world speaker identification systems. Furthermore, the compression methods employed by these techniques are too simplistic and crude, resulting in the loss of considerable information and a significant decrease in the representativeness of the compressed model.
[0034] To reduce the number of parameters and complexity of a model, model quantization is a commonly used and feasible solution. However, directly using simple quantization methods can lead to a significant performance degradation.
[0035] To address the issue of excessive performance degradation after quantization, this application proposes two novel quantization strategies: static quantization and adaptive quantization. For static quantization, this application proposes a weight regularization technique to maintain maximum information entropy and reduce information loss. Furthermore, this application proposes an adaptive quantization scheme that dynamically determines the optimal binary values for each layer to achieve better alignment with the real-valued weight distribution.
[0036] Please refer to Figure 2 It provides an overview of static and adaptive binary quantization.
[0037] (1) Static quantization Figure 2 The left side of the map maps the real-valued weights of all layers to a fixed set of integers {-1, +1}.
[0038] (2) In contrast, adaptive quantization ( Figure 2 The right side of the layer can dynamically determine the binary values {β-α, β+α} for each layer to better match the distribution of real-valued weights.
[0039] In implementing this application, the inventors also explored several alternative solutions. One of these alternatives was to employ a traditional binary quantization method. The advantage of this alternative solution is the availability of mature software packages and practical application experience. The disadvantage of this alternative solution is that its performance is not ideal compared to the model in the embodiments of this application.
[0040] Experimental results show that the best binarization model in this application outperforms the previous state-of-the-art lightweight system, achieving relative performance improvements of 38%, 36%, and 30% on Vox1-O, E, and H, respectively, while maintaining almost the same model size. Furthermore, analysis of the binarization weight histogram shows that, compared to static methods, the adaptive quantization scheme better matches the distribution of real-valued weights, thus demonstrating superior representational capabilities.
[0041] Developing lightweight systems tailored for mobile devices is a pressing and interesting topic in speaker verification tasks. In this application, the inventors investigated extremely low-bit quantization for miniaturized speaker verification systems. Specifically, they proposed two different binary quantization schemes: a static quantizer and an adaptive quantizer. By applying them to a pre-trained full-precision ResNet model, they successfully obtained a binary model called b-vector (binarized vector), with a model size less than 1MB of memory. Experiments on the Voxceleb dataset show that, compared to previous state-of-the-art miniaturized speaker verification systems, the best b-vector system in this application achieves relative performance improvements of 38%, 36%, and 30% on Vox1-O, E, and H, respectively, while maintaining almost the same model size. Furthermore, analysis of the binary weight distribution shows that the adaptive quantization scheme better matches the full-precision weight distribution compared to the static method, thus exhibiting more efficient representation capabilities.
[0042] This application investigates how to achieve a better balance between performance and model size to realize a miniaturized speaker verification system. Neural network quantization is a compression technique used to represent 32-bit floating-point numbers with a smaller bit width. Quantization of network weights can produce models with a smaller memory footprint. Specifically, this application proposes two different low-bit quantization schemes for the SV system: a static quantizer and an adaptive quantizer. By applying them to a pre-trained full-precision ResNet model, this application successfully obtained a binary model called b-vector with a model size of less than 1MB. Experimental results on Voxceleb show that, compared to the previous best miniaturized speaker verification system, the best b-vector system in this application achieves significant relative performance improvements of 38%, 36%, and 30% on Vox1-O, E, and H, respectively, while maintaining almost the same model size. Furthermore, analysis of the binary weight histogram shows that, compared to the static method, the adaptive quantization scheme can better match the distribution of real-valued weights, thus demonstrating superior representation capabilities.
[0043] In recent years, miniaturized speaker verification systems have been an important and active research area. Some related techniques propose label-level and embedding-level refinement for learning deep speaker embeddings on a small scale. Other techniques introduce a self-knowledge refinement framework to leverage enhanced features as teachers. Furthermore, some techniques employ the QuartzNet architecture with a lightweight temporally channel-separable one-dimensional convolution (TCSConv1d) module. Still others develop a simplified version of ECAPATDNN by compressing the feature map size and employing separable convolutions. Finally, some techniques propose a novel module called channel-segmentation temporal-channel-time separable one-dimensional convolution (CS-CTCSConv1d) to improve the performance of small-scale SV systems.
[0044] Neural quantization is a widely used compression method for representing full-precision digits with fewer bits. It has been extensively explored in various deep learning fields, including computer vision, natural language processing (NLP), and speech recognition. Some related techniques propose trainable quantization-based image classification methods based on k-means clustering. Others propose binary weighted networks for challenging visual tasks. Still others introduce novel non-uniform quantization schemes. Some techniques design mixed-precision quantization strategies, assigning different bit numbers to each layer. For NLP tasks, some techniques aim to quantize large pre-trained language models to accelerate the inference process. Still others demonstrate that impressive compression rates can be achieved for speech tasks without sacrificing performance.
[0045] This application first introduces the basic concept of neural network quantization. Then, this application proposes two different binary quantizers, namely the extreme cases of quantization schemes, to quantize the full-precision weights of a pre-trained ResNet model system into 1-bit values for speaker verification based on quantization-aware training.
[0046] Generally, quantization in neural networks involves two operations: quantization and non-quantization. In recent years, to bridge the significant performance gap between full-precision models and quantized models, quantization-aware training has been introduced to minimize quantization errors during training.
[0047] Quantization: This step aims to project real-valued numbers onto low-precision integer values. For n-bit quantization, the set of integers q is typically predefined as:
[0048] q∈{0, ±1, ±2, ..., ±(2 n-1 -1)} (1)
[0049] Quantization operations can be implemented using the `round` function. Non-quantization operations: This operation is an affine mapping from integers to real numbers. The specific calculation method is described below:
[0050] Q=α×q∈{0,±α,...,±α×(2 n-1 -1)} (2)
[0051] Where α represents the learnable full-precision scaling factor.
[0052] For a neural network, a set of quantized integers and a corresponding scaling factor can be established for each layer.
[0053] For static 1-bit quantization, binary values are restricted to a fixed set of integers, i.e., {-1, +1}. For all layers of the neural network, such as... Figure 2 As shown on the left. Although this quantization strategy is simple, it ignores the fact that the weight distribution is different in different neural network layers. Furthermore, there is a significant size mismatch between real-valued weights and quantized weights. For example, in a pre-trained ResNet model 34 speaker verification system, most weights are on the order of 10⁻³ to 10⁻². However, quantized weights are generally distributed in the range [-1, 1]. This phenomenon generates a large amount of quantization error. This application proposes entropy-preserving weight regularization to improve the performance of binary networks.
[0054] Figure 3 Pre-trained weight distribution of the first and last convolutional layers in the ResNet model 34 speaker verification system.
[0055] From an information theory perspective, a distribution with higher entropy can retain more information. Therefore, this application introduces a weight regularizer, the purpose of which is to preserve the maximum entropy and minimize the information loss of the quantized weights. Theoretical analysis shows that when real-valued weights are quantized proportionally to each quantization level, the information entropy value of the quantized weights can reach its maximum value. Empirically, when real-valued weights are normalized using the following formula, the corresponding quantized weights exhibit an approximately uniform distribution within the binary integer set {-1, +1}:
[0056]
[0057] Among them W r It is a real-valued weight matrix. |W r | represents the number of entries in the matrix. ||w r || l1 The L1 criterion represents the matrix.
[0058] Then, through the following quantization and dequantization operations, the regularized real-valued weights W are... r′ Binarization is shown in Equations 4 and 5.
[0059]
[0060] Q=α×q (5)
[0061] Here, `clip` is a function that clips values between -1 and 1. `round` is a function that maps a value to the nearest integer. `α` is a scaling factor.
[0062] Previous research has shown that weights in neural networks generally adhere to a bell-shaped distribution. However, the inventors' empirical findings indicate that the shape of this distribution differs in different layers of the neural network. Figure 1 As shown, the weight distribution in shallow layers exhibits a larger range and greater variance, while the weight distribution in deeper layers is typically denser and narrower, with most weights concentrated around 0. Therefore, using a fixed set of integers in static quantization limits the ability to provide binary diversity for various weight distributions, ultimately constraining the representational power of the quantized network. In this section, embodiments of this application propose an adaptive quantization scheme that dynamically determines the best binary set for each layer to achieve a better match with the real-valued weight distribution.
[0063] Figure 2 Overview of static and adaptive binary quantization. Static quantization ( Figure 2 The left side of the map maps all real-valued weights of all layers to a fixed set of integers {-1, +1}. In contrast, adaptive quantization ( Figure 2 The right side of the layer can dynamically determine the binary {β-α, β+α} for each layer to better match the distribution of real-valued weights.
[0064] Unlike static quantization, which uses a fixed set of binary integers {-1, +1}, this application introduces two adaptive parameters, α and β, to better align with the distribution of real-valued weights across layers. Figure 2 As shown on the right. The weights of the binary values can be obtained as follows:
[0065]
[0066] Where β is the center of the binary weights, and α is the distance to the center. In this case, the binary set becomes {β-α, β+α}.
[0067] Furthermore, the Kullback-Leibler divergence (KLD) is used to measure the distributional similarity between the binarized weights and the realized weights, as follows:
[0068]
[0069] Where P r (x) and P b (x) represents the probability distribution of real-valued and binary weights, respectively.
[0070] Given a real-valued weight matrix W r In this embodiment, the center of the binary β is first aligned with the average value of the real-valued weight distribution. Therefore, β can be obtained in the following way:
[0071]
[0072] As deduced above, the embodiments of this application assume that the binary weights conform to a uniform distribution, which means that P b (β-α)=Pb(β+α)=0.5. For real-valued weights, their distribution is approximately a bell-shaped curve, and it is generally believed to follow a Gaussian distribution. To minimize the KL distance, the inventors observed empirically that α should be within W. r The location of the standard deviation. Finally, α can be estimated as follows:
[0073]
[0074] In the proposed adaptive quantization scheme, α and β can be dynamically updated along with the real-valued weights during the training process of each network layer.
[0075] This application's embodiments were tested on the Voxceleb1&2 datasets, using the development set of Voxceleb2 as training data and Voxceleb1 as test data. Performance was evaluated in three formal trials: Vox1-O, Vox1-E, and Vox1-H. Furthermore, three data augmentation techniques were employed to enhance the diversity of the training data, including online data augmentation using the MUSAN and RIR datasets, speculative perturbation, and velocity changes of 0.9 and 1.1 times.
[0076] The training process in this embodiment includes two stages. The first stage aims to obtain a fully accurate speaker verification system. Subsequently, this embodiment applies the previously proposed 1-bit quantization scheme to the pre-trained network to generate a corresponding binarized model.
[0077] Phase 1: In the experiments, this application's embodiments use ResNet34 as the speaker embedding extraction model. First, the ResNet34-based SV system is trained to full precision. For the training data, a 200-frame segment is randomly selected from each corpus. The input features are an 80-dimensional F-bank with a window length of 25ms and a shift of 10ms. AAM-softmax is used as the loss function, with a margin of 0.2 and a scale of 32. The optimizer is stochastic gradient descent (SGD) with a momentum of 0.9 and a weight decay of 1e-4. The total training time is 165 seconds. The extracted speaker embeddings are 256-dimensional.
[0078] Phase Two: Subsequently, the pre-trained ResNet34 full-precision model is reloaded and fine-tuned 40 times using the proposed 1-bit quantization scheme. Online data augmentation and specification enhancement are discarded during training. The remaining settings are the same as in Phase One.
[0079] Cosine distance is used to measure the similarity of the embeddings. Then, in this embodiment, adaptive score normalization (AS-Norm) is used to normalize the obtained scores, with a queue size of 600 for impersonation. In P target =0.01 and C FA =C Miss With a setting of 1, performance was evaluated using the Equivalent Error Rate (EER) and the Minimum Detection Cost Function (MinDCF).
[0080] Performance of b-vector
[0081] Figure 4 The results of EER and MinDCF from previous miniaturized speaker verification systems, as well as the b-vector proposed in this application on the Voxceleb1 dataset.
[0082] Figure 4 This paper outlines the performance of recent miniaturized speaker verification systems (SV) and the binarization model proposed in this application. Furthermore, model sizes in megabytes (MB) are provided for a detailed comparison of storage memory usage. As previously mentioned, this application first pre-trains a system based on a ResNet model 34 at full precision. While the full-precision model exhibits good performance, its practical deployment on edge devices is hampered by excessive memory requirements. Two different binarization models are obtained by applying the proposed static and adaptive 1-bit quantization schemes. Specifically, this application names the embeddings extracted from the resulting quantized models as b-vectors. Figure 4 As can be seen, the model size was effectively reduced to less than 1MB, resulting in a significant compression ratio of 27 times.
[0083] Regarding model performance, it is clear that the b-vector (adaptive) method achieves significantly better results than the b-vector (static) method, demonstrating the superior speaker representation capabilities of the adaptive quantization scheme. Compared to recently published miniaturized speaker validation systems, both the static and adaptive b-vector systems achieve new state-of-the-art performance with similar model sizes. Specifically, Julien et al. proposed a QuartzNet model tailored for embedded systems. Furthermore, CS-CTCSConv1D offers some architectural improvements to Julien et al.'s model, resulting in the best reported performance to date for miniaturized speaker validation systems. In contrast, the best b-vector system (adaptive) in this application achieves an average relative performance improvement of 35% in EER and a 29% improvement in MinDCF while maintaining almost the same model size. Moreover, the b-vector system (adaptive) proposed in this application significantly outperforms ECAPA-TDNNLite while reducing memory costs by 24%. The above analysis shows that, in the context of miniaturized speaker validation systems, the b-vector system (adaptive) achieves a better trade-off between performance and model size.
[0084] Weight distribution analysis: This application embodiment analyzes the binary weight histograms of static and adaptive quantization schemes. For example... Figure 5 As shown, the distribution of pre-trained real-valued weights exhibits a significant difference between the first and last convolutional layers. Static quantization uses a fixed set of integers, resulting in highly similar binarization results for the first and last convolutional layers (0.07 vs. 0.06). This affects its ability to accurately match the distribution of real-valued weights. For example, most weights are concentrated in the range [-0.05, 0.05] in the last layer. Nevertheless, the two binary weights produced by static quantization, ±0.06, introduce a significant quantization error. In contrast, adaptive quantization demonstrates superior representational power because it adaptively determines the set of binary weights based on the distribution of real-valued weights. For example, in the first layer, with a wider distribution, adaptive quantization maps the weights to ±0.05. On the other hand, in the last layer, due to a denser and narrower distribution, it produces two binary weights of -0.02 and 0.02. This demonstrates that the adaptive approach better aligns with the distribution of real-valued weights, leading to improved performance.
[0085] Figure 5 The distribution of pre-trained real-valued weights and binarized weights in the first and last convolutional layers.
[0086] In this embodiment, we explore low-bit quantization for miniaturized speaker verification systems. Specifically, two different binary quantization schemes are proposed: a static quantizer and an adaptive quantizer. By applying them to a pre-trained, full-precision ResNet model, we successfully obtained a binary model called b-vector with a size less than 1MB of memory. Experimental results on Voxeleb show that our best b-vector model outperforms previous state-of-the-art lightweight systems, achieving relative performance improvements of 38%, 36%, and 30% on Voxel-1-O, E, and H, respectively, while maintaining almost the same model size. Furthermore, analysis of the binary weight histogram shows that the adaptive quantization scheme better matches the real-valued weight distribution compared to the static method, thus exhibiting more efficient representation capabilities.
[0087] In other embodiments, the present invention also provides a non-volatile computer storage medium storing computer-executable instructions that can execute the quantization method of the speaker verification model in any of the above method embodiments;
[0088] In one embodiment, the non-volatile computer storage medium of the present invention stores computer-executable instructions, which are configured as follows:
[0089] Obtain the real-valued weights of all layers in the speaker validation model;
[0090] Map the real-valued weights of all the layers to a fixed set of integers; or
[0091] The binary weights corresponding to the real weights of each layer are dynamically determined to better match the distribution of real weights.
[0092] Non-volatile computer-readable storage media may include a stored program area and a stored data area, wherein the stored program area may store an operating system and an application program required for at least one function; the stored data area may store data created based on the use of the quantization device of the speaker verification model, etc. Furthermore, the non-volatile computer-readable storage medium may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the non-volatile computer-readable storage medium may optionally include memory remotely disposed relative to a processor, which can be connected to the quantization device of the speaker verification model via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0093] This invention also provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium. The computer program includes program instructions that, when executed by a computer, cause the computer to perform any of the above-described speaker verification model quantization methods.
[0094] Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present invention, such as... Figure 6 As shown, the device includes one or more processors 610 and a memory 620. Figure 6 Taking a processor 610 as an example, the device for the speaker verification model quantization method may further include an input device 630 and an output device 640. The processor 610, memory 620, input device 630, and output device 640 can be connected via a bus or other means. Figure 6 Taking a bus connection as an example, memory 620 is the aforementioned non-volatile computer-readable storage medium. Processor 610 executes various server functions and data processing by running non-volatile software programs, instructions, and modules stored in memory 620, thereby implementing the quantization method of the speaker verification model in the above-described method embodiment. Input device 630 can receive input digital or character information and generate key signal inputs related to user settings and function control of the communication compensation device. Output device 640 may include display devices such as a display screen.
[0095] The above-described product can execute the method provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the method provided in the embodiments of the present invention.
[0096] In one implementation, the above-described electronic device is used in a quantization apparatus for a speaker verification model, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0097] When obtaining the real-valued weights of all layers in the speaker validation model;
[0098] Map the real-valued weights of all the layers to a fixed set of integers; or
[0099] The binary weights corresponding to the real weights of each layer are dynamically determined to better match the distribution of real weights.
[0100] The electronic devices described in this application exist in various forms, including but not limited to:
[0101] (1) Mobile communication devices: These devices are characterized by their mobile communication capabilities and primarily aim to provide voice and data communication. These terminals include: smartphones (e.g., iPhones), multimedia phones, feature phones, and low-end phones, etc.
[0102] (2) Ultra-mobile personal computer devices: These devices fall under the category of personal computers, possessing computing and processing capabilities, and generally also have mobile internet access features. These terminals include PDAs, MIDs, and UMPCs, such as the iPad.
[0103] (3) Portable entertainment devices: These devices can display and play multimedia content. This category includes: audio and video players (such as iPods), handheld game consoles, e-books, as well as smart toys and portable car navigation devices.
[0104] (4) Server: A device that provides computing services. The components of a server include a processor, hard disk, memory, system bus, etc. Servers are similar to general computer architectures, but because they need to provide highly reliable services, they have higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.
[0105] (5) Other electronic devices with data interaction functions.
[0106] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0107] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0108] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A quantification method for a speaker verification model, comprising: Obtain the real-valued weights of all layers in the speaker validation model; Dynamically determining the binary weights corresponding to the real-valued weights of each layer to better match the distribution of real-valued weights includes: aligning the center β of the binary weights with the average value of the distribution of real-valued weights; determining the standard deviation of the real-valued weight matrix as the distance α from the boundary to the center; and determining the binary weights {β-α, β+α} of each layer based on the center β of the binary weights and the distance α from the boundary to the center, wherein α and β can be dynamically updated together with the real-valued weights during the training process of each layer.
2. The method according to claim 1, wherein, The dynamic determination of the binary weights corresponding to the real-valued weights of each layer includes: KL divergence is used to measure the distributional similarity between binarized weights and real-valued weights.
3. An electronic device comprising: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the steps of the method of claim 1 or 2.
4. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method of claim 1 or 2.
Citation Information
Patent Citations
Handwritten digital image recognition and classification method based on binary deep neural network
CN110070119A