A system, method, device, medium and equipment for training image classification model

By introducing agent nodes and data distribution models into the distributed training system, the distribution strategy of training data is optimized, the problem of low data usage in the training node cache system is solved, and the training efficiency of the image classification model is improved.

CN118570560BActive Publication Date: 2024-09-27ZHEJIANG LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411044024.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-09-27
Estimated Expiration
2044-07-31

AI Technical Summary

Technical Problem

When training image classification models in a distributed manner, the delay in each training node obtaining training data from the storage node results in low local usage of training data in the cache system, affecting training efficiency.

Method used

Introduce agent nodes, determine the distribution strategy of training data through the data distribution model, optimize data distribution and improve the local cache hit rate based on the remaining local cache space of the training node and the historical data usage.

Benefits of technology

By optimizing the data distribution strategy, the local cache hit rate of each training node is improved, and the training efficiency of the image classification model is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570560B
    Figure CN118570560B
Patent Text Reader

Abstract

This specification discloses a system, method, device, medium and equipment for training an image classification model. The proxy node determines the distribution strategy of training data through a data distribution model, and distributes training data to each training node according to the distribution strategy. Each training node caches training data. When receiving a training task, it first obtains the training data required to perform the training task from the local cache. When the training data in the local cache cannot match the training data required to perform the training task, it obtains other training data required to perform the training task and not cached locally, thereby completing the training task. When executing a training task, each training node can determine the local cache hit rate and return it to the proxy node. The proxy node adjusts the parameters of the data distribution model based on the local cache hit rate of each training node, thereby optimizing the distribution strategy to improve the local cache hit rate of the training data in the training node and improve the training efficiency of the image classification model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a system, method, device, medium and equipment for training an image classification model. Background Art

[0002] With the development of science and technology, the application of image classification models is becoming more and more extensive. When performing distributed training on image classification models, one of the training methods is storage and computing separation. In the distributed training method of storage and computing separation, it can include management nodes, storage nodes and multiple training nodes. The management node can distribute training tasks to each training node, and the storage node can store training data, that is, sample images and category labels corresponding to the sample images. Each training node can execute training tasks. Usually, each training node receives different training tasks. When training an image classification model, each training node can obtain the training data corresponding to the training task from the storage node based on the training task distributed by the management node, and then execute the training task based on the obtained training data.

[0003] At present, in order to solve the problem of data transmission delay when each training node obtains the training data corresponding to the training task from the storage node, a cache system is usually deployed on each training node to cache the training data. Since the size of the cache space of the cache system is much smaller than the size of the training data stored in the storage node, before each training node receives the training task, the storage node can distribute part of the training data to each training node in advance, and each training node can store the part of the training data through the cache system. After each training node receives the training task, it can first obtain the training data corresponding to the training task from the cache system. When all the training data corresponding to the training task cannot be obtained from the cache system, it can be obtained from the storage node. Therefore, when training an image classification model, how to improve the local usage rate of the training data stored in the cache system of each training node, that is, to improve the local cache hit rate of the training data cached by each training node, so as to improve the training efficiency of the image classification model, is an important issue.

[0004] Based on this, the present application specification provides a system for training an image classification model. Summary of the invention

[0005] This specification provides a system, method, device, medium and equipment for training an image classification model to at least partially solve the above-mentioned problems existing in the prior art.

[0006] This manual adopts the following technical solutions:

[0007] This specification provides a system for training an image classification model, the system comprising a management node, an agent node, and a plurality of training nodes;

[0008] The proxy node obtains the training data to be distributed and the remaining local cache space of each training node; determines the basic information of the training data to be distributed, and uses the basic information of the training data to be distributed and the remaining local cache space of each training node as status information; wherein the basic information includes: the data volume of the training data to be distributed and the historical usage of the training data to be distributed; inputs the status information into the data distribution model to obtain the distribution strategy output by the data distribution model; and sends the training data to be distributed to each training node according to the distribution strategy;

[0009] The multiple training nodes receive the to-be-distributed training data sent by the proxy node, use the received to-be-distributed training data as initial training data, and cache the initial training data;

[0010] The management node sends a training task of training the image classification model to each training node;

[0011] The multiple training nodes receive the training tasks sent by the management node and execute the training tasks; determine the target training data required to execute the training tasks according to the training tasks; determine the local cache hit rate according to the target training data and the initial training data, and send the local cache hit rate to the proxy node;

