A model optimization method, device, equipment and readable storage medium

By selecting the target network model with the smallest description length as the optimization network model, the problem of insufficient optimization of deep learning network models in the prior art is solved, and the effect of reducing model complexity and improving data processing accuracy is achieved.

CN114169490BActive Publication Date: 2025-04-15CHINA MOBILE COMM LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010945736.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-10
Publication Date
2025-04-15
Estimated Expiration
2040-09-10

AI Technical Summary

Technical Problem

The existing deep learning network models have weak optimization degree and cannot effectively reduce the complexity of the model, resulting in high consumption of computing resources and storage resources and prone to overfitting.

Method used

By determining M network models and determining the description length of each network model based on the data set to be analyzed, the target network model with the smallest description length is selected as the optimized network model, and data processing is performed based on the optimized network model.

Benefits of technology

This method can effectively reduce the complexity of the deep learning network model while ensuring the calculation accuracy, improve the optimization degree of the model and the accuracy of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114169490B_ABST
    Figure CN114169490B_ABST
Patent Text Reader

Abstract

The present invention provides a model optimization method, device, equipment and readable storage medium, which relate to the field of deep learning technology. The model optimization method includes determining M network models; determining the description length of the M network models based on the data set to be analyzed; determining the target network model with the smallest description length from the M network models as the optimized network model, and performing data processing based on the optimized network model. In this way, the problem that the existing deep learning network model has a weak degree of optimization and cannot effectively reduce the complexity of the deep learning network model is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning technology, and in particular to a model optimization method, device, equipment and readable storage medium. Background Art

[0002] With the rapid development of network technology, deep learning network models are being used more and more widely, and deep learning network models are becoming more and more complex. Overly complex network models require more training data, computing resources, and storage resources in applications, and are prone to overfitting problems. At present, network pruning based on transfer learning is often used to optimize models. Network pruning is to compress the width of the network to achieve the purpose of model optimization. In this way, the network width is optimized first, and the optimization degree of the deep learning network model is weak, which cannot effectively reduce the complexity of the deep learning network model. Summary of the invention

[0003] Embodiments of the present invention provide a model optimization method, apparatus, device and readable storage medium to solve the problem that the existing deep learning network model has a weak degree of optimization and cannot effectively reduce the complexity of the deep learning network model.

[0004] To solve the above technical problems, the present invention is achieved as follows:

[0005] In a first aspect, an embodiment of the present invention provides a model optimization method, comprising:

[0006] Determine M network models;

[0007] Determining the description lengths of the M network models based on the data set to be analyzed;

[0008] Determine a target network model with the smallest description length from the M network models as an optimized network model;

[0009] Data processing is performed based on the optimized network model.

[0010] In a second aspect, an embodiment of the present invention provides a model optimization device, comprising:

[0011] A first determination module, used to determine M network models;

[0012] A second determination module, used to determine the description lengths of the M network models based on the data set to be analyzed;

[0013] An optimization module, used for determining a target network model with the smallest description length from the M network models as an optimized network model;

[0014] A processing module is used to perform data processing based on the optimized network model.

[0015] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the model optimization method described in the first aspect.

[0016] In a fourth aspect, an embodiment of the present invention provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the model optimization method described in the first aspect are implemented.

[0017] In an embodiment of the present invention, M network models are determined, and a target network model with the shortest description length is determined as the optimized network model, and data processing is further performed based on the optimized network model. In this way, the accuracy and complexity of the network model can be balanced, the degree of optimization of the network model can be improved, and the complexity of the deep learning network model can be effectively reduced while ensuring the calculation accuracy of the network model, thereby improving the accuracy of data processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0019] Figure 1 is a flow chart of a model optimization method provided by an embodiment of the present invention;

[0020] Figure 2 is a schematic diagram of a picture to be analyzed provided by an embodiment of the present invention;

[0021] Figure 3 is a schematic diagram of the calculation results of likelihood and complexity when optimizing the convolutional layer provided by an embodiment of the present invention;

[0022] Figure 4 is a schematic diagram of the calculation results of likelihood and complexity when optimizing a fully connected layer provided by an embodiment of the present invention;

