A speech model compression method, device, equipment and readable storage medium

By performing layered analysis, iterative adjustment and energy consumption evaluation of the voice model, the problems of model accuracy decrease and energy consumption increase in traditional compression methods are solved, and efficient deployment of local devices is achieved.

CN120356473BActive Publication Date: 2025-08-22AISPEECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510848545.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-08-22
Estimated Expiration
2045-06-24

AI Technical Summary

Technical Problem

Traditional speech model compression methods lead to a decrease in model accuracy and an increase in energy consumption, making it difficult to effectively deploy on local devices.

Method used

By performing hierarchical analysis of the compressed speech model, the channel contribution score is calculated, the low contribution channel is removed, and dynamic sharing coefficients are allocated through iterative adjustment, clustering and energy consumption evaluation, and the target model is finally obtained.

Benefits of technology

The compressed model maintains high accuracy, significantly reduces energy consumption, and is suitable for local device deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120356473B_ABST
    Figure CN120356473B_ABST
Patent Text Reader

Abstract

The present application discloses a speech model compression method, apparatus, device and readable storage medium, which relates to the field of artificial intelligence technology. It includes: firstly performing a hierarchical analysis on the speech model to be compressed, and calculating the contribution score of each channel in each layer of the speech model to be compressed; then, based on the contribution score, removing the channels whose contribution score is lower than a preset score threshold in the speech model to be compressed, and obtaining a first compression model; then iteratively adjusting the first compression model, reducing the number of channels in the first compression model, and obtaining a second compression model; then clustering the channels in the second compression model, assigning a dynamic sharing coefficient to each channel in each cluster, and obtaining a third compression model; finally obtaining the energy consumption of each channel in the third compression model, and compressing the third compression model again according to the energy consumption to obtain a target model. The compressed target model can still ensure accuracy and significantly reduces the energy consumption of the speech model to be compressed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a speech model compression method, apparatus, device and readable storage medium. Background Art

[0002] In recent years, with the rapid adoption of IoT smart hardware, voice interaction technology has become the core gateway to natural human-computer interaction. To meet the low power consumption, high real-time performance, and privacy and security requirements of end-devices, voice perception models need to be migrated from the cloud to local devices. However, the limited computing power and storage resources of local devices make it difficult to directly deploy traditional large-scale voice AI models.

[0003] To overcome the above problems, technicians in this field usually compress neural network models, such as global channel pruning, fixed weight sharing, heuristic channel selection, and single energy consumption optimization strategies. However, these methods still have the problem of causing a decrease in model accuracy and an increase in model operation costs (such as increased technical time and energy consumption). Therefore, there is an urgent need for a speech model compression method that can overcome the above defects. Summary of the Invention

[0004] The purpose of the present invention is to provide a speech model compression method, device, equipment and readable storage medium. By scoring, iteratively adjusting, clustering and energy consumption evaluation of each channel in the speech model to be compressed, the channels with lower importance and higher energy consumption in the speech model to be compressed are removed, so that the compressed target model can still ensure accuracy and significantly reduce the energy consumption of the speech model to be compressed.

[0005] In order to achieve the above object, the present invention provides the following technical solutions:

[0006] In a first aspect, the present invention provides a speech model compression method, the method comprising:

[0007] Performing layered analysis on the speech model to be compressed, and calculating the contribution score of each channel in each layer of the speech model to be compressed;

[0008] Based on the contribution score, removing channels in the speech model to be compressed whose contribution scores are lower than a preset score threshold, to obtain a first compression model;

[0009] Iteratively adjusting the first compression model to reduce the number of channels in the first compression model to obtain a second compression model;

[0010] Clustering the channels in the second compression model, and assigning a dynamic sharing coefficient to the channels in each cluster to obtain a third compression model;

[0011] The energy consumption of each channel in the third compression model is obtained, and the third compression model is compressed again according to the energy consumption to obtain a target model.

[0012] In some embodiments, clustering the channels in the second compression model and assigning a dynamic sharing coefficient to the channels in each cluster to obtain a third compression model includes:

[0013] using a clustering algorithm to divide each channel in the second compression model into a plurality of clusters;

[0014] For each cluster, the cluster center is used as the sharing weight, and a dynamic sharing coefficient is allocated to each channel in each cluster to obtain the third compression model.

[0015] In some embodiments, assigning dynamic sharing coefficients to channels in each cluster includes:

