Disclosure of Invention
Therefore, in order to solve the problems that each module is tightly coupled in the training and using process of the existing deep learning model, the flexibility is insufficient, and a required model cannot be obtained quickly and effectively, the embodiment of the invention provides a deep learning technology tool chain system, optimizes a management mode of a sample library and the model, and improves management efficiency.
In order to achieve the above purpose, the present invention provides the following technical solutions:
the embodiment of the invention provides a deep learning technology tool chain system, which comprises a deep learning technology tool chain system architecture, interface definition and component realization of the deep learning technology tool chain and a flexible query module, wherein: the deep learning technical tool chain system architecture comprises a set of architecture taking a model warehouse as a core, the whole system is divided into a plurality of mutually independent and interdependent functional modules through the process division of deep learning training, each functional module of the deep learning tool chain is realized on the basis of an interface by defining the interface of each functional module of the deep learning technical tool chain, various query conditions are customized through a flexible query module, and data required by the next process functional module is generated at each process functional module.
Preferably, the interface definition and component implementation of the deep learning technology tool chain includes:
the model warehouse supports a version control function and a model format conversion function of the model, and stores the model and metadata of the model;
the data processing tool is used for generating a sample set after data extraction and sample definition are carried out on the obtained original data;
the model training tool is used for training the model after the sample set;
the calculation optimization tool is used for retrieving a model from a model warehouse to optimize;
the model evaluation tool is used for evaluating the model in the model warehouse;
and the application deployment tool queries the model in the model warehouse according to the application requirements and receives the model corresponding to the feedback of the model warehouse.
Preferably, the deep learning technology tool chain system architecture describes abstract components, structures and connection rules of the deep learning technology tool chain, and describes communication among the components, which uses a model warehouse as a core, and is used with a data processing tool, a model training tool, an application deployment tool, a calculation optimization tool and a model evaluation tool, wherein other tools except the data processing tool interact with the model warehouse only, and the data processing tool is used for generating samples and providing the samples to the model training tool; the model training tool puts the model after training and the metadata of the model into a model warehouse, and the calculation optimization tool optimizes the model fetched from the model warehouse; after the model evaluation tool model warehouse evaluates, the evaluation result is stored in the model warehouse; the application deployment tool retrieves the model in a model warehouse, the model warehouse returns the model to the application deployment tool, and if the model meeting the application requirement is not available, the model is fed back to the application deployment tool for the reason that the corresponding model is not found, and the query condition needs to be changed.
Preferably, the flexible query module: the method comprises an abstract mechanism and an imaging strategy, wherein the abstract mechanism is the basis of flexible query, the imaging strategy is defined for abstract definition of a database table structure, a user selects a column in the database and compares the column with a constant or other columns to serve as a query condition, the query condition is combined through AND, OR, NOT, a complex query condition meeting the requirement of the user is generated, and finally data is generated.
Preferably, the data processing tool comprises: the system comprises an original data module and a sample warehouse module, wherein the original data module is used for acquiring original data, and the original data is not marked;
the sample warehouse module comprises a data extraction sub-module, a sample definition sub-module and a sample generation sub-module, wherein the data extraction sub-module comprises an extraction task management unit, an extraction tool set and a result list, the extraction task management unit establishes a data extraction task, invokes a subset of all original data by calling the flexible query module, performs data annotation by the extraction tool set, and stores a data annotation result into the result list; and the sample definition sub-module is used for defining the sample by calling the flexible query module according to the data marking result, and automatically generating a required sample set through the sample generation sub-module after the definition is finished.
Preferably, the extracting tool set comprises an automatic labeling tool, a labeling tool and a third-party tool interface, wherein the automatic labeling tool is used for labeling an existing model and then sending the model to manual verification, and the labeling tool is used for labeling original data; the third party tool interface is used for accessing a third party marking tool to mark the data.
Preferably, when the original data is a picture, the original picture is automatically scaled when the original picture enters the sample warehouse module, the original picture is scaled to the common sizes of several deep learning training frames and is placed in different catalogues, and when the sample is generated, only the picture size is selected, and the picture with the corresponding size is automatically used as a training set.
Preferably, the model training tool comprises: the system comprises an AutoML tool, a custom algorithm module and a model training module, wherein the AutoML tool stores various deep learning tools; the user-defined algorithm module obtains a user-defined algorithm input by a user through an interface; the model training module invokes an initial model from the AutoML tool and/or the custom algorithm module by invoking the flexible query module according to the requirements, invokes a sample set from the sample generation sub-module to perform model training, and stores the trained model in the model warehouse.
Preferably, the application deployment tool comprises: the system comprises a business application module, a deployment tool module, a cloud reasoning module and an edge computing module, wherein the deployment tool module is used for calling a corresponding model from a model warehouse according to requirements for the cloud reasoning module or the edge computing module to use and sending data generated by the cloud reasoning module or the edge computing module to the business application module for use.
Preferably, the model evaluation tool includes an index for model evaluation in a model repository: precision, applicable environment, time consumption.
The technical scheme of the invention has the following advantages:
the invention provides a deep learning technology tool chain system, which comprises: the deep learning technology tool chain system architecture comprises a set of architecture taking a model warehouse as a core, the whole system is divided into a plurality of mutually independent and interdependent functional modules through a process of deep learning training, the interface and the implementation are separated through the interface of each functional module of the defined deep learning technology tool chain, each module of the deep learning tool chain is realized on the basis of the interface, various query conditions are customized through the flexible query module, data required for the next process module to use is generated at each process functional module, and the implementation, the access, the replacement and the expansion of a third party interface are supported, so that the whole life cycle management of the deep learning process is completed, the whole process from original data to labeling data to sample data to the model to application is realized, the management mode of a sample library and the model is optimized, the management efficiency is improved, and the original artificial sample management, the model migration time and the cost can be remarkably reduced.
Detailed Description
The following description of the embodiments of the present invention will be made apparent and fully in view of the accompanying drawings, in which some, but not all embodiments of the invention are shown. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In addition, the technical features of the different embodiments of the present invention described below may be combined with each other as long as they do not collide with each other.
Example 1
The embodiment of the invention provides a deep learning technology tool chain system which can be applied to scenes of selection, training and application of various depth models, and comprises the following steps: the system architecture of the deep learning technology tool chain comprises a set of architecture taking a model warehouse as a core, the whole system is divided into a plurality of independent and interdependent functional modules through flow division of the deep learning training, each functional module of the deep learning tool chain is realized on the basis of the interface by defining the interface of each functional module of the deep learning technology tool chain, various query conditions are customized through the flexible query module, and data required by the next flow functional module is generated at each flow functional module.
The embodiment of the invention uses the architecture design taking the model warehouse as a core, defines the interface specification of each module function, forms a set of deep learning tool chain by realizing the function interface combination of each module, ensures that each module in the tool chain is mutually independent, is easy to realize and expand, can process different data processing flows in parallel, optimizes the management mode of a sample library and a model, improves the management efficiency, flexibly supports the realization, access, replacement and expansion of a third party, combines flexible query functions, and can selectively and automatically generate the input and the output of each flow of the tool chain.
The interface definition and component implementation of the deep learning technology tool chain in the implementation of the invention comprises the following steps:
the model warehouse supports a version control function and a model format conversion function of the model, and stores the model and metadata of the model; the data processing tool is used for generating a sample set after data extraction and sample definition are carried out on the obtained original data; the model training tool is used for training the model after the sample set; the calculation optimization tool is used for retrieving a model from a model warehouse to optimize; the model evaluation tool is used for evaluating the model in the model warehouse; and the application deployment tool queries the model in the model warehouse according to the application requirements and receives the model corresponding to the feedback of the model warehouse.
The deep learning technology tool chain system architecture in the implementation of the invention describes abstract components, structures and connection rules of the deep learning technology tool chain and describes communication among the components, and as shown in fig. 1, the deep learning technology tool chain system architecture takes a model warehouse as a core, and is used in cooperation with a data processing tool, a model training tool, an application deployment tool, a calculation optimization tool and a model evaluation tool, and other tools only interact with the model warehouse except the data processing tool. The data processing tool is used for generating samples and providing the samples for the model training tool, the model training tool puts the model after training and metadata of the model into a model warehouse, and the calculation optimization tool optimizes the model fetched from the model warehouse; after the model evaluation tool model warehouse evaluates, the evaluation result is stored in the model warehouse (the indexes of model evaluation comprise precision, applicable environment, time consumption and the like, which are only used as examples and not limiting), so as to help the calculation optimization tool optimize the model in the model warehouse; the application deployment tool queries the models in the model warehouse according to the application requirements, and the model warehouse selects the corresponding models (such as the models with the corresponding formats, the applicable environments, the precision and the performance versions are selected as examples, but not limited to the examples) according to the application requirements and returns the models to the application deployment tool; if there is no model meeting the application requirements, feedback is given to the application deployment tool as to why the corresponding model was not found (e.g., the model cannot be matched to meet the time-consuming requirements according to the required environment and accuracy), and the query conditions need to be changed (e.g., a suggested change reduces the time-consuming requirement setting).
In the implementation of the invention, a framework taking the model warehouse as the center is provided, and other associated flow tools interact to form a deep learning tool chain, so that the interaction efficiency of data is improved.
Further, as shown in fig. 2, the data processing tool includes: the system comprises an original data module and a sample warehouse module, wherein the original data module is used for acquiring original data, and the original data is not marked; the sample warehouse module comprises a data extraction sub-module, a sample definition sub-module and a sample generation sub-module, wherein the data extraction sub-module comprises an extraction task management unit, an extraction tool set and a result list, the extraction task management unit establishes a data extraction task, invokes a subset of all original data by calling the flexible query module, performs data annotation by the extraction tool set, stores a data annotation result into the result list, and the annotated result can be checked in a result list menu; and the sample definition sub-module is used for defining the sample by calling the flexible query module according to the data marking result, and automatically generating a required sample set through the sample generation sub-module after the definition is finished.
The extraction tool set comprises an automatic labeling tool, a labeling tool and a third party tool interface, wherein the automatic labeling tool is used for labeling an existing model and then sending the model to manual verification, and the labeling tool is used for labeling original data (such as an original picture and original business data); the third party tool interface is used for accessing a third party marking tool to mark the data. The multiple labeling tools can meet multiple labeling requirements, so that a more comprehensive and various sample set is obtained, and multiple training requirements are met.
The marked data set in the embodiment of the invention contains the full data of the data set, but the training is not required to meet the requirement of training, the training may have other requirements on the frame size, the defect type and the like, a plurality of marked sets of data may be required, different training frames may have different requirements on the format of the sample set, the training data and the verification data are required to be divided according to the proportion, and the conventional method is to manually sort out the picture files and the marked data meeting the conditions, but the method is low in efficiency and may have manual errors.
When the original data is a picture, the original picture is automatically resized (zoomed) when the original picture enters the sample warehouse module, the original picture resize is the common size of a plurality of deep learning training frames and is placed in different catalogues, and when a sample is generated, only the picture size is selected, and the picture with the corresponding size can be automatically used as a training set, so that the storage space cost is saved, and the time cost for generating the sample is saved.
Further, as shown in fig. 2, the model training tool includes: the system comprises an AutoML tool, a custom algorithm module and a model training module, wherein the AutoML tool stores various deep learning tools; the user-defined algorithm module obtains a user-defined algorithm input by a user through an interface; the model training module invokes an initial model from the AutoML tool and/or the custom algorithm module and invokes a sample set from the sample generation sub-module to perform model training by invoking the flexible query module according to requirements, and stores the trained model in the model warehouse.
Further, as shown in fig. 2, the application deployment tool includes: the system comprises a business application module, a deployment tool module, a cloud reasoning module and an edge computing module, wherein the deployment tool module is used for calling a corresponding model from a model warehouse according to requirements for the cloud reasoning module or the edge computing module to use, and sending data generated by the cloud reasoning module or the edge computing module to the business application module for use. The trained model may be suitable for edge calculation or cloud reasoning, the deep learning tool chain may automatically store the information, for example, if some cloud reasoning is deployed to edge calculation, the deep learning tool chain may automatically reject the request, and the model warehouse may convert the cloud model into the edge calculation model through model compression, quantization and other technologies.
The flexible query module in the embodiment of the invention: the method comprises an abstract mechanism and an imaging strategy, wherein the abstract mechanism is the basis of flexible query, the abstract definition of a database table structure is used for imaging strategies, a user selects columns in the database, the columns are compared with constants or other columns to serve as query conditions, the query conditions are combined through AND, OR, NOT, complex query conditions meeting the requirements of the user are generated, and finally data are generated, for example, a data set in a Pascal VOC or YOLO format is generated.
As shown in fig. 3, the query conditions of the flexible query may be classified into complex conditions and simple conditions, simple conditions and simple logic expressions, and simple conditions or complex conditions and non-complex conditions, and selection conditions of final samples or data may be generated by constructing simple conditions and complex conditions, for example, a deep learning tool chain generates data to be annotated from original data according to the conditions of the flexible query, or selects all or part of annotation data from one or more pieces of annotation data to generate sample data, where the sample data includes both pictures and annotation information.
In a specific embodiment, it is assumed that there are already multiple label sets, for example, 8 types of defects including missing pin-gt, bowl pin fault-gt, missing nut-gt, small handshake damage-gt, pin pull-out-gt, nut loosening or under-fastening-gt, missing bolt-gt and pin installation defect-gt in the aisgcs0, other information also includes industry, service, scene, net province, local market, location, shooting equipment, database address, path and shooting time of the data set, a list of a certain list can be directly selected when a query condition is constructed, and the list is displayed in a form of 'list name-list name', and when one of list names is selected, the list name is selected. In order to improve training effect, the query condition is that the frame size is larger than 10px x 10px, only the pictures AND labels of the category with the missing pin-gt defect are selected, the picture size is 640 x 640 (YOLO v5 default size), namely, firstly, 3 simple query conditions are created, AND then, the conditions are connected by an AND operator, as follows:
condition 1 = defect class IN ("missing pin-gt')
Condition 2 = box size >10px x 10px
Condition 3 = picture size = 640 x 640
Return AND (Condition 1, condition 2, condition 3)
Finally, the sample set format (such as YOLO and Pascal VOC) and the ratio of the training data and the verification data are input, and the deep learning tool chain automatically generates the training data set and the verification data set, which can be directly used for training and verification.
According to the deep learning technology tool chain system provided by the embodiment of the invention, each process of deep learning is decoupled based on flow division of the deep learning training, the correlations are cleared, a set of architecture design taking a model warehouse as a core is formed, the deep learning tool chain is realized based on the architecture design, the flexible query function is combined, the output meeting the conditions can be regulated in each flow of the tool chain, the realization, the access, the replacement and the expansion of a third party interface are supported, a set of deep learning tool chain is formed, the whole process from original data to labeling data to sample data to the model to the application is realized, the management mode of a sample library and the model is optimized, the management efficiency is improved, and the original artificial sample management, the model migration time and the cost can be remarkably reduced.
It is apparent that the above examples are given by way of illustration only and are not limiting of the embodiments. Other variations or modifications of the above teachings will be apparent to those of ordinary skill in the art. It is not necessary here nor is it exhaustive of all embodiments. And obvious variations or modifications thereof are contemplated as falling within the scope of the present invention.