[0023] Figure 5 is a second flow chart of the model optimization method provided by an embodiment of the present invention;

[0024] Figure 6 It is a module diagram of a model optimization device provided by an embodiment of the present invention;

[0025] Figure 7 is a schematic diagram of a module structure of an electronic device provided by an embodiment of the present invention;

[0026] Figure 8 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0028] In order to obtain the optimal accuracy on a specific data set, when designing the network structure, convolution and pooling layers are continuously added to build a deeper network structure. However, as the network deepens, the increase in accuracy will weaken, gradually reach saturation, and may even cause a decrease in accuracy due to problems such as overfitting. In this process, the complexity of the network will also increase, the amount of calculation will increase, and the execution efficiency will decrease. The present application is aimed at the situation where a suitable network model cannot be selected for the size of the data set to be analyzed, and provides a model optimization method, device, equipment and readable storage medium, and its specific implementation methods are as follows.

[0029] The model optimization method of the present application is applied in one or more computer devices, which are devices that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and whose hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0030] The computer device can be, but is not limited to, any electronic product that can interact with a user through a keyboard, mouse, remote control, touchpad or voice control device, such as a tablet computer, a smart phone, a personal digital assistant (PDA), a smart wearable device, etc.

[0031] See also Figure 1 , Figure 1 is a flow chart of a model optimization method provided by an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:

[0032] Step 101: Determine M network models;

[0033] In this embodiment, the network model refers to a network model suitable for machine learning. This type of network model can be applied to various data processing, for example, image processing. In this embodiment, the image processing is illustrated by taking the classic convolutional neural network VGG as the network model. The network model includes a convolutional layer, a downsampling layer, and a fully connected layer.

[0034] Among them, the processing steps of the convolutional layer are as follows.

[0035] First, overlay the filter on a certain position in the image; then multiply the value in the filter with the value of the corresponding pixel in the image; then add up the above products, and the sum obtained is the value of the target pixel in the output image; and repeat this operation for all positions in the image.

[0036] The processing steps of the downsampling layer are as follows.

[0037] The downsampling layer is also called the pooling layer. Its specific operation is basically the same as that of the convolution layer. We will not go into details here. The difference is that the convolution kernel of the downsampling only takes the maximum value (maximum pooling), average value (average pooling), etc. of the corresponding position, and the weights are not modified through back propagation.

[0038] The processing steps of the fully connected layer are as follows.

[0039] The fully connected layer plays a role similar to that of a "classifier" in the entire convolutional neural network. For example, if operations such as the convolution layer, pooling layer, and activation function layer map the original data to the hidden feature space, the fully connected layer maps the learned "distributed feature representation" to the sample label space. In actual use, the fully connected layer can be implemented by a convolution operation: the fully connected layer whose previous layer is a fully connected layer can be converted into a convolution with a convolution kernel of 1x1; and the fully connected layer whose previous layer is a convolution layer can be converted into a global convolution with a convolution kernel of H×K, where H and K are the height and width of the previous convolution result, respectively. The fully connected layer parameters are redundant, and the fully connected layer parameters alone can account for about 80% of the entire network parameters. It should be noted that this is only for illustration, not for example. In other feasible embodiments, other types of network models can also be used.

[0040] Step 102: Determine the description lengths of M network models based on the data set to be analyzed.

[0041] When performing an image classification task, first the corresponding image is used as the data to be analyzed, and the description length of the image to be analyzed under each network model is calculated.

[0042] Specifically, in this implementation, CIFAR10 data is used as the data to be analyzed to introduce the processing flow. CIFAR10 consists of 60,000 32x32 pixel color images, which are divided into 10 categories, such as Figure 2 As shown in the figure, there are the first category of pictures, the second category of pictures, and the tenth category of pictures, each of which contains 6,000 pictures. For example, these 10 categories of pictures can be airplanes, cars, birds, cats, deer, dogs, frogs, horses, ships, and trucks.

[0043] Step 103: Determine a target network model with the smallest description length from the M network models as the optimized network model.

[0044] Step 104: Perform data processing based on the optimized network model.

