Data processing method and device, electronic equipment and storage medium

CN116597216BActive Publication Date: 2026-10-20ZHIDAO NETWORK TECH (BEIJING) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310573272.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-19
Publication Date
2026-10-20
Estimated Expiration
2043-05-19

AI Technical Summary

Technical Problem

[0003]对于一次训练的不同样本,会产生多个不同的损失值,相关技术的深度学习过程中,通常是以样本中各个损失值的平均值作为最终损失值,但是采用上述损失函数进行深度学习网络模型训练时,其训练效果不佳,进而导致在进行例如图像分类处理、图像识别处理等操作时效果不佳

Benefits of technology

通过降低对预测效果好(损失值数值更小)的位置的关注度、增大对预测效果差(损失值数值更大)的位置的关注度,使得深度学习网络模型在预测效果差的位置的性能提升,有助于提高效果差的位置的预测效果,能够提高深度学习网络的预测准确度,提高深度学习效果。该方法用于图像分类处理时,可以获得较好的分类效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116597216B_ABST
    Figure CN116597216B_ABST
Patent Text Reader

Abstract

The application relates to a data processing method and device, electronic equipment and a storable medium. The method comprises the following steps: obtaining a training sample data set, inputting the training sample data set into a deep learning network model, obtaining N loss values output by a loss function processing module in the deep learning network model, obtaining a weight value corresponding to each loss value in the N loss values according to each loss value in the N loss values, obtaining a total loss value according to each loss value in the N loss values and the weight value corresponding to each loss value in the N loss values, and training and optimizing the deep learning network model according to the total loss value. The scheme provided by the application can improve the prediction accuracy of the deep learning network and improve the training effect of the deep learning network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a data processing method, apparatus, electronic device, and storage medium. Background Technology

[0002] Deep learning is a complex machine learning algorithm whose ultimate goal is to enable robots to analyze and learn like humans, recognizing data such as text, images, and sound. In the deep learning process, each batch of training data is first input into the model, and a predicted value is output through forward propagation. Then, a loss function is applied to calculate the difference between the predicted value and the true value, i.e., the loss. loss The loss value is obtained, and then the model is trained through backpropagation.

[0003] For different samples in a single training session, multiple different loss values ​​will be generated. In the deep learning process of related technologies, the average of the loss values ​​in the samples is usually used as the final loss value. However, when using the above loss function to train a deep learning network model, the training effect is not good, which leads to poor performance when performing operations such as image classification and image recognition. Summary of the Invention

[0004] To address or partially address the problems existing in related technologies, this application provides a data processing method, apparatus, electronic device, and storage medium that can improve the prediction accuracy and training effect of deep learning networks.

[0005] The first aspect of this application provides a data processing method, including: Obtain the training sample dataset and input it into the deep learning network model to obtain the output of the loss function processing module of the deep learning network model. N Each loss value; According to the above N From each of the loss values, obtain the... N The weight values ​​corresponding to each loss value in the loss values; According to the above N Each loss value in the loss values, and the aforementioned N The total loss value is obtained by assigning weights to each loss value among the loss values. The deep learning network model is trained and optimized based on the overall loss value.

[0006] In one embodiment, the terms are respectively based on the N From each of the loss values, obtain the... N The weight values ​​corresponding to each loss value in the loss values ​​include: According to the above N From each of the loss values, obtain the... N The mean of the loss values; According to the above N Each loss value in the loss values, and the aforementioned N The mean of the loss values ​​is used to obtain the... N The weight values ​​corresponding to each loss value in the loss values.

[0007] In one embodiment, the statement based on the N Each loss value in the loss values, and the aforementioned N The mean of the loss values ​​is used to obtain the... N The weight values ​​corresponding to each loss value in the loss values ​​include: According to the above N Each loss value in the loss values, the aforementioned N The mean of each loss value and the hyperparameter are used to obtain the... N The weight values ​​corresponding to each loss value in the loss values.

[0008] In one embodiment, the activation function is used to obtain the... N The weight values ​​corresponding to each loss value in the loss values.

