Method and device for determining hyper-parameters of training model, electronic equipment and storage medium

By analyzing the log data generated during the training and evaluation process of the model, the type of impact of hyperparameters on target performance is determined, which solves the problem of insufficient recommendation of hyperparameter values ​​in the existing technology and realizes automatic recommendation and performance of hyperparameter values ​​for the training model. promote.

CN118585802APending Publication Date: 2024-09-03BEIJING EYECOOL TECHNOLOGY CO LTD +2

Patent Information

Application Number
CN202310187351.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-01
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

There is a lack of effective methods for determining hyperparameters of training models in the existing technology. Hyperparameter values ​​are usually empirical values ​​or are continuously adjusted without recommended methods.

Method used

By obtaining the log data generated by the model during the training and evaluation process, analyzing the indicator values ​​to determine the type of impact of the hyperparameters on the target performance, and determining the target hyperparameter values ​​based on this, to achieve recommendations for model hyperparameter values ​​that are expected to have the target performance. .

Benefits of technology

It realizes automatic recommendation of hyperparameter values ​​for training models, improves the performance and efficiency of the model, and reduces the complexity and time of hyperparameter adjustment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118585802A
    Figure CN118585802A
Patent Text Reader

Abstract

The invention provides a method and device for determining hyper-parameters of a training model, electronic equipment and a storage medium, and relates to the technical field of artificial intelligence, and the method for determining the hyper-parameters of the training model comprises the following steps: obtaining log data; the log data comprises at least one type of index values generated by at least one type of models in respective training and evaluation processes; each type of index value is used for representing one performance of the model; for each type of model, determining an influence type of a hyper-parameter value corresponding to each model training task of the model on target performance based on an index value corresponding to the target performance; the influence type comprises a positive influence type or a negative influence type; determining a target hyper-parameter value of a target model based on the influence type corresponding to each model training task; the target model is a model expected to have the target performance. According to the invention, the recommendation of the hyper-parameter value of the target model expected to have the target performance is realized.
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 method, device, electronic device and storage medium for determining hyperparameters of a training model. Background Art

[0002] Artificial Intelligence (AI), also known as machine intelligence, is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. Before starting to learn an artificial intelligence model, it is usually necessary to set hyperparameter values.

[0003] In the related art, the hyperparameter value is usually an empirical value or a value that is continuously adjusted, and there is no method to recommend the hyperparameter value. Therefore, the method of recommending the hyperparameter value has become an urgent problem to be solved. Summary of the invention

[0004] In view of the problems existing in the prior art, an embodiment of the present invention provides a method, device, electronic device and storage medium for determining hyperparameters of a training model.

[0005] The present invention provides a method for determining hyperparameters of a training model, comprising:

[0006] Obtaining log data; the log data includes at least one type of indicator value generated by at least one type of model during training and evaluation; each type of indicator value is used to characterize a performance of the model;

[0007] For each type of the model, determining the type of influence of the hyperparameter value corresponding to each model training task of the model on the target performance based on the indicator value corresponding to the target performance; the influence type includes a positive influence type or a negative influence type;

[0008] The target hyperparameter value of the target model is determined based on the impact type corresponding to each model training task; the target model is a model expected to have the target performance.

[0009] According to a method for determining hyperparameters of a training model provided by the present invention, determining the type of influence of the hyperparameter value corresponding to each model training task of the model on the target performance based on the indicator value corresponding to the target performance includes:

[0010] Determine an indicator average value based on each of the indicator values ​​corresponding to the target performance;

[0011] Compare each indicator value corresponding to the target performance with the indicator average value to obtain a comparison result;

[0012] Based on the comparison result, determine the type of influence of the hyperparameter value corresponding to each model training task of the model on the target performance.

[0013] According to a method for determining hyperparameters of a training model provided by the present invention, the network structures of the models of the same type are the same, the hyperparameter values ​​corresponding to each model training task of the models of the same type are different, and the training data sets corresponding to each model training task are the same;

[0014] The determining a target hyperparameter value of a target model based on the impact type corresponding to each model training task includes:

[0015] In a case where the target performance includes one performance, determining the target hyperparameter value based on the hyperparameter value of the model training task corresponding to the impact type being a positive impact type;

[0016] In the case where the target performance includes at least two performances, the target hyperparameter value is determined based on the hyperparameter value of the model training task in which the impact type corresponding to each performance is a positive impact type.

[0017] According to a method for determining a training model hyperparameter provided by the present invention, the hyperparameter value of the model training task corresponding to each performance, in which the impact type is a positive impact type, is used to determine the target hyperparameter value, including:

[0018] Obtaining the performance with the highest priority among the at least two performances;

[0019] Compare the model training tasks corresponding to each performance where the impact type is a positive impact type with each indicator value corresponding to the performance with the highest priority to obtain a target indicator value; the hyperparameter value of the model training task corresponding to the target indicator value has the greatest positive impact on the target performance;

