Data processing method and device, computer device, and storage medium

By adjusting the convolutional kernels and weight matrices in the network model and reducing the size of large convolutional layers, the problem of low data processing efficiency is solved, achieving more efficient and accurate data processing.

CN113392688BActive Publication Date: 2026-02-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011551623.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-24
Publication Date
2026-02-10
Estimated Expiration
2041-05-13

AI Technical Summary

Technical Problem

The large size of convolutional layers and kernels in existing network models leads to low data processing efficiency.

Method used

By adjusting the convolution kernels and weight matrices in the data processing model, the convolution kernels and weight matrices of convolutional layers with weight variance greater than the reference threshold are reduced, thereby decreasing the amount of data and improving processing efficiency.

Benefits of technology

It improves the processing efficiency and accuracy of the data processing model, reduces the amount of data, and enhances the model's generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113392688B_ABST
    Figure CN113392688B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a data processing method and device, computer equipment and a storage medium, belonging to the technical field of computer. The method comprises: obtaining sample data and corresponding label results, calling a data processing model, processing the sample data to obtain a prediction result, adjusting a convolution kernel and a corresponding weight matrix in the data processing model according to the label results and the prediction result, in response to a weight variance corresponding to any convolution layer in the data processing model being greater than a reference threshold, reducing the convolution kernel and the corresponding weight matrix in the convolution layer after this adjustment to obtain an updated data processing model, calling the updated data processing model to process data to obtain a processing result of the data, and reducing the size of the convolution kernel and the corresponding weight matrix in the convolution layer through the weight variance to reduce the amount of data included in the data processing model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of computer, and particularly relate to a data processing method and device, computer equipment and storage medium. BACKGROUND

[0002] With the development of artificial intelligence technology, network models are widely used in various business scenarios, such as image classification scenarios, image segmentation scenarios, image recognition scenarios, etc. Network models can be deployed in different business scenarios, and business data can be processed by calling network models. Generally, network models are deployed by technical personnel according to sample data. The network model deployed in this way contains multiple convolution layers and multiple convolution kernels, and the size of the convolution kernel is large and contains a large amount of data, which reduces the efficiency of the network model in processing data. SUMMARY

[0003] Embodiments of the present application provide a data processing method, device, computer equipment and storage medium, which can improve the efficiency of data processing model in processing data. The technical solution is as follows:

[0004] In one aspect, a data processing method is provided, which includes:

[0005] obtaining sample data and corresponding annotation results;

[0006] calling a data processing model to process the sample data and obtain a prediction result, the data processing model including at least one convolution layer, each convolution layer including at least one convolution kernel, and each convolution kernel corresponding to a weight matrix;

[0007] adjusting the convolution kernel and the corresponding weight matrix in the data processing model according to the annotation results and the prediction results;

[0008] in response to the weight variance corresponding to any convolution layer in the data processing model being greater than a reference threshold, reducing the convolution kernel and the corresponding weight matrix in the convolution layer after this adjustment to obtain an updated data processing model, the weight variance being the variance of the weight matrix in the convolution layer before this adjustment;

[0009] calling the updated data processing model to process data and obtain a processing result of the data.

[0010] In another aspect, a data processing device is provided, which includes:

[0011] a obtaining module configured to obtain sample data and corresponding annotation results;

[0012] The processing module is configured to invoke the data processing model to process the sample data and obtain a prediction result, the data processing model comprises at least one convolution layer, each convolution layer comprises at least one convolution kernel, and each convolution kernel corresponds to a weight matrix;

[0013] The adjusting module is configured to adjust the convolution kernel and the corresponding weight matrix in the data processing model according to the annotation result and the prediction result.

[0014] The reducing module is configured to, in response to the weight variance corresponding to any convolution layer in the data processing model being greater than a reference threshold, reduce the convolution kernel and the corresponding weight matrix in the convolution layer after this adjustment to obtain an updated data processing model, and the weight variance is a variance of the weight matrix in the convolution layer before this adjustment.

[0015] The processing module is further configured to invoke the updated data processing model to process data and obtain a processing result of the data.

[0016] In a possible implementation manner, the obtaining module is further configured to obtain the weight variance corresponding to each convolution layer according to the weights in the at least one weight matrix corresponding to each convolution layer.

[0017] In another possible implementation manner, the obtaining unit is configured to determine an initial loss value of the data processing model according to the annotation result and the prediction result, determine a first sum value of the weight variances corresponding to the at least one convolution layer, and determine a difference value between the initial loss value and the first sum value as the loss value of the data processing model.

[0018] In another possible implementation manner, the obtaining unit is configured to determine an initial loss value of the data processing model according to the annotation result and the prediction result, determine a second sum value of the weights in the weight matrix corresponding to the at least one convolution layer, and determine a sum value of the initial loss value and the second sum value as the loss value of the data processing model.

[0019] In another possible implementation manner, the data processing model is an image classification model, and the data is image data.

[0020] The processing module is configured to invoke the updated image classification model to classify the image data and obtain a category to which the image data belongs.

[0021] In another possible implementation manner, the data processing model is an object recognition model, and the data is image data.

[0022] The processing module is configured to call the updated object recognition model to recognize the image data, and obtain a category to which an object contained in the image data belongs and a position of the object in the image data.

[0023] In another aspect, a computer device is provided, which includes a processor and a memory, and the memory stores at least one computer program, which is loaded and executed by the processor to implement the operations performed in the data processing method according to the above aspect.

[0024] In another aspect, a computer readable storage medium is provided, which stores at least one computer program, which is loaded and executed by a processor to implement the operations performed in the data processing method according to the above aspect.

[0025] In still another aspect, a computer program product or computer program is provided, which includes computer program code stored in a computer readable storage medium. A processor of a computer device reads the computer program code from the computer readable storage medium, and the processor executes the computer program code, so that the computer device implements the operations performed in the data processing method according to the above aspect.

[0026] The technical scheme provided by the embodiments of the present application has at least the following beneficial effects:

[0027] The method, device, computer device and storage medium provided by the embodiments of the present application can adjust the convolution kernel and the corresponding weight matrix in the data processing model during the training of the data processing model, so as to ensure the accuracy of the data processing model, and can determine the data size of the convolution layer through the weight variance of the convolution layer, and when the data size of the convolution layer is large, the size of the convolution kernel and the corresponding weight matrix in the convolution layer are reduced through the weight variance, so as to reduce the data size of the data processing model, thereby improving the processing efficiency of the data processing model. BRIEF DESCRIPTION OF DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0029] Figure 1 is a structural schematic diagram of an implementation environment provided by the embodiments of the present application;

[0030] Figure 2 is a flowchart of a data processing method provided by an embodiment of the present application;

[0031] Figure 3 is a flowchart of a data processing method provided by an embodiment of the present application;

[0032] Figure 4 is a schematic diagram of averaging pooling of a weight matrix provided by an embodiment of the present application;

[0033] Figure 5 is a schematic diagram of reducing a convolution kernel provided by an embodiment of the present application;

[0034] Figure 6 is a schematic diagram of automatically searching a model by using a data processing method provided by an embodiment of the present application;

[0035] Figure 7 is a structural schematic diagram of a data processing apparatus provided by an embodiment of the present application;

[0036] Figure 8 is a structural schematic diagram of a data processing apparatus provided by an embodiment of the present application;

[0037] Figure 9 is a structural schematic diagram of a terminal provided by an embodiment of the present application;

[0038] Figure 10 is a structural schematic diagram of a server provided by an embodiment of the present application. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the drawings.

[0040] The terms "at least one", "multiple", "each", "any" used in the present application include one, two or more than two, multiple includes two or more than two, and each refers to each of the corresponding multiple, and any refers to any one of the multiple. For example, multiple convolution layers include 3 convolution layers, and each refers to each of the 3 convolution layers, and any refers to any one of the 3 convolution layers, which can be the first convolution layer, or the second convolution layer, or the third convolution layer.

[0041] Artificial Intelligence (AI) is the theory, method, technology and application system of using digital computers or digital computer controlled machines to simulate, extend and expand human intelligence, perceive environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology of computer science, which attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making.

[0042] Artificial intelligence technology is a comprehensive discipline, involving a wide range of fields, both hardware and software technologies. Artificial intelligence basic technologies generally include technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc.

[0043] Machine Learning (ML) is a multi-disciplinary subject, involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, etc. It is a subject that studies how computers simulate or implement human learning behavior to acquire new knowledge or skills, and reorganize existing knowledge structure to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental approach to making computers intelligent, and its applications are widespread in various fields of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning technologies.

[0044] The scheme provided by the embodiments of the present application can update the data processing model based on the machine learning technology of artificial intelligence, and realize the data processing method by using the updated data processing model.

[0045] The data processing method provided by the embodiments of the present application can be used in a computer device. Optionally, the computer device is a terminal or a server. Optionally, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto.

[0046] Figure 1 is a structural schematic diagram of an implementation environment provided by an embodiment of the present application, as shown in the figure, Figure 1 The system includes a terminal 101 and a server 102, and the terminal 101 and the server 102 can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application.

[0047] Optionally, the terminal 101 is installed with a target application provided by the server 102, and the terminal 101 can realize functions such as image classification and object recognition through the target application. Optionally, the target application is a target application in the operating system of the terminal 101, or a target application provided by a third party. For example, the target application is a smart camera application, which has the function of face recognition, of course, the smart camera application can also have other functions, such as age recognition, face changing, automatic makeup, etc.

[0048] The terminal 101 is used to log in to the target application based on the user identifier, and send data to the server 102 through the target application, and the server 102 is used to receive the data sent by the terminal 101, process the data sent by the terminal 101, and return the processing result of the data to the terminal 101.

[0049] The method provided by the present application can be used in various scenarios.

[0050] For example, in the face recognition scenario:

[0051] After the terminal obtains the sample face image and the corresponding label result, the convolution kernel and the corresponding weight matrix in the data processing model are adjusted through the sample face image and the corresponding label result, and the size of the convolution kernel and the corresponding weight matrix in the convolution layer whose weight variance is greater than the reference threshold is adjusted, and then the terminal calls the updated data processing model to process the face image, extracts the face features in the face image, and subsequently compares the extracted face features with the stored multiple face features to achieve the effect of face recognition.

[0052] For another example, in the image segmentation scenario:

[0053] After the terminal obtains the sample image and the corresponding label result, the convolution kernel and the corresponding weight matrix in the data processing model are adjusted through the sample image and the corresponding label result, and the size of the convolution kernel and the corresponding weight matrix in the convolution layer whose weight variance is greater than the reference threshold is adjusted, and then the terminal calls the updated image processing model to process the target image, extracts the region where the target object in the target image is located, so as to subsequently identify the target object in the extracted region.

[0054] Figure 2 is a flowchart of a data processing method provided by an embodiment of the present application, applied in a computer device, as shown in Figure 2 The method comprises the following steps.

[0055] 201. The computer device acquires sample data and corresponding annotation results.

[0056] The sample data is data in any business scenario, and the annotation result is used to represent the annotation result of the sample data in the business scenario. For example, in the image classification scenario, the sample data is sample image data, and the annotation result is the type label to which the sample image data belongs; or in the object recognition scenario, the sample data is sample image data, and the annotation result is the class label of the object contained in the sample image data and the position of the object in the sample image data.

[0057] 202. The computer device calls a data processing model to process the sample data and obtain a prediction result.

[0058] The data processing model comprises at least one convolution layer, each convolution layer comprises at least one convolution kernel, and each convolution kernel corresponds to a weight matrix. After the sample data is input into the data processing model, the sample data is processed by the convolution kernel and the corresponding weight matrix in the at least one convolution layer included in the data processing model, so as to obtain the prediction result of the sample data.

[0059] 203. The computer device adjusts the convolution kernel and the corresponding weight matrix in the data processing model according to the annotation result and the prediction result.

[0060] Since the annotation result is the true result corresponding to the sample data, and the prediction result is the result predicted by the data processing model, the convolution kernel and the corresponding weight matrix in the data processing model are adjusted according to the annotation result and the prediction result, so as to improve the accuracy of the data processing model, so that an accurate data processing model can be obtained.

