Deep learning model training method and device, equipment and storage medium

By freezing network layers and adjusting layer parameters based on target vector similarity during the training process of the deep learning model, the problem of overfitting of the traditional deep learning model is solved and the model performance and training efficiency are improved.

CN119358602APending Publication Date: 2025-01-24JINGDONG TECH HLDG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310861655.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-13
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

Traditional deep learning models are prone to overfitting problems during iterative training, resulting in poor model performance.

Method used

Based on the training process of deep learning models, based on the target vector similarity of the corresponding target vector corresponding to the network layer, the freezing operation of the unwell network layer is performed, and the loss function of the current deep learning model is based on the current deep learning model Adjust until you meet stop training conditions.

Benefits of technology

It avoids adjusting the layer parameters of each network layer in the deep learning model during each iteration process, solves the problem of overfitting in traditional deep learning models, and improves the model performance of the trained target deep learning model. And improve the training efficiency of deep learning models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119358602A_ABST
    Figure CN119358602A_ABST
Patent Text Reader

Abstract

The invention discloses a deep learning model training method and device, equipment and a storage medium, and relates to the technical field of artificial intelligence. The method comprises the following steps: inputting training data into a current deep learning model which is not trained completely; wherein the current deep learning model comprises at least one unfrozen network layer; for each unfrozen network layer, executing freezing operation on the unfrozen network layer based on the target vector similarity corresponding to the unfrozen network layer; based on the loss function of the current deep learning model, respectively adjusting layer parameters of at least one unfrozen network layer in the current deep learning model; and taking the current deep learning model as a trained target deep learning model until a training stopping condition is met. According to the embodiment of the invention, the method solves a problem that a conventional deep learning model is liable to overfitting, and improves the model performance of the target deep learning model obtained through training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Deep learning models are increasingly being used in various business scenarios, such as face recognition, image classification, image segmentation, etc. By preprocessing business data, selecting and processing business features, selecting training models, adjusting hyperparameters of training models, and performing iterative training, a deep learning model that can solve actual business needs is obtained.

[0003] In the process of implementing the present invention, it is found that there are at least the following technical problems in the prior art:

[0004] During the iterative training process of traditional deep learning models, each iteration step requires adjusting the layer parameters of each network layer in the deep learning model based on the loss function. However, the convergence speed of each network layer is not the same. Therefore, the trained deep learning model is prone to overfitting and the model performance is poor. Summary of the invention

[0005] The embodiments of the present invention provide a deep learning model training method, apparatus, device and storage medium to solve the problem of overfitting that traditional deep learning models are prone to, and improve the model performance of the target deep learning model obtained through training.

[0006] According to an embodiment of the present invention, a method for training a deep learning model is provided, the method comprising:

[0007] Inputting the training data into a current deep learning model that has not been trained; wherein the current deep learning model includes at least one unfrozen network layer;

[0008] For each unfrozen network layer, a freezing operation is performed on the unfrozen network layer based on a target vector similarity corresponding to the unfrozen network layer; wherein the target vector similarity represents a vector similarity between network vectors outputted by the unfrozen network layer in at least two iteration processes, each of which includes a current iteration process;

[0009] Based on the loss function of the current deep learning model, respectively adjust layer parameters of at least one unfrozen network layer in the current deep learning model;

[0010] Until the training stop condition is met, the current deep learning model is used as the target deep learning model after training.

[0011] According to another embodiment of the present invention, a training device for a deep learning model is provided, the device comprising:

[0012] A training data input module, used to input training data into a current deep learning model that has not been trained; wherein the current deep learning model includes at least one unfrozen network layer;

[0013] An unfrozen network layer freezing module is used to perform a freezing operation on each unfrozen network layer based on a target vector similarity corresponding to the unfrozen network layer; wherein the target vector similarity represents the vector similarity between network vectors outputted by the unfrozen network layer in at least two iteration processes, each of which includes the current iteration process;

[0014] A current deep learning model adjustment module, configured to adjust layer parameters of at least one unfrozen network layer in the current deep learning model based on a loss function of the current deep learning model;