[0012] The proxy node receives the local cache hit rate sent by each training node; determines the reward value according to the received cache hit rate of each training node; and adjusts the parameters of the data distribution model according to the state information, the distribution strategy and the reward value.

[0013] Optionally, the system further comprises: a storage node;

[0014] The storage node is used to determine the training data to be distributed, and send the training data to be distributed to the proxy node;

[0015] The proxy node is used to receive the training data to be distributed sent by the storage node.

[0016] Optionally, the multiple training nodes are specifically used to, when the local cache hit rate is greater than a first preset threshold, obtain target training data from the initial training data, and execute the training task based on the obtained target training data; when the local cache hit rate is not greater than the first preset threshold, determine the uncached target training data according to the initial training data and the target training data, and obtain the uncached target training data, and obtain the full amount of target training data based on the initial training data and the obtained uncached target training data; and execute the training task based on the obtained full amount of target training data.

[0017] Optionally, the proxy node is specifically used to determine the number of local cache hit rates that are greater than a second preset threshold; determine a reward value based on the number; wherein the reward value is positively correlated with the number.

[0018] This specification provides a method for training an image classification model, the method is applied to a training node in a distributed system, the distributed system also includes: a management node and an agent node; the method includes:

[0019] receiving the training data sent by the proxy node, using the received training data as initial training data, and storing the initial training data; wherein the initial training data is distributed by the proxy node to the training node according to a distribution strategy, and the distribution strategy is obtained by the proxy node through a data distribution model based on basic information of the training data to be distributed and status information composed of the remaining space of the local cache of each training node, wherein the basic information includes: the amount of the training data to be distributed and the historical usage of the training data to be distributed;

[0020] When receiving a training task for training the image classification model sent by the management node, executing the training task, and determining target training data used to execute the training task according to the training task;

[0021] A local cache hit rate is determined according to the target training data and the initial training data, and the local cache hit rate is sent to the proxy node, so that the proxy node adjusts the parameters of the data distribution model based on the received local cache hit rates of each training node.

[0022] This specification provides a method for training an image classification model, the method is applied to an agent node in a distributed system, the distributed system further comprising: a management node and a plurality of training nodes; the method comprises:

[0023] Obtain the training data to be distributed and the remaining local cache space of each training node;

[0024] Determine the basic information of the training data to be distributed, and use the basic information and the remaining space of the local cache of each training node as status information; wherein the basic information includes: the amount of the training data to be distributed and the historical usage of the training data to be distributed;

[0025] Inputting the state information into a data distribution model to obtain a distribution strategy output by the data distribution model;

[0026] According to the distribution strategy, the training data to be distributed is sent to each training node, so that each training node performs the training task when receiving the training task of the training image classification model sent by the management node, and determines the local cache hit rate according to the target training data used to perform the training task and the training data to be distributed, and sends the local cache hit rate to the proxy node;

[0027] Receive the local cache hit rate sent by each training node;

[0028] Determine the reward value according to the cache hit rate of each training node received;

[0029] The parameters of the data distribution model are adjusted according to the state information, the distribution strategy and the reward value.

[0030] This specification provides a device for training an image classification model, the device is located at a training node in a distributed system, the distributed system further includes: a management node and an agent node; the device specifically includes:

[0031] a receiving module, configured to receive the training data sent by the proxy node, use the received training data as initial training data, and store the initial training data; wherein the initial training data is distributed by the proxy node to the training node according to a distribution strategy, and the distribution strategy is obtained by the proxy node through a data distribution model based on basic information of the training data to be distributed and status information composed of the remaining space of the local cache of each training node, wherein the basic information includes: the amount of the training data to be distributed and the historical usage of the training data to be distributed;

[0032] A training module, configured to, when receiving a training task for training an image classification model sent by the management node, execute the training task, and determine target training data used to execute the training task according to the training task;

[0033] The sending module is used to determine the local cache hit rate according to the target training data and the initial training data, and send the local cache hit rate to the proxy node, so that the proxy node adjusts the parameters of the data distribution model based on the received local cache hit rates.

[0034] This specification provides a device for training an image classification model, the device is located at an agent node in a distributed system, the distributed system further includes: a management node and multiple training nodes; the device specifically includes:

[0035] An acquisition module is used to acquire the training data to be distributed and the remaining space of the local cache of each training node;