[0020] The hyperparameter value of the model training task corresponding to the target index value is determined as the target hyperparameter value.

[0021] According to a method for determining hyperparameters of a training model provided by the present invention, the network structures of the models of the same type are the same, the hyperparameter values ​​corresponding to each model training task of the models of the same type are the same, and the training data sets corresponding to each model training task are different; the log data also includes training data where the predicted values ​​generated by each type of model during the training and evaluation process are different from the true values; the method also includes:

[0022] For each of the training data of the same type of the model, comparing the number of times the predicted value is different from the true value with a preset number;

[0023] When the number of times the predicted value differs from the true value is greater than or equal to the preset number, determining the training data as abnormal data;

[0024] A target training data set for the target model is determined based on the abnormal data.

[0025] According to a method for determining hyperparameters of a training model provided by the present invention, determining a target training data set of the target model based on the abnormal data includes:

[0026] Obtaining an initial training data set for the target model;

[0027] The abnormal data is removed from the initial training data set to obtain the target training data set.

[0028] According to a method for determining hyperparameters of a training model provided by the present invention, the step of obtaining log data includes:

[0029] The log data is obtained in the target container through Filebeat; the log data generated by each type of the model during the training and evaluation process is stored in the target container.

[0030] The present invention also provides a device for determining hyperparameters of a training model, comprising:

[0031] An acquisition unit, configured to acquire log data; the log data includes at least one type of index value generated by at least one type of model during training and evaluation; each type of index value is used to characterize a performance of the model;

[0032] A first determining unit is used to determine, for each type of the model, an influence type of the hyperparameter value corresponding to each model training task of the model on the target performance based on the indicator value corresponding to the target performance; the influence type includes a positive influence type or a negative influence type;

[0033] The second determination unit is used to determine the target hyperparameter value of the target model based on the impact type corresponding to each model training task; the target model is a model expected to have the target performance.

[0034] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for determining the hyperparameters of a training model as described in any one of the above is implemented.

[0035] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the methods for determining hyperparameters of a training model as described above.

[0036] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the methods for determining training model hyperparameters as described above.

[0037] The method, device, electronic device and storage medium for determining hyperparameters of a training model provided by the present invention obtain log data generated by each type of model during the training and evaluation process, wherein the log data includes at least one type of indicator value, and for each type of model, the type of influence of the hyperparameter value corresponding to each model training task of the model on the target performance is determined based on the indicator value corresponding to the target performance, and the target hyperparameter value of the target model is determined based on the influence type corresponding to each model training task, thereby realizing the recommendation of hyperparameter values ​​for the target model that is expected to have the target performance. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0039] Figure 1 It is one of the flowcharts of the method for determining the hyperparameters of the training model provided by the present invention;

[0040] Figure 2 This is the second flow chart of the method for determining the hyperparameters of the training model provided by the present invention;

[0041] Figure 3 It is a structural schematic diagram of the model training platform provided by the present invention;

[0042] Figure 4 It is a structural schematic diagram of a device for determining hyperparameters of a training model provided by the present invention;

[0043] Figure 5 It is a schematic diagram of the physical structure of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] Combine the following Figure 1 and Figure 2The method of determining hyperparameters of a training model according to the present invention is described.

[0046] Figure 1 is one of the flow charts of the method for determining the hyperparameters of the training model provided in an embodiment of the present invention, such as Figure 1 As shown, the method for determining the hyperparameters of the training model includes the following steps:

[0047] Step 101, obtaining log data; the log data includes at least one type of indicator value generated by at least one type of model during the training and evaluation process; each type of indicator value is used to characterize a performance of the model.

[0048] Among them, the index values ​​generated during the training process may be data processing speed, accuracy value, and loss value per unit time, etc.; the index values ​​generated during the evaluation process may be accuracy value, recall rate, etc. The data processing speed per unit time is used to characterize the number of data processed per unit time, such as the number of images processed per unit time, which represents the processing speed of the model. The accuracy value is used to characterize the accuracy performance of the model prediction. The loss value is used to characterize the degree of inconsistency between the model's predicted value and the true value. The recall rate is used to characterize the performance of the proportion of correctly predicted values ​​among all positive examples used for model training.

[0049] It should be noted that a relatively large data flow of log data can obtain better analysis results, and the structure of log data is relatively variable. Therefore, when a large amount of log data is obtained, all log data needs to be uniformly cleaned, filtered, aggregated and structured in order to facilitate subsequent analysis of each log data.

[0050] Step 102: for each type of the model, determine the type of impact of the hyperparameter value corresponding to each model training task of the model on the target performance based on the indicator value corresponding to the target performance; the impact type includes a positive impact type or a negative impact type.