[0061] 204. The computer device reduces the convolution kernel and the corresponding weight matrix in the convolution layer after this adjustment to obtain an updated data processing model, in response to the weight variance corresponding to any convolution layer in the data processing model being greater than a reference threshold.

[0062] The updated data processing model comprises the convolution kernel and the corresponding weight matrix after size reduction, and the weight variance is the variance of the weight matrix in the convolution layer before this adjustment. When the weight variance corresponding to the convolution layer is greater than the reference threshold, it indicates that the data amount of the convolution kernel and the corresponding weight matrix included in the convolution layer is large, and the convolution kernel and the corresponding weight matrix in the convolution layer are reduced to obtain the updated data processing model.

[0063] 205、The computer device calls the updated data processing model to process the data and obtain a processing result of the data.

[0064] After obtaining the updated data processing model, the data can be processed by the updated data processing model to ensure the accuracy of the obtained processing result.

[0065] The method provided in the embodiments of the present application adjusts the convolution kernel and the corresponding weight matrix in the data processing model during the training of the data processing model to ensure the accuracy of the data processing model, and judges the data size of the convolution layer through the weight variance of the convolution layer, and when the data size of the convolution layer is large, the size of the convolution kernel and the corresponding weight matrix in the convolution layer are reduced through the weight variance to reduce the data size of the data processing model, thereby improving the processing efficiency of the data processing model.

[0066] Figure 3 is a flowchart of a data processing method provided in the embodiments of the present application, which is applied to a computer device, as shown in Figure 3 The method comprises the following steps.

[0067] 301、The computer device obtains sample data and a corresponding annotation result.

[0068] The sample data is data in any business scenario, and the annotation result is used to represent the annotation result of the sample data in the business scenario. For example, in the image classification scenario, the sample data is sample image data, and the annotation result is a type label to which the sample image data belongs; or in the object recognition scenario, the sample data is sample image data, and the annotation result is a category label of an object contained in the sample image data and a position of the object in the sample image data.

[0069] In a possible implementation manner, the step 301 comprises: the computer device obtains a plurality of sample data and a corresponding annotation result of each sample data. By obtaining a plurality of sample data and a corresponding annotation result of each sample data, the data processing model can be updated by the obtained sample data and the corresponding annotation result subsequently.

[0070] In a possible implementation manner, the step 301 comprises: the computer device receives sample data and a corresponding annotation result sent by another device. For example, a background administrator annotates the sample data to obtain a corresponding annotation result of the sample data, and sends the sample data and the corresponding annotation result to the computer device through a terminal of the background administrator.

[0071] 302、The computer device calls the data processing model to process the sample data and obtain a prediction result.

[0072] The data processing model comprises at least one convolution layer, each convolution layer comprises at least one convolution kernel, and each convolution kernel corresponds to a weight matrix. Optionally, each convolution kernel has the same size as the corresponding weight matrix. For example, the size of each convolution kernel is 7*7, and the size of the corresponding weight matrix is 7*7. Optionally, a plurality of parameters included in each convolution kernel correspond to a plurality of weights included in the corresponding weight matrix one by one. For example, the size of each convolution kernel and the corresponding weight matrix is 7*7, and the parameter at each position in the convolution kernel corresponds to the weight at the corresponding position in the weight matrix.

[0073] After the sample data is input into the data processing model, the sample data is processed by the convolution kernel and the corresponding weight matrix in the at least one convolution layer included in the data processing model, so as to obtain the prediction result of the sample data. For example, the data processing model comprises a plurality of convolution layers. When the data processing model processes the sample data, each convolution layer receives the data features output by the previous convolution layer, multiplies the data features with each convolution kernel and the weight matrix corresponding to the convolution kernel, respectively, to obtain a plurality of updated data features, fuses the plurality of updated data features to obtain new data features, and outputs the new data features for processing by the next convolution layer. The plurality of convolution layers process the data features in the above manner until the last convolution layer outputs the prediction result.

[0074] In a possible implementation, the data processing model is a hypernetwork model, and the hypernetwork model comprises a plurality of convolution layers. In the initialized hypernetwork model, the convolution kernel in each convolution layer is a large-size convolution kernel. For example, the size of the convolution kernel in the initialized hypernetwork model is 7*7, or 9*9, and the like.

[0075] 303. The computer device obtains the weight variance corresponding to each convolution layer according to the weights in the at least one weight matrix corresponding to each convolution layer.

[0076] The weight variance is the variance of each weight in the weight matrix. In the embodiments of the present application, each convolution layer comprises at least one convolution kernel, each convolution kernel corresponds to a weight matrix, the weight matrix comprises at least one weight, and for any convolution layer, the weight variance corresponding to the convolution layer can be obtained by the weights in the at least one weight matrix corresponding to the convolution layer.

[0077] In a possible implementation, the step 303 comprises: determining the average value of a plurality of weights in the at least one weight matrix corresponding to any convolution layer, determining the square of the difference between each weight in the convolution layer and the average value, and determining the ratio between the sum of the squares of the differences corresponding to the plurality of weights and the number of the plurality of weights as the weight variance corresponding to the convolution layer.

[0078] 304、The computer device obtains a loss value of the data processing model according to the annotation result and the prediction result.

[0079] The loss value is used to represent the inaccuracy of the data processing model. Since the annotation result is the real result corresponding to the sample data, and the prediction result is the predicted result obtained by the data processing model, the difference between the annotation result and the prediction result can be determined, and thus the loss value of the data processing model is obtained.

[0080] In a possible implementation, the step 304 includes: determining an initial loss value of the data processing model according to the annotation result and the prediction result, determining a first sum value of the weight variances corresponding to the at least one convolution layer, and determining a difference value between the initial loss value and the first sum value as the loss value of the data processing model.

[0081] The initial loss value is used to represent the difference between the annotation result and the prediction result. For example, the initial loss value is obtained by cross-entropy loss. The first sum value refers to the sum of the weight variances corresponding to all the convolution layers in the data processing model. For example, the data processing model includes three convolution layers, and the first sum value is the sum of the weight variances corresponding to the three convolution layers.