[0009] In one embodiment, the step of obtaining the activation function N The weight values ​​corresponding to each loss value in the loss values ​​include: According to the above N Each loss value in the loss value The above N The mean m of each loss value and the hyperparameter K are obtained using the following formula. N The weight value corresponding to each loss value in the loss values. : .

[0010] In one embodiment, the step of obtaining the activation function N The weight values ​​corresponding to each loss value in the loss values ​​include: According to the above N Each loss value in the loss value The above N The mean m of each loss value and the hyperparameter K are obtained using the following formula. N The weight value corresponding to each loss value in the loss values. : .

[0011] In one embodiment, the statement based on the NEach loss value in the loss values, and the aforementioned N The total loss value is obtained by assigning weights to each loss value among the loss values, including: According to the above N Each loss value in the loss value and the aforementioned N The weight value corresponding to each loss value in the loss values. The total loss value (Loss) is obtained using the following formula: .

[0012] A second aspect of this application provides a data processing apparatus, comprising: The acquisition unit is used to acquire the training sample dataset and input the training sample dataset into the deep learning network model to obtain the output of the loss function processing module of the deep learning network model. N Each loss value; The first calculation unit is used to calculate the results obtained by the acquisition unit, respectively. N From each of the loss values, obtain the... N The weight values ​​corresponding to each loss value in the loss values; The second calculation unit is used to calculate the result obtained by the acquisition unit. N Each loss value among the loss values, and the loss value obtained by the first calculation unit N The total loss value is obtained by assigning weights to each loss value among the loss values. The update unit is used to train and optimize the deep learning network model based on the overall loss value obtained by the second calculation unit.

[0013] A third aspect of this application provides an electronic device, comprising: Processor; and A memory that stores executable code, which, when executed by the processor, causes the processor to perform the method described above.

[0014] A fourth aspect of this application provides a computer-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to perform the method described above.

[0015] The technical solution provided in this application may include the following beneficial effects: By reducing the focus on locations with good prediction results (smaller loss values) and increasing the focus on locations with poor prediction results (larger loss values), the performance of the deep learning network model at these poorly predicted locations is improved. This helps to enhance the prediction accuracy of the deep learning network and improve the overall deep learning effect. When used for image classification, this method can achieve better classification results.

[0016] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0017] The above and other objects, features and advantages of this application will become more apparent from the following description of exemplary embodiments of this application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of this application.

[0018] Figure 1 This is a schematic flowchart illustrating the data processing method in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of the data processing apparatus shown in the embodiments of this application; Figure 3 This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application. Detailed Implementation

[0019] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to make this application more thorough and complete, and to fully convey the scope of this application to those skilled in the art.

[0020] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0021] It should be understood that although the terms "first," "second," "third," etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0022] Deep learning is applied to the recognition and learning of data such as text, images, and sound. Current deep learning generally uses two types of loss functions: classification loss functions and regression loss functions. Commonly used classification loss functions include 0-1 loss function, log loss function, and squared loss function. Hinge Loss function, cross-entropy loss function CrossEntropyLoss Common regression loss functions include mean absolute error (MAE), etc. MeanAbsoluteError , MAE ), mean square error ( MeanSquareError , MSE ), Huber loss function Log - Cosh Loss functions, quantile loss functions, etc. Currently, in deep learning network models, the final step in calculating the loss function is usually to average the loss values ​​of the samples to obtain the final loss value. Below is an example of the cross-entropy loss function used in the field of image semantic segmentation, specifically represented as follows: (1) Among them, L CE This refers to the loss value that the network predicts based on the sample images. N This represents the total number of pixels in the sample image. C The number of sample categories; y The truth value for the probability that a pixel belongs to that category is: if a pixel belongs to that category... id for k ,but (2) p To predict the probability of a pixel belonging to a certain category using a network, the value range is [0,1], and the sum of the probabilities of all categories for the same pixel is 1.0, i.e. (3) As can be seen, the cross-entropy loss function used in the semantic segmentation of images above averages the loss values ​​of all pixel-classes in the image through global averaging to obtain the final loss value. However, for different samples in a single training session, multiple different loss values ​​will be generated. The global averaging method will hinder the performance improvement of the deep learning network model in areas where the prediction effect is poor. Therefore, when using the above loss function to train a deep learning network model, the training effect is not good.