[0051] Among them, the target performance is the performance that the user expects the model to have. The target performance can be high speed, high accuracy, low loss, high recall rate, or a combination of at least two of high speed, high accuracy, low loss and high recall rate.

[0052] For example, when log data is obtained, the log data can be analyzed based on the Pig analysis platform of Hadoop. Pig is a large-scale data analysis platform based on Hadoop. It includes a scripting language called Pig Latin to describe data streams and an engine that executes data stream processing in parallel, providing a simple operation and programming interface for complex parallel computing of massive data. Pig Latin itself provides many traditional data operations, and allows users to develop custom functions related to the usage scenarios based on the user's usage scenarios to read, process and write data. The compiler of the language converts SQL-like data analysis requests into a series of optimized MapReduce operations. The usage scenario of the present invention is to analyze the log data generated by the model during training and evaluation.

[0053] Taking the target performance of high accuracy as an example, the indicator value corresponding to the target performance is the accuracy value. For each type of model, the influence type of the hyperparameter value corresponding to each model training task on the performance of high accuracy is determined based on the accuracy value; for example, the accuracy value of model training task 1 is 94%, and the accuracy value of model training task 2 is 99%. The accuracy values ​​94% and 99% are compared with the preset accuracy value 95% respectively. Since the accuracy value 94% is less than the preset accuracy value 95%, it can be determined that the influence type of the hyperparameter value corresponding to model training task 1 on the performance of high accuracy is a negative influence type; since the accuracy value 99% is greater than the preset accuracy value 95%, it can be determined that the influence type of the hyperparameter value corresponding to model training task 2 on the performance of high accuracy is a positive influence type.

[0054] Taking the target performance of high accuracy and high speed as an example, for the performance of high accuracy, the corresponding indicator value is the accuracy value. For each type of model, the type of influence of the hyperparameter value corresponding to each model training task on the performance of high accuracy is determined based on the accuracy value; for the performance of high speed, the corresponding indicator value is the data processing speed per unit time. For each type of model, the type of influence of the hyperparameter value corresponding to the model training task on the performance of high speed is determined based on the data processing speed per unit time; for example, the data processing speed per unit time of model training task 1 is 100 samples / s (the number of images processed per second), and the data processing speed per unit time of model training task 2 is 200s amples / s, and compare the data processing speeds of 100samples / s and 200samples / s per unit time with the preset speed value of 150samples / s respectively. Since the data processing speed of 100samples / s per unit time is less than the preset speed value of 150samples / s, it can be determined that the influence type of the hyperparameter value corresponding to model training task 1 on the high speed performance is a negative influence type; since the data processing speed of 200samples / s per unit time is greater than the preset speed value of 150samples / s, it can be determined that the influence type of the hyperparameter value corresponding to model training task 2 on the high speed performance is a positive influence type.

[0055] Step 103: determine a target hyperparameter value of a target model based on the impact type corresponding to each model training task; the target model is a model expected to have the target performance.

[0056] For example, when the impact type corresponding to each model training task is obtained, the target hyperparameter value of the target model expected to have the target performance can be determined based on the impact type corresponding to each model training task. For example, the hyperparameter value of the model training task corresponding to the positive impact type is used as the target hyperparameter value of the target model.

[0057] It should be noted that when the target hyperparameter value of the target model is obtained, the target model can be trained based on the target hyperparameter value. For example, the target model can be a model of a detection task.

[0058] The method for determining the hyperparameters of a training model provided by the present invention obtains log data generated by each type of model during the training and evaluation process, wherein the log data includes at least one type of indicator value, and for each type of model, determines the type of influence of the hyperparameter value corresponding to the model training task on the target performance based on the indicator value corresponding to the target performance, and determines the target hyperparameter value of the target model based on the influence type corresponding to each model training task, thereby realizing the recommendation of the hyperparameter value of the target model that is expected to have the target performance.

[0059] In one embodiment, the above step 102 may be implemented in the following manner:

[0060] Determine an indicator average value based on each indicator value corresponding to the target performance; compare each indicator value corresponding to the target performance with the indicator average value to obtain a comparison result; and determine the type of influence of the hyperparameter value corresponding to each model training task of the model on the target performance based on the comparison result.

[0061] For example, when the target performance is high speed, the corresponding indicator value is the data processing speed per unit time, and the corresponding indicator average value is the data processing speed average value. The data processing speed average value is the average value of the data processing speed per unit time of each model training task of the same type of model. The data processing speed in each unit time is compared with the data processing speed average value. When the data processing speed per unit time is greater than or equal to the data processing speed average value, it is determined that the influence type of the hyperparameter value corresponding to the model training task with the data processing speed per unit time greater than or equal to the data processing speed average value on the high speed performance is a positive influence type; when the data processing speed per unit time is less than the data processing speed average value, it is determined that the influence type of the hyperparameter value corresponding to the model training task with the data processing speed per unit time less than the data processing speed average value on the high speed performance is a negative influence type.