[0082] When determining the loss value of the data processing model, the influence of the weight variances corresponding to the convolution layers on the data processing model is considered. By taking the difference value between the initial loss value and the first sum value as the loss value of the data processing model, the weights in the weight matrix are constrained, so that there is a large difference between the plurality of weights corresponding to any convolution layer. Subsequently, the convolution kernel and the corresponding weight matrix in the data processing model are adjusted according to the loss value, so as to ensure the accuracy of the data processing model.

[0083] In a possible implementation, the step 304 includes: determining an initial loss value of the data processing model according to the annotation result and the prediction result, determining a second sum value of the weights in the weight matrix corresponding to the at least one convolution layer, and determining a sum value between the initial loss value and the second sum value as the loss value of the data processing model.

[0084] The second sum value refers to the sum of the weights in the weight matrix in all the convolution layers in the data processing model. For example, the data processing model includes three convolution layers, each of which includes three convolution kernels, and each convolution layer corresponds to three weight matrices. Therefore, there are nine weight matrices in the data processing model, and the second sum value corresponding to the data processing model is the sum of the weights in the nine weight matrices.

[0085] In determining the loss value of the data processing model, considering the influence of the weight in each weight matrix in the data processing model on the data processing model, the sum of the initial loss value and the second sum value is taken as the loss value of the data processing model, so that the subsequent adjustment of the convolution kernel and the corresponding weight matrix in the data processing model can be performed through the loss value, so as to ensure the accuracy of the data processing model.

[0086] In a possible implementation manner, the step 304 comprises: determining an initial loss value of the data processing model according to the annotation result and the prediction result, determining a first sum value of the weight variance corresponding to the at least one convolution layer, and determining a second sum value of the weight in the weight matrix corresponding to the at least one convolution layer, and determining the difference between the sum of the initial loss value and the second sum value and the first sum value as the loss value of the data processing model.

[0087] Optionally, the loss value of the data processing model satisfies the following relationship:

[0088]

[0089] wherein, the initial loss value of the data processing model is represented by L; the weight in the weight matrix is represented by w; the second sum value is represented by S2; the weight method corresponding to one convolution layer is represented by W; is a function for calculating the variance, the first sum value is represented by S1.

[0090] 305. The computer device adjusts the convolution kernel and the corresponding weight matrix in the data processing model according to the loss value.

[0091] According to the loss value, the data processing model is adjusted to improve the accuracy of the data processing model.

[0092] In a possible implementation manner, the step 305 comprises: the computer device adjusts the parameter in the convolution kernel and the weight in the corresponding weight matrix in the data processing model according to the loss value.

[0093] It should be noted that the present embodiment adjusts the convolution kernel and the corresponding weight matrix in the data processing model according to the loss value, and in another embodiment, steps 304-305 are not required to be performed, and other ways can be adopted to adjust the convolution kernel and the corresponding weight matrix in the data processing model according to the annotation result and the prediction result.

[0094] ​306. When the variance of the weights corresponding to any convolutional layer in the data processing model is greater than a reference threshold, the computer device performs average pooling on the weight matrix corresponding to the convolutional layer after this adjustment, based on the reference size, to obtain a weight matrix with a reduced size.

[0095] The weight variance is the variance of the weight matrix in the convolutional layer before this adjustment, i.e., the variance before the weight matrix was adjusted. In this embodiment, the weight variance is the variance obtained by executing step 303, and the convolutional layer after this adjustment refers to the convolutional layer obtained by executing steps 304-305. The reference threshold is an arbitrarily set value, for example, a reference threshold of 0.8 or 0.5. The reference size is an arbitrary size, for example, a reference size of 3×3 or 5×5. Weights are selected from the weight matrix using this reference size, and the selected weights are average pooled to obtain the reduced weight matrix.

[0096] If the variance of the weights corresponding to any convolutional layer is greater than the reference threshold, it indicates that the amount of data contained in the convolutional layer is large. In this case, average pooling needs to be performed on each weight matrix corresponding to the convolutional layer after this adjustment to reduce the amount of data contained in the convolutional layer and obtain a reduced-size weight matrix corresponding to each weight matrix.

[0097] In one possible implementation, step 306 includes: for any weight matrix in the convolutional layer, selecting multiple sets of weights from the weight matrix according to the reference size, determining the average value of each set of weights, using the multiple average values ​​as the weights at the center positions corresponding to each set of weights, and constructing a weight matrix with a reduced size from the multiple average values.

[0098] For example, if the weight matrix before average pooling is 5×5 and the reference size is 3×3, then the size of the weight matrix after size reduction is 3×3. Figure 4 As shown, using a reference size, a first group of weights is selected from the weight matrix, and the average value of this first group of weights is 0.41. 0.41 is used as the weight at the center position corresponding to the first group of weights. Using the reference size, a second group of weights is selected from the weight matrix, and the average value of this second group of weights is 0.38. 0.38 is used as the weight at the center position corresponding to the second group of weights. Using the reference size, a third group of weights is selected from the weight matrix, and the average value of this third group of weights is 0.49. 0.49 is used as the weight at the center position corresponding to the third group of weights. Following this method, average pooling is performed on the weight matrix to obtain a 3×3 weight matrix after size reduction.

[0099] 307. The computer device determines the center position of the convolution kernel corresponding to the weight matrix, which corresponds to the position of the maximum weight in the reduced-size weight matrix.

[0100] Since the weight matrix before size reduction has the same size as the corresponding convolution kernel, after the size of the weight matrix is reduced, the maximum weight in the size-reduced weight matrix is determined, and according to the maximum weight, the corresponding position of the maximum weight in the convolution kernel can be determined as the center position. As shown in Figure 5 FIG. 5, in the size-reduced weight matrix 501, the maximum weight is 0.49, and the position corresponding to 0.49 is determined as the center position 502.

[0101] 308. The computer device crops the convolution kernel after this adjustment according to the center position and the size of the size-reduced weight matrix to obtain the size-reduced convolution kernel.

[0102] In this embodiment of the present application, the convolution kernel after this adjustment refers to the convolution kernel obtained by performing steps 304-305.

