Data processing method, apparatus, device, and medium

By performing multi-rate pruning and performance evaluation on candidate network layers of neural networks, the problem of poor network performance after pruning is solved, and high-precision and efficient data processing is achieved.

CN117114073BActive Publication Date: 2026-02-03BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210524932.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-13
Publication Date
2026-02-03
Estimated Expiration
2042-05-13

AI Technical Summary

Technical Problem

In existing technologies, pruned neural networks have poor processing performance, leading to unreliable data processing results.

Method used

By pruning candidate network layers in the original neural network according to multiple preset pruning rates, multiple sub-neural networks are obtained. The performance indicators of each sub-neural network are evaluated through a test dataset. The parameter redundancy of the candidate network layers under different pruning rates is analyzed, and a suitable pruning rate is selected to prune the target network layer.

Benefits of technology

This improves the high precision of neural networks and the efficiency and accuracy of data processing, ensuring the reliability of network performance after pruning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117114073B_ABST
    Figure CN117114073B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to a data processing method, device, equipment and medium, wherein the method comprises: pruning candidate network layers in an original neural network according to a plurality of preset pruning rates to obtain a plurality of sub-neural networks; inputting a test data set into the original neural network and the plurality of sub-neural networks for processing; obtaining a reference performance index corresponding to the original neural network and a plurality of test performance indexes corresponding to the plurality of sub-neural networks based on output data sets of the original neural network and the plurality of sub-neural networks; and analyzing parameter redundancy of candidate network layers in the original neural network under different pruning rates according to performance losses of the plurality of test performance indexes relative to the reference performance index. The above technical solution is adopted to obtain parameter redundancy based on actual test data sets, improve the reliability of subsequent pruning, thereby improving the high precision of the neural network after pruning, and improving the efficiency and accuracy of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and particularly relates to a data processing method and device, equipment and medium. BACKGROUND

[0002] The application of artificial intelligence technology based on neural networks on mobile terminals has led to the rapid development of intelligent mobile terminals to meet various application needs of people. Among them, the main implementation technology includes data processing in application fields such as video processing language recognition, image recognition and understanding, and game vision based on trained neural network model data. Considering that most convolutional neural networks have a certain degree of parameter redundancy, the pruning method is used to remove redundant convolution kernels or neurons on the convolution kernels in each layer of the neural network, so as to obtain a neural network with smaller computing resources and storage resources on the mobile terminal.

[0003] In the related art, the pruning scheme causes different processing performances of the pruned network, and some pruning schemes result in relatively poor network processing performance, thereby causing unreliable results of subsequent data processing. SUMMARY

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a data processing method, device, equipment and medium.

[0005] The embodiment of the present disclosure provides a data processing method, which comprises:

[0006] The candidate network layer in the original neural network is pruned according to a plurality of preset pruning rates to obtain a plurality of sub-neural networks corresponding to the plurality of pruning rates;

[0007] The test data set is input into the original neural network and a plurality of sub-neural networks for processing, and based on the output data sets of the original neural network and the plurality of sub-neural networks, a reference performance index corresponding to the original neural network and a plurality of test performance indexes corresponding to the plurality of sub-neural networks are obtained;

[0008] According to the performance loss of the plurality of test performance indexes relative to the reference performance index, the parameter redundancy of the candidate network layer parameters in the original neural network under different pruning rates is analyzed.

[0009] In an optional implementation, the method further comprises:

[0010] Obtaining a network compression requirement;

[0011] The plurality of pruning rates are set according to the network compression requirement, and the difference between the plurality of pruning rates is positively correlated with the degree of network compression.

[0012] In an optional implementation, the pruning processing according to the plurality of preset pruning rates respectively to obtain the plurality of sub neural networks includes:

[0013] The weight distribution in the candidate network layer is subjected to norm calculation.

[0014] If it is determined according to the calculation result that the weight distribution belongs to a candidate network layer of a preset first region distribution, a preset first pruner is used for pruning processing, wherein the norm interval of the first region distribution is greater than a preset interval threshold, and the minimum value of the norm of the first region distribution is zero.

[0015] If it is determined according to the calculation result that the weight distribution belongs to a candidate network layer of a preset second region distribution, a preset second pruner is used for pruning processing, wherein the norm variance of the second region distribution is greater than a preset variance threshold, and the minimum value of the norm of the second region distribution is not zero.

[0016] In an optional implementation, the test data set includes multimedia data, wherein the multimedia data is one or a combination of multiple of audio data, video data and image data.

[0017] In an optional implementation, the processing of the test data set in the original neural network and the plurality of sub neural networks respectively, based on the output data set of the original neural network and the plurality of sub neural networks, obtains the reference performance index corresponding to the original neural network, and the plurality of test performance indexes corresponding to the plurality of sub neural networks, includes:

[0018] The test image data set is input into the original neural network and each of the sub neural networks respectively for processing, based on the pixel processing result between the output image data set of the original neural network and the plurality of sub neural networks and the test image data set, the peak signal-to-noise ratio corresponding to the original neural network is obtained as the reference performance index, and the peak signal-to-noise ratio corresponding to each of the sub neural networks is obtained as the test performance index.

[0019] Or,

[0020] The test audio data set is input into the original neural network and each of the sub neural networks respectively for processing, based on the comparison result between the output recognition text data set of the original neural network and the plurality of sub neural networks and the labeled text of the test audio data set, the accuracy corresponding to the original neural network is obtained as the reference performance index, and the accuracy corresponding to each of the sub neural networks is obtained as the test performance index.

[0021] In one optional implementation, the method further includes:

[0022] Detect whether there are associated network layers with channel-dependent features in the original neural network, wherein the channel-dependent features include: adjacent network layers have data operations of addition and / or multiplication;

[0023] If the associated network layer exists, all associated network layers with channel dependency characteristics are set as a candidate network layer.