[0016] Calculating the cosine similarity between each channel and the cluster center;

[0017] Based on the cosine similarity and a preset precision sensitivity factor, a dynamic sharing coefficient of each channel is calculated.

[0018] In some embodiments, obtaining energy consumption of each channel in the third compression model, and re-compressing the third compression model according to the energy consumption to obtain a target model includes:

[0019] monitoring the energy consumption of each channel in the third compression model in real time, and calculating an energy consumption score of each channel based on the energy consumption;

[0020] Performing a weighted summation on the contribution score and the energy consumption score to obtain a comprehensive score;

[0021] The third compression model is compressed again according to the comprehensive score to obtain a target model.

[0022] In some embodiments, performing layered analysis on the speech model to be compressed and calculating the contribution score of each channel in each layer of the speech model to be compressed includes:

[0023] Performing layered analysis on the speech model to be compressed to obtain channel attributes of each channel in each layer of the speech model to be compressed;

[0024] The importance of each channel is calculated based on the channel attributes to obtain a contribution score of each channel.

[0025] In some embodiments, iteratively adjusting the first compression model to reduce the number of channels in the first compression model to obtain a second compression model includes:

[0026] removing channels from the first compression model one by one, and calculating the accuracy of the first compression model after each channel is removed;

[0027] Based on the accuracy, the number of channels in the first compression model is reduced to obtain a second compression model.

[0028] In some embodiments, the method further comprises:

[0029] Testing the target model based on the sample data to obtain a test result of the target model;

[0030] The target model is optimized and adjusted according to the test results.

[0031] In a second aspect, the present invention further provides a speech model compression device, the device comprising:

[0032] A score calculation module is used to perform hierarchical analysis on the speech model to be compressed and calculate the contribution score of each channel in each layer of the speech model to be compressed;

[0033] A first compression module is configured to remove channels in the speech model to be compressed whose contribution scores are lower than a preset score threshold based on the contribution scores, to obtain a first compression model;

[0034] a second compression module, configured to iteratively adjust the first compression model to reduce the number of channels in the first compression model to obtain a second compression model;

[0035] a third compression module, configured to cluster the channels in the second compression model, assign a dynamic sharing coefficient to each channel in each cluster, and obtain a third compression model;

[0036] The fourth compression module is used to obtain the energy consumption of each channel in the third compression model, and compress the third compression model again according to the energy consumption to obtain a target model.

[0037] In a third aspect, the present invention also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the speech model compression method provided in the first aspect when executing the computer program.

[0038] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the speech model compression method provided in the first aspect.

[0039] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the speech model compression method provided in the first aspect.

[0040] The beneficial effects of the present invention are:

[0041] The speech model compression method provided in the present invention first performs a hierarchical analysis on the speech model to be compressed, and calculates the contribution score of each channel in each layer of the speech model to be compressed; then, based on the contribution score, removes the channels in the speech model to be compressed whose contribution score is lower than a preset score threshold to obtain a first compression model; then iteratively adjusts the first compression model to reduce the number of channels in the first compression model to obtain a second compression model; then clusters the channels in the second compression model, assigns a dynamic sharing coefficient to each channel in each cluster to obtain a third compression model; finally, obtains the energy consumption of each channel in the third compression model, and compresses the third compression model again according to the energy consumption to obtain a target model. By scoring, iteratively adjusting, clustering and evaluating the energy consumption of each channel in the speech model to be compressed, the channels with lower importance and higher energy consumption in the speech model to be compressed are removed, so that the compressed target model can still ensure accuracy and significantly reduce the energy consumption of the speech model to be compressed.

[0042] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present invention with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A flowchart of a speech model compression method according to an embodiment of the present invention is shown;

[0044] Figure 2 A flowchart of another speech model compression method according to an embodiment of the present invention;

[0045] Figure 3 This is a structural diagram of a speech model compression device according to an embodiment of the present invention;

[0046] Figure 4 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0047] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0048] It should be noted that references to "one embodiment," "an embodiment," "an example embodiment," etc., in this specification indicate that the described embodiment may include specific features, structures, or characteristics. However, not every embodiment must include these specific features, structures, or characteristics. In addition, such references do not necessarily refer to the same embodiment. Furthermore, when specific features, structures, or characteristics are described in conjunction with an embodiment, whether or not explicitly described, it is indicated that it is within the knowledge of those skilled in the art to incorporate such features, structures, or characteristics into other embodiments.