[0023] To address the aforementioned issues, this application provides a data processing method that can improve the prediction accuracy and training performance of deep learning networks.

[0024] The technical solutions of the embodiments of this application are described in detail below with reference to the accompanying drawings.

[0025] Figure 1 This is a schematic flowchart illustrating the data processing method in an embodiment of this application.

[0026] See Figure 1 The data processing method includes: S 110. Obtain the training sample dataset and input it into the deep learning network model to obtain the output of the loss function processing module of the deep learning network model. N Each loss value.

[0027] In one implementation, a training sample dataset may be obtained, the training sample dataset containing N The training sample dataset is input into a deep learning network model, which outputs predicted values, thus obtaining the output of the loss function processing module of the deep learning network model. N There are one loss value, with one loss value corresponding to each sample.

[0028] In another implementation, a training sample dataset may be obtained, which contains... M There are samples, and the number of sample categories is . C The training sample dataset is input into the deep learning network model, which outputs predicted values, thus obtaining the output from the loss function processing module of the deep learning network model. N There are several loss values, among which... N = M * C That is, for M For each sample in the sample, there exists a corresponding C The total number of loss values ​​for this training sample dataset is the product of the number of samples and the number of classes, representing one probability of each of the categories. N .

[0029] In this embodiment, the training sample dataset is input into the deep learning network model, and for each sample... i In other words, the sample is output by the deep learning network model. i Corresponding predicted value f(i) and predicted values f(i) Compared with the true value y i loss value l i Obtain the loss value corresponding to each sample in the training sample dataset. li .

[0030] Here, "deep learning network model" refers to a model trained by a deep learning network. Deep learning networks include, but are not limited to, convolutional neural networks, autoencoder neural networks, and deep belief networks, etc., without any restrictions. In the deep learning network model, an appropriate loss function type can be selected according to the actual application scenario. For example, a 0-1 loss function can be selected to calculate the loss value of the training sample dataset, and its expression is shown in equation (4): (4) The 0-1 loss function means that when the predicted value... f(i) Compared with the true value y i When the values ​​are equal, the loss value is 0; when the predicted values ​​are equal, the loss value is 0. f(i) Compared with the true value y i When they are not equal, the loss value is 1; Alternatively, the cross-entropy loss function can be used to calculate the loss value of the training sample dataset, and its expression is shown in equation (1). When the pixels in the sample image are correctly classified, the loss value is... loss It is 0 if it is not 0, otherwise it is greater than 0.

[0031] It should be noted that, in S 110 obtained N The loss value is obtained through the classification loss function or regression loss function mentioned above, and is not limited to the cross-entropy loss function or the 0-1 loss function.

[0032] S 120. According to respectively N For each loss value among the loss values, obtain N The weight values ​​corresponding to each loss value in the loss values.

[0033] In the training sample dataset of a single training session NThe loss value varies. The loss value is smaller for positions (samples) with better prediction results and larger for positions (samples) with worse prediction results. Therefore, if the overall loss value of the training sample dataset for this training session is calculated by global averaging, the proportion of positions with good prediction results in the overall loss value will be small, while the proportion of positions with poor prediction results will be large, which will greatly affect the accuracy of the prediction results.

[0034] In this embodiment, calculation is used. N Each loss value has its weight in the total loss value. Then, the total loss value corresponding to the training sample dataset is calculated once. This allows the deep learning network model to reduce its focus on poorly predicted locations and increase its focus on well-predicted locations. In other words, it reduces the proportion of the loss value of poorly predicted locations in the total loss value and increases the proportion of the loss value of well-predicted locations in the total loss value, thereby improving the overall prediction accuracy.

[0035] In one embodiment, it can be based on respectively N For each loss value among the loss values, obtain N The mean of the loss values; according to N Each loss value and the loss value in each loss value N The average of the loss values ​​is obtained. N The weight values ​​corresponding to each loss value in the loss values. Among them, the weight values ​​corresponding to each loss value are obtained. N The method for calculating the mean of the loss values ​​is... N The average of the sums of the loss values, expressed in equation (5): (5) in, m for N The mean of the loss values; N The number of loss values; l i for N The first of the loss values i Each loss value.