[0024] In one optional implementation, the method further includes:

[0025] Based on the parameter redundancy of the candidate network layer parameters under different pruning rates, the target network layer to be pruned in the original neural network is determined, so as to generate the target neural network to process the target dataset.

[0026] In one optional implementation, determining the target network layer to be pruned in the original neural network based on the parameter redundancy of the candidate network layer parameters under different pruning rates includes:

[0027] Based on the performance loss of the multiple test performance metrics relative to the reference performance metrics, plot the performance metric curves of the candidate network layer and the multiple pruning rates;

[0028] Calculate the slope of each pruning rate in the performance index curve, and determine the maximum pruning rate of the candidate network layer based on the slope change, wherein the performance index corresponding to the maximum pruning rate represents the maximum parameter redundancy of the candidate network layer parameters;

[0029] The target network layer to be pruned in the original neural network is determined based on the target pruning rate and the maximum pruning rate corresponding to the maximum parameter redundancy of each candidate network layer.

[0030] This disclosure also provides a data processing apparatus, the apparatus comprising:

[0031] The pruning module is used to prune candidate network layers in the original neural network according to multiple preset pruning rates to obtain multiple corresponding sub-neural networks.

[0032] The processing and acquisition module is used to input the test dataset into the original neural network and the multiple sub-neural networks respectively for processing, and based on the output datasets of the original neural network and the multiple sub-neural networks, to obtain the reference performance index corresponding to the original neural network and the multiple test performance indexes corresponding to the multiple sub-neural networks;

[0033] The determination module is used to analyze the parameter redundancy of candidate network layer parameters in the original neural network under different pruning rates based on the performance loss of the multiple test performance indicators relative to the reference performance indicator.

[0034] This disclosure also provides an electronic device, the electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the data processing method provided in this disclosure.

[0035] This disclosure also provides a computer-readable storage medium storing a computer program for performing the data processing method provided in this disclosure.

[0036] This disclosure also provides a computer program product, which includes a computer program / instructions that, when executed by a processor, implement the method described above.

[0037] Compared with the prior art, the technical solution provided in this disclosure has the following advantages: The data processing solution provided in this disclosure prunes candidate network layers in the original neural network according to multiple preset pruning rates to obtain multiple corresponding sub-neural networks. Test datasets are input into the original neural network and the multiple sub-neural networks for processing. Based on the output datasets of the original neural network and the multiple sub-neural networks, reference performance indicators corresponding to the original neural network and multiple test performance indicators corresponding to the multiple sub-neural networks are obtained. Based on the performance loss of the multiple test performance indicators relative to the reference performance indicators, the parameter redundancy of the candidate network layer parameters in the original neural network under different pruning rates is analyzed. By adopting the above technical solution, parameter redundancy is obtained based on the actual test dataset, improving the reliability of subsequent pruning, thereby improving the high accuracy of the neural network after pruning and improving the efficiency and accuracy of data processing. Attached Figure Description

[0038] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0039] Figure 1 A flowchart illustrating a data processing method provided in an embodiment of this disclosure;

[0040] Figure 2 A flowchart illustrating another data processing method provided in an embodiment of this disclosure;

[0041] Figure 3 A schematic diagram illustrating the relationship between pruning rate and performance indicators provided in an embodiment of this disclosure;

[0042] Figure 4 A schematic diagram illustrating another relationship between pruning rate and performance indicators provided in an embodiment of this disclosure;

[0043] Figure 5 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of the present disclosure;

[0044] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation

[0045] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0046] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0047] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0048] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0049] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0050] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0051] Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of the present disclosure. The method can be executed by a data processing device, which can be implemented using software and / or hardware, and is generally integrated into an electronic device. Figure 1 As shown, the method includes:

[0052] Step 101: Prune the candidate network layers in the original neural network according to multiple preset pruning rates to obtain the corresponding multiple sub-neural networks.

[0053] To ensure model performance, there may be a certain amount of parameter redundancy in neural networks. Pruning can remove redundant convolutional kernels (i.e., structured pruning) or neurons on convolutional kernels (i.e., unstructured pruning) in each convolutional layer of the neural network while maintaining the accuracy of the neural network. This results in a "slimmed-down model" with less computational and storage resources, accelerates the inference process of the neural network, and facilitates the edge deployment of the neural network.

[0054] However, different pruning schemes result in varying network processing performance after pruning, with some schemes leading to poor performance and unreliable data processing results. This embodiment addresses the problem of unreliable data processing results caused by pruning schemes by including:

[0055] In this embodiment, the original neural network is a neural network model that needs to be pruned. This neural network model can be obtained through training, and it can be set according to the application scenario and / or user needs, etc. This embodiment does not impose any restrictions.

[0056] In this embodiment of the disclosure, the relative importance of all neurons in the original neural network is ranked by a specific evaluation criterion, and then relatively unimportant neurons in the network are pruned according to a preset pruning rate to achieve the purpose of compressing the network model.

[0057] In this embodiment of the disclosure, candidate network layers in the original neural network are pruned according to multiple preset pruning rates to obtain multiple corresponding sub-neural networks. The original neural network includes multiple candidate network layers. For example, if the original neural network includes four convolutional layers, namely Conv1, Conv2, Conv3, and Conv4, then Conv1, Conv2, Conv3, and Conv4 can all be used as candidate network layers of the original neural network, or Conv1 and Conv2 can be used as candidate network layers. The specific settings are selected according to the application scenario.

[0058] In this process, the pruning rate is set in advance according to the importance of each candidate network layer. The pruning rate refers to the percentage of convolutional kernels pruned from the candidate network layer. For example, if candidate network layer A has N convolutional kernels and the pruning rate is p%, then candidate network layer A needs to prune N multiplied by p% of the convolutional kernels.