[0103] In the convolution kernel, according to the center position and the size of the size-reduced weight matrix, a part of the area in the convolution kernel can be determined, and the size-reduced convolution kernel can be obtained by cropping the determined part. As shown in Figure 5 FIG. 5, the size of the size-reduced weight matrix is 3x3, and after the center position 502 is determined, the convolution kernel is cropped to obtain the size-reduced convolution kernel 503.

[0104] When the weight variance of any convolution layer in the data processing model is greater than the reference threshold, the size of the convolution kernel in the convolution layer and the corresponding weight matrix are reduced to obtain an updated data processing model, so that the updated data processing model includes the size-reduced convolution kernel and the corresponding weight matrix, thereby reducing the number of convolution layers included in the data processing model and ensuring the processing efficiency of the data processing model.

[0105] It should be noted that in this embodiment of the present application, the size-reduced convolution kernel is obtained by first performing average pooling on the weight matrix with reference to the size, and then using the size-reduced weight matrix. In another embodiment, steps 306-308 are not performed, and in response to the weight variance of any convolution layer in the data processing model being greater than the reference threshold, other ways can be adopted to reduce the size of the convolution kernel and the corresponding weight matrix in the convolution layer after this adjustment to obtain an updated data processing model.

[0106] In a possible implementation manner, after step 308, the method further includes: the computer device resets each weight in the size-reduced weight matrix to a reference value. The reference value is an arbitrary value, for example, the reference value is 1.

[0107] It should be noted that in the embodiments of the present application, the steps 301-308 are only used to describe one update round of the data processing model. After the step 308, the updated data processing model can be directly called to process data, or the next update round of the data processing model can be performed according to the steps 301-308. After multiple update rounds of the data processing model, the updated data processing model is called to process data.

[0108] In the multiple update rounds of the data processing model, in a possible implementation, the update of the data processing model is stopped in response to the number of iteration rounds reaching a reference value, or the update of the data processing model is stopped in response to the loss value of the data processing model being less than a reference loss value. The reference value is an arbitrary set value, for example, 10 or 15, etc. The reference loss value is an arbitrary set value, for example, 0.2 or 0.3, etc.

[0109] In addition, in the multiple update rounds, the size of the convolution kernel and the corresponding weight matrix in the data processing model can be reduced. After multiple update rounds of training, the updated data processing model is obtained. Then, the updated data processing model can be further trained by using sample data and labeled samples. In this training process, the size of the convolution kernel and the corresponding weight matrix in the data processing model does not need to be adjusted. Then, the trained data processing model is called to process data.

[0110] In a possible implementation, sample data and labeled samples are obtained, the updated data processing model is called to process the sample data, and a prediction result is obtained. According to the labeled result and the prediction result, the loss value of the data processing model is determined. According to the loss value, the size of the convolution kernel and the corresponding weight matrix in the data processing model are adjusted.

[0111] In this training process, the updated data processing model can also be trained for multiple rounds. In the multiple rounds of training of the updated data processing model, the updated data processing model is stopped in response to the number of iteration rounds reaching a reference value, or the updated data processing model is stopped in response to the loss value of the updated data processing model being less than a reference loss value.

[0112] 309. The computer device calls the updated data processing model to process data and obtains a processing result of the data.

[0113] After obtaining the updated data processing model, the data can be processed by using the updated data processing model to ensure the accuracy of the obtained processing result.

[0114] In a possible implementation, the step 309 includes: calling the updated image classification model, classifying the image data, and obtaining a category to which the image data belongs.

[0115] In the embodiments of the present application, the data processing model is an image classification model, the data is image data, the sample data is sample image data, the annotation result is a category label corresponding to the sample image data, and the prediction result is a category label predicted by the data processing model. After the image classification model is updated, the category to which the image data belongs can be determined by using the updated image classification model, and the accuracy of the determined category is ensured.

[0116] In a possible implementation, the step 309 includes: calling the updated object recognition model, recognizing the image data, and obtaining a category to which an object contained in the image data belongs and a position of the object in the image data.

[0117] In the embodiments of the present application, the data processing model is an image classification model, the data is image data, the sample data is sample image data, the annotation result is a category label corresponding to an object contained in the sample image data, and the prediction result is a category label of the object contained in the sample image data predicted by the data processing model. After the object recognition model is updated, the category to which the object contained in the image data belongs and the position of the object in the image data can be determined by using the updated object recognition model, and the accuracy of the determined category is ensured.

[0118] It should be noted that the method provided in the embodiments of the present application is only described for data in any business scenario, and in another embodiment, the data processing model provided in the embodiments of the present application can be used to update a data processing model providing functions for different business scenarios. Moreover, based on the method provided in the embodiments of the present application, a neural architecture search method is implemented, which searches for a data model providing functions for a corresponding business scenario from a data processing model for data in any business scenario. The feature extraction capability of the model searched by the neural architecture search is good, and the model can be applied in different business scenarios.

[0119] The method provided in the embodiments of the present application adjusts the convolution kernel and the corresponding weight matrix in the data processing model to ensure the accuracy of the data processing model during the training of the data processing model, and judges the data size of the convolution layer through the weight variance of the convolution layer. When the data size of the convolution layer is large, the size of the convolution kernel and the corresponding weight matrix in the convolution layer are reduced through the weight variance, so as to reduce the data size of the data processing model, thereby improving the processing efficiency of the data processing model.

[0120] And the loss value is determined by the weight variance corresponding to each convolution layer, and the data processing model is updated by using the loss value, so that the weight variance corresponding to each convolution layer is large enough, that is, the difference between the weights in the weight matrix corresponding to each convolution layer is large enough, so as to highlight the weights between different convolution kernels in the convolution layer, and ensure the accuracy of the data processing model.

[0121] And the method provided by the embodiment of the application can automatically search for a data processing model matching the data in the search space of the data processing model, and the data processing model requires fewer parameters and has high search efficiency during the search process.