[0062] When the target performance is high accuracy, the corresponding indicator value is the accuracy value, and the corresponding indicator average is the accuracy average. The accuracy average is the average of the accuracy values ​​of each model training task. Each accuracy value is compared with the accuracy average. When the accuracy value is greater than or equal to the accuracy average, the influence type of the hyperparameter value corresponding to the model training task with the accuracy value greater than or equal to the accuracy average on the performance of high accuracy is determined to be a positive influence type; when the accuracy value is less than the accuracy average, the influence type of the hyperparameter value corresponding to the model training task with the accuracy value less than the accuracy average on the performance of high accuracy is determined to be a negative influence type.

[0063] When the target performance is small loss, the corresponding indicator value is the loss value, and the corresponding indicator average is the loss average. The loss average is the average of the loss values ​​of each model training task. Each loss value is compared with the loss average. When the loss value is greater than or equal to the loss average, the hyperparameter value corresponding to the model training task with a loss value greater than or equal to the loss average is determined to have a negative impact on the performance of small loss. When the loss value is less than the loss average, the hyperparameter value corresponding to the model training task with a loss value less than the loss average is determined to have a positive impact on the performance of small loss.

[0064] The method for determining the hyperparameters of a training model provided in an embodiment of the present invention determines the type of influence of the hyperparameter value corresponding to the model training task on the target performance based on the comparison result of each indicator value corresponding to the target performance with the indicator average value, that is, determines the relationship data between the hyperparameter value and the target performance, and realizes the classification of the influence of the hyperparameter value corresponding to each model training task on the target performance, which is convenient for the subsequent recommendation of appropriate hyperparameter values ​​based on the influence type.

[0065] In one embodiment, the network structures of the models of the same type are the same, the hyperparameter values ​​corresponding to each model training task of the models of the same type are different, and the training data sets corresponding to each model training task are the same; the above step 103 can be specifically implemented in the following two ways:

[0066] In a first manner, when the target performance includes one performance, the target hyperparameter value is determined based on the hyperparameter value of the model training task corresponding to the positive impact type.

[0067] For example, when the target performance includes one performance, the target hyperparameter is determined based on the influence type corresponding to each model training task with the same network structure, different hyperparameter values, and the same training data set. When the influence type is a positive influence type, it means that the hyperparameter value of the corresponding model training task has a positive effect on the target performance and is beneficial to the training of the model; when the influence type is a negative influence type, it means that the hyperparameter value of the corresponding model training task has a negative effect on the target performance and is not conducive to the training of the model; therefore, the hyperparameter value of the model training task corresponding to the positive influence type can be determined as the target hyperparameter value.

[0068] It should be noted that when the number of model training tasks corresponding to the positive impact type is greater than 1, the hyperparameter values ​​of each model training task corresponding to the positive impact type can be recommended to the user, and the user can select the target hyperparameter value from the multiple recommended hyperparameter values ​​based on the needs; the hyperparameter value that has the greatest positive impact on the model among the hyperparameter values ​​of each model training task corresponding to the positive impact type can also be used as the target hyperparameter value. For example, there are three model training tasks of the same model corresponding to the positive impact type, namely model training task 1, model training task 2 and model training task 3, among which the hyperparameter value of model training task 1 has a low degree of positive impact on the model, the hyperparameter value of model training task 2 has a medium degree of positive impact on the model, and the hyperparameter value of model training task 3 has a high degree of positive impact on the model. In this case, the hyperparameter value of model training task 3 can be used as the target hyperparameter value of the target model.

[0069] In the second manner, when the target performance includes at least two performances, the target hyperparameter value is determined based on the hyperparameter value of the model training task in which the impact type corresponding to each performance is a positive impact type.

[0070] For example, when the target performance includes at least two performances, the target hyperparameter is determined based on the impact type corresponding to each performance in each model training task with the same network structure, different hyperparameter values, and the same training data set; for example, the two performances are high speed and high accuracy, the network structure is the same, the hyperparameter values ​​are different, and the training data set is the same, and the number of model training tasks is three, namely model training task 1, model training task 2, and model training task 3. For model training task 1, it is determined that the impact type of the hyperparameter value of model training task 1 on high speed is a positive impact type, and model training task The impact type of the hyperparameter value of model training task 1 on high accuracy is a negative impact type; the impact type of the hyperparameter value of model training task 2 on high speed is a positive impact type, and the impact type of the hyperparameter value of model training task 2 on high accuracy is a positive impact type; the impact type of the hyperparameter value of model training task 3 on high speed is a negative impact type, and the impact type of the hyperparameter value of model training task 3 on high accuracy is a positive impact type; since the impact type of model training task 2 on both high accuracy and high speed is a positive impact type, the hyperparameter value of model training task 2 is determined as the target hyperparameter value.