[0015] The target deep learning model determination module is used to use the current deep learning model as the target deep learning model after training is completed until the training stop condition is met.

[0016] According to another embodiment of the present invention, an electronic device is provided, the electronic device comprising:

[0017] at least one processor; and

[0018] a memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the training method of the deep learning model described in any embodiment of the present invention.

[0020] According to another embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the training method of the deep learning model described in any embodiment of the present invention when executed.

[0021] The technical solution of the embodiment of the present invention performs a freezing operation on an unfrozen network layer based on the target vector similarity corresponding to the unfrozen network layer during the training process of the deep learning model, wherein the target vector similarity represents the vector similarity between the network vectors output by the unfrozen network layer in at least two iteration processes respectively, and each iteration process includes a current iteration process, and based on the loss function of the current deep learning model, the layer parameters of at least one unfrozen network layer in the current deep learning model are adjusted respectively, thereby avoiding adjusting the layer parameters of each network layer in the deep learning model in each iteration process, solving the problem that traditional deep learning models are prone to overfitting, improving the model performance of the target deep learning model obtained by training, and improving the training efficiency of the deep learning model.

[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0024] Figure 1 A flowchart of a deep learning model training method provided by one embodiment of the present invention;

[0025] Figure 2 A flowchart of another deep learning model training method provided by one embodiment of the present invention;

[0026] Figure 3 A flowchart of a specific example of a deep learning model training method provided by one embodiment of the present invention;

[0027] Figure 4 A schematic diagram of changes in CAA similarity during the training of each network layer in a deep learning model provided by an embodiment of the present invention;

[0028] Figure 5 A schematic diagram of the structure of a deep learning model training device provided by one embodiment of the present invention;

[0029] Figure 6 The present invention is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first", "second", "target", "reference", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] Figure 1 This is a flowchart of a deep learning model training method provided by an embodiment of the present invention. This embodiment is applicable to the case of iterative training of a deep learning model. The method can be executed by a deep learning model training device. The deep learning model training device can be implemented in the form of hardware and / or software. The deep learning model training device can be configured in a terminal device. Figure 1 As shown, the method includes:

[0033] S110: Input the training data into the current deep learning model that has not yet been trained.

[0034] In a specific embodiment, the training data can be pre-stored locally on the current terminal device, or in other storage devices or the cloud associated with the current terminal device, and when needed, the training data can be retrieved from the local current terminal device, other storage devices or the cloud associated with the current terminal device.

[0035] In another specific embodiment, the training data is pre-stored locally on the current terminal device, in other storage devices associated with the current terminal device, or in the cloud, and when needed, the training data is retrieved from the local storage devices on the current terminal device, in other storage devices associated with the current terminal device, or in the cloud based on the mapping relationship between the training labels and the training data.

[0036] In order to effectively distinguish different training data and avoid repeated storage of the same training data, a unique training data identifier, such as a training number, may be established for different training data in the entire terminal device or device group. Alternatively, different training data may be stored in different storage devices.

[0037] It is understandable that in order to facilitate the search of training data, a hash table can be used for storage, that is, after performing hash calculation on the training label, a storage address is obtained, and the training data corresponding to the training label is stored in the storage space corresponding to the storage address. When necessary, the training label is used as the key to query the hash table, and the training data corresponding to the training label is obtained according to the query result.

[0038] Specifically, the current deep learning model is used to characterize the deep learning model of the current iteration process. The current iteration process can be expressed as the kth iteration process, k = [1, 2, 3 ... n], and n represents the total number of iterations of the deep learning model. Exemplarily, the deep learning model includes but is not limited to a convolutional network model, a generative adversarial network model, a recurrent network model, a long short-term memory network model, a sequence-to-sequence model, a recursive network model, and a network model in the form of a combination of various network architectures. There is no limitation on the deep learning model used here, and it can be customized according to actual needs.