[0122] In the embodiment of the application, the sample data can be data in a public data set or private data provided by a user. Regardless of the form of the sample data, the data processing model can be trained, and the data can be processed by using the trained data processing model. Moreover, the method provided by the embodiment of the application can be applied to a cloud server. The method provided by the embodiment of the application deployed by the cloud server can provide the required model for the user. For example, the method provided in the above embodiment is used to train a data processing model for the user according to the training data provided by the user. The data processing model can be used by the user after the accuracy of the training data is high. Figure 6 As shown in the figure, in the related art, the model deployed by the technical personnel through the public data has high accuracy but poor generalization ability, so the technical personnel need to deploy different models for different application scenarios. The data processing method provided by the application can be deployed in a cloud server. By using the private data of the user, a data processing model matching the private data can be searched from the initialized data processing model, so as to ensure that the accuracy of the searched data processing model is high, the data amount in the data processing model is small, and the data processing efficiency is high. Moreover, by using the method provided in the above embodiment, only one initialized data processing model needs to be deployed, and then the data in any scenario is used as sample data to train the initialized data processing model, so as to train a data processing model for the scenario, that is, different data processing models can be searched for different scenarios, different models do not need to be deployed for different data, the generalization ability is strong, and the method can be applied to various scenarios, such as image recognition scenarios, image segmentation scenarios, object detection scenarios, object positioning scenarios, and object recognition scenarios.

[0123] The method provided in this application can be applied to smart cameras. During the use of a smart camera, a large amount of image data can be obtained. With the user's permission, the method provided in this application can use the acquired image data as sample data to search for data processing models offering multiple functions from the deployed, initialized data processing models. This provides the smart camera with various functions, such as face recognition, age recognition, face swapping, and automatic makeup enhancement, eliminating the need for technicians to develop separate models for each function. This saves time and manpower. Furthermore, the method provided in this application can alleviate the pressure on non-professionals in projects. For example, if multiple data processing models are needed, the method provided in this application can acquire various sample data and corresponding annotation results, allowing multiple data processing models to be searched from the initialized data processing models. The searched models can be reused repeatedly. This process does not require professional technicians; only the data processing method provided in this application needs to be deployed in advance.

[0124] Taking image classification as an example, this application provides a flowchart of an image classification method. In this embodiment, the data processing model is an image classification model, the sample data is sample image data, the data is image data, the annotation result is the sample label to which the sample image data belongs, and the prediction result is the predicted label of the sample image data. The flowchart includes:

[0125] 1. Computer equipment acquires sample image data and corresponding sample labels.

[0126] 2. The computer equipment calls the image classification model to process the sample image data and obtain the predicted label.

[0127] 3. The computer device obtains the weight variance corresponding to each convolutional layer based on the weights in at least one weight matrix corresponding to each convolutional layer.

[0128] 4. The computer equipment obtains the loss value of the image classification model based on the sample labels and the predicted labels.

[0129] 5. The computer equipment adjusts the convolution kernels and corresponding weight matrices in the image classification model based on the loss values.

[0130] 6. When the variance of the weights corresponding to any convolutional layer in the image classification model is greater than the reference threshold, the computer device performs average pooling on the weight matrix corresponding to the convolutional layer according to the reference size to obtain a weight matrix with a reduced size.

[0131] 7. The computer device determines the center position of the convolution kernel corresponding to the weight matrix, which corresponds to the position of the maximum weight in the reduced-size weight matrix.

[0132] 8. The computer device crops the convolution kernel according to the size of the weight matrix after the size reduction of the center position and the size, to obtain the convolution kernel after the size reduction.

[0133] 9. The computer device calls the updated image classification model to process the image data, to determine the category of the image data.

[0134] It should be noted that steps 1-9 in the embodiments of the present application are similar to steps 301-309 in the above embodiments, and will not be described here.

[0135] Figure 7 is a structural schematic diagram of a data processing apparatus provided by an embodiment of the present application, as shown in the figure, the apparatus comprises: Figure 7

[0136] The acquisition module 701 is configured to acquire sample data and corresponding annotation results.

[0137] The processing module 702 is configured to call a data processing model to process the sample data, to obtain a prediction result, the data processing model comprising at least one convolution layer, each convolution layer comprising at least one convolution kernel, each convolution kernel corresponding to a weight matrix.

[0138] The adjustment module 703 is configured to adjust the convolution kernel and the corresponding weight matrix in the data processing model according to the annotation result and the prediction result.

[0139] The reduction module 704 is configured to, in response to the weight variance corresponding to any convolution layer in the data processing model being greater than a reference threshold, reduce the convolution kernel and the corresponding weight matrix in the convolution layer after this adjustment, to obtain an updated data processing model, the weight variance being the variance of the weight matrix in the convolution layer before this adjustment.

[0140] The processing module 702 is further configured to call the updated data processing model to process the data, to obtain a processing result of the data.

[0141] In a possible implementation manner, the reduction module 704 comprises:

[0142] The pooling unit 7041 is configured to, in response to the weight variance being greater than the reference threshold, average-pool the weight matrix corresponding to the convolution layer according to a reference size, to obtain a weight matrix after the size reduction.

[0143] The determination unit 7042 is configured to determine, as a center position, a position in the convolution kernel corresponding to the weight matrix, which corresponds to the maximum weight in the weight matrix after the size reduction.

[0144] ​The cropping unit 7043 is used to crop the convolution kernel according to the center position and the size of the reduced weight matrix to obtain a reduced-size convolution kernel.

[0145] In another possible implementation, the device also includes:

[0146] The reset module 705 is used to reset each weight in the reduced-size weight matrix to a reference value.

[0147] In another possible implementation, the acquisition module 701 is further configured to acquire the weight variance corresponding to each convolutional layer based on the weights in at least one weight matrix corresponding to each convolutional layer.

[0148] In another possible implementation, module 703 is adjusted to include:

[0149] The acquisition unit 7031 is used to acquire the loss value of the data processing model based on the annotation results and prediction results;

[0150] The adjustment unit 7032 is used to adjust the convolution kernel and the corresponding weight matrix in the data processing model according to the loss value.

[0151] In another possible implementation, the acquisition unit 7031 is used to determine the initial loss value of the data processing model based on the annotation results and prediction results; determine the first sum of the weight variances corresponding to at least one convolutional layer; and determine the difference between the initial loss value and the first sum as the loss value of the data processing model.