[0036] Understandably, the above N The loss value can be N The loss value corresponding to each sample in the sample can also be M Each sample in the samples corresponds to C The loss value is obtained by considering each sample category.

[0037] In one embodiment, the weight value corresponding to the N loss values ​​can be calculated by the ratio of each of the N loss values ​​to the mean of the N loss values, as expressed in equation (6): (6) in, w i for N The first of the loss values i The weight values ​​corresponding to each loss value.

[0038] In one implementation, it can also be calculated via an activation function. N The weights corresponding to each loss value in the loss set, and the activation function can be either monotonically increasing or monotonically decreasing and can constrain the upper and lower bounds. Sigmoid function, Tanh function.

[0039] in, Sigmoid Functions are also called Logistic The function, whose formula is shown in equation (7): (7) In one implementation, when via Sigmoid When calculating the weight value using the function, N Each loss value in the loss values ​​and N The ratio of the average of the individual loss values ​​can be used to calculate each loss value. l i The corresponding weight value, that is, let x= Its expression is shown in equation (8): (8) pass Sigmoid Obtained by function calculation N The weight value corresponding to each loss value is in the range of 0 < 0. w i The value <1 can constrain the range of weight values ​​corresponding to each of the N loss values, thus avoiding situations where the weight values ​​corresponding to individual loss values ​​are too large.

[0040] In one embodiment, in order to adjust N The difference between different loss values, i.e., the increase in the weight difference corresponding to different loss values, can make... x= For example, we can use equation (9): (9) At this point, calculation N Among the loss values l i < m When the weight value corresponds to the loss value, its 0 < w i <0.5; Calculate N Among the loss values li > m When the weight value corresponding to the loss value is 0.5 < w i <1, which widens the gap between the weight values ​​corresponding to different loss values, and helps to distinguish the proportion of each loss value in the total loss value.

[0041] In one embodiment, it can be based on N Each loss value in the loss value, N The mean of each loss value and the hyperparameters are obtained. N The weight values ​​corresponding to each loss value are used in the calculation. In practical applications, this can be achieved by utilizing... With hyperparameters K The product is used to calculate each loss value. l i The corresponding weight value; or, it can also be used With hyperparameters K The product is used to calculate each loss value. l i The corresponding weights. The following are examples... With hyperparameters K Calculate the product as an example N The expression (10) for the weights corresponding to each loss value in the loss values ​​is given here. x= : (10) in, K For hyperparameters, K >0.

[0042] Using the introduction of hyperparameters K The value method has been further adjusted. N The difference between different loss values ​​increases the weight difference between them, which helps to distinguish the proportion of each loss value in the total loss value. When calculating the total loss value for a single training sample, the same hyperparameter needs to be used. K This ensures the fairness of calculating the overall loss value from all samples within a single training iteration. It should be noted that hyperparameters... K The hyperparameters can be adjusted according to different sample datasets or application scenarios until a suitable hyperparameter is selected. At the same time, multiple different hyperparameters K can be used to train the same training sample dataset simultaneously to obtain multiple different training results. The hyperparameter K corresponding to the better training result can be selected as the hyperparameter K of the training sample dataset.

[0043] Introducing hyperparameters K When calculating weight values, comparisons can be made. or With a size of 1, if most or If the value is less than or equal to 1, then the hyperparameter can be... K Set as K >1; If most or If the value is greater than 1, then the hyperparameter can be adjusted. K Set to <1 to adjust appropriately. Sigmoid function x Within the range, the weights corresponding to different loss values ​​should be adjusted appropriately.

[0044] Furthermore, hyperparameters K The interval can be set to 0.5 < K <2, thereby increasing the weight difference between different loss values, so that the weights corresponding to each loss value are distributed between (0,1), and the weights corresponding to the loss values ​​will not completely tend to 1 or completely tend to 0, which is helpful to distinguish the proportion of each different loss value in the total loss value.