[0059] In this embodiment of the disclosure, each candidate network layer is pre-set with multiple different pruning rates. After pruning each candidate network layer according to the pre-set multiple different pruning rates, multiple sub-neural networks corresponding to each candidate network layer can be obtained. For example, ten pruning rates are pre-set, each pruning rate differing by 10%, namely 10%, 20%, 30% up to 100%. Based on the ten different pruning rates, the candidate network layer, such as convolutional layer 1 Conv1, is processed to obtain ten sub-neural networks corresponding to convolutional layer 1 Conv1.

[0060] In this embodiment, there are multiple ways to obtain multiple sub-neural networks by performing pruning processing according to multiple preset pruning rates, which can be selected according to the application scenario, etc. This embodiment does not limit the method. Examples are illustrated below:

[0061] In one optional implementation, the norm of the weight distribution in the candidate network layer is calculated. If the calculation result determines that the weight distribution belongs to a candidate network layer with a preset first region distribution, then a preset first pruner is used for pruning. The norm interval of the first region distribution is greater than a preset interval threshold, and the minimum norm value of the first region distribution is zero. If the calculation result determines that the weight distribution belongs to a candidate network layer with a preset second region distribution, then a preset second pruner is used for pruning. The norm variance of the second region distribution is greater than a preset variance threshold, and the minimum norm value of the second region distribution is not zero.

[0062] In another optional implementation, the candidate network layers of the original neural network are pruned directly by calling the relevant pruning tool according to multiple preset pruning rates to obtain multiple sub-neural networks.

[0063] It should be noted that each time a candidate network layer is processed according to a preset pruning rate, the other candidate network layers remain unchanged, resulting in a sub-neural network.

[0064] Step 102: Input the test dataset into the original neural network and multiple sub-neural networks respectively for processing. Based on the output datasets of the original neural network and multiple sub-neural networks, obtain the reference performance index corresponding to the original neural network and multiple test performance indexes corresponding to the multiple sub-neural networks.

[0065] In this embodiment of the disclosure, the test dataset can be selected and set according to the application scenario, such as multimedia data, which is one or more combinations of audio data, video data, and image data.

[0066] The reference performance index refers to the performance value obtained by analyzing the output dataset of the original neural network after processing the test dataset, while the test performance index refers to the performance value obtained by analyzing the output dataset of the sub-neural network after processing the test dataset after pruning.

[0067] Specifically, the precision of the loss when the sub-neural network after pruning at different pruning rates processes the test dataset varies, i.e., the performance loss is different. For example, the greater the precision of the loss when the sub-neural network after pruning the candidate network layer at a pruning rate of 30%, i.e., the greater the performance loss, indicates that the parameter redundancy of the candidate network layer is relatively small at a pruning rate of 30%.

[0068] In this embodiment of the disclosure, the reference performance metrics and test performance metrics obtained from test datasets in different scenarios are different. Therefore, the test datasets are input into the original neural network and multiple sub-neural networks for processing. Based on the output datasets of the original neural network and multiple sub-neural networks, there are various ways to obtain the reference performance metrics corresponding to the original neural network and the multiple test performance metrics corresponding to the multiple sub-neural networks. These methods can be selected according to the application scenario, etc. This embodiment does not impose any restrictions. Examples are illustrated below:

[0069] In one alternative implementation, such as in an image quality enhancement scenario, the test image dataset is input into the original neural network and each sub-neural network for processing. Based on the pixel processing results between the output image datasets of the original neural network and multiple sub-neural networks and the test image dataset, the peak signal-to-noise ratio corresponding to the original neural network is obtained as a reference performance indicator, and the peak signal-to-noise ratio corresponding to each sub-neural network is obtained as a test performance indicator.

[0070] In another alternative implementation, such as in a speech recognition scenario, the test audio dataset is input into the original neural network and each sub-neural network for processing. Based on the comparison results between the recognized text dataset and the labeled text of the test audio dataset, which are the outputs of the original neural network and multiple sub-neural networks, the accuracy corresponding to the original neural network is obtained as a reference performance indicator, and the accuracy corresponding to each sub-neural network is obtained as a test performance indicator.

[0071] Step 103: Based on the performance loss of multiple test performance indicators relative to the reference performance indicators, analyze the parameter redundancy of candidate network layer parameters in the original neural network under different pruning rates.

[0072] In this embodiment of the disclosure, for each candidate network layer, a number of different pruning rates are set to obtain a number of sub-neural networks, and a number of sub-neural networks correspond to a number of test performance indicators. Therefore, by calculating the performance loss of multiple test performance indicators relative to the reference performance indicator, the parameter redundancy of the candidate network layer parameters in the original neural network under different pruning rates can be obtained.

[0073] Specifically, based on the performance loss of multiple test performance indicators relative to reference performance indicators, performance indicator curves corresponding to the candidate network layer and the multiple pruning rates are plotted, and the parameter redundancy of the candidate network layer parameters under different pruning rates is analyzed based on the performance indicator curves.

[0074] The data processing scheme provided in this disclosure prunes candidate network layers in the original neural network according to multiple preset pruning rates to obtain corresponding sub-neural networks. Test datasets are input into the original neural network and the multiple sub-neural networks for processing. Based on the output datasets of the original neural network and the multiple sub-neural networks, a reference performance index corresponding to the original neural network and multiple test performance indices corresponding to the multiple sub-neural networks are obtained. The parameter redundancy of the candidate network layer parameters in the original neural network under different pruning rates is analyzed based on the performance loss of the multiple test performance indices relative to the reference performance index. By adopting the above technical solution, parameter redundancy is obtained based on actual datasets, improving the reliability of subsequent pruning, thereby improving the high accuracy of the neural network after pruning and enhancing the efficiency and accuracy of data processing.