[0152] In another possible implementation, the acquisition unit 7031 is used to determine the initial loss value of the data processing model based on the annotation results and prediction results; determine the second sum of the weights in the weight matrix corresponding to at least one convolutional layer; and determine the sum of the initial loss value and the second sum as the loss value of the data processing model.

[0153] In another possible implementation, the data processing model is an image classification model, and the data is image data;

[0154] The processing module 702 is used to call the updated image classification model to classify the image data and obtain the category to which the image data belongs.

[0155] In another possible implementation, the data processing model is an object recognition model, and the data is image data;

[0156] The processing module 702 is used to call the updated object recognition model to recognize the image data and obtain the category of the object contained in the image data and the position of the object in the image data.

[0157] It should be noted that the data processing apparatus provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the data processing apparatus and data processing method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0158] This application also provides a computer device, which includes a processor and a memory. The memory stores at least one computer program, which is loaded and executed by the processor to perform the operations performed in the data processing method of the above embodiments.

[0159] Optionally, the computer device is provided as a terminal. Figure 9 A structural block diagram of a terminal 900 provided in an exemplary embodiment of this application is shown. The terminal 900 may be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. The terminal 900 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.

[0160] The terminal 900 includes a processor 901 and a memory 902.

[0161] Processor 901 may include one or more processing cores, such as a quad-core processor or an octa-core processor. Processor 901 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 901 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 901 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 901 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0162] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 902 are used to store at least one computer program, which is executed by the processor 901 to implement the data processing method provided in the method embodiments of this application.

[0163] In some embodiments, the terminal 900 may also optionally include a peripheral device interface 903 and at least one peripheral device. The processor 901, memory 902, and peripheral device interface 903 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 903 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 904, a display screen 905, a camera assembly 906, an audio circuit 907, and a power supply 909.

[0164] Peripheral device interface 903 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 901 and memory 902. In some embodiments, processor 901, memory 902 and peripheral device interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 901, memory 902 and peripheral device interface 903 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.

[0165] The radio frequency (RF) circuit 904 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 904 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 904 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 904 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 904 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 904 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.

[0166] Display screen 905 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 905 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 901 for processing. In this case, display screen 905 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 905, disposed on the front panel of terminal 900; in other embodiments, there may be at least two display screens 905, disposed on different surfaces of terminal 900 or in a folded design; in other embodiments, display screen 905 may be a flexible display screen, disposed on a curved or folded surface of terminal 900. Furthermore, display screen 905 may be configured as a non-rectangular irregular shape, i.e., a non-rectangular screen. Display screen 905 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).

[0167] The camera assembly 906 is used to acquire images or videos. Optionally, the camera assembly 906 includes a front-facing camera and a rear-facing camera. The front-facing camera is disposed on the front panel of the terminal, and the rear-facing camera is disposed on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 906 may also include a flash. The flash may be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cool light flash, which can be used for light compensation at different color temperatures.

[0168] The audio circuit 907 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting them into electrical signals that are input to the processor 901 for processing, or to the radio frequency circuit 904 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each positioned at a different location on the terminal 900. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 901 or the radio frequency circuit 904 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 907 may also include a headphone jack.

[0169] Power supply 909 is used to supply power to the various components in terminal 900. Power supply 909 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery. When power supply 909 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, while a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0170] In some embodiments, the terminal 900 further includes one or more sensors 910. The one or more sensors 910 include, but are not limited to, an accelerometer 911, a gyroscope 912, a pressure sensor 913, an optical sensor 915, and a proximity sensor 916.

[0171] Accelerometer 911 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by terminal 900. For example, accelerometer 911 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 901 can control display screen 905 to display the user interface in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 911. Accelerometer 911 can also be used for games or for acquiring user motion data.

[0172] The gyroscope sensor 912 can detect the orientation and rotation angle of the terminal 900. The gyroscope sensor 912, in conjunction with the accelerometer sensor 911, can collect the user's 3D movements on the terminal 900. Based on the data collected by the gyroscope sensor 912, the processor 901 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.

[0173] The pressure sensor 913 can be disposed on the side bezel of the terminal 900 and / or the lower layer of the display screen 905. When the pressure sensor 913 is disposed on the side bezel of the terminal 900, it can detect the user's grip signal on the terminal 900, and the processor 901 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 913. When the pressure sensor 913 is disposed on the lower layer of the display screen 905, the processor 901 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 905. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

[0174] An optical sensor 915 is used to collect ambient light intensity. In one embodiment, the processor 901 can control the display brightness of the display screen 905 based on the ambient light intensity collected by the optical sensor 915. Specifically, when the ambient light intensity is high, the display brightness of the display screen 905 is increased; when the ambient light intensity is low, the display brightness of the display screen 905 is decreased. In another embodiment, the processor 901 can also dynamically adjust the shooting parameters of the camera assembly 906 based on the ambient light intensity collected by the optical sensor 915.

[0175] The proximity sensor 916, also known as a distance sensor, is installed on the front panel of the terminal 900. The proximity sensor 916 is used to detect the distance between the user and the front of the terminal 900. In one embodiment, when the proximity sensor 916 detects that the distance between the user and the front of the terminal 900 is gradually decreasing, the processor 901 controls the display screen 905 to switch from a screen-on state to a screen-off state; when the proximity sensor 916 detects that the distance between the user and the front of the terminal 900 is gradually increasing, the processor 901 controls the display screen 905 to switch from a screen-off state to a screen-on state.

[0176] Those skilled in the art will understand that Figure 9 The structure shown does not constitute a limitation on terminal 900, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0177] Optionally, the computer equipment is provided as a server. Figure 10This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1000 can vary considerably due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 1001 and one or more memories 1002. The memory 1002 stores at least one computer program, which is loaded and executed by the processor 1001 to implement the methods provided in the above-described method embodiments. Of course, the server may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be elaborated here.

[0178] This application also provides a computer-readable storage medium storing at least one computer program, which is loaded and executed by a processor to perform the operations performed in the data processing method of the above embodiments.