[0039] In this embodiment, the current deep learning model includes at least one unfrozen network layer. The unfrozen network layer represents the network layer that participates in the layer parameter adjustment during the model training process, and the frozen network layer represents the network layer that does not participate in the layer parameter adjustment during the model training process, that is, the layer parameters of the unfrozen network layer can be adjusted in the current iteration process and subsequent iteration processes, and the layer parameters of the frozen network layer cannot be adjusted in the current iteration process and subsequent iteration processes.

[0040] As model training progresses, the number of unfrozen network layers in the deep learning model will gradually decrease. Specifically, the current deep learning model may contain no frozen network layers, or it may contain at least one frozen network layer. For example, assuming that the deep learning model contains network layer A, network layer B, and network layer C, then network layer A in the current deep learning model is a frozen network layer, and network layer B and network layer C are both unfrozen network layers, or network layer A, network layer B, and network layer C in the current deep learning model are all unfrozen network layers.

[0041] S120 . For each unfrozen network layer, based on the target vector similarity corresponding to the unfrozen network layer, perform a freezing operation on the unfrozen network layer.

[0042] In this embodiment, the target vector similarity represents the vector similarity between network vectors outputted by the unfrozen network layer in at least two iteration processes, each iteration process including the current iteration process.

[0043] In a specific embodiment, based on the vector similarity corresponding to the unfrozen network layer, a freezing operation is performed on the unfrozen network layer, including: when the vector similarity is greater than a similarity threshold, the parameter value of the trainable parameter corresponding to the unfrozen network layer is modified from a first parameter value to a second parameter value; wherein the first parameter value represents that the unfrozen network layer participates in model training, and the second parameter value represents that the unfrozen network layer does not participate in model training.

[0044] Exemplarily, the similarity threshold may be 0.9999 or 0.99998, the first parameter value may be 0 or false, and the second parameter value may be 1 or true. The similarity threshold, the first parameter value, and the second parameter value are not limited here, and can be customized according to actual needs.

[0045] Specifically, the trainable parameters are pre-defined trainable parameters in each network layer in the deep learning model. When the unfrozen network layer is frozen, the unfrozen network layer is updated to a frozen network layer.

[0046] S130. Based on the loss function of the current deep learning model, adjust the layer parameters of at least one unfrozen network layer in the current deep learning model.

[0047] Specifically, the loss function is determined based on the training labels and the predicted labels output by the current deep learning model. Exemplarily, the function type of the loss function can be a square loss function, a logarithmic loss function, an exponential loss function, a mean square error loss function, a logistic regression loss function, a Huber loss function, a cross entropy loss function, and a Kullback-Leibler divergence loss function, etc. The function type of the loss function is not limited here, and can be customized according to actual needs.

[0048] S140: until the training stop condition is met, the current deep learning model is used as the target deep learning model after training.

[0049] In a specific embodiment, the condition for stopping training includes that the loss function converges before all network layers in the current deep learning model are frozen, or that all network layers in the current deep learning model are frozen before the loss function converges.

[0050] In one embodiment, before executing S130, it is determined whether there are any unfrozen network layers in the current deep learning model. If not, the current deep learning model is used as the target deep learning model for training. If so, it is determined whether the loss function converges. If so, the current deep learning model is used as the target deep learning model for training. If not, the next round of iterative training is performed.

[0051] In another embodiment, before executing S130, it is determined whether the loss function converges. If it converges, the current deep learning model is used as the target deep learning model for training. If it does not converge, it is determined whether there are any unfrozen network layers in the current deep learning model. If not, the current deep learning model is used as the target deep learning model for training. If so, the next round of iterative training is performed.

[0052] The technical solution of this embodiment performs a freezing operation on an unfrozen network layer based on the target vector similarity corresponding to the unfrozen network layer during the training process of the deep learning model, wherein the target vector similarity represents the vector similarity between the network vectors output by the unfrozen network layer in at least two iteration processes respectively, and each iteration process includes a current iteration process, and based on the loss function of the current deep learning model, layer parameters of at least one unfrozen network layer in the current deep learning model are adjusted respectively, thereby avoiding adjusting the layer parameters of each network layer in the deep learning model in each iteration process, solving the problem that traditional deep learning models are prone to overfitting, improving the model performance of the target deep learning model obtained through training, and improving the training efficiency of the deep learning model.