[0075] In some embodiments, the target network layer to be pruned in the original neural network is determined based on the parameter redundancy of the candidate network layer parameters under different pruning rates, so as to generate a target neural network to process the target dataset.

[0076] The target network layer refers to the target network layer that has been pruned after the pruning rate of the candidate network layers has been readjusted based on the parameter redundancy, and the target neural network refers to the neural network after the target network layer in the original neural network has been pruned.

[0077] In this embodiment, there are multiple ways to determine the target network layer to be pruned in the original neural network based on the parameter redundancy of the candidate network layer parameters under different pruning rates. The appropriate method can be selected based on the application scenario, etc. This embodiment does not impose any limitations. Examples are illustrated below:

[0078] In one optional implementation, based on the performance loss of multiple test performance indicators relative to reference performance indicators, performance indicator curves corresponding to candidate network layers and multiple pruning rates are plotted. The slope of each pruning rate in the performance indicator curve is calculated. The maximum pruning rate of the candidate network layer is determined based on the slope change. The performance indicator corresponding to the maximum pruning rate represents the maximum parameter redundancy of the candidate network layer parameters. Based on the target pruning rate and the maximum pruning rate corresponding to the maximum parameter redundancy of each candidate network layer, the target network layer to be pruned in the original neural network is determined.

[0079] In another alternative implementation, the maximum pruning rate of each candidate network layer is determined based on parameter redundancy, and the target network layer to be pruned in the original neural network is determined directly based on the maximum pruning rate.

[0080] Based on the description of the above embodiments, different application scenarios have different compression requirements for the network, resulting in different pruning rates. Furthermore, it is necessary to attempt pruning at different pruning rates for candidate network layers. The accuracy of the test dataset after pruning is used as the parameter redundancy of the candidate network layer under different pruning rates. Therefore, different norm criteria are needed to evaluate and select different pruners for pruning. In addition, the number of channels between different candidate network layers in the original neural network may be dependent. The pruning of different candidate network layers with channel dependencies needs to be correlated to further improve processing efficiency.

[0081] This disclosure embodiment analyzes the parameter redundancy of candidate network layers by examining the performance loss between the test performance metrics obtained by the sub-neural network processing the test dataset at different pruning rates and the reference performance metrics obtained by the original neural network processing the test dataset. This yields the relative parameter redundancy of a specified candidate network layer in the original neural network at a specified pruning rate. Furthermore, this parameter redundancy is calculated based on the actual test dataset, ensuring high reliability. In addition, to further improve reliability during the parameter redundancy calculation process, different pruners are selected for layers with different weight distributions. Simultaneously, for candidate network layers with channel dependencies, the candidate network layers to be pruned are calculated comprehensively for each pruning rate. Then, the parameter redundancy of each candidate network layer is calculated separately. Finally, the average parameter redundancy of these layers is used as the parameter redundancy of all layers, achieving channel-dependent parameter redundancy calculation. The following section combines... Figure 2 Provide a detailed description.

[0082] Specifically, Figure 2 This is a flowchart illustrating another data processing method provided in this embodiment of the present disclosure. This embodiment further optimizes the above data processing method based on the previous embodiments. Figure 2 As shown, the method includes:

[0083] Step 201: Obtain network compression requirements and set multiple pruning rates based on these requirements. The difference between the multiple pruning rates is positively correlated with the network compression degree.

[0084] Specifically, in the parameter redundancy analysis process, it is necessary to try pruning the candidate network layer at different pruning rates, and use the accuracy of the test dataset after pruning as the parameter redundancy of the candidate network layer under different pruning rates.

[0085] In the embodiments of this disclosure, different application scenarios have different requirements for network compression. For example, audio processing platforms have relatively high requirements for network compression, so they need to set more pruning rates to try pruning, in order to obtain more accurate parameter redundancy, thereby further improving the processing accuracy of the final target neural network. On the other hand, image processing platforms have relatively low requirements for network compression, so they need to set relatively fewer pruning rates to try pruning, in order to improve the adjustment efficiency of the original neural network.

[0086] Among them, the data difference between multiple pruning rates is positively correlated with the network compression degree. That is, the greater the difference between multiple pruning rates, the greater the network compression degree; the smaller the difference between multiple pruning rates, the smaller the network compression degree.

[0087] Step 202: Detect whether there are associated network layers with channel-dependent features in the original neural network. The channel-dependent features include: adjacent network layers have data operations of addition and / or multiplication. If associated network layers exist, set all associated network layers with channel-dependent features as a candidate network layer.

[0088] Specifically, since the number of channels between candidate network layers in the original neural network may be dependent, the pruning of associated network layers with channel dependency characteristics needs to be aligned to achieve the actual acceleration effect. Therefore, when analyzing the pruning sensitivity of associated network layers, all associated network layers should be set as a candidate network layer, so associated network layers with channel dependency characteristics have the same parameter redundancy.

[0089] In this embodiment, a convolutional kernel with a pruning rate of p% is selected for the nth candidate network layer according to a certain convolutional kernel evaluation criterion, that is, N*p% of the convolutional kernels are pruned. All other layers of the original neural network remain unchanged. The performance of the original neural network on the test dataset is directly tested and defined as B. The pruning performance loss of the nth candidate network layer at the p% pruning rate is defined as S. The larger S is, the greater the accuracy loss caused by pruning the candidate network layer, and the greater the pruning sensitivity of the candidate network layer. The more sensitive the pruning, the more important the candidate network layer contains. Therefore, it can be considered that the parameter redundancy of the candidate network layer is smaller. Thus, parameter redundancy and pruning sensitivity are negatively correlated.

[0090] In this embodiment of the disclosure, multiple performance metrics are the parameter redundancy corresponding to candidate network layers and multiple pruning rates, including: obtaining the number of all associated network layers with channel dependency features in the candidate network layers, averaging multiple performance metrics with respect to the number of layers, and obtaining the parameter redundancy corresponding to each associated network layer and multiple pruning rates.