[0045] Among them, the model optimization method is applicable to a variety of data processing, for example, processing image data. For example, in agricultural breeding, using image analysis technology, deploying deep learning-based pest detection, plant growth status observation, accident alarm and other applications on the equipment; for example, in the field of security, the security function installed on the camera realizes face recognition, pedestrian detection and other functions. In many scenarios, the optimized network model is stored in the cloud, the data collected by the device is uploaded to Cloudton, and the results are returned after analysis in the cloud.

[0046] In the above steps, M network models are determined, and the target network model with the smallest description length is determined as the optimized network model, and data processing is further performed based on the optimized network model. In this way, the accuracy and complexity of the network model can be balanced, and the degree of optimization of the network model can be improved. The complexity of the deep learning network model can be effectively reduced while ensuring the calculation accuracy of the network model, and the accuracy of data processing can be improved.

[0047] Optionally, determining the M network models includes:

[0048] When M is a first number, determining a first number of network models, where the network models include convolutional layers;

[0049] The number of convolutional layers corresponding to each network model is determined, and the corresponding number of convolutional layers is set based on the number of convolutional layers to generate M network models.

[0050] In this implementation, the number of network models is determined to be 7 for illustration, which is only an example and not a limitation. In other feasible embodiments, the number of network models can be adjusted within a certain range.

[0051] First, the CIFAR10 data obtained above is preprocessed, including filtering out data that does not meet the definition requirements and adjusting the image pixels accordingly. For example, a 32x32 image can be enlarged to 64x64, and then the part with insufficient definition can be removed, and the image can be cut to a 24x24 pixel size image for subsequent processing. A unique label is assigned to each image.

[0052] Then, the number of network models is determined to be 7, wherein the number of convolutional layers of each network model is m. In this embodiment, the value of m is m=2, 3, 4, ... 8. That is, the number of convolutional layers of the 7 network models can be: the number of convolutional layers of the first network model is 2, the number of convolutional layers of the second network model is 3... The number of convolutional layers of the 7th network model is 8. Here, it is only used as an example and not as a limitation. In other feasible embodiments, other numbers of network models can be determined, or the number of convolutional layers of each network model can be taken as other numbers. However, no matter how it is transformed, it is within the scope of protection of this embodiment.

[0053] Furthermore, a number of downsampling layers, activation layers, and fully connected layers are added to each network model, and the number of the layers is preset, for example, it can be set to be consistent with the number of convolutional layers in the corresponding network model. The loss function is set as the cross entropy function in the last layer of each network model to form 7 network models.

[0054] Optionally, determining the description lengths of the M network models based on the data set to be analyzed includes:

[0055] Calculate the likelihood and complexity of the data set to be analyzed under M network models respectively;

[0056] The description length of the M networks is calculated based on the likelihood and complexity.

[0057] Then, a learning rate change strategy is set for the above 7 network models. The learning rate change strategy in this embodiment can be that the initial value is 0.01, and it is reduced by 1 / 10 every 100 iterations, and it is iterated 1000 times in total. The above CIFAR10 data is input into the above 7 network models for iterative training respectively, and the likelihood and complexity of the above CIFAR10 data under the 7 network models are obtained.

[0058] Specifically, in this embodiment, the loss value of the loss function of each network model is used as the likelihood. In this embodiment, the likelihood values ​​of the seven network models are calculated respectively as shown in the second row of Table 1, where the diagram of Table 1 is as follows: Figure 3 shown.

[0059] Table 1

[0060]

[0061] In this embodiment, the calculation of the complexity p satisfies the following formula.

[0062] p = a*m*log(N);

[0063] Wherein, m is the number of the above-mentioned convolutional layers, N is the number of training set images (in this embodiment, N = 6000), and a is a free parameter, for example, a = 0.1. It should be noted that the free parameter is used to adjust p and m to be at the same order of magnitude. For example, there may be a situation where m is a hundred digit and p is a single digit. In this way, a is set to 0.01 so that p and m are at the same order of magnitude. In this way, large errors in calculation results can be avoided during the training process, thereby improving the accuracy of the results.

[0064] In this way, the complexity of each model calculated is shown in the third row of Table 1.

[0065] Optionally, calculating the description lengths of the M network models based on likelihood and complexity includes:

[0066] The weighted sum of likelihood and complexity is calculated as the description length.

[0067] Specifically, the weighted sum of the likelihood and complexity of each network model is calculated as the description length DL. The minimum description length MDL is selected. In this embodiment, the minimum description length of the above 7 network models is 2.53, and the corresponding number of layers m is 6. Therefore, in this embodiment, the network model with 6 convolution layers is determined to be the optimized network model.

[0068] It should be noted that in most cases, the network model includes a convolutional layer and a fully connected layer. During optimization, the convolutional layer can be optimized separately to achieve the purpose of optimizing the network model, and the fully connected layer can also be optimized to achieve the purpose of optimizing the network model.

[0069] Among them, the steps for optimizing the fully connected layer are as follows.

[0070] Optionally, determining the M network models includes:

[0071] When M is a second number, determining a second number of network models, where the network models include fully connected layers;

[0072] The number of dimensions of the fully connected layer corresponding to each network model is determined, and based on the number of dimensions of the fully connected layer, a fully connected layer of corresponding dimensions is generated to generate M network models.

[0073] The CIFAR10 data obtained above is preprocessed in the same manner as above, which will not be described in detail here.

[0074] Then, the number of network models is determined to be 5, wherein the number of dimensions of the fully connected layer of each network model is w. In this embodiment, the values ​​of w are 16, 32, 64, 128, and 256, respectively. That is, the number of fully connected networks of the five network models can be: the number of dimensions of the fully connected layer of the first network model is 16...the number of dimensions of the fully connected layer of the fifth network model is 256. Here, this is only an example and not a limitation. In other feasible embodiments, other numbers of network models can be determined, or the number of dimensions of the fully connected layer of each network model can be taken as other numbers. However, no matter how it is transformed, it is within the scope of protection of this embodiment.

[0075] Furthermore, a number of convolutional layers, downsampling layers, and activation layers are added to each network model, and the number of the layers is preset, for example, it can be set to be consistent with the number of fully connected layers in the corresponding network model. The loss function is set as the cross entropy function in the last layer of each network model to form 5 network models.

[0076] Then, a learning rate change strategy is set for the above five network models. The learning rate change strategy in this embodiment can be that the initial value is 0.01, and it is reduced by 1 / 10 every 100 iterations, and it is iterated 1000 times in total. The above CIFAR10 data is input into the above five network models for iterative training respectively, and the likelihood and complexity of the above CIFAR10 data under the five network models are obtained.

[0077] In this implementation, the manner of calculating likelihood, complexity and description length is consistent with the above steps and will not be described in detail here.

[0078] Specifically, in this implementation, the likelihood, complexity and description length of the above data under the five network models are shown in Table 2, and the corresponding diagrams are shown in Figure 4.

[0079] Table 2

[0080]

[0081] According to Table 2, the minimum description length of the above five network models is 0.446. The number of dimensions of the corresponding fully connected layer is 64. Therefore, in this embodiment, the network model corresponding to the number of fully connected layers being 64 is determined to be the optimized network model.

[0082] Optionally, determining the M network models includes:

[0083] When M is a third number, determining a third number of network models, where the network models include convolutional layers and fully connected layers;

[0084] Determine the number of convolutional layers and the number of dimensions of fully connected layers corresponding to each network model, generate a corresponding number of convolutional layers based on the number of convolutional layers, and generate a corresponding number of fully connected layers based on the number of dimensions of the fully connected layers to generate M network models.

[0085] Alternatively, in other feasible embodiments, the convolutional layer and the fully connected layer of the same network can be optimized at the same time to achieve the purpose of optimizing the network model. The specific optimization steps are the same as the above optimization steps, the only difference is that the convolutional layer and the fully connected layer of the same network model are optimized at the same time, which will not be described here. Figure 5 As shown, in this implementation, first, M network models are defined, then the network models are trained, the likelihood of the data to be analyzed under the M network models is calculated, and the complexity of the M network models is calculated, each description length is calculated, and the network model corresponding to the minimum description length is determined as the optimized network model. In this way, the accuracy and complexity of the network model can be balanced, the optimization degree of the network model can be improved, and the complexity of the deep learning network model can be effectively reduced while ensuring the calculation accuracy of the network model.