[0049] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0050] In some embodiments, as Figure 1 As shown in FIG, a specific process of a speech model compression method is provided:

[0051] S101, performing layer-by-layer analysis on the speech model to be compressed, and calculating the contribution score of each channel in each layer of the speech model to be compressed.

[0052] Among them, the speech model to be compressed is a neural network model that needs to be compressed. The neural network model is divided into multiple layers, and each layer has multiple channels. The process of removing some channels from these channels is the process of model compression. The contribution score is a score that characterizes the degree of influence of each channel on the model output result. The higher the score, the more important the channel is, and vice versa, it means that the channel is a redundant channel.

[0053] Specifically, the contribution score of each channel may be calculated according to a preset scoring algorithm.

[0054] Optionally, the speech model to be compressed may be analyzed hierarchically to obtain channel attributes of each channel in each layer of the speech model to be compressed; and the importance of each channel may be calculated based on the channel attributes to obtain a contribution score of each channel.

[0055] Among them, channel attributes include the weight, activation value and computational load indicators of each channel.

[0056] Specifically, for each channel, the higher the weight, activation value, and computational index of the channel, the higher the score of the channel, and vice versa. Therefore, based on the preset weight values ​​of weight, activation value, and computational index, the weight, activation value, and computational index of each channel can be weighted and summed to obtain the contribution score of each channel.

[0057] S102: Based on the contribution scores, channels with contribution scores lower than a preset score threshold in the speech model to be compressed are removed to obtain a first compression model.

[0058] Specifically, the preset scoring threshold is set manually and can be set according to the compression degree requirement. When the compression requirement is large, the preset scoring threshold can be increased. When the compression requirement is small, the preset scoring threshold can be appropriately lowered. Channels with contribution scores lower than the preset scoring threshold are removed from the speech model to be compressed, and channels with contribution scores greater than or equal to the preset scoring threshold are retained, thus obtaining the first compression model.

[0059] S103: Iteratively adjust the first compression model to reduce the number of channels in the first compression model to obtain a second compression model.

[0060] Specifically, the influence of each channel in the first compression model on the accuracy of the output result of the first compression model can be tested in turn. When a certain channel has no influence on the accuracy of the output result of the first compression model, or the influence is small, the channel can be removed from the first compression model to obtain the second compression model.

[0061] Optionally, the second compression model can be obtained by removing channels in the first compression model one by one and calculating the accuracy of the first compression model after each channel is removed; based on the accuracy, reducing the number of channels in the first compression model to obtain the second compression model.

[0062] Specifically, without removing the channel, the original accuracy of the first compression model is tested, and then the channels in the first compression model are removed one by one, and then the accuracy of the first compression model after each channel is removed is tested again (for example, the first channel is first removed, and then the accuracy of the first compression model is tested, and then the first channel is restored, and then the second channel is removed, and then the accuracy of the first compression model is tested, and so on). For each channel, if the accuracy of the first compression model does not change or the accuracy is improved after the channel is removed, the channel is directly removed. If the accuracy of the first compression model after the channel is removed decreases slightly compared with the original accuracy, but the decrease is lower than the preset amplitude threshold, the channel is directly removed. If the accuracy of the first compression model after the channel is removed decreases significantly compared with the original accuracy, and the decrease is greater than or equal to the preset amplitude threshold, the channel is retained to finally obtain the second compression model.

[0063] S104 , clustering the channels in the second compression model, allocating a dynamic sharing coefficient to the channels in each cluster, and obtaining a third compression model.

[0064] Optionally, a clustering algorithm is used to divide the channels in the second compression model into multiple clusters; for each cluster, the cluster center is used as a sharing weight, and a dynamic sharing coefficient is allocated to each channel in each cluster to obtain a third compression model.

[0065] Specifically, there are multiple channels in a neural network model, and the functions of some channels are the same or similar. These channels with similar functions can be classified into one category. For each cluster, the cluster center is calculated as the sharing weight, and a dynamic sharing coefficient is assigned to each channel, so that the diversity of channel characteristics is retained during the sharing process. The generation strategy of the dynamic sharing coefficient is integrated into the fine-tuning training, the back propagation algorithm is modified, and the sharing coefficient is updated in real time to ensure global optimization. The dynamic sharing coefficient is finally output and applied to the second compression model to obtain the third compression model. The obtained third compression model greatly reduces the number of parameters while ensuring that information transmission is not affected by excessive sharing.