[0071] It should be noted that the present invention can also analyze the log data corresponding to the models of the same training data set and different network structures to determine which network structure is more suitable for which type of task, such as classification tasks or detection tasks, etc. For example, it can be analyzed that network structure 1 is suitable for classification tasks, network structure 2 is suitable for detection tasks, etc.

[0072] The method for determining the hyperparameters of a training model provided in an embodiment of the present invention is based on the analysis of the log data of each model training task with the same network structure, different hyperparameter values, and the same training data set. For different numbers of target performances, the method for determining the target hyperparameter values ​​is also different, thereby achieving automatic recommendation of hyperparameter values ​​under different numbers of target performances.

[0073] In one embodiment, the target hyperparameter value is determined based on the hyperparameter value of the model training task in which the impact type corresponding to each performance is a positive impact type. Specifically, it can be implemented in the following way:

[0074] Obtaining the performance with the highest priority among the at least two performances;

[0075] Compare the model training tasks corresponding to each performance where the impact type is a positive impact type with each indicator value corresponding to the performance with the highest priority to obtain a target indicator value; the hyperparameter value of the model training task corresponding to the target indicator value has the greatest positive impact on the target performance;

[0076] The hyperparameter value of the model training task corresponding to the target index value is determined as the target hyperparameter value.

[0077] For example, when the number of model training tasks whose impact type corresponding to each performance is a positive impact type is greater than 1, the target hyperparameter value can be determined based on the priority of each performance; for example, the two performances are high speed and high accuracy, the network structure is the same, the number of model training tasks with different hyperparameter values ​​and the same training data set is three, namely model training task 1, model training task 2 and model training task 3. For model training task 1, it is determined that the impact type of the hyperparameter value of model training task 1 on high speed is a positive impact type, and the impact type of the hyperparameter value of model training task 1 on high accuracy is a positive impact type; the impact type of the hyperparameter value of model training task 2 on high speed is a positive impact type. The influence type of the hyperparameter value of model training task 2 is positive, and the influence type of the hyperparameter value of model training task 3 on high speed is positive. The influence type of the hyperparameter value of model training task 3 on high accuracy is positive. If the priority of the performance of high accuracy is greater than the priority of the performance of high speed, the accuracy value of model training task 1, the accuracy value of model training task 2, and the accuracy value of model training task 3 are compared. If the accuracy value of model training task 2 is the largest, the accuracy value of model training task 2 is determined as the target indicator value, and the hyperparameter value of model training task 2 is determined as the target hyperparameter value of the target model.

[0078] The method for determining the hyperparameters of a training model provided in an embodiment of the present invention can select a target hyperparameter value from the hyperparameter values ​​of model training tasks that are all of a positive impact type based on performance priority, so as to improve the matching degree between the selected target hyperparameter value and the performance with the highest priority.

[0079] In one embodiment, the network structures of the models of the same type are the same, the hyperparameter values ​​corresponding to each model training task of the models of the same type are the same, and the training data sets corresponding to each model training task are different; the log data also includes training data where the predicted values ​​generated by each type of model during the training and evaluation process are different from the true values; Figure 2 FIG. 2 is a flow chart of a method for determining hyperparameters of a training model provided in an embodiment of the present invention. Figure 2 As shown, the method for determining the hyperparameters of the training model also includes the following steps:

[0080] Step 104: for each of the training data of the same type of the model, the number of times the predicted value is different from the true value is compared with a preset number.

[0081] The training data may be image data, audio data, video data or general data.

[0082] Step 105: When the number of times that the predicted value is different from the true value is greater than or equal to the preset number of times, the training data is determined as abnormal data.

[0083] For example, during the training and evaluation process of each type of model, each training data for which the predicted value and the true value are different will be recorded in each iteration. Therefore, for each model training task with the same network structure and the same hyperparameter value but different training data sets, if the predicted value of the training data is different from the true value, it means that the training data will affect the convergence speed of the model, or the accuracy of the model, or both the convergence speed and accuracy of the model, etc. Therefore, when the number of times the predicted value of the training data is different from the true value is greater than or equal to the preset number of times, the training data is considered to be abnormal data; when the number of times the predicted value of the training data is different from the true value is less than the preset number of times, the training data is considered to be normal data.

[0084] Step 106: Determine a target training data set for the target model based on the abnormal data.

[0085] Optionally, an initial training data set of the target model is obtained; and the abnormal data is removed from the initial training data set to obtain the target training data set.

[0086] For example, when determining abnormal data, when an initial training data set for a target model is obtained, the abnormal data included in the initial training data set can be removed to obtain a target training data set, and the target model is trained based on the target training data set.