[0036] A first determination module is used to determine basic information of the training data to be distributed, and use the basic information and the remaining space of the local cache of each training node as status information; wherein the basic information includes: the amount of the training data to be distributed and the historical usage of the training data to be distributed;

[0037] An input module, used for inputting the state information into a data distribution model to obtain a distribution strategy output by the data distribution model;

[0038] A distribution module, configured to send the training data to be distributed to each training node according to the distribution strategy, so that each training node performs the training task when receiving the training task of the training image classification model sent by the management node, and determines the local cache hit rate according to the target training data used to perform the training task and the training data to be distributed, and sends the local cache hit rate to the proxy node;

[0039] A receiving module, used for receiving the local cache hit rate sent by each training node;

[0040] A second determination module is used to determine a reward value according to the received local cache hit rate of each training node;

[0041] An adjustment module is used to adjust the parameters of the data distribution model according to the state information, the distribution strategy and the reward value.

[0042] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method for training an image classification model is implemented.

[0043] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for training an image classification model when executing the program.

[0044] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:

[0045] It can be seen from the system and method for training an image classification model provided in this specification that when the image classification model is trained in a distributed training method with storage and computing separation, the proxy node can determine the distribution strategy of the training data through the data distribution model to distribute the training data to each training node according to the distribution strategy. Each training node can cache the training data distributed by the proxy node, so that when each training node receives a training task, it can first obtain the training data required to perform the training task from the local cache. When the training data in the local cache cannot match the training data required to perform the training task, each training node then obtains other training data required to perform the training task and not cached locally, thereby completing the training task. When each training node performs a training task, the local cache hit rate of the training data can also be determined and returned to the proxy node. The proxy node can adjust the parameters of the data distribution model based on the local cache hit rate of each training node, so that the data distribution model optimizes the distribution strategy, thereby improving the local cache hit rate of the training data in each training node, so as to improve the training efficiency of the image classification model. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:

[0047] Figure 1 A system for training an image classification model provided in this specification;

[0048] Figure 2 A system for training an image classification model provided in this specification;

[0049] Figure 3 A flowchart of a method for training an image classification model provided in this specification;

[0050] Figure 4 A flowchart of a method for training an image classification model provided in this specification;

[0051] Figure 5 A schematic diagram of a device for training an image classification model provided in this specification;

[0052] Figure 6 A schematic diagram of a device for training an image classification model provided in this specification;

[0053] Figure 7 The corresponding Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the specification.

[0055] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.

[0056] like Figure 1 As shown, a system for training an image classification model provided in the specification of this application is shown, and it can be seen that the system includes: a management node, an agent node, and multiple training nodes. In this specification, a node can be a server, a terminal, etc., and this specification does not limit it.

[0057] As described in the background technology, the training efficiency of the image classification model can be improved by improving the local cache hit rate of the training node. In this specification, in order to improve the local cache hit rate of the training node, a proxy node is added to the distributed system of the training image classification model, and a data distribution model is deployed in the proxy node. The data distribution model is used to determine the distribution strategy through the status information of the training data. In addition, in this specification, the proxy node can adjust the parameters of the data distribution model as the training node performs the training task, that is, the data distribution model deployed in the proxy node can be a model that has not been pre-trained. Specifically, in the process of iterative training of the image classification model, for each training node, the training node can determine the local cache hit rate of the training data obtained based on the distribution strategy, and the training node can send its local cache hit rate to the proxy node. The proxy node can use a reinforcement learning algorithm to adjust the data distribution model based on the local cache hit rate of the training data received from each training node, and continuously optimize the distribution strategy, thereby improving the local cache hit rate of each training node to improve the training efficiency of the image classification model.

[0058] In this specification, the proxy node can obtain the training data to be distributed and obtain the remaining local cache space of each training node. In one or more embodiments of this specification, the system may also include a storage node, which is used to store all the training data for training the image classification model, such as Figure 2 As shown, Figure 2A system for training an image classification model provided in this specification. In this specification, a storage node can determine the training data to be distributed. Specifically, the storage node can determine the training data to be distributed from all the training data based on a preset rule. The preset rule can be to use a specified number of training data in all the training data as the training data to be distributed. The specified number can be one twentieth, one thirtieth, etc. of the total training data. The preset rule can also be to use a specified type of training data in all the training data as the data to be distributed. The specified type of training data can be training data whose sample image contains object X, or the specified type of training data can be training data whose category label corresponding to the sample image is category Y, etc., which is not limited in this specification. Of course, the storage node can also use other methods to determine the training data to be distributed, which is not limited in this specification. Then, the storage node can send the determined data to be distributed to the proxy node. Therefore, the proxy node can receive the training data to be distributed sent by the storage node, that is, the proxy node can obtain the training data to be distributed.