[0091] For example, suppose there are two layers, Conv1 and Conv2, with channel-dependent characteristics. To analyze the parameter redundancy of Conv1 and Conv2 at a pruning rate of p%, firstly, N*p% of convolutional kernels to be pruned are selected from both Conv1 and Conv2. Then, the first parameter redundancy and the second parameter redundancy are calculated based on the pruning of these convolutional kernels in Conv1. Finally, the average of the first parameter redundancy and the second parameter redundancy is calculated as the parameter redundancy of Conv1 and Conv2 at a compression rate of p%.

[0092] Step 203: Calculate the norm of the weight distribution in the candidate network layer. If the calculation result determines that the weight distribution belongs to the candidate network layer of the preset first region distribution, then use the preset first pruner to perform pruning. The norm interval of the first region distribution is greater than the preset interval threshold, and the minimum norm of the first region distribution is zero.

[0093] Step 204: If the weight distribution is determined to be a candidate network layer belonging to the preset second region distribution based on the calculation results, then the preset second pruner is used for pruning, wherein the norm variance of the second region distribution is greater than the preset variance threshold, and the minimum norm value of the second region distribution is not zero.

[0094] Specifically, in the process of parameter redundancy analysis, it is necessary to prune the candidate network layer at different pruning rates, and use the accuracy of the test dataset after pruning as the parameter redundancy of the candidate network layer under different pruning rates. Therefore, pruning performance directly affects the reliability of different pruning rates.

[0095] Specifically, pruning strategies typically use L1 norm / L2 norm to evaluate the importance of convolutional kernels. Norm-based evaluation criteria usually rely on two assumptions that are not always valid: (1) the filter's norm distribution is wide and has large variance; (2) the filter's minimum norm should be very small, close to 0. Specifically, when the filter's norm deviation is very small, that is, when the filter's norm distribution is very dense, it will be difficult to find a suitable threshold to achieve the desired sparsity. At the same time, when the filter's minimum norm is very large, it indicates that all filters in the candidate network layer are very important, and in this case, selection based on norm will lose accuracy.

[0096] Therefore, in both of the above situations, the norm-based evaluation criterion becomes inapplicable. In this embodiment, before pruning, the weight distribution of the candidate network layers is first analyzed. For candidate network layers whose weight distribution conforms to a first region distribution, a preset first pruner is used for pruning, i.e., a one-shot pruning algorithm using the first norm is employed. The norm of the first region distribution is greater than a preset range and its minimum value is zero. The preset range is set according to the application scenario. For candidate network layers whose weight distribution conforms to a second region distribution, a preset second pruner is used for pruning, i.e., a one-shot pruning algorithm using a filter that prunes through the geometric median is employed. The norm variance of the second region is greater than a preset threshold and its minimum value is not zero. The preset threshold is set according to the application scenario.

[0097] Step 205: Input the test image dataset into the original neural network and each sub-neural network for processing. Based on the pixel processing results between the output image datasets of the original neural network and multiple sub-neural networks and the test image dataset, obtain the peak signal-to-noise ratio corresponding to the original neural network as a reference performance indicator, and the peak signal-to-noise ratio corresponding to each sub-neural network as a test performance indicator.

[0098] In this embodiment of the disclosure, for the scene enhancement scenario, it is necessary to enhance the image. The test dataset is a test image dataset. The test image dataset is input into the original neural network and each sub-neural network respectively for processing to obtain the output image dataset. By the pixel processing results between the output image dataset and the test image dataset, the peak signal-to-noise ratio corresponding to the original neural network is obtained as a reference performance index, and the peak signal-to-noise ratio corresponding to each sub-neural network is obtained as a test performance index.

[0099] Therefore, in image enhancement scenarios, the reference performance index corresponding to the original neural network and the test performance index corresponding to the sub-neural network are used to determine the parameter redundancy of the candidate network layer parameters in the original neural network under different pruning rates based on the performance loss of the test performance index relative to the reference performance index. Thus, the image enhancement processing of the pruned network based on this parameter redundancy has better processing efficiency and effect.

[0100] Step 206: Input the test audio dataset into the original neural network and each sub-neural network for processing. Based on the comparison results between the recognized text dataset and the labeled text of the test audio dataset, which are the outputs of the original neural network and multiple sub-neural networks, obtain the accuracy corresponding to the original neural network as a reference performance index, and the accuracy corresponding to each sub-neural network as a test performance index.

[0101] In this embodiment of the disclosure, for a speech recognition scenario, speech recognition processing is required. The test dataset is a test audio dataset. The test audio dataset is input into the original neural network and each sub-neural network for processing to obtain the recognized text dataset. By comparing the labeled text in the recognized text dataset with the labeled text in the test audio dataset, the accuracy corresponding to the original neural network is obtained as a reference performance indicator, and the accuracy corresponding to each sub-neural network is obtained as a test performance indicator.

[0102] Therefore, in speech recognition scenarios, the reference performance index corresponding to the original neural network and the test performance index corresponding to the sub-neural network are used to determine the parameter redundancy of the candidate network layer parameters in the original neural network under different pruning rates based on the performance loss of the test performance index relative to the reference performance index. Thus, the network pruned based on this parameter redundancy has better processing efficiency and effect for speech recognition processing.

[0103] Step 207: Based on the performance loss of multiple test performance indicators relative to the reference performance indicators, plot the performance indicator curves of the candidate network layer and multiple pruning rates, calculate the slope of each pruning rate in the performance indicator curves, and determine the maximum pruning rate of the candidate network layer based on the slope change. The performance indicator corresponding to the maximum pruning rate represents the maximum parameter redundancy of the candidate network layer parameters.