[0053] Figure 2 This is a flowchart of another method for training a deep learning model provided by an embodiment of the present invention. This embodiment further refines the method for determining the "target vector similarity" in the above embodiment. Figure 2 As shown, the method includes:

[0054] S210: Input the training data into the current deep learning model that has not yet been trained.

[0055] In this embodiment, S210 and Figure 1 The S110 shown in FIG. 1 is the same or similar to that in FIG. 1 , and will not be described in detail in this embodiment.

[0056] S220. For each unfrozen network layer, obtain a current network vector output by the unfrozen network layer in the current deep learning model.

[0057] Specifically, a pre-registered hook function in a network output module in an unfrozen network layer in the current deep learning model is called to obtain a current network vector output by the unfrozen network layer.

[0058] S230. Obtain historical network vectors outputted by unfrozen network layers in a historical deep learning model during at least one historical iteration.

[0059] In a specific embodiment, obtaining historical network vectors outputted by unfrozen network layers in a historical deep learning model during at least one historical iteration process includes: calling a pre-registered hook function in a network output module in an unfrozen network layer in the historical deep learning model to obtain the historical network vectors outputted by the unfrozen network layer.

[0060] In another specific embodiment, obtaining historical network vectors respectively output by unfrozen network layers in a historical deep learning model in at least one historical iteration process includes: obtaining historical network vectors respectively output by unfrozen network layers in at least one historical deep learning model from a memory storage space.

[0061] In a specific embodiment, the method further includes: when the vector similarity is less than or equal to a similarity threshold, replacing and updating at least one historical network vector in the memory storage space based on the current network vector.

[0062] Specifically, the hook function is used to intercept the network vector output by the frozen network layer, and the network vector can be stored in the memory storage space or in a file. In this embodiment, the network vector is stored in the memory storage space, which can improve the reading efficiency of the network vector.

[0063] The advantage of setting up replacement updates for historical network vectors is that it can reduce the memory storage space occupied by network vectors and further ensure the training efficiency of deep learning models.

[0064] Specifically, each historical iteration process includes at least one iteration process before the current iteration process. Assuming that the current iteration process is the kth iteration process, in a specific embodiment, each historical iteration process includes the k-1th iteration process, or each historical iteration process includes the k-2th iteration process, or each historical iteration process includes the k-1th iteration process and the k-2th iteration process. The number of each historical iteration process is not limited here, and can be customized according to actual needs.

[0065] S240: Determine the target vector similarity of the unfrozen network layer based on the current network vector and each historical network vector.

[0066] In a specific embodiment, based on the current network vector and each historical network vector, the target vector similarity of the unfrozen network layer is determined, including: when there is one historical network vector, the reference vector similarity between the current network vector and the historical network vector is used as the target vector similarity of the unfrozen network layer; when there are multiple historical network vectors, based on the current network vector and at least two historical network vectors, at least two reference vector similarities corresponding to the unfrozen network layer are determined, and the statistical value corresponding to each reference vector similarity is used as the target vector similarity of the unfrozen network layer.

[0067] In a specific embodiment, there is one historical network vector. Assuming that the current network vector is the kth network vector, the historical network vector may be the k-1th network vector or the k-2th network vector.

[0068] In another specific embodiment, there are multiple historical network vectors. Assuming that the current network vector is the kth network vector, each historical network vector may include the k-1th network vector and the k-2th network vector, and each reference vector similarity includes the vector similarity between the kth network vector and the k-1th network vector and the vector similarity between the kth network vector and the k-2th network vector.

[0069] In a specific embodiment, the similarity algorithm used for the reference vector similarity includes but is not limited to a distance-based similarity algorithm, a Pearson correlation coefficient algorithm, a Jaccard similarity coefficient algorithm, and an angle cosine algorithm, among which the distance-based similarity algorithm includes but is not limited to Euclidean distance, Manhattan distance, Chebyshev distance, and the like.