[0059] In one or more embodiments of the present specification, all training data for training the image classification model may also be pre-stored in the proxy node, and then the proxy node may determine the training data to be distributed from all the training data according to the preset rules, that is, obtain the training data to be distributed. This specification does not specifically limit whether all the training data for training the image classification model is pre-stored in the storage node or the proxy node. As mentioned above, the preset rule may be to use a specified number of training data from all the training data as the training data to be distributed, or to use a specified type of training data from all the training data as the training data to be distributed, and the details will not be repeated.

[0060] In this specification, each training node can determine its own local cache remaining space, and then each proxy node can send its own local cache remaining space to the proxy node, and the proxy node can receive the local cache remaining space of each training node, that is, the proxy node can obtain the local cache remaining space of each training node.

[0061] Then, the proxy node can determine the basic information of the training data to be distributed, and use the basic information of the training data to be distributed and the remaining space of the local cache of each training node as status information. In this specification, the basic information of the training data to be distributed includes the amount of training data to be distributed and the historical usage of the training data to be distributed. The historical usage of the training data to be distributed includes: the historical usage times of the training data to be distributed, the training tasks that have used the training data to be distributed, and the importance score of the training data to be distributed to each training task. Among them, there is no specific restriction on the method for determining the importance score. For example, the proxy node can determine the importance score based on the correlation between the training data to be distributed and each training task. The correlation can be, for each training task, the historical usage rate of the training data to be distributed by the training task, that is, the proportion of training data that executes the training task in the training data to be distributed. The correlation can also be, for each training task, the historical usage times of the training data to be distributed by the training task, and so on.

[0062] Next, the proxy node can input the obtained state information into the data distribution model, so that the data distribution model outputs a distribution strategy based on the state information, which is a strategy for how to distribute the data to be distributed to each training node. Thus, the proxy node can send the training data to be distributed to each training node according to the distribution strategy.

[0063] Therefore, each training node can receive the training data to be distributed sent by the proxy node, and use the received training data to be distributed as initial training data. Each training node can cache the initial training data.

[0064] As described above, each training node has pre-cached part of the training data. Therefore, for each training node, when the training node receives a training task, the training task can be executed according to the training data pre-cached locally by the training node.

[0065] The management node may send a training task for training an image classification model to each training node, and each training node may execute the training task based on its own locally pre-cached training data.

[0066] When training an image classification model, the training data distributed by the management node to each training node is different, that is, each training node receives a different training task, and each training node uses a different training data to perform the training task. Therefore, in this specification, for each training node, the training node can determine the target training data required to perform the training task based on the received training task. When the management node sends a training task to each training node, the target training data required to perform the training task can also be sent to the training node. Then, for each training node, the training node can receive the training task and the name or identifier of the target training data required to perform the training task, that is, the training node can determine the target training data required to perform the training task, or the training node can determine the name or identifier of the target training data required to perform the received training task based on the correspondence between the preset training task and the training data. This specification does not specifically limit how the training node determines the name or identifier of the target training data required to perform the training task.

[0067] It should be noted that when the training node determines the target training data required to perform the training task, the target training data here refers to the name or identifier of the target training data, that is, the training node determines the name or identifier of the target data required to perform the training task. In other words, the training node does not obtain the target training data, but only obtains the name or identifier of the target training data.

[0068] In addition, the training tasks for training the image classification model may be predetermined by the management node, and the training tasks may be assigned to each training node when the training starts. In one or more embodiments of the present specification, when determining the training tasks for training the image classification model, each training task may be obtained by setting the hyperparameters of the image classification model, which may be a learning rate, a batch size, a regularization parameter, etc. Alternatively, each training task may be divided according to the flow of data in the image classification model. This specification does not limit this, and the training tasks for training the image classification model may be determined according to specific scenarios and requirements.