[0066] Optionally, the method of allocating dynamic sharing coefficients to each channel in each cluster may also be: calculating the cosine similarity between each channel and the cluster center; and calculating the dynamic sharing coefficients of each channel based on the cosine similarity and a preset accuracy sensitivity factor.

[0067] Specifically, the cosine similarity between each channel and the cluster center can be calculated using the following formula (1):

[0068] ;

[0069] in, is the cosine similarity, Express the channel weight, Represents the cluster center.

[0070] Then, the dynamic sharing coefficient of each channel is calculated based on the following formula (2):

[0071] ;

[0072] in, is the cosine similarity, is the preset accuracy sensitivity factor, n is the number of channels, is the dynamic sharing coefficient.

[0073] S105 , obtaining energy consumption of each channel in the third compression model, and compressing the third compression model again according to the energy consumption to obtain a target model.

[0074] Specifically, a hardware energy consumption evaluation tool may be used to monitor the energy consumption of the third compression model in real time, and channels with energy consumption higher than an energy consumption threshold may be removed to obtain a target model.

[0075] Optionally, the method for compressing the third compression model to obtain the target model can also be: monitoring the energy consumption of each channel in the third compression model in real time, and calculating the energy consumption score of each channel based on the energy consumption; performing weighted summation on the contribution score and the energy consumption score to obtain a comprehensive score; and compressing the third compression model again based on the comprehensive score to obtain the target model.

[0076] Specifically, a hardware energy consumption assessment tool is used to monitor the energy consumption of the third compression model in real time, determining the energy consumption of each channel. This energy consumption score is then calculated for each channel (higher energy consumption, lower scores). The contribution score and energy consumption score are then weighted and summed (with pre-set weights) to obtain a comprehensive score. Channels with a comprehensive score below a comprehensive score threshold are removed from the third compression model to obtain the target model. A lower comprehensive score indicates a channel with higher energy consumption and greater redundancy, which has little impact on model prediction accuracy. The resulting target model reduces overall energy consumption while maintaining accuracy.

[0077] The speech model compression method in the above embodiment first performs a hierarchical analysis on the speech model to be compressed, and calculates the contribution score of each channel in each layer of the speech model to be compressed; then, based on the contribution score, removes the channels in the speech model to be compressed whose contribution score is lower than a preset score threshold to obtain a first compression model; then iteratively adjusts the first compression model to reduce the number of channels in the first compression model to obtain a second compression model; then clusters the channels in the second compression model, assigns a dynamic sharing coefficient to each channel in each cluster, and obtains a third compression model; finally, obtains the energy consumption of each channel in the third compression model, and compresses the third compression model again based on the energy consumption to obtain a target model. By scoring, iteratively adjusting, clustering, and evaluating the energy consumption of each channel in the speech model to be compressed, channels with lower importance and higher energy consumption in the speech model to be compressed are removed, so that the compressed target model can still ensure accuracy and significantly reduce the energy consumption of the speech model to be compressed.

[0078] In another embodiment, in order to further increase the accuracy of the target model, the target model may be tested based on sample data to obtain a test result of the target model; and the target model may be optimized and adjusted according to the test result.

[0079] Among them, the sample data includes input data and control data. The input data is input into the target model, and the target model will output the corresponding predicted data. Based on the difference between the predicted data and the control data, the parameters of the target model are adjusted until the difference between the predicted data and the control data meets the preset difference range. The optimized target model is then exported to the format of AP-level, embedded or extremely low-power chip, which completes the compression of the model. The compressed model not only ensures accuracy, but also greatly reduces power consumption, computing power and storage space, thereby reducing the conditions for model deployment.

[0080] In order to more comprehensively demonstrate this solution, this embodiment provides an optional method for compressing a speech model, such as Figure 2 As shown:

[0081] S201 , performing layer-by-layer analysis on the speech model to be compressed to obtain channel attributes of each channel in each layer of the speech model to be compressed.

[0082] S202: Calculate the importance of each channel based on the channel attributes to obtain a contribution score of each channel.

[0083] S203: Based on the contribution scores, remove channels in the speech model to be compressed whose contribution scores are lower than a preset score threshold to obtain a first compression model.

[0084] S204: Remove channels in the first compression model one by one, and calculate the accuracy of the first compression model after each channel is removed.

[0085] S205 , based on the accuracy, reducing the number of channels in the first compression model to obtain a second compression model.

[0086] S206: Divide each channel in the second compression model into multiple clusters using a clustering algorithm.