[0087] It should be noted that steps 104 to 106 may be performed after step 103 or after step 101, and the present invention does not limit this.

[0088] The method for determining the hyperparameters of a training model provided in an embodiment of the present invention determines abnormal data based on the analysis of training data in which the predicted values ​​in log data are different from the true values, removes the abnormal data from the initial training data set, and trains the target model based on the target training data set, thereby optimizing the training data to improve the convergence speed or accuracy of the target model and reduce the training loss of the target model.

[0089] In one embodiment, the above step 101 may be implemented in the following manner:

[0090] The log data is obtained in the target container through Filebeat; the log data generated by each type of the model during the training and evaluation process is stored in the target container.

[0091] For example, in each task created in the K8S cluster, FileBeat is used to collect the log data of the target container running in the pod. Filebeat collects the log data of the target container in sidecar mode, that is, filebeat and the target container are deployed in the same pod. By specifying the path or file for collecting log data, the log data can be sent to a search engine such as Elasticsearch or a disk file. When log data needs to be obtained, it can be obtained in the target container through Filebeat. In addition, Filebeat deployed in the pod can be configured in YAML or other languages.

[0092] The method for determining the hyperparameters of a training model provided by an embodiment of the present invention obtains log data in a target container through filebeat, thereby realizing rapid acquisition of log data generated during model training and evaluation.

[0093] Figure 3 is a schematic diagram of the structure of the model training platform provided by an embodiment of the present invention, such as Figure 3 As shown, the model training platform includes a data set module 301, an image support module 302, an algorithm network management module 303, a model training module 304, a model release management module 305, a model deployment module 306, an algorithm network editing module 307, a model evaluation management module 308, a log collection module 309, a data storage module 310 and a data processing module 311; wherein:

[0094] The data set module 301 is used to store the original information and annotation information of the data set used for model training, including pictures, audio and video data.

[0095] The image support module 302 is the system and environment required for task training, Jupyter NoteBook, publishing, evaluation, deployment, etc.

[0096] The algorithm network management module 303 supports uploading built-in and custom algorithm packages, which contain common Python scripts such as algorithm framework, algorithm network structure, training, export inference and evaluation.

[0097] The algorithm network editing module 307 is a web-based application for interactive computing, development, document writing, code running and result display; the entire algorithm package can be edited and modified in Python code, and the code running results will be displayed directly under the code block.

[0098] The model training module 304 selects an algorithm package in the system, searches for a corresponding algorithm network, fills in the training data set, image, hyperparameters and other training parameter configurations, saves them, and starts the training task. The system submits the task to the K8S cluster for task training. K8S selects the corresponding service node for model training based on the set parameters. The training logs will also be saved through the log collection tool for data analysis.

[0099] The model publishing management module 305 can publish the inference model for the training task that has been completed or paused. The inference model can be used for inference of data such as pictures.

[0100] The model evaluation management module 308 is used to select a suitable data set for the published model to perform model evaluation and evaluate various index values ​​of the model. The evaluation log will be saved for data analysis.

[0101] The log collection module 309 is used to collect key log information such as training logs and evaluation logs through tools. The data storage module 310 is used to store the collected log data. The data processing module 311 is used to read the collected log data, clean and structure it, summarize and organize the index value data, analyze the index value data, obtain the relationship between the hyperparameter value and the target performance of each model training task, and the relationship between the training data and the target performance, and then recommend the target hyperparameter value for the target model and eliminate abnormal training data.

[0102] A conventional model training platform includes a data set module 301, an image support module 302, an algorithm network management module 303, a model training module 304, a model release management module 305, a model deployment module 306, an algorithm network editing module 307, a model evaluation management module 308 and a log collection module 309. The present invention adds a data storage module 310 and a data processing module 311. The data processing module 311 is used to analyze the log data stored in the data storage module 310. Based on the analysis results described in the above embodiments, target hyperparameter values ​​and target training data sets are recommended for the target model. The target model is trained based on the recommended target hyperparameter values ​​and target training data sets, which can improve the data processing speed or accuracy of the target model per unit time and reduce the training loss of the target model.

[0103] The device for determining the hyperparameters of a training model provided by the present invention is described below. The device for determining the hyperparameters of a training model described below and the method for determining the hyperparameters of a training model described above can be referenced to each other.

[0104] Figure 4is a schematic diagram of the structure of the device for determining the hyperparameters of the training model provided by an embodiment of the present invention, such as Figure 4 As shown, the apparatus 400 for determining the hyperparameters of a training model includes an acquisition unit 401, a first determination unit 402, and a second determination unit 403; wherein:

[0105] The acquisition unit 401 is used to acquire log data; the log data includes at least one type of index value generated by at least one type of model during the training and evaluation process; each type of index value is used to characterize a performance of the model;