[0069] In this specification, for each training node, when executing a training task, the training node can determine the identifier of the target training data required to execute the training task. Then, in the initial training data pre-cached locally, the target training data is obtained based on the identifier of the target training data. Then, the training task can be executed based on the acquired target training data. Specifically, in this specification, the training node can determine the local cache hit rate of the training data based on the target training data and the initial training data required to execute the training task. When the local cache hit rate is greater than a first preset threshold, the training node can obtain the target training data from the initial training data. That is, when the local cache hit rate is greater than the first preset threshold, it indicates that the training node has cached all the target training data, or in other words, the initial training data includes all the target training data required to execute the training task, then the training node can execute the training task based on the acquired target training data. When the local cache hit rate is not greater than the first preset threshold, the training node can determine the uncached target training data based on the initial training data and the target training data, and obtain the uncached target training data, and obtain the full amount of target training data (that is, all target training data) based on the initial training data and the obtained uncached target training data, and then the training node can perform the training task based on the obtained full amount of target training data. In other words, when the local cache hit rate is not greater than the first preset threshold, it indicates that the training node has not cached all the target training data, or that the initial training data does not include all the target training data required to perform the training task, so the training node can determine the uncached target training data based on the initial training data and the target training data, and obtain the uncached target training data, so that the training node can obtain all the target training data, and then can perform the training task based on all the obtained target training data.

[0070] Among them, when obtaining the uncached target training data, as mentioned above, all the training data used to train the image classification model can be pre-stored in the storage node, and the training node can obtain the uncached target training data from the storage node, or all the training data used to train the image classification model can be pre-stored in the proxy node, and the training node can obtain the uncached target training data from the proxy node. Of course, other methods are also used to obtain the target training data that is not locally cached by the training node, such as obtaining it from the training data cached by other training nodes, etc. This manual does not make specific restrictions.

[0071] It should be noted that, as described in the background technology, when training an image classification model, the training data may include sample images and category labels corresponding to the sample images. Therefore, for each training node, after the training node obtains all the target training data, the training node may perform the training task based on the sample images and the category labels corresponding to the sample images. This specification does not limit the sample images and category labels corresponding to the sample images, which can be pre-set based on specific scenarios and specific needs. For example, in the medical field, the image classification model can be used to classify the types of medical images, such as CT images, MRI images, etc. In the field of autonomous driving, the image classification model can be used to identify pedestrians, vehicles, traffic lights, etc. in the image. For example, in the field of e-commerce, the image classification model can be used to classify commodities, such as clothing, tea sets, stationery, etc.

[0072] In this specification, each training node may send the local cache hit rate of its corresponding training data to the proxy node, and the proxy node may receive the local cache hit rate sent by each training node. And the reward value may be determined based on the received local cache hit rate of each training node. Specifically, the proxy node may determine the number of local cache hit rates greater than the second preset threshold, and determine the reward value based on the number, and the reward value is positively correlated with the number. In other words, the proxy node may determine the number of local cache hit rates greater than the second preset threshold among the received local cache hit rates, and the number is positively correlated with the reward value, that is, the more the number of local cache hit rates greater than the second preset threshold, the greater the reward value, and the fewer the number of local cache hit rates greater than the second preset threshold, the smaller the reward value.

[0073] In this specification, the following formula may be used to determine the reward value:

[0074]

[0075] in, is the reward value, It is the time taken for the last iteration of training when the training node performs training tasks and iteratively trains the image classification model. is a penalty factor, which may be 0.001×Se, where Se refers to the used cache space in the training node. The specified number may be preset, and in this specification, the specified number may be half of the number of training nodes in the distributed system.

[0076] It should be noted that the first preset threshold and the second preset threshold can be pre-set based on specific scenarios and needs. The first preset threshold and the second preset threshold can be the same or different. For example, the first preset threshold can be 80%, 90%, etc., and the second preset threshold can be 70%, 80%, etc. This manual does not make specific restrictions.

[0077] After obtaining the reward value, the proxy node can adjust the parameters of the data distribution model according to the state information, the distribution strategy and the reward value. In this specification, the proxy node can use a reinforcement learning algorithm to adjust the parameters of the data distribution model based on the state information, the distribution strategy and the reward value to optimize the distribution strategy. Adjusting model parameters based on the reinforcement learning algorithm is a relatively mature technology at present, and this specification will not be repeated.