[0045] In another embodiment, it can be adopted Tanh The function retrieves the weight value corresponding to each of the N loss values. Tanh The formula for the function is shown in equation (11): (11) When passing Tanh Function calculation N When considering the weights corresponding to each loss value in the loss values, it is also possible to let x= , or make x= , or make x= The following is based on x= Calculate as an example N The first of the loss values i The weight value corresponding to each loss value w i The expression (12): (12) pass Tanh Obtained by function calculation N The weight value corresponding to each loss value is in the range of 0 < 0. w i <2 can constrain the range of weight values ​​corresponding to each of the N loss values, thus avoiding situations where the weight values ​​corresponding to individual loss values ​​are too large.

[0046] In this embodiment, the weight value corresponding to each loss value is the weight value for the loss value corresponding to each sample in each training process. That is, if the loss value generated by the same training sample is different in different batches of training, its corresponding weight value is also different. The weight value is dynamically adjusted according to the result of each loss value obtained. Moreover, in the calculation... N piece When calculating the weights corresponding to each loss value in the loss value set, backpropagation is not required.

[0047] S 130. According to N Each loss value in the loss value, and N The total loss value is obtained by assigning weights to each loss value.

[0048] During training, after incorporating the weights into the calculation of the overall loss value, according to... N Each loss value in the loss value, and N The weight values ​​corresponding to each loss value are obtained from the loss values. N The weighted average of the loss values, with this N The weighted average of the individual loss values ​​is the total loss value, and the specific calculation formula is as follows: (13) In the calculation of the overall loss value, locations with larger loss values ​​(locations with worse prediction performance) account for a larger proportion, which helps to improve the detection performance of locations with poor prediction performance, thereby improving the accuracy of the prediction results. Meanwhile, when using... Sigmoid When calculating weight values ​​using the function, the largest weight value is less than 1, and the smallest weight value is greater than 0; when using Tanh When calculating the weight values, the maximum weight value is less than 2 and the minimum weight value is greater than 0. This ensures that the overall loss value does not overemphasize the poorly predicted positions while ignoring the moderately predicted positions, thus improving the deep learning effect.

[0049] S140. Train and optimize the deep learning network model based on the overall loss value.

[0050] The overall loss value and related parameters of the deep learning network model are updated and optimized to improve the accuracy of the predicted values ​​output by the deep learning network model.

[0051] The method for obtaining the overall loss value can be applied to loss function calculations in various application scenarios, such as deep learning fields like semantic segmentation of images, object detection of images, instance segmentation of images, human keypoint detection, and semantic segmentation of point clouds, without any limitations.

[0052] Taking image classification processing as an example, the process of training a deep learning network model using this data processing method includes: a) Input a batch of image training samples into a deep learning network model. The loss function processing module of the deep learning network model outputs the error between the predicted value and the true value of the sample image belonging to a certain category, i.e., the loss value. b) Average each loss value to obtain the mean; c) Obtain the weight value corresponding to each loss value from each loss value and the mean; d) Obtain the overall loss value of the batch of image training samples by using each loss value and its corresponding weight value; e) Train the deep learning network model using the overall loss value, adjust the relevant parameters of the deep learning network model until the obtained overall loss value is less than or equal to the set threshold, and complete the training of the deep learning network model.

[0053] The data processing method in this application embodiment weights the original loss value of the deep learning network model to obtain a new loss value. By reducing the focus on locations with good prediction results (smaller loss values) and increasing the focus on locations with poor prediction results (larger loss values), the performance of the deep learning network model at locations with poor prediction results is improved, thus enhancing the prediction performance at these locations and improving the overall deep learning effect. When applied to image classification processing, it can achieve better classification results.

[0054] Meanwhile, the loss function processing does not require backpropagation, that is, it does not require calculating gradient values. The overall computational load of the loss function processing is small and it consumes few resources.

[0055] Corresponding to the aforementioned application function implementation method embodiments, this application also provides a data processing device, an electronic device, and corresponding embodiments.