[0087] S207 : For each cluster, use the cluster center as a sharing weight, and allocate a dynamic sharing coefficient to each channel in each cluster to obtain a third compression model.

[0088] The allocating a dynamic sharing coefficient to each channel in each cluster includes: calculating the cosine similarity between each channel and the cluster center; and calculating the dynamic sharing coefficient of each channel based on the cosine similarity and a preset accuracy sensitivity factor.

[0089] S208 , monitoring the energy consumption of each channel in the third compression model in real time, and calculating an energy consumption score of each channel according to the energy consumption.

[0090] S209: Perform weighted summation on the contribution score and the energy consumption score to obtain a comprehensive score.

[0091] S210: compress the third compression model again according to the comprehensive score to obtain a target model.

[0092] S211, testing the target model based on the sample data to obtain a test result of the target model.

[0093] S212, optimizing and adjusting the target model according to the test results.

[0094] The specific process of the above S201-S212 can be found in the description of the above method embodiment. The implementation principle and technical effects are similar and will not be repeated here.

[0095] Based on the same inventive concept, embodiments of the present application also provide a speech model compression device for implementing the aforementioned speech model compression method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations in one or more speech model compression device embodiments provided below can be found in the aforementioned limitations on the speech model compression method and will not be further elaborated here.

[0096] In one embodiment, Figure 3 As shown, a speech model compression device is provided, the device comprising:

[0097] The score calculation module 30 is used to perform hierarchical analysis on the speech model to be compressed and calculate the contribution score of each channel in each layer of the speech model to be compressed.

[0098] The first compression module 31 is configured to remove channels in the speech model to be compressed whose contribution scores are lower than a preset score threshold based on the contribution scores, so as to obtain a first compression model.

[0099] The second compression module 32 is configured to iteratively adjust the first compression model to reduce the number of channels in the first compression model to obtain a second compression model.

[0100] The third compression module 33 is configured to cluster the channels in the second compression model, allocate a dynamic sharing coefficient to the channels in each cluster, and obtain a third compression model.

[0101] The fourth compression module 34 is configured to obtain the energy consumption of each channel in the third compression model, and compress the third compression model again according to the energy consumption to obtain a target model.

[0102] The model optimization module 35 is configured to test the target model based on sample data to obtain a test result of the target model; and optimize and adjust the target model according to the test result.

[0103] In another embodiment, the above Figure 3The third compression module 33 is specifically configured to: use a clustering algorithm to divide the channels in the second compression model into multiple clusters; for each cluster, use the cluster center as a sharing weight, and assign a dynamic sharing coefficient to each channel in each cluster to obtain a third compression model. Assigning a dynamic sharing coefficient to each channel in each cluster includes: calculating a cosine similarity between each channel and the cluster center; and calculating the dynamic sharing coefficient for each channel based on the cosine similarity and a preset accuracy sensitivity factor.

[0104] In another embodiment, the above Figure 3 The fourth compression module 34 is specifically used to: monitor the energy consumption of each channel in the third compression model in real time, and calculate the energy consumption score of each channel based on the energy consumption; perform weighted summation of the contribution score and the energy consumption score to obtain a comprehensive score; and compress the third compression model again according to the comprehensive score to obtain a target model.

[0105] In another embodiment, the above Figure 3 The score calculation module 30 is specifically used to: perform hierarchical analysis on the speech model to be compressed to obtain the channel attributes of each channel in each layer of the speech model to be compressed; calculate the importance of each channel based on the channel attributes to obtain the contribution score of each channel.

[0106] In another embodiment, the above Figure 3 The second compression module 32 is specifically used to: remove channels in the first compression model one by one, and calculate the accuracy of the first compression model after each channel is removed; based on the accuracy, reduce the number of channels in the first compression model to obtain a second compression model.

[0107] The present application also provides an electronic device, in some embodiments, referring to Figure 4 As shown, the electronic device 700 includes an input unit 710, a memory 720, a processor 730, and an output unit 740. The memory 720 stores program instructions that can be executed on the processor 730. The processor 730 calls the program instructions to execute the speech model compression method and / or technical solution based on the above-mentioned embodiments. The electronic device 700 can be a mobile terminal device such as a mobile phone or a computer.