[0086] See also Figure 6 . Figure 6 A model optimization device 600 provided in this embodiment includes:

[0087] A first determination module 601 is used to determine M network models;

[0088] A second determination module 602, configured to determine the description lengths of the M network models based on the data set to be analyzed;

[0089] An optimization module 603 is used to determine a target network model with the smallest description length from the M network models as an optimized network model;

[0090] The processing module 604 is used to perform data processing based on the optimized network model.

[0091] Optionally, the first determining module 601 is specifically configured to:

[0092] When M is a first number, determining the first number of network models, wherein the network models include convolutional layers;

[0093] The number of convolutional layers corresponding to each network model is determined, and a corresponding number of convolutional layers are set based on the number of convolutional layers to generate the M network models.

[0094] Optionally, the first determining module 601 is specifically configured to:

[0095] When M is a second number, determining a second number of network models, wherein the network models include fully connected layers;

[0096] The number of dimensions of the fully connected layer corresponding to each network model is determined, and based on the number of dimensions of the fully connected layer, a fully connected layer of corresponding dimensions is generated to generate the M network models.

[0097] Optionally, the first determining module 601 is specifically configured to:

[0098] When M is a third number, determining a third number of network models, wherein the network models include convolutional layers and fully connected layers;

[0099] Determine the number of convolutional layers and the number of dimensions of fully connected layers corresponding to each network model, generate a corresponding number of convolutional layers based on the number of convolutional layers, and generate a corresponding number of fully connected layers based on the number of dimensions of the fully connected layers to generate the M network models.

[0100] Optionally, the second determining module 602 is specifically configured to:

[0101] Calculating the likelihood and complexity of the data set to be analyzed under the M network models respectively;

[0102] The description lengths of the M networks are calculated based on the likelihood and the complexity.

[0103] Optionally, the second determining module 602 is specifically configured to:

[0104] A weighted sum of the likelihood and the complexity is calculated as the description length.

[0105] The model optimization device 600 in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0106] The model optimization device 600 in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0107] The model optimization device 600 provided in the embodiment of the present application can achieve Figures 1 to 5 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0108] Optional, such as Figure 7 As shown, an embodiment of the present application also provides an electronic device 700, including a processor 701, a memory 702, and a program or instruction stored in the memory 702 and executable on the processor 701. When the program or instruction is executed by the processor 701, each process of the above-mentioned method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0109] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0110] Figure 8 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0111] The electronic device 800 includes but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, and a processor 810 and other components.

[0112] Those skilled in the art will appreciate that the electronic device 800 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 810 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0113] The processor 810 is used to: determine M network models;

[0114] Determining the description lengths of the M network models based on the data set to be analyzed;

[0115] Determine a target network model with the smallest description length from the M network models as an optimized network model;

[0116] Data processing is performed based on the optimized network model.

[0117] Optionally, the processor 810 is further configured to:

[0118] When M is a first number, determining the first number of network models, wherein the network models include convolutional layers;

[0119] The number of convolutional layers corresponding to each network model is determined, and a corresponding number of convolutional layers are set based on the number of convolutional layers to generate the M network models.

[0120] Optionally, the processor 810 is further configured to:

[0121] When M is a second number, determining a second number of network models, wherein the network models include fully connected layers;

[0122] The number of dimensions of the fully connected layer corresponding to each network model is determined, and based on the number of dimensions of the fully connected layer, a fully connected layer of corresponding dimensions is generated to generate the M network models.

[0123] Optionally, the processor 810 is further configured to:

[0124] When M is a third number, determining a third number of network models, wherein the network models include convolutional layers and fully connected layers;

[0125] Determine the number of convolutional layers and the number of dimensions of fully connected layers corresponding to each network model, generate a corresponding number of convolutional layers based on the number of convolutional layers, and generate a corresponding number of fully connected layers based on the number of dimensions of the fully connected layers to generate the M network models.

[0126] Optionally, the processor 810 is further configured to:

[0127] Calculating the likelihood and complexity of the data set to be analyzed under the M network models respectively;