[0078] Based on the above, it can be seen that in the process of training the image classification model, the training data is distributed through the data distribution model in the proxy node, and the proxy node can adjust the parameters of the data distribution model based on the local cache hit rate of each training node, optimize the obtained data distribution strategy, and improve the local cache hit rate of the training data in each training node, thereby improving the training efficiency of the image classification model.

[0079] Corresponding to the above-mentioned system for training an image classification model, this specification provides a method for training an image classification model, which is applied to a training node in a distributed system, and the distributed system also includes a management node and an agent node.

[0080] like Figure 3 As shown, Figure 3 A flowchart of a method for training an image classification model provided in this specification may include the following steps:

[0081] S300: receiving the training data sent by the proxy node, taking the received training data as initial training data, and storing the initial training data; wherein, the initial training data is distributed by the proxy node to the training node according to a distribution strategy, and the distribution strategy is obtained by the proxy node through a data distribution model based on the basic information of the training data to be distributed and the status information composed of the remaining space of the local cache of each training node, and the basic information includes: the data volume of the training data to be distributed and the historical usage of the training data to be distributed.

[0082] S302: When receiving a training task for training an image classification model sent by the management node, executing the training task, and determining target training data used to execute the training task according to the training task.

[0083] S304: Determine a local cache hit rate according to the target training data and the initial training data, and send the local cache hit rate to the proxy node, so that the proxy node adjusts the parameters of the data distribution model based on the received local cache hit rates of each training node.

[0084] Corresponding to the above-mentioned system for training an image classification model, this specification provides a method for training an image classification model, which is applied to an agent node in a distributed system. The distributed system also includes: a management node and multiple training nodes.

[0085] like Figure 4 As shown, Figure 4 A flowchart of a method for training an image classification model provided in this specification may include the following steps:

[0086] S400: Obtain the training data to be distributed and obtain the remaining space of the local cache of each training node.

[0087] S402: Determine basic information of the training data to be distributed, and use the basic information and the remaining space of the local cache of each training node as status information; wherein the basic information includes: the data volume of the training data to be distributed and the historical usage of the training data to be distributed.

[0088] S404: Input the state information into a data distribution model to obtain a distribution strategy output by the data distribution model.

[0089] S406: According to the distribution strategy, the training data to be distributed is sent to each training node, so that each training node executes the training task when receiving the training task of the training image classification model sent by the management node, and determines the local cache hit rate based on the target training data used to execute the training task and the training data to be distributed, and sends the local cache hit rate to the proxy node.

[0090] S408: Receive the local cache hit rate sent by each training node.

[0091] S410: Determine a reward value according to the received local cache hit rate of each training node.

[0092] S412: Adjust the parameters of the data distribution model according to the state information, the distribution strategy and the reward value.

[0093] based on Figure 3 as well as Figure 4The method for training the image classification model provided in the specification is shown. When the distributed training method with storage and computing separation is used to train the image classification model, the proxy node can determine the distribution strategy of the training data through the data distribution model to distribute the training data to each training node according to the distribution strategy. Each training node can cache the training data distributed by the proxy node locally, so that when each training node receives the training task, it can first obtain the training data required to perform the training task from the local cache of each training node. When the training data in the local cache cannot match the training data required to perform the training task, each training node obtains other training data required to perform the training task and not cached locally, thereby completing the training task. When each training node performs the training task, the local cache hit rate of the training data can also be determined and the local cache hit rate is returned to the proxy node. The proxy node can adjust the parameters of the data distribution model based on the received local cache hit rate of each training node, so that the data distribution model optimizes the distribution strategy, thereby improving the local cache hit rate of the training data of each training node, so as to improve the training efficiency of the image classification model.

[0094] Based on the method for training an image classification model described above, the embodiment of this specification also provides a schematic diagram of a device for training an image classification model. Figure 5 shown.

[0095] Figure 5 A schematic diagram of a device for training an image classification model provided in an embodiment of this specification, wherein the device is located at a training node in a distributed system, wherein the distributed system further includes: a management node and an agent node; the device specifically includes:

[0096] The receiving module 500 is used to receive the training data sent by the proxy node, use the received training data as initial training data, and store the initial training data; wherein the initial training data is distributed by the proxy node to the training node according to the distribution strategy, and the distribution strategy is obtained by the proxy node through a data distribution model based on the basic information of the training data to be distributed and the status information composed of the remaining space of the local cache of each training node, and the basic information includes: the data volume of the training data to be distributed and the historical usage of the training data to be distributed;