[0070] In another specific embodiment, the similarity algorithm used for the reference vector similarity includes a canonical correlation analysis (CCA) algorithm. The CCA algorithm is a multivariate statistical analysis method that uses the correlation between comprehensive variable pairs to reflect the overall correlation between two groups of indicators. The basic principle of the CAA algorithm is: in order to grasp the correlation between the two groups of indicators as a whole, two representative comprehensive variables U1 and V1 (linear combinations of the variables in the two variable groups, respectively) are extracted from the two groups of variables, and the correlation between the two comprehensive variables is used to reflect the overall correlation between the two groups of indicators.

[0071] Among them, illustratively, the statistical values ​​include but are not limited to the median, maximum, minimum and average values, etc. The statistical values ​​are not limited here and can be customized according to actual needs.

[0072] S250: Based on the target vector similarity corresponding to the unfrozen network layer, a freezing operation is performed on the unfrozen network layer.

[0073] S260: Based on the loss function of the current deep learning model, adjust the layer parameters of at least one unfrozen network layer in the current deep learning model.

[0074] S270: until the training stop condition is met, the current deep learning model is used as the target deep learning model after training.

[0075] In this embodiment, S250-S270 and Figure 1 S120 - S140 shown in FIG. 1 are identical or similar to each other, and will not be described in detail in this embodiment.

[0076] Figure 3 A flowchart of a specific example of a training method for a deep learning model provided by an embodiment of the present invention. Specifically, before the deep learning model starts iterative training, a hook function is registered in the network output module of each network layer of the deep learning model. After the iterative training starts, for each unfrozen network layer in each round of iteration, the CAA similarity is calculated based on the network vectors output by the unfrozen network layer in at least two iterations. Determine whether there is an unfrozen network layer whose CAA similarity is greater than the similarity threshold. If not, continue to perform the step of determining whether the condition for stopping training is met. If so, perform a freezing operation on the unfrozen network layer, and continue to determine whether the condition for stopping training is met. If so, the iterative training ends and the trained target deep learning model is obtained. If not, start the next round of iterative training.

[0077] The technical solution of this embodiment obtains the current network vector output by the unfrozen network layer in the current deep learning model for each unfrozen network layer, obtains the historical network vectors output by the unfrozen network layers in the historical deep learning model in at least one historical iteration process, and determines the target vector similarity of the unfrozen network layer based on the current network vector and each historical network vector, thereby solving the problem of calculating the target vector similarity and improving the accuracy of the target vector similarity, thereby further improving the model performance of the trained target deep learning model and further improving the training efficiency of the deep learning model.

[0078] On the basis of the above embodiment, specifically, the data type of the training data is order data, which may be item order data or credit application order data, etc. The current deep learning model is a risk prediction model, and the similarity algorithm used for the reference vector similarity is the CCA algorithm.

[0079] Among them, illustratively, taking item order data as an example, the item order data includes but is not limited to order time, login address, payment type, installment ratio, item type, item quantity and total order price, etc. The item order data is not limited here and can be customized according to actual needs.

[0080] Based on the above embodiment, specifically, the training label is an order risk label. Exemplarily, the order risk label can be whether there is risk, or it can be a risk level, or it can be a risk type, such as risk types including but not limited to information leakage risk, fraud risk, cash-out risk, and no risk. The order risk label is not limited here, and can be customized according to actual needs.

[0081] In a specific embodiment, the deep learning model is a NLP (Natural Language Processing) sequence model, or the deep learning model includes 1 embedding layer, 8 LSTM (Long Short-Term Memory) layers and 1 FC layer (fully connected layers).