[0106] A first determining unit 402 is used to determine, for each type of the model, an influence type of the hyperparameter value corresponding to each model training task of the model on the target performance based on the indicator value corresponding to the target performance; the influence type includes a positive influence type or a negative influence type;

[0107] The second determination unit 403 is used to determine the target hyperparameter value of the target model based on the impact type corresponding to each model training task; the target model is a model expected to have the target performance.

[0108] The device for determining the hyperparameters of a training model provided by the present invention obtains log data generated by each type of model during the training and evaluation process, wherein the log data includes at least one type of indicator value, and for each type of model, determines the type of influence of the hyperparameter value corresponding to each model training task of the model on the target performance based on the indicator value corresponding to the target performance, and determines the target hyperparameter value of the target model based on the influence type corresponding to each model training task, thereby realizing the recommendation of the hyperparameter value of the target model that is expected to have the target performance.

[0109] Based on any of the foregoing embodiments, the first determining unit 402 is specifically configured to:

[0110] Determine an indicator average value based on each of the indicator values ​​corresponding to the target performance;

[0111] Compare each indicator value corresponding to the target performance with the indicator average value to obtain a comparison result;

[0112] Based on the comparison result, determine the type of influence of the hyperparameter value corresponding to each model training task of the model on the target performance.

[0113] Based on any of the foregoing embodiments, the network structures of the models of the same type are the same, the hyperparameter values ​​corresponding to each model training task of the models of the same type are different, and the training data sets corresponding to each model training task are the same; the second determining unit 403 is specifically used to:

[0114] In a case where the target performance includes one performance, determining the target hyperparameter value based on the hyperparameter value of the model training task corresponding to the impact type being a positive impact type;

[0115] In the case where the target performance includes at least two performances, the target hyperparameter value is determined based on the hyperparameter value of the model training task in which the impact type corresponding to each performance is a positive impact type.

[0116] Based on any of the foregoing embodiments, the second determining unit 403 is further specifically configured to:

[0117] Obtaining the performance with the highest priority among the at least two performances;

[0118] Compare the model training tasks corresponding to each performance where the impact type is a positive impact type with each indicator value corresponding to the performance with the highest priority to obtain a target indicator value; the hyperparameter value of the model training task corresponding to the target indicator value has the greatest positive impact on the target performance;

[0119] The hyperparameter value of the model training task corresponding to the target index value is determined as the target hyperparameter value.

[0120] Based on any of the above embodiments, the network structures of the models of the same type are the same, the hyperparameter values ​​corresponding to each model training task of the models of the same type are the same, and the training data sets corresponding to each model training task are different; the log data also includes training data in which the predicted values ​​generated by each type of model during the training and evaluation process are different from the true values; the device 400 for determining the hyperparameters of the training model also includes:

[0121] A comparing unit, for comparing the number of times that the predicted value is different from the true value with a preset number for each of the training data of the same type of the model;

[0122] A third determination unit, configured to determine the training data as abnormal data when the number of times the predicted value differs from the true value is greater than or equal to the preset number of times;

[0123] A fourth determining unit is used to determine a target training data set of the target model based on the abnormal data.

[0124] Based on any of the foregoing embodiments, the fourth determining unit is specifically configured to:

[0125] Obtaining an initial training data set for the target model;

[0126] The abnormal data is removed from the initial training data set to obtain the target training data set.

[0127] Based on any of the above embodiments, the acquiring unit 401 is specifically used for:

[0128] The log data is obtained in the target container through Filebeat; the log data generated by each type of the model during the training and evaluation process is stored in the target container.

[0129] Figure 5 is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention, such as Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the method for determining the hyperparameters of the training model, the method comprising: obtaining log data; the log data comprises at least one type of index value generated by at least one type of model in the training and evaluation process; each type of index value is used to characterize a performance of the model;

[0130] For each type of the model, determining the type of influence of the hyperparameter value corresponding to each model training task of the model on the target performance based on the indicator value corresponding to the target performance; the influence type includes a positive influence type or a negative influence type;

[0131] The target hyperparameter value of the target model is determined based on the impact type corresponding to each model training task; the target model is a model expected to have the target performance.

[0132] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0133] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the method for determining the hyperparameters of the training model provided by the above methods, the method comprising: obtaining log data; the log data includes at least one type of indicator value generated by at least one type of model during the training and evaluation process; each type of indicator value is used to characterize a performance of the model;

[0134] For each type of the model, determining the type of influence of the hyperparameter value corresponding to each model training task of the model on the target performance based on the indicator value corresponding to the target performance; the influence type includes a positive influence type or a negative influence type;

[0135] The target hyperparameter value of the target model is determined based on the impact type corresponding to each model training task; the target model is a model expected to have the target performance.

[0136] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the method for determining the hyperparameters of the training model provided by the above methods, the method comprising: obtaining log data; the log data comprising at least one type of index value generated by at least one type of model during the training and evaluation process; each type of index value is used to characterize a performance of the model;