[0179] This application also provides a computer program product or computer program, which includes computer program code stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium and executes the computer program code, causing the computer device to perform the operations as described in the data processing method of the above embodiments.

[0180] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0181] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present application should be included within the protection scope of the present application.

Claims

1. A data processing method, characterized in that, The method includes: Acquire sample data and corresponding annotation results, wherein the sample data is sample image data; The data processing model is invoked to process the sample data and obtain the prediction result. The data processing model includes at least one convolutional layer, each convolutional layer includes at least one convolutional kernel, and each convolutional kernel corresponds to a weight matrix. Based on the annotation results and the prediction results, the convolution kernels and corresponding weight matrices in the data processing model are adjusted; In response to a situation where the variance of the weights corresponding to any convolutional layer in the data processing model exceeds a reference threshold, average pooling is performed on the weight matrix corresponding to the convolutional layer after the adjustment, based on the reference size, to obtain a weight matrix with a reduced size. The position in the convolutional kernel corresponding to the weight matrix that corresponds to the maximum weight in the weight matrix with a reduced size is determined as the center position. Based on the center position and the size of the weight matrix with a reduced size, the convolutional kernel after the adjustment is pruned to obtain a convolutional kernel with a reduced size. The variance of the weights is the variance of the weight matrix in the convolutional layer before the adjustment. The updated data processing model is invoked to process the data and obtain the processing result; wherein the data is image data; the updated data processing model includes a scaled-down convolution kernel and a corresponding weight matrix.

2. The method according to claim 1, characterized in that, After cropping the convolution kernel according to the center position and the size of the reduced-size weight matrix to obtain a reduced-size convolution kernel, the method further includes: Each weight in the reduced-size weight matrix is ​​reset to a reference value.

3. The method according to claim 1, characterized in that, Before adjusting the convolution kernels and corresponding weight matrices in the data processing model based on the annotation results and the prediction results, the method further includes: The weight variance corresponding to each convolutional layer is obtained based on the weights in at least one weight matrix corresponding to each convolutional layer.

4. The method according to claim 1, characterized in that, The step of adjusting the convolution kernels and corresponding weight matrices in the data processing model based on the annotation results and the prediction results includes: Based on the annotation results and the prediction results, the loss value of the data processing model is obtained; Based on the loss value, the convolution kernels and corresponding weight matrices in the data processing model are adjusted.

5. The method according to claim 4, characterized in that, The step of obtaining the loss value of the data processing model based on the annotation results and the prediction results includes: Based on the annotation results and the prediction results, the initial loss value of the data processing model is determined; Determine the first sum of the weight variances corresponding to the at least one convolutional layer; The difference between the initial loss value and the first sum is determined as the loss value of the data processing model.

6. The method according to claim 4, characterized in that, The step of obtaining the loss value of the data processing model based on the annotation results and the prediction results includes: Based on the annotation results and the prediction results, the initial loss value of the data processing model is determined; Determine the second sum of the weights in the weight matrix corresponding to the at least one convolutional layer; The sum of the initial loss value and the second sum value is determined as the loss value of the data processing model.

7. The method according to any one of claims 1-6, characterized in that, The data processing model is an image classification model; The process of calling the updated data processing model to process the data and obtain the processing result includes: The updated image classification model is invoked to classify the image data and obtain the category to which the image data belongs.

8. The method according to any one of claims 1-6, characterized in that, The data processing model is an object recognition model; The process of calling the updated data processing model to process the data and obtain the processing result includes: The updated object recognition model is invoked to identify the image data, thereby obtaining the category of the object contained in the image data and the position of the object in the image data.

9. A data processing apparatus, characterized in that, The device includes: The acquisition module is used to acquire sample data and corresponding annotation results, wherein the sample data is sample image data; The processing module is used to call the data processing model to process the sample data and obtain the prediction result. The data processing model includes at least one convolutional layer, each convolutional layer includes at least one convolutional kernel, and each convolutional kernel corresponds to a weight matrix. The adjustment module is used to adjust the convolution kernels and corresponding weight matrices in the data processing model based on the annotation results and the prediction results. The scaling module is used to respond to situations where the variance of the weights corresponding to any convolutional layer in the data processing model is greater than a reference threshold. Based on the reference size, it performs average pooling on the weight matrix corresponding to the adjusted convolutional layer to obtain a scaled-down weight matrix. It then determines the center position of the convolutional kernel corresponding to the weight matrix, corresponding to the position of the maximum weight in the scaled-down weight matrix. Based on the center position and the size of the scaled-down weight matrix, it prunes the adjusted convolutional kernel to obtain a scaled-down convolutional kernel. The variance of the weights is the variance of the weight matrix in the convolutional layer before the adjustment. The processing module is further configured to call the updated data processing model to process the data and obtain the processing result of the data; wherein the data is image data; the updated data processing model includes a scaled-down convolution kernel and a corresponding weight matrix.

10. The apparatus according to claim 9, characterized in that, The shrinking module includes: A pooling unit is used to perform average pooling on the weight matrix corresponding to the convolutional layer according to the reference size in response to the weight variance being greater than the reference threshold, so as to obtain a weight matrix with a reduced size. The determining unit is used to determine the position in the convolution kernel corresponding to the weight matrix, which corresponds to the position of the maximum weight in the reduced-size weight matrix, as the center position; The cropping unit is used to crop the convolution kernel according to the center position and the size of the reduced weight matrix to obtain a reduced-size convolution kernel.

11. The apparatus according to claim 10, characterized in that, The device further includes: The reset module is used to reset each weight in the reduced-size weight matrix to a reference value.

12. The apparatus according to claim 9, characterized in that, The adjustment module includes: An acquisition unit is used to acquire the loss value of the data processing model based on the annotation results and the prediction results. The adjustment unit is used to adjust the convolution kernels and corresponding weight matrices in the data processing model according to the loss value.

13. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one computer program, which is loaded and executed by the processor to perform the operations performed in the data processing method as described in any one of claims 1 to 8.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to perform the operations performed in the data processing method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Convolutional neural network generation method and device

    CN110059796A

  • System and method for implementing a neural network

    US20190378017A1