[0097] The training module 502 is used to execute the training task for training the image classification model when receiving the training task sent by the management node, and determine the target training data used to execute the training task according to the training task;

[0098] The sending module 504 is used to determine the local cache hit rate according to the target training data and the initial training data, and send the local cache hit rate to the proxy node, so that the proxy node adjusts the parameters of the data distribution model based on the received local cache hit rate of each training node.

[0099] Based on the method for training an image classification model described above, the embodiment of this specification also provides a schematic diagram of a device for training an image classification model. Figure 6 shown.

[0100] Figure 6 A schematic diagram of a device for training an image classification model provided in an embodiment of this specification, wherein the device is located at an agent node in a distributed system, wherein the distributed system further includes: a management node and multiple training nodes; the device specifically includes:

[0101] An acquisition module 600 is used to acquire the training data to be distributed and to acquire the remaining space of the local cache of each training node;

[0102] The first determination module 602 is used to determine the basic information of the training data to be distributed, and use the basic information and the remaining space of the local cache of each training node as the status information; wherein the basic information includes: the amount of the training data to be distributed and the historical usage of the training data to be distributed;

[0103] An input module 604 is used to input the state information into a data distribution model to obtain a distribution strategy output by the data distribution model;

[0104] A distribution module 606 is used to send the training data to be distributed to each training node according to the distribution strategy, so that each training node performs the training task when receiving the training task of the training image classification model sent by the management node, and determines the local cache hit rate according to the target training data used to perform the training task and the training data to be distributed, and sends the local cache hit rate to the proxy node;

[0105] A receiving module 608 is used to receive a local cache hit rate sent by each training node;

[0106] A second determination module 610 is used to determine a reward value according to the received local cache hit rate of each training node;

[0107] The adjustment module 612 is used to adjust the parameters of the data distribution model according to the state information, the distribution strategy and the reward value.

[0108] The embodiments of this specification also provide a computer-readable storage medium, which stores a computer program. The computer program can be used to execute the method for training an image classification model described above.

[0109] Based on the method of training the image classification model described above, this specification embodiment also proposes Figure 7 The schematic structure diagram of the electronic device shown in FIG. Figure 7 At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the method for training the image classification model described above.

[0110] Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the executor of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0111] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with hardware entity modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0112] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.

[0113] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0114] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0115] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0116] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0117] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0118] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0119] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0120] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0121] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0122] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0123] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0124] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0125] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0126] The above description is only an embodiment of this specification and is not intended to limit this specification. For those skilled in the art, this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification should be included in the scope of the claims of this application.

Claims

1. A system for training an image classification model, characterized in that: The system includes a management node, an agent node and a plurality of training nodes; The proxy node obtains the training data to be distributed and the remaining local cache space of each training node; Determine the basic information of the training data to be distributed, and use the basic information of the training data to be distributed and the remaining space of the local cache of each training node as status information; wherein the basic information includes: the amount of the training data to be distributed and the historical usage of the training data to be distributed; input the status information into a data distribution model to obtain a distribution strategy output by the data distribution model; according to the distribution strategy, send the training data to be distributed to each training node; The multiple training nodes receive the to-be-distributed training data sent by the proxy node, use the received to-be-distributed training data as initial training data, and cache the initial training data; The management node sends a training task of training the image classification model to each training node; The multiple training nodes receive the training tasks sent by the management node and execute the training tasks; determine the target training data required to execute the training tasks according to the training tasks; determine the local cache hit rate according to the target training data and the initial training data, and send the local cache hit rate to the proxy node; The proxy node receives the local cache hit rate sent by each training node; determines the reward value according to the received local cache hit rate of each training node; and adjusts the parameters of the data distribution model according to the state information, the distribution strategy and the reward value.

2. The system according to claim 1, characterized in that The system further comprises: a storage node; The storage node is used to determine the training data to be distributed, and send the training data to be distributed to the proxy node; The proxy node is used to receive the training data to be distributed sent by the storage node.

3. The system according to claim 1, characterized in that The multiple training nodes are specifically configured to, when the local cache hit rate is greater than a first preset threshold, obtain target training data from the initial training data, and execute the training task based on the obtained target training data; When the local cache hit rate is not greater than a first preset threshold, determining uncached target training data according to the initial training data and the target training data, and obtaining the uncached target training data, and obtaining the full amount of target training data based on the initial training data and the obtained uncached target training data; And based on the obtained full amount of target training data, the training task is performed.