[0137] For each type of the model, determining the type of influence of the hyperparameter value corresponding to each model training task of the model on the target performance based on the indicator value corresponding to the target performance; the influence type includes a positive influence type or a negative influence type;

[0138] The target hyperparameter value of the target model is determined based on the impact type corresponding to each model training task; the target model is a model expected to have the target performance.

[0139] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0140] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0141] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for determining hyperparameters of a training model, characterized in that: include: Obtaining log data; the log data includes at least one type of indicator value generated by at least one type of model during training and evaluation; Each type of indicator value is used to characterize a performance of the model; For each type of the model, determining the type of influence of the hyperparameter value corresponding to each model training task of the model on the target performance based on the indicator value corresponding to the target performance; the influence type includes a positive influence type or a negative influence type; The target hyperparameter value of the target model is determined based on the impact type corresponding to each model training task; the target model is a model expected to have the target performance.

2. The method for determining training model hyperparameters according to claim 1, characterized in that: The determining, based on the indicator value corresponding to the target performance, the type of influence of the hyperparameter value corresponding to each model training task of the model on the target performance includes: Determine an indicator average value based on each of the indicator values ​​corresponding to the target performance; Compare each indicator value corresponding to the target performance with the indicator average value to obtain a comparison result; Based on the comparison result, determine the type of influence of the hyperparameter value corresponding to each model training task of the model on the target performance.

3. The method for determining training model hyperparameters according to claim 1, characterized in that: The network structures of the models of the same type are the same, the hyperparameter values ​​corresponding to each model training task of the models of the same type are different, and the training data sets corresponding to each model training task are the same; The determining a target hyperparameter value of a target model based on the impact type corresponding to each model training task includes: In a case where the target performance includes one performance, determining the target hyperparameter value based on the hyperparameter value of the model training task corresponding to the impact type being a positive impact type; In the case where the target performance includes at least two performances, the target hyperparameter value is determined based on the hyperparameter value of the model training task in which the impact type corresponding to each performance is a positive impact type.

4. The method for determining training model hyperparameters according to claim 3, characterized in that: The determining of the target hyperparameter value based on the hyperparameter value of the model training task in which the impact type corresponding to each performance is a positive impact type includes: Obtaining the performance with the highest priority among the at least two performances; Compare the model training tasks corresponding to each performance where the impact type is a positive impact type with each indicator value corresponding to the performance with the highest priority to obtain a target indicator value; the hyperparameter value of the model training task corresponding to the target indicator value has the greatest positive impact on the target performance; The hyperparameter value of the model training task corresponding to the target index value is determined as the target hyperparameter value.

5. The method for determining training model hyperparameters according to claim 1, characterized in that: The network structures of the models of the same type are the same, the hyperparameter values ​​corresponding to each model training task of the models of the same type are the same, and the training data sets corresponding to each model training task are different; The log data also includes training data in which the predicted values ​​generated by each type of model during the training and evaluation process are different from the true values; The method further comprises: For each of the training data of the same type of the model, comparing the number of times the predicted value is different from the true value with a preset number; When the number of times the predicted value differs from the true value is greater than or equal to the preset number, determining the training data as abnormal data; A target training data set for the target model is determined based on the abnormal data.

6. The method for determining training model hyperparameters according to claim 5, characterized in that: The step of determining a target training data set for the target model based on the abnormal data includes: Obtaining an initial training data set for the target model; The abnormal data is removed from the initial training data set to obtain the target training data set.

7. The method for determining training model hyperparameters according to any one of claims 1 to 6, characterized in that: The obtaining of log data includes: The log data is obtained in the target container through Filebeat; the log data generated by each type of the model during the training and evaluation process is stored in the target container.

8. A device for determining hyperparameters of a training model, characterized in that: include: An acquisition unit, configured to acquire log data; the log data includes at least one type of indicator value generated by at least one type of model during training and evaluation; Each type of indicator value is used to characterize a performance of the model; A first determination unit is used to determine, for each type of the model, an influence type of the hyperparameter value corresponding to each model training task of the model on the target performance based on the indicator value corresponding to the target performance; the influence type includes a positive influence type or a negative influence type; A second determination unit, configured to determine a target hyperparameter value of a target model based on the impact type corresponding to each model training task; The target model is a model that is expected to have the target performance.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for determining the hyperparameters of the training model as described in any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for determining the hyperparameters of a training model as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Parameter optimization and feature tuning method and system for machine learning

    CN104200087A

  • Hyper-parameter determination method and device, computer equipment and storage medium

    CN112529211A

  • Hyper-parameter optimization method and device and computing equipment

    CN114444709A

Cited By

  • Multi-modal model training method and multi-modal model training device

    CN120764725A