[0082] In one embodiment, the data type of the training data is order data, the current deep learning model is a risk prediction model, the similarity algorithm used for the reference vector similarity is the CCA algorithm, and the deep learning model includes 1 embedding layer, 8 LSTM layers and 1 FC layer. Figure 4 A schematic diagram of the change of CAA similarity during the training of each network layer in a deep learning model provided by an embodiment of the present invention. Specifically, Figure 4 The horizontal axis in represents the number of iterative training rounds, and the vertical axis represents the CAA similarity of the network layer in two adjacent iterations. Different curves represent the CAA similarities corresponding to different network layers.

[0083] from Figure 4 It can be seen that with the progress of iterative training, the CAA similarity of each network layer gradually tends to 1, that is, each network layer gradually converges, and some network layers converge earlier. For example, the embedding layer as the input layer in the deep learning model converges first, and convergence is achieved around 10 rounds of model training. Therefore, the embedding layer is frozen in the 10th round and no longer participates in the subsequent layer parameter adjustment to save training time and prevent overfitting of the embedding layer.

[0084] from Figure 4It can be further seen that after about 45 rounds of model training, each network layer in the deep learning model has reached convergence. At this time, all network layers are frozen to end the iterative training process. If the traditional training method is used, and the training stop condition is based only on the convergence of the loss function, then after about 45 rounds of model training, since the loss function has not converged, the deep learning model continues to be trained. Figure 4 It can be seen that during the iterative training process after 45 rounds, the CAA similarity of some network layers will fluctuate greatly, indicating that these network layers have deviated from the convergence state and may have overfitted, affecting the model performance.

[0085] from Figure 4 It can be further seen that the embodiment of the present invention can obtain the trained target deep learning model in about the 45th round, while the traditional training method needs to obtain the trained target deep learning model in about the 100th round, saving about 50% of the training time.

[0086] In another embodiment, the data type of the training data is order data, the current deep learning model is a risk prediction model, the similarity algorithm used for the reference vector similarity is the CCA algorithm, and the deep learning model is an NLP sequence model. The traditional training method is used to train the NLP sequence model, and the training time spent is 1203.081549s. The training method provided in the embodiment of the present invention is used to train the NLP sequence model, and the training time spent is 1056.679306s, which saves about 12% of the training time.

[0087] It can be seen from the above examples that training a deep learning model according to the training method provided in an embodiment of the present invention will save the training time of the entire model, and for more complex (more network layers) deep learning models, the saved training time is more significant and the anti-overfitting effect is better.

[0088] On the basis of the above embodiments, specifically, when the order data includes the order time, the training stage of the deep learning model can be divided by time windows, and different training stages use the order data corresponding to the corresponding time windows in the training data to perform model training.

[0089] It is understandable that since the order data corresponding to multiple time windows can be used for model training at the same time, the effect of multi-stage pipeline training can be achieved, and multiple hardware in the terminal device can be in operation at the same time, significantly improving the training efficiency.

[0090] However, the use of pipelines will lead to memory consumption, because the order data corresponding to the next time window will be read in advance and stored in the memory, waiting for the current time window to be processed. In order to control the use of memory resources, a back pressure mechanism can be introduced in the pipeline control process, that is, strictly control the number of time windows that exist at the same time and accurately control the memory usage. Among them, the number of time windows can be set by technicians according to needs or experience, or determined through a large number of experiments. Among them, the window length of the time window can be determined according to the device performance of the terminal device.

[0091] It is understandable that in order to achieve continuous updating of the deep learning model and facilitate the smooth acquisition of relevant data of the previous deep learning model during the current model training, after each model training, the model file can be stored in the cloud in the form of a binary file, for example, it can be stored in HDFS (Hadoop Distributed FileSystem). Accordingly, before each model training, a group of threads are started, and each thread starts a HADOOP CLIENT to download the model file from HDFS until all model files are downloaded locally. Among them, the model file includes the model parameters of the trained deep learning model and the order data of the current time window.

[0092] In order to prevent accidents during model training that may cause damage to the model, the complete model text can also be backed up periodically for redundant storage. The backup period and backup location can be set by the technicians as needed. For example, the backup period can be 10 minutes, and the backup location can be the aforementioned HDFS.