4. The system according to claim 1, characterized in that The proxy node is specifically used to determine the number of local cache hit rates that are greater than a second preset threshold; and determine a reward value based on the number; wherein the reward value is positively correlated with the number.

5. A method for training an image classification model, characterized in that: The method is applied to a training node in a distributed system, wherein the distributed system further comprises: a management node and an agent node; the method comprises: receiving the training data sent by the proxy node, using the received training data as initial training data, and storing the initial training data; wherein the initial training data is distributed by the proxy node to the training node according to a distribution strategy, and the distribution strategy is obtained by the proxy node through a data distribution model based on basic information of the training data to be distributed and status information composed of the remaining space of the local cache of each training node, wherein the basic information includes: the amount of the training data to be distributed and the historical usage of the training data to be distributed; When receiving a training task for training the image classification model sent by the management node, executing the training task, and determining target training data used to execute the training task according to the training task; A local cache hit rate is determined according to the target training data and the initial training data, and the local cache hit rate is sent to the proxy node, so that the proxy node adjusts the parameters of the data distribution model based on the received local cache hit rates of each training node.

6. A method for training an image classification model, characterized in that: The method is applied to a proxy node in a distributed system, wherein the distributed system further comprises: a management node and a plurality of training nodes; the method comprises: Obtain the training data to be distributed and the remaining local cache space of each training node; Determine the basic information of the training data to be distributed, and use the basic information and the remaining space of the local cache of each training node as status information; wherein the basic information includes: the amount of the training data to be distributed and the historical usage of the training data to be distributed; Inputting the state information into a data distribution model to obtain a distribution strategy output by the data distribution model; According to the distribution strategy, the training data to be distributed is sent to each training node, so that each training node performs the training task when receiving the training task of the training image classification model sent by the management node, and determines the local cache hit rate according to the target training data used to perform the training task and the training data to be distributed, and sends the local cache hit rate to the proxy node; Receive the local cache hit rate sent by each training node; Determine the reward value according to the received local cache hit rate of each training node; The parameters of the data distribution model are adjusted according to the state information, the distribution strategy and the reward value.

7. A device for training an image classification model, characterized in that: The device is located at a training node in a distributed system, and the distributed system further includes: a management node and an agent node; the device specifically includes: a receiving module, configured to receive the training data sent by the proxy node, use the received training data as initial training data, and store the initial training data; wherein the initial training data is distributed by the proxy node to the training node according to a distribution strategy, and the distribution strategy is obtained by the proxy node through a data distribution model based on basic information of the training data to be distributed and status information composed of the remaining space of the local cache of each training node, wherein the basic information includes: the amount of the training data to be distributed and the historical usage of the training data to be distributed; A training module, configured to, when receiving a training task for training an image classification model sent by the management node, execute the training task, and determine target training data used to execute the training task according to the training task; A sending module is used to determine a local cache hit rate according to the target training data and the initial training data, and send the local cache hit rate to the proxy node, so that the proxy node adjusts the parameters of the data distribution model based on the received cache hit rates of each training node.

8. A device for training an image classification model, characterized in that: The device is located at an agent node in a distributed system, and the distributed system further includes: a management node and a plurality of training nodes; the device specifically includes: An acquisition module is used to acquire the training data to be distributed and the remaining space of the local cache of each training node; A first determination module is used to determine basic information of the training data to be distributed, and use the basic information and the remaining space of the local cache of each training node as status information; wherein the basic information includes: the amount of the training data to be distributed and the historical usage of the training data to be distributed; An input module, used for inputting the state information into a data distribution model to obtain a distribution strategy output by the data distribution model; A distribution module, configured to send the training data to be distributed to each training node according to the distribution strategy, so that each training node performs the training task when receiving the training task of the training image classification model sent by the management node, and determines the local cache hit rate according to the target training data used to perform the training task and the training data to be distributed, and sends the local cache hit rate to the proxy node; A receiving module, used for receiving the local cache hit rate sent by each training node; A second determination module is used to determine a reward value according to the received local cache hit rate of each training node; An adjustment module is used to adjust the parameters of the data distribution model according to the state information, the distribution strategy and the reward value.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 5 to 6 is implemented.

10. An electronic device, characterized in that: The method comprises 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 described in any one of claims 5 to 6 is implemented.