[0104] Step 208: Determine the target network layer to be pruned in the original neural network based on the target pruning rate and the maximum pruning rate corresponding to the maximum parameter redundancy of each candidate network layer.

[0105] In this embodiment of the disclosure, performance index curves corresponding to candidate network layers and multiple pruning rates are plotted based on parameter redundancy. That is, multiple pruning rates are used as the horizontal axis, and parameter redundancy, i.e., the performance loss of multiple test performance indicators relative to the reference performance indicator, is used as the vertical axis to plot the performance index curves. This allows the slope of each pruning rate to be obtained. The maximum pruning rate of the candidate network layer is determined based on the change in slope. For example, the pruning rate when the slope change is the largest is the maximum pruning rate of the candidate network layer. The performance index corresponding to the maximum pruning rate represents the maximum parameter redundancy corresponding to the parameters of the candidate network layer.

[0106] Furthermore, based on the target pruning rate and the maximum pruning rate corresponding to the maximum parameter redundancy of each candidate network layer, the target network layer to be pruned in the original neural network is determined, so as to generate the target neural network to process the target dataset. In other words, after determining the maximum pruning rate, the target pruning rate can be determined based on the specific scenario, and the target network layer to be pruned in the original neural network can be determined based on the maximum parameter redundancy of each candidate network layer, so as to generate the target neural network to process the target dataset. The resulting target neural network is more in line with personalized needs, further improving data processing efficiency and accuracy.

[0107] As an example, relevant tools can be used to perform performance loss analysis on specified candidate network layers of the original neural network at a preset pruning rate. The analysis principle is to perform structured pruning on the set candidate network layers at the preset pruning rate, and then process the pruned sub-neural networks on the test dataset for performance verification. The result is used as the performance loss of the candidate network layer at the current pruning rate. The analysis results are as follows: Figure 3 As shown, there are significant differences in the pruning performance loss among the candidate network layers. For some key candidate network layers, such as conv1 and conv2, the performance loss is relatively large when the pruning rate is 0.2 and 0.3, respectively. That is, conv1 has a larger performance loss when the pruning rate is 0.2, and the parameter redundancy is relatively small at this time. Similarly, conv1 has a larger performance loss when the pruning rate is 0.3, and the parameter redundancy is relatively small at this time.

[0108] For example, some layers are not very sensitive to pruning. In such cases, it may be considered to remove them from the original neural network design or increase their pruning rate. For instance, the performance of conv3 is almost unchanged when the pruning rate is between 0.1 and 0.9, meaning that the performance loss of conv3 is relatively small when the pruning rate is between 0.1 and 0.9, and the parameter redundancy of conv3 is relatively large when the pruning rate is between 0.1 and 0.9.

[0109] As another example, using an attention module to model spatial dependencies allows the original neural network to focus on more important spatial features, demonstrating superior performance. For example... Figure 4 As shown, the parameter redundancy of the attention module was analyzed. It can be seen that the parameter redundancy of the three convolutional layers c1-c3 is relatively high under various pruning rates, thus proving that it has high parameter redundancy. The three convolutional layers c1-c3 were directly reduced to one convolutional layer. Finally, after retraining the original neural network, the performance was shown to be lossless.

[0110] The data processing scheme provided in this disclosure includes: obtaining network compression requirements; setting multiple pruning rates based on these requirements, wherein the difference between the multiple pruning rates is positively correlated with the network compression degree; detecting whether there are associated network layers with channel-dependent characteristics in the original neural network, wherein channel-dependent characteristics include: adjacent network layers having data operations of addition, and / or multiplication; if associated network layers exist, setting all associated network layers with channel-dependent characteristics as a candidate network layer; calculating the norm of the weight distribution in the candidate network layer; if the calculation result determines that the weight distribution belongs to a candidate network layer of a preset first region distribution, then using a preset first pruner for pruning processing, wherein the norm interval of the first region distribution is greater than a preset interval threshold, and the minimum norm value of the first region distribution is zero; if the calculation result determines that the weight distribution belongs to a candidate network layer of a preset second region distribution, then using a preset second pruner for pruning processing, wherein the norm variance of the second region distribution is greater than a preset variance threshold, and the minimum norm value of the second region distribution is not zero; and inputting the test image dataset into the original neural network and each sub-neural network for processing. Based on the pixel processing results between the output image dataset of the original neural network and multiple sub-neural networks and the test image dataset, the peak signal-to-noise ratio (PSNR) corresponding to the original neural network is obtained as a reference performance indicator, and the PSNR corresponding to each sub-neural network is obtained as a test performance indicator. Alternatively, the test audio dataset is input into the original neural network and each sub-neural network for processing. Based on the comparison results between the recognized text dataset output by the original neural network and multiple sub-neural networks and the labeled text of the test audio dataset, the accuracy corresponding to the original neural network is obtained as a reference performance indicator, and the accuracy corresponding to each sub-neural network is obtained as a test performance indicator. According to the performance loss of multiple test performance indicators relative to the reference performance indicators, performance indicator curves corresponding to candidate network layers and multiple pruning rates are plotted. The slope of each pruning rate in the performance indicator curve is calculated. The maximum pruning rate of the candidate network layer is determined according to the slope change. The performance indicator corresponding to the maximum pruning rate represents the maximum parameter redundancy of the candidate network layer parameters. Based on the target pruning rate and the maximum pruning rate corresponding to the maximum parameter redundancy of each candidate network layer, the target network layer to be pruned in the original neural network is determined.Using the above technical solution, the relative parameter redundancy of each candidate network layer in the original neural network under a specified pruning rate is analyzed. This parameter redundancy is obtained based on the actual test dataset and has high reliability. Furthermore, in the process of solving the parameter redundancy, in order to further improve reliability, different pruners are selected for pruning based on the weight distribution in the candidate network layers. At the same time, all related network layers with channel-dependent features are set as a candidate network layer, and the parameter redundancy corresponding to each related network layer and multiple pruning rates is calculated based on the average number of layers of all related network layers. This further improves the accuracy of subsequent calculations, thereby improving the reliability of the target neural network.