[0108] In addition, an embodiment of the present application further provides a computer-readable storage medium for storing a computer program for executing a speech model compression method. For example, computer program instructions, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. The program instructions for calling the method of the present application may be stored in a fixed or removable storage medium, and / or transmitted via a data stream in a broadcast or other signal-carrying media and / or stored in a storage medium that operates according to the program instructions.

[0109] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be implemented using a general-purpose computing device. They can be concentrated on a single computing device or distributed across a network consisting of multiple computing devices. Alternatively, they can be implemented using program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0110] The various technical features of the above embodiments can be arbitrarily integrated. To make the description concise, not all possible integrations of the various technical features in the above embodiments are described. However, as long as there is no contradiction in the integration of these technical features, they should be considered to be within the scope of this specification.

[0111] The above embodiments merely illustrate several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent. It should be noted that a person skilled in the art would be able to make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the patent for this invention shall be determined by the appended claims.

Claims

1. A speech model compression method, characterized in that: The method comprises: Performing layered analysis on the speech model to be compressed, and calculating the contribution score of each channel in each layer of the speech model to be compressed; Based on the contribution score, removing channels in the speech model to be compressed whose contribution scores are lower than a preset score threshold, to obtain a first compression model; Iteratively adjusting the first compression model to reduce the number of channels in the first compression model to obtain a second compression model; Clustering the channels in the second compression model, and assigning a dynamic sharing coefficient to the channels in each cluster to obtain a third compression model; The energy consumption of each channel in the third compression model is obtained, and the third compression model is compressed again according to the energy consumption to obtain a target model.

2. The speech model compression method according to claim 1, wherein Clustering the channels in the second compression model and assigning a dynamic sharing coefficient to the channels in each cluster to obtain a third compression model, including: using a clustering algorithm to divide each channel in the second compression model into a plurality of clusters; For each cluster, the cluster center is used as the sharing weight, and a dynamic sharing coefficient is allocated to each channel in each cluster to obtain the third compression model.

3. The speech model compression method according to claim 2, wherein: Dynamic sharing coefficients are assigned to each channel in each cluster, including: Calculating the cosine similarity between each channel and the cluster center; Based on the cosine similarity and a preset precision sensitivity factor, a dynamic sharing coefficient of each channel is calculated.

4. The speech model compression method according to claim 1, wherein: Obtaining energy consumption of each channel in the third compression model, and compressing the third compression model again according to the energy consumption to obtain a target model, including: monitoring the energy consumption of each channel in the third compression model in real time, and calculating an energy consumption score of each channel based on the energy consumption; Performing a weighted summation on the contribution score and the energy consumption score to obtain a comprehensive score; The third compression model is compressed again according to the comprehensive score to obtain a target model.

5. The speech model compression method according to claim 1, wherein: Performing a hierarchical analysis on the speech model to be compressed and calculating the contribution score of each channel in each layer of the speech model to be compressed, including: Performing layered analysis on the speech model to be compressed to obtain channel attributes of each channel in each layer of the speech model to be compressed; The importance of each channel is calculated based on the channel attributes to obtain a contribution score of each channel.

6. The speech model compression method according to claim 1, wherein: Iteratively adjusting the first compression model to reduce the number of channels in the first compression model to obtain a second compression model, comprising: removing channels from the first compression model one by one, and calculating the accuracy of the first compression model after each channel is removed; Based on the accuracy, the number of channels in the first compression model is reduced to obtain a second compression model.

7. The speech model compression method according to any one of claims 1 to 6, wherein: The method further comprises: Testing the target model based on the sample data to obtain a test result of the target model; The target model is optimized and adjusted according to the test results.

8. A speech model compression device, characterized in that: The device comprises: A score calculation module is used to perform hierarchical analysis on the speech model to be compressed and calculate the contribution score of each channel in each layer of the speech model to be compressed; A first compression module is configured to remove channels in the speech model to be compressed whose contribution scores are lower than a preset score threshold based on the contribution scores, to obtain a first compression model; a second compression module, configured to iteratively adjust the first compression model to reduce the number of channels in the first compression model to obtain a second compression model; a third compression module, configured to cluster the channels in the second compression model, assign a dynamic sharing coefficient to each channel in each cluster, and obtain a third compression model; The fourth compression module is used to obtain the energy consumption of each channel in the third compression model, and compress the third compression model again according to the energy consumption to obtain a target model.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the speech model compression method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the speech model compression method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Deep learning model compression method and related equipment

    CN113128660A

  • Adaptive quantization compression method and system of voice model and electronic equipment

    CN116524941A