[0093] In order to speed up the export of deep learning models, you can use the external storage of the terminal device (such as a solid-state drive SSD) as a large-capacity cache area, first generate a binary model file in the terminal device, and then start a process to upload the model file from the external storage to HDFS. With the above operation, more background processes can be started at the same time to upload files, greatly improving the utilization of network bandwidth.

[0094] The following is an embodiment of a deep learning model training device provided in an embodiment of the present invention. The device and the deep learning model training method of the above embodiment belong to the same inventive concept. For details not described in detail in the embodiment of the deep learning model training device, please refer to the content about the deep learning model training method in the above embodiment.

[0095] Figure 5 A schematic diagram of a deep learning model training device provided by an embodiment of the present invention. Figure 5As shown, the device includes: a training data input module 310, an unfrozen network layer freezing module 320, a current deep learning model adjustment module 330 and a target deep learning model determination module 340.

[0096] The training data input module 310 is used to input the training data into the current deep learning model that has not been trained; wherein the current deep learning model includes at least one unfrozen network layer;

[0097] The unfrozen network layer freezing module 320 is used to perform a freezing operation on each unfrozen network layer based on the target vector similarity corresponding to the unfrozen network layer; wherein the target vector similarity represents the vector similarity between the network vectors outputted by the unfrozen network layer in at least two iteration processes, each iteration process including the current iteration process;

[0098] A current deep learning model adjustment module 330, configured to adjust layer parameters of at least one unfrozen network layer in the current deep learning model based on a loss function of the current deep learning model;

[0099] The target deep learning model determination module 340 is used to use the current deep learning model as the target deep learning model after training is completed until the training stop condition is met.

[0100] The technical solution of this embodiment avoids adjusting the layer parameters of each network layer in the deep learning model in each iteration process, solves the problem that traditional deep learning models are prone to overfitting, improves the model performance of the target deep learning model obtained through training, and improves the training efficiency of the deep learning model.

[0101] In a specific embodiment, the data type of the training data is order data, and the current deep learning model is a risk prediction model.

[0102] In a specific embodiment, the device further comprises:

[0103] A target vector similarity determination module is used to obtain, for each unfrozen network layer, a current network vector output by the unfrozen network layer in the current deep learning model;

[0104] Obtain historical network vectors outputted by unfrozen network layers in a historical deep learning model during at least one historical iteration;

[0105] Based on the current network vector and each historical network vector, the target vector similarity of the unfrozen network layer is determined.

[0106] In a specific embodiment, the target vector similarity determination module is specifically used to:

[0107] When the historical network vector is one, the reference vector similarity between the current network vector and the historical network vector is used as the target vector similarity of the unfrozen network layer;

[0108] In the case of multiple historical network vectors, based on the current network vector and at least two historical network vectors, the similarities of at least two reference vectors corresponding to the unfrozen network layer are determined, and the statistical value corresponding to each reference vector similarity is used as the target vector similarity of the unfrozen network layer.

[0109] In a specific embodiment, the similarity algorithm used for the reference vector similarity includes a canonical correlation analysis algorithm.

[0110] In a specific embodiment, the unfrozen network layer freezing module 320 is specifically used to:

[0111] When the vector similarity is greater than the similarity threshold, modifying the parameter value of the trainable parameter corresponding to the unfrozen network layer from the first parameter value to the second parameter value;

[0112] The first parameter value indicates that the unfrozen network layer participates in the model training, and the second parameter value indicates that the unfrozen network layer does not participate in the model training.

[0113] In a specific embodiment, the device further comprises:

[0114] The historical network vector updating module is used to replace and update at least one historical network vector in the memory storage space based on the current network vector when the vector similarity is less than or equal to the similarity threshold.

[0115] In a specific embodiment, the condition for stopping training includes that the loss function converges before all network layers in the current deep learning model are frozen, or that all network layers in the current deep learning model are frozen before the loss function converges.