[0128] The description lengths of the M networks are calculated based on the likelihood and the complexity.

[0129] Optionally, the processor 810 is further configured to:

[0130] A weighted sum of the likelihood and the complexity is calculated as the description length.

[0131] In an embodiment of the present application, the electronic device 800 determines M network models, and determines the target network model with the smallest description length as the optimized network model, and further performs data processing based on the optimized network model. In this way, the accuracy and complexity of the network model can be balanced, the degree of optimization of the network model can be improved, and the complexity of the deep learning network model can be effectively reduced while ensuring the calculation accuracy of the network model, thereby improving the accuracy of data processing.

[0132] It should be understood that in the embodiment of the present application, the input unit 804 may include a graphics processor (Graphics Processing Unit, GPU) 8041 and a microphone 8042, and the graphics processor 8041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 806 may include a display panel 8061, and the display panel 8061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 807 includes a touch panel 8071 and other input devices 8072. The touch panel 8071 is also called a touch screen. The touch panel 8071 may include two parts: a touch detection device and a touch controller. Other input devices 8072 may include but are not limited to a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 809 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 810 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, the user interface, and the application program, etc., and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 810.

[0133] The embodiment of the present application also provides a readable storage medium on which a program or instruction is stored. When the program or instruction is executed by a processor, the above Figures 1 to 5The various processes of the model optimization method embodiment can achieve the same technical effect. To avoid repetition, they will not be described here.

[0134] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0135] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

Claims

1. A model optimization method, characterized in that: include: Determine M network models, where the network models are used to perform image classification tasks; Determining the description lengths of the M network models based on a data set to be analyzed, wherein the data set to be analyzed is an image; Determine a target network model with the smallest description length from the M network models as an optimized network model; Performing data processing based on the optimized network model; Determining the M network models includes: When M is a first number, determining the first number of network models, wherein the network models include convolutional layers; Determine the number of convolutional layers corresponding to each network model, and set a corresponding number of convolutional layers based on the number of convolutional layers to generate the M network models; The determining the description lengths of the M network models based on the data set to be analyzed includes: Calculating the likelihood and complexity of the data set to be analyzed under the M network models respectively; The description lengths of the M networks are calculated based on the likelihood and the complexity.

2. The model optimization method according to claim 1, characterized in that: Determining the M network models includes: When M is a second number, determining a second number of network models, wherein the network models include fully connected layers; The number of dimensions of the fully connected layer corresponding to each network model is determined, and based on the number of dimensions of the fully connected layer, a fully connected layer of corresponding dimensions is generated to generate the M network models.

3. The model optimization method according to claim 1, characterized in that: Determining the M network models includes: When M is a third number, determining a third number of network models, wherein the network models include convolutional layers and fully connected layers; Determine the number of convolutional layers and the number of dimensions of fully connected layers corresponding to each network model, generate a corresponding number of convolutional layers based on the number of convolutional layers, and generate a corresponding number of fully connected layers based on the number of dimensions of the fully connected layers to generate the M network models.

4. The model optimization method according to claim 1, characterized in that: The calculating the description lengths of the M network models based on the likelihood and the complexity includes: A weighted sum of the likelihood and the complexity is calculated as the description length.

5. A model optimization device, characterized in that: include: A first determination module is used to determine M network models, where the network models are used to perform an image classification task; A second determination module is used to determine the description lengths of the M network models based on a data set to be analyzed, where the data set to be analyzed is an image; An optimization module, used for determining a target network model with the smallest description length from the M network models as an optimized network model; A processing module, used for performing data processing based on the optimized network model; The first determining module is specifically used for: When M is a first number, determining the first number of network models, wherein the network models include convolutional layers; Determine the number of convolutional layers corresponding to each network model, and set a corresponding number of convolutional layers based on the number of convolutional layers to generate the M network models; The second determining module is further used for: Calculating the likelihood and complexity of the data set to be analyzed under the M network models respectively; The description lengths of the M networks are calculated based on the likelihood and the complexity.

6. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the model optimization method as described in any one of claims 1 to 4.

7. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the model optimization method according to any one of claims 1 to 4 are implemented.