[0056] Figure 2 This is a schematic diagram of the loss function processing device shown in the embodiments of this application.

[0057] See Figure 2 The data processing device 200 includes an acquisition unit 210, a first calculation unit 220, a second calculation unit 230, and an update unit 240.

[0058] The acquisition unit 210 is used to acquire the training sample dataset and input the training sample dataset into the deep learning network model to obtain the output of the loss function processing module of the deep learning network model. N Each loss value.

[0059] The first calculation unit 220 is used to calculate the results obtained by the acquisition unit 210 respectively.N For each loss value among the loss values, obtain N The weight values ​​corresponding to each loss value in the loss values.

[0060] The first calculation unit 220 is used to calculate according to the... N From each of the loss values, obtain the... N The mean of the loss values; according to the N Each loss value in the loss values, and the aforementioned N The mean of the loss values ​​is used to obtain the... N The weight values ​​corresponding to each loss value in the loss values; or, according to the... N Each loss value in the loss values, the aforementioned N The mean of each loss value and the hyperparameter are used to obtain the... N The weight values ​​corresponding to each loss value in the loss values.

[0061] The activation function is used to obtain the... N The weight values ​​corresponding to each loss value in the loss values, for example: according to the... N Each loss value in the loss value The above N The mean m of each loss value and the hyperparameter K are obtained using the following formula. N The weight value corresponding to each loss value in the loss values. : ; Or, according to the above N Each loss value in the loss value The above N The mean m of each loss value and the hyperparameter K are obtained using the following formula. N The weight value corresponding to each loss value in the loss values. :

[0062] The second calculation unit 230 is used to calculate the result obtained by the acquisition unit 210. N Each loss value among the loss values, and the loss value obtained by the first calculation unit 220 N The total loss value is obtained by assigning weights to each loss value.

[0063] The second computing unit 230 is used to calculate according to the... N Each loss value in the loss values, and the aforementioned N The total loss value is obtained by assigning weights to each loss value among the loss values; specifically, based on the aforementioned... N Each loss value in the loss value and the aforementionedN The weight value corresponding to each loss value in the loss values. The total loss value (Loss) is obtained using the following formula: .

[0064] The update unit 240 is used to train and optimize the deep learning network model based on the overall loss value obtained by the second calculation unit.

[0065] The data processing apparatus of this application improves the performance of the deep learning network at locations with poor prediction results (smaller loss values) by reducing the focus on locations with good prediction results and increasing the focus on locations with poor prediction results (larger loss values). This helps to improve the prediction performance at these locations and enhance the overall deep learning effect. When applied to image classification processing, it can achieve better classification results. Furthermore, this loss function processing does not require backpropagation, i.e., it does not require gradient calculation, resulting in low overall computational cost and low resource consumption.

[0066] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated further here.

[0067] Figure 3 This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application.

[0068] See Figure 3 The electronic device 300 includes a memory 310 and a processor 320.

[0069] Processor 320 may be a central processing unit (CPU) CentralProcessingUnit , CPU It can also be other general-purpose processors, digital signal processors (DSPs) DigitalSignalProcessor , DSP Application-Specific Integrated Circuits (ASICs) Applicati onSpecificIntegratedCircuit , ASIC Field-programmable gate array (FPGA) Field - ProgrammableGateArray , FPGA Or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor, etc.

[0070] Memory 310 may include various types of storage units, such as system memory, read-only memory (ROM), etc. ROM ) and permanent storage devices. Among them, ROMThe permanent storage device can store static data or instructions required by the processor 320 or other modules of the computer. The permanent storage device can be a read-write storage device. It can be a non-volatile storage device that retains stored instructions and data even when the computer is powered off. In some embodiments, the permanent storage device uses a high-capacity storage device (e.g., magnetic or optical disk, flash memory) as the permanent storage device. In other embodiments, the permanent storage device can be a removable storage device (e.g., floppy disk, optical drive). System memory can be a read-write storage device or a volatile read-write storage device, such as dynamic random access memory. System memory can store some or all of the instructions and data required by the processor during operation. Furthermore, memory 310 can include any combination of computer-readable storage media, including various types of semiconductor memory chips (e.g., ...). DRAM , SRAM , SDRAM Flash memory, programmable read-only memory, disks, and / or optical discs may also be used. In some embodiments, memory 310 may include a removable storage device that is readable and / or writable, such as a laser disc (or a removable storage device that is readable and / or writable). CD ), read-only digital multifunction optical disc (e.g.) DVD - ROM Double layer DVD - ROM ), read-only Blu-ray discs, ultra-high density discs, flash memory cards (e.g.) SD Card, mini - SD Card, Micro - SD Computer-readable storage media, such as cards and magnetic floppy disks, do not contain carrier waves or transient electronic signals transmitted wirelessly or via wired means.