[0116] The deep learning model training device provided in the embodiment of the present invention can execute the deep learning model training method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0117] Figure 6A schematic diagram of the structure of an electronic device provided for one embodiment of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0118] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by the at least one processor 11, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0119] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0120] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as the training method of the deep learning model provided in the above embodiments.

[0121] In some embodiments, the training method of the deep learning model provided in the above embodiments may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps in the training method of the deep learning model described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the training method of the deep learning model in any other appropriate manner (e.g., by means of firmware).

[0122] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0123] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0124] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0125] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0126] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0127] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0128] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0129] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A training method for a deep learning model, characterized in that: include: Inputting the training data into a current deep learning model that has not been trained; wherein the current deep learning model includes at least one unfrozen network layer; For each unfrozen network layer, a freezing operation is performed on the unfrozen network layer based on a target vector similarity corresponding to the unfrozen network layer; wherein the target vector similarity represents a vector similarity between network vectors outputted by the unfrozen network layer in at least two iteration processes, each of which includes a current iteration process; Based on the loss function of the current deep learning model, respectively adjust layer parameters of at least one unfrozen network layer in the current deep learning model; Until the training stop condition is met, the current deep learning model is used as the target deep learning model after training.

2. The method according to claim 1, characterized in that The data type of the training data is order data, and the current deep learning model is a risk prediction model.

3. The method according to claim 1, characterized in that The method further comprises: For each unfrozen network layer, obtaining a current network vector output by the unfrozen network layer in the current deep learning model; Obtain historical network vectors respectively output by the unfrozen network layers in the historical deep learning model in at least one historical iteration process; Based on the current network vector and each of the historical network vectors, a target vector similarity of the unfrozen network layer is determined.

4. The method according to claim 3, characterized in that Determining the target vector similarity of the unfrozen network layer based on the current network vector and each of the historical network vectors includes: In the case where there is only one historical network vector, taking the reference vector similarity between the current network vector and the historical network vector as the target vector similarity of the unfrozen network layer; In the case where there are multiple historical network vectors, based on the current network vector and at least two historical network vectors, the similarities of at least two reference vectors corresponding to the unfrozen network layer are determined, and the statistical values ​​corresponding to the similarities of each reference vector are used as the target vector similarity of the unfrozen network layer.

5. The method according to claim 4, characterized in that The similarity algorithm used for the reference vector similarity includes a canonical correlation analysis algorithm.

6. The method according to claim 3, characterized in that The performing a freezing operation on the unfrozen network layer based on the vector similarity corresponding to the unfrozen network layer includes: When the vector similarity is greater than a similarity threshold, modifying a parameter value of a trainable parameter corresponding to the unfrozen network layer from a first parameter value to a second parameter value; The first parameter value represents that the unfrozen network layer participates in model training, and the second parameter value represents that the unfrozen network layer does not participate in model training.

7. The method according to claim 6, characterized in that The method further comprises: When the vector similarity is less than or equal to a similarity threshold, at least one historical network vector in the memory storage space is replaced and updated based on the current network vector.

8. The method according to claim 1, characterized in that: The training stop condition includes that the loss function converges before all network layers in the current deep learning model are frozen, or that all network layers in the current deep learning model are frozen before the loss function converges.

9. A training device for a deep learning model, characterized in that: include: A training data input module, used to input training data into a current deep learning model that has not been trained; wherein the current deep learning model includes at least one unfrozen network layer; An unfrozen network layer freezing module is used to perform a freezing operation on each unfrozen network layer based on a target vector similarity corresponding to the unfrozen network layer; wherein the target vector similarity represents the vector similarity between network vectors outputted by the unfrozen network layer in at least two iteration processes, each of which includes the current iteration process; A current deep learning model adjustment module, configured to adjust layer parameters of at least one unfrozen network layer in the current deep learning model based on a loss function of the current deep learning model; The target deep learning model determination module is used to use the current deep learning model as the target deep learning model after training is completed until the training stop condition is met.

10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the training method of the deep learning model described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which are used to enable a processor to implement the training method of the deep learning model described in any one of claims 1-8 when executed.