[0111] Figure 5 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this disclosure. The device can be implemented by software and / or hardware and is generally integrated into an electronic device. Figure 5 As shown, the device includes:

[0112] The pruning module 301 is used to prune each candidate network layer in the original neural network according to multiple preset pruning rates to obtain multiple corresponding sub-neural networks.

[0113] The processing and acquisition module 302 is used to input the test dataset into the original neural network and the multiple sub-neural networks respectively for processing, and based on the output datasets of the original neural network and the multiple sub-neural networks, to obtain the reference performance index corresponding to the original neural network and the multiple test performance indexes corresponding to the multiple sub-neural networks.

[0114] Analysis module 303 is used to analyze the parameter redundancy of candidate network layer parameters in the original neural network under different pruning rates based on the performance loss of the multiple test performance indicators relative to the reference performance indicators.

[0115] Optionally, the test dataset includes multimedia data, which is one or more combinations of audio data, video data, and image data.

[0116] Optionally, the device further includes:

[0117] The acquisition module is used to acquire network compression requirements;

[0118] The setting module is used to set the plurality of pruning rates according to the network compression requirements, wherein the difference between the plurality of pruning rates is positively correlated with the network compression degree.

[0119] Optionally, the pruning module 301 is specifically used for:

[0120] The norm of the weight distribution in the candidate network layer is calculated;

[0121] If the weight distribution is determined to belong to a candidate network layer of a preset first region distribution based on the calculation results, then a preset first pruner is used for pruning, wherein the norm interval of the first region distribution is greater than a preset interval threshold, and the minimum norm of the first region distribution is zero.

[0122] If the weight distribution is determined to belong to a candidate network layer of a preset second region distribution based on the calculation results, then a preset second pruner is used for pruning, wherein the norm variance of the second region distribution is greater than a preset variance threshold, and the minimum norm value of the second region distribution is not zero.

[0123] Optionally, the processing and acquisition module 302 is specifically used for:

[0124] The test image dataset is input into the original neural network and each of the sub-neural networks for processing. Based on the pixel processing results between the output image datasets of the original neural network and the multiple sub-neural networks and the test image dataset, the peak signal-to-noise ratio corresponding to the original neural network is obtained as the reference performance index, and the peak signal-to-noise ratio corresponding to each sub-neural network is obtained as the test performance index.

[0125] or,

[0126] The test audio dataset is input into the original neural network and each of the sub-neural networks for processing. Based on the comparison results between the recognized text dataset and the labeled text of the test audio dataset, which are the outputs of the original neural network and the multiple sub-neural networks, the accuracy corresponding to the original neural network is obtained as the reference performance index, and the accuracy corresponding to each sub-neural network is obtained as the test performance index.

[0127] Optionally, the device further includes:

[0128] The detection module is used to detect whether there are associated network layers with channel-dependent features in the original neural network, wherein the channel-dependent features include: adjacent network layers have data operations of addition and / or multiplication;

[0129] The association setting module is used to set all the associated network layers with channel dependency characteristics as a candidate network layer if the associated network layer exists.

[0130] Optionally, the device further includes:

[0131] The calculation module is used to obtain the number of all associated network layers with channel dependency features in the candidate network layers, average the multiple performance indicators with the number of layers, and obtain the parameter redundancy corresponding to each associated network layer and multiple pruning rates.

[0132] Optionally, the device further includes a determining module for:

[0133] Based on the parameter redundancy of the candidate network layer parameters under different pruning rates, the target network layer to be pruned in the original neural network is determined, so as to generate the target neural network to process the target dataset.

[0134] Optionally, the determining module is specifically used for:

[0135] Based on the performance loss of the multiple test performance metrics relative to the reference performance metrics, plot the performance metric curves of the candidate network layer and the multiple pruning rates;

[0136] Calculate the slope of each pruning rate in the performance index curve, and determine the maximum pruning rate of the candidate network layer based on the slope change, wherein the performance index corresponding to the maximum pruning rate represents the maximum parameter redundancy of the candidate network layer parameters;

[0137] Based on the target pruning rate and the maximum pruning rate corresponding to the maximum parameter redundancy of each candidate network layer, the target network layer to be pruned in the original neural network is determined. The data processing apparatus provided in this disclosure embodiment can execute the data processing method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method.

[0138] This disclosure also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the data processing method provided in any embodiment of this disclosure.

[0139] Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of the present disclosure. See below for details. Figure 6 The diagram illustrates a structural schematic suitable for implementing the electronic device 400 in the embodiments of this disclosure. The electronic device 400 in the embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0140] like Figure 6 As shown, electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from storage device 408 into random access memory (RAM) 403. RAM 403 also stores various programs and data required for the operation of electronic device 400. Processing device 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.

[0141] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic device 400 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 400 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0142] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 409, or installed from storage device 408, or installed from ROM 402. When the computer program is executed by processing device 401, it performs the functions defined in the data processing method of embodiments of this disclosure.

[0143] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0144] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.

[0145] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0146] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: receive a user's information display trigger operation during video playback; acquire at least two target information associated with the video; display a first target information among the at least two target information in the information display area of ​​the video playback page, wherein the size of the information display area is smaller than the size of the playback page; and receive a user's first switching trigger operation to switch the first target information displayed in the information display area to the second target information among the at least two target information.

[0147] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0148] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0149] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.

[0150] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0151] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0152] According to one or more embodiments of this disclosure, this disclosure provides an electronic device, including:

[0153] processor;

[0154] Memory used to store the processor's executable instructions;

[0155] The processor is configured to read the executable instructions from the memory and execute the instructions to implement any of the data processing methods provided in this disclosure.

[0156] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium storing a computer program for performing any of the data processing methods provided in the present disclosure.

[0157] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0158] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0159] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. A data processing method, characterized in that, include: For candidate network layers in the original neural network, pruning is performed according to multiple preset pruning rates to obtain multiple corresponding sub-neural networks. The process of obtaining multiple sub-neural networks by pruning according to multiple preset pruning rates includes: calculating the norm of the weight distribution in the candidate network layer; if the calculation result determines that the weight distribution belongs to a candidate network layer with a preset first region distribution, then a preset first pruner is used for pruning, wherein the norm interval of the first region distribution is greater than a preset interval threshold, and the minimum norm value of the first region distribution is zero; if the calculation result determines that the weight distribution belongs to a candidate network layer with a preset second region distribution, then a preset second pruner is used for pruning, wherein the norm variance of the second region distribution is greater than a preset variance threshold, and the minimum norm value of the second region distribution is not zero. The test dataset is input into the original neural network and the multiple sub-neural networks respectively for processing. Based on the output datasets of the original neural network and the multiple sub-neural networks, a reference performance index corresponding to the original neural network and multiple test performance indexes corresponding to the multiple sub-neural networks are obtained. The test dataset includes multimedia data, wherein the multimedia data is one or a combination of audio data, video data, and image data. Based on the performance loss of the multiple test performance metrics relative to the reference performance metrics, the parameter redundancy of the candidate network layer parameters in the original neural network under different pruning rates is analyzed.

2. The method according to claim 1, characterized in that, Also includes: Obtain network compression requirements; The plurality of pruning rates are set according to the network compression requirements, wherein the difference between the plurality of pruning rates is positively correlated with the network compression degree.

3. The method according to claim 1, characterized in that, The process involves inputting the test dataset into the original neural network and the multiple sub-neural networks for processing. Based on the output datasets of the original neural network and the multiple sub-neural networks, a reference performance index corresponding to the original neural network and multiple test performance indices corresponding to the multiple sub-neural networks are obtained, including: The test image dataset is input into the original neural network and each of the sub-neural networks for processing. Based on the pixel processing results between the output image datasets of the original neural network and the multiple sub-neural networks and the test image dataset, the peak signal-to-noise ratio corresponding to the original neural network is obtained as the reference performance index, and the peak signal-to-noise ratio corresponding to each sub-neural network is obtained as the test performance index. or, The test audio dataset is input into the original neural network and each of the sub-neural networks for processing. Based on the comparison results between the recognized text dataset and the labeled text of the test audio dataset, which are the outputs of the original neural network and the multiple sub-neural networks, the accuracy corresponding to the original neural network is obtained as the reference performance index, and the accuracy corresponding to each sub-neural network is obtained as the test performance index.

4. The method according to claim 1, characterized in that, Also includes: Detect whether there are associated network layers with channel-dependent features in the original neural network, wherein the channel-dependent features include: adjacent network layers have data operations of addition and / or multiplication; If the associated network layer exists, all associated network layers with channel dependency characteristics are set as a candidate network layer.

5. The method according to any one of claims 1-4, characterized in that, Also includes: Based on the parameter redundancy of the candidate network layer parameters under different pruning rates, the target network layer to be pruned in the original neural network is determined, so as to generate the target neural network to process the target dataset.

6. The method according to claim 5, characterized in that, The step of determining the target network layer to be pruned in the original neural network based on the parameter redundancy of the candidate network layer parameters under different pruning rates includes: Based on the performance loss of the multiple test performance metrics relative to the reference performance metrics, plot the performance metric curves of the candidate network layer and the multiple pruning rates; Calculate the slope of each pruning rate in the performance index curve, and determine the maximum pruning rate of the candidate network layer based on the slope change, wherein the performance index corresponding to the maximum pruning rate represents the maximum parameter redundancy of the candidate network layer parameters; The target network layer to be pruned in the original neural network is determined based on the target pruning rate and the maximum pruning rate corresponding to the maximum parameter redundancy of each candidate network layer.

7. A data processing apparatus, characterized in that, include: A pruning module is used to prune candidate network layers in the original neural network according to multiple preset pruning rates to obtain corresponding sub-neural networks. Specifically, the pruning module is used to: calculate the norm of the weight distribution in the candidate network layers; if the calculation result determines that the weight distribution belongs to a candidate network layer with a preset first region distribution, then a preset first pruner is used for pruning, wherein the norm interval of the first region distribution is greater than a preset interval threshold, and the minimum norm value of the first region distribution is zero; if the calculation result determines that the weight distribution belongs to a candidate network layer with a preset second region distribution, then a preset second pruner is used for pruning, wherein the norm variance of the second region distribution is greater than a preset variance threshold, and the minimum norm value of the second region distribution is not zero. The processing and acquisition module is used to input the test dataset into the original neural network and the multiple sub-neural networks respectively for processing, and based on the output datasets of the original neural network and the multiple sub-neural networks, to obtain the reference performance index corresponding to the original neural network and the multiple test performance indexes corresponding to the multiple sub-neural networks; wherein, the test dataset includes: multimedia data, wherein the multimedia data is one or a combination of audio data, video data, and image data; The analysis module is used to analyze the parameter redundancy of candidate network layer parameters in the original neural network under different pruning rates based on the performance loss of the multiple test performance indicators relative to the reference performance indicator.

8. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the data processing method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for executing the data processing method described in any one of claims 1-6.

10. A computer program product, characterized in that, The computer program product includes a computer program / instruction that, when executed by a processor, implements the data processing method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Neural network model compression method and device, and storage medium

    CN114282670A