[0071] The memory 310 stores executable code, which, when processed by the processor 320, can cause the processor 320 to execute part or all of the methods described above.

[0072] Furthermore, the method according to this application can also be implemented as a computer program or computer program product, which includes computer program code instructions for performing some or all of the steps in the method described above.

[0073] Alternatively, this application may be implemented as a computer-readable storage medium (or a non-transitory machine-readable storage medium or a machine-readable storage medium) storing executable code (or computer program or computer instruction code) thereon, which, when executed by a processor of an electronic device (or server, etc.), causes the processor to perform part or all of the steps of the methods described above according to this application.

[0074] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A data processing method, characterized in that, The method, applied to image data classification processing, includes: Obtain an image training sample dataset and input the dataset into a deep learning network model to obtain the output of the loss function processing module within the deep learning network model. N Each loss value is the error between the predicted value and the true value of a sample image belonging to a certain category. According to the above N From each of the loss values, obtain the... N The weight values ​​corresponding to each loss value in the loss values; including, respectively, according to the... N From each of the loss values, obtain the... N The mean of the loss values; according to the N Each loss value in the loss value The above N The mean m of each loss value and the hyperparameter K are obtained using the following activation function formula. N The weight value corresponding to each loss value in the loss values. : ,or ; According to the above N Each loss value in the loss values, and the aforementioned N The weight values ​​corresponding to each loss value in the loss values ​​are used to obtain the overall loss value of the image training samples; The deep learning network model is trained and optimized based on the overall loss value.

2. The method according to claim 1, characterized in that, According to the N Each loss value in the loss values, and the aforementioned N The total loss value is obtained by assigning weights to each loss value among the loss values, including: According to the above N Each loss value in the loss value and the aforementioned N The weight value corresponding to each loss value in the loss values. The total loss value (Loss) is obtained using the following formula: 。 3. A data processing apparatus, characterized in that, The apparatus, used for image data classification processing, includes: The acquisition unit is used to acquire an image training sample dataset and input the training sample dataset into a deep learning network model to obtain the output of the loss function processing module of the deep learning network model. N Each loss value is the error between the predicted value and the true value of a sample image belonging to a certain category. The first calculation unit is used to calculate the results obtained by the acquisition unit, respectively. N From each of the loss values, obtain the... N The weight values ​​corresponding to each loss value in the loss values; including, respectively, according to the... N From each of the loss values, obtain the... N The mean of the loss values; according to the N Each loss value in the loss value The above N The mean m of each loss value and the hyperparameter K are obtained using the following activation function formula. N The weight value corresponding to each loss value in the loss values. : ,or ; The second calculation unit is used to calculate the result obtained by the acquisition unit. N Each loss value among the loss values, and the loss value obtained by the first calculation unit N The weight values ​​corresponding to each loss value in the loss values ​​are used to obtain the overall loss value of the image training samples; The update unit is used to train and optimize the deep learning network model based on the overall loss value obtained by the second calculation unit.

4. An electronic device, characterized in that, include: processor; as well as A memory having executable code stored thereon, which, when executed by the processor, causes the processor to perform the method as described in any one of claims 1-2.

5. A computer-readable storage medium, characterized in that, It stores executable code that, when executed by a processor of an electronic device, causes the processor to perform the method as described in any one of claims 1-2.

Citation Information

Patent Citations

  • Training method of multi-task learning deep network and target detection method and device

    CN115359334A