Object detection model training method and device based on ETL tool
By integrating relational databases into ETL tools, target detection model training and evaluation can be achieved, solving the problems of slow recognition speed and low accuracy in traditional methods, meeting the real-time and accuracy requirements of the industrial field, and providing a comprehensive model training solution that meets user preferences.
Patent Information
- Application Number
- CN202211516257.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-30
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-11-30
AI Technical Summary
Existing technologies lack target detection model training solutions based on ETL tools. Traditional visual algorithms have slow recognition speeds and low accuracy, making it difficult to meet the real-time and accuracy requirements of the industrial field.
By connecting to a relational database in the backend program of the ETL tool, storing the training set and validation set tables, obtaining model training information, selecting the target detection algorithm and setting hyperparameters, and using training images and annotation information for model training, it supports the training and evaluation of the target detection model.
It implements target detection model training based on ETL tools, supports the access of image data, improves the comprehensiveness of model evaluation and conforms to user preferences, and meets the real-time and accuracy requirements of the industrial field.
Smart Images

Figure CN115878701B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of deep learning target detection model training, and in particular to a target detection model training method and device based on ETL tools. Background Art
[0002] When addressing image processing tasks such as industrial part recognition and defect detection, traditional visual algorithms suffer from slow recognition speeds and low accuracy. Currently, the industry often relies on deep learning object detection technology based on convolutional neural networks. Object detection, also known as object extraction, combines the tasks of locating and identifying objects in an image, requiring both real-time performance and accuracy.
[0003] ETL tools, or Extract-Transform-Load (ETL), are responsible for extracting unevenly distributed, multi-source, and heterogeneous data. They then cleanse, transform, and integrate the data according to specific rules, ultimately loading it into a data warehouse. This provides a foundation for subsequent data analysis and intelligent decision-making. However, there is currently no solution for training object detection models based on ETL tools. Summary of the Invention
[0004] In response to at least one of the above technical problems, an embodiment of the present invention provides a method and device for training an object detection model based on an ETL tool.
[0005] According to a first aspect, an embodiment of the present invention provides an object detection model training method based on an ETL tool. The backend program of the ETL tool is installed in an application server. The application server stores an image folder and an annotation folder. The annotation folder stores annotation information of each image in the image folder. The backend program of the ETL tool is connected to a relational database. The relational database stores a training set table and a validation set table. The training set table and the validation set table both store multiple field information of the image. The multiple field information includes path field information. The path field information is path information for storing the image and annotation information.
[0006] The method is executed by the application server, and includes:
[0007] Upon receiving a JSON request from the backend program of the ETL tool, obtaining model training information input by the user in the front-end program of the ETL tool from the JSON request; wherein the model training information includes the type of target detection algorithm, hyperparameters of the target detection algorithm, and image setting information;
[0008] According to the type of the target detection algorithm, select a target detection algorithm of a corresponding type, and set hyperparameters of the target detection algorithm according to the hyperparameters;
[0009] Obtain path information from a training set table of a relational database accessed by a backend program of the ETL tool according to the image setting information, and obtain training images from the image folder and obtain annotation information corresponding to the training images from the annotation folder according to the path information;
[0010] The target detection algorithm with set hyperparameters is trained according to the obtained training images and the labeled information to obtain a target detection model.
[0011] According to a second aspect, an embodiment of the present invention provides an object detection model training device based on an ETL tool, wherein a backend program of the ETL tool is installed in an application server, wherein an image folder and an annotation folder are stored in the application server, wherein the annotation folder stores annotation information of each image in the image folder; the backend program of the ETL tool is connected to a relational database, wherein a training set table and a validation set table are stored in the relational database, wherein the training set table and the validation set table both store multiple field information of the image, wherein the multiple field information includes path field information, wherein the path field information is path information for storing the image and the annotation information;
[0012] The training device is deployed on the application server, and the training device includes:
[0013] a first acquisition module, configured to, upon receiving a JSON request sent by the backend program of the ETL tool, acquire model training information input by a user in the front-end program of the ETL tool from the JSON request; wherein the model training information includes the type of the target detection algorithm, the hyperparameters of the target detection algorithm, and image setting information;
[0014] A first setting module selects a target detection algorithm of a corresponding type according to the type of the target detection algorithm, and sets hyperparameters of the target detection algorithm according to the hyperparameters;
[0015] A second acquisition module is configured to acquire path information from a training set table of a relational database accessed by a backend program of the ETL tool according to the image setting information, and acquire training images from the image folder and annotation information corresponding to the training images from the annotation folder according to the path information;
[0016] The model training module is used to train the target detection algorithm with set hyperparameters based on the obtained training images and the labeled information to obtain a target detection model.
[0017] According to a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method provided in the first aspect.
[0018] According to a fourth aspect, an embodiment of the present invention provides a computing device, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method provided in the first aspect is implemented.
[0019] The object detection model training method and device based on ETL tools provided in the embodiments of the present invention have the following beneficial effects individually or in combination:
[0020] (1) The user enters the model training information in the front-end program of the ETL tool. The back-end program of the ETL tool generates a json request based on the model training information set by the user, and then sends the json request to the application server. In this way, the application server obtains the model training information from the json request, and then selects the corresponding target detection algorithm according to the type in the model training information, and then sets the target detection algorithm hyperparameters according to the hyperparameters in the model training information. Then, according to the image setting information in the model training information, the path information is obtained from the training set table of the relational database accessed by the back-end program of the ETL tool, and then the training image is obtained from the image folder and the annotation information corresponding to the training image is obtained from the annotation folder according to the path information; finally, the target detection algorithm with the set hyperparameters is trained based on the obtained training image and the annotation information to obtain the target detection model. It can be seen that the embodiment of the present invention provides a solution for implementing target detection model training based on the ETL tool. In the above process, model training is implemented based on the ETL tool, and the back-end program of the ETL tool is accessed to the relational database. The path information of the image is stored in the relational database, so that the ETL tool supports access to image data, so that the ETL tool can be used to train the target detection model for the image.
[0021] (2) In one embodiment, the target detection model is evaluated based on three parameters: recall, precision, and average accuracy, making the evaluation of the target detection model more comprehensive. Furthermore, the user can set weights to give more weight to the results of certain parameters according to their preferences or task requirements, so that the trained target detection model is more in line with the user's preferences or task requirements.
[0022] (3) In one embodiment, the user can preview the image and annotation information through the front-end program of the ETL tool. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A schematic diagram of the deployment of the system architecture in one embodiment of the present invention;
[0024] Figure 2 Schematic diagram of the process of training a target detection model based on an ETL tool in one embodiment of the present invention;
[0025] Figure 3 Schematic diagram of a PR curve in one embodiment of the present invention. DETAILED DESCRIPTION
[0026] In the first aspect, the embodiment of the present invention provides a method for training a target detection model based on an ETL tool, see Figure 1 The backend program of the ETL tool is installed in an application server, in which a picture folder and an annotation folder are stored, and the annotation folder stores the annotation information of each picture in the picture folder; the backend program of the ETL tool is connected to a relational database, in which a training set table and a validation set table are stored, and the training set table and the validation set table both store multiple field information of the picture, and the multiple field information includes path field information, and the path field information is the path information for storing the picture and annotation information.
[0027] exist Figure 1 In the example, the ETL software application refers to the backend program of the ETL tool, the database refers to the relational database, and the image dataset refers to the picture folder and the annotation folder.
[0028] In other words, the application server stores the backend program for the ETL tool, an image folder, and an annotation folder. The image folder contains a large number of images, including training and validation images, while the annotation folder stores annotation information for each image. The annotation folder can be in XML format.
[0029] The backend program of the ETL tool is connected to a relational database, which stores a training set table and a validation set table. The training set table includes multiple field information, such as primary key field information, host name field information, and path field information. The primary key field information is used to represent the serial number of the training image, the host name field information is used to represent the host name of the application server, and the path field information is used to represent the storage path of each training image and the corresponding annotation information. The validation set table also includes multiple field information, such as primary key field information, host name field information, and path field information. The primary key field information is used to represent the serial number of the verification image, the host name field information is used to represent the host name of the application server, and the path field information is used to represent the storage path of each verification image and the corresponding annotation information.
[0030] The relational database can be deployed on a host different from the application server, and the application server can access the relational database through IP+port.
[0031] Because the backend program for the ETL tool is deployed on the application server, it can be called an ETL application server. The application server has at least 16GB of memory, uses an X86 multi-core processor, has at least 600GB of storage, a CPU clocked at 3.2GHz or higher, and a GTX 2080Ti graphics card with 11GB of memory. The application server also includes a built-in Python algorithm service, which can be invoked by Java programs when they send requests. Because the ETL tool can be programmed using Python, the application server can also be called a Python algorithm application server.
[0032] The backend of the ETL tool supports access to multiple data sources, including relational, manual, and sensor data sources. Relational data sources support the management and inspection of entities, code tables, stored procedures, functions, and views. Manual data sources support Excel data access. Sensor data sources integrate with the MQTT protocol to access and persist device data.
[0033] In the embodiment of the present invention, a relational data source is selected, that is, the relational database mentioned above.
[0034] The method provided in the embodiment of the present invention is executed by the application server, see Figure 2 , specifically including the following steps S110 to S140:
[0035] S110. Upon receiving a JSON request from the backend program of the ETL tool, obtaining model training information input by the user in the front-end program of the ETL tool from the JSON request; wherein the model training information includes the type of the target detection algorithm, the hyperparameters of the target detection algorithm, and image setting information;
[0036] In other words, the user enters model training information into the front-end program of the ETL tool. The front-end program then sends this model training information to the back-end program of the ETL tool. The back-end program processes the received model training information to form a JSON request, and then sends the JSON request to the application server. When the application server receives the JSON request, it parses it and obtains the model training information.
[0037] Among them, JSON (JavaScript Object Notation) is a lightweight data exchange format.
[0038] ETL stands for Extract-Transform-Load, and it describes the process of extracting, transforming, and loading data from a source to a destination. While the term ETL is often used in data warehouses, its application is not limited to data warehouses.
[0039] The model training information includes the type of target detection algorithm, the hyperparameters of the target detection algorithm, and image setting information.
[0040] The types of target detection algorithms may include a single-stage target detection algorithm and a dual-stage target detection algorithm. A user may specify a type in the model component of the front-end program of the ETL tool.
[0041] Understandably, the task of an object detection model is to locate all objects of interest in an image and determine their category. This task is challenging because different objects can vary significantly in shape, color, and appearance, and objects can be obscured by other objects. Object detection algorithms involve two steps: classification and localization. First, the category of the object in the image is determined, and then its location is determined.
[0042] The single-stage object detection algorithm directly performs a one-step regression on the input image, completing both classification and localization simultaneously. The dual-stage object detection algorithm first generates candidate regions within the image and then classifies them. Single-stage object detection algorithms are more real-time, while dual-stage algorithms are slower but offer higher accuracy. Industry typically uses single-stage algorithms with higher real-time performance combined with optimization techniques to achieve both high accuracy and accuracy.
[0043] Among them, the representative of single-stage object detection algorithms is the Yolo series of algorithms, whose full name is You Only LookOnce. This name means that this algorithm only needs to process the input image once to obtain the location and category information of the target to be detected. YOLOv1 has a very fast detection speed and strong feature extraction capabilities, but YOLOv1's positioning accuracy is very low. To further improve detection efficiency, YOLOv2 and YOLOv3 were developed. YOLOv2 removes the original fully connected layer of YOLOv1 and borrows the operation of setting anchor boxes to guide the regression of bounding boxes. It also uses the Batch Normalization algorithm to improve the convergence rate of loss. In YOLOv3, a new backbone network named Darknet53 is proposed and combined with the feature pyramid structure to achieve feature fusion, so that it can extract features from feature maps of different sizes. In the algorithm, the sizes of the three feature maps are 13×13, 26×26, and 52×52, respectively. Among them, the small feature map will be spliced with the large feature map for further prediction. This step improves the detection accuracy of small targets.
[0044] Among them, the hyperparameters of the target detection algorithm, such as learning rate, optimizer parameters, etc.
[0045] The image setting information may include an image selection method and / or the number of images. The image selection methods include sequential selection and random selection. Sequential selection selects images according to their sequence numbers, while random selection selects images randomly. The number of images refers to the number of training images used during model training.
[0046] S120. Selecting a target detection algorithm of a corresponding type according to the type of the target detection algorithm, and setting hyperparameters of the target detection algorithm according to the hyperparameters;
[0047] Specifically, based on the type of object detection algorithm selected by the user, the application server selects that type of object detection algorithm and uses it to build the framework of the object detection model. The application server then sets the hyperparameters of the framework based on the hyperparameters set by the user. After setting the hyperparameters, training images and annotation information can be selected and input into the framework in S130 to train the framework's parameters.
[0048] S130: Obtain path information from a training set table of a relational database accessed by a backend program of the ETL tool according to the image setting information, and obtain training images from the image folder and obtain annotation information corresponding to the training images from the annotation folder according to the path information;
[0049] That is, based on the image setting information set by the user, the path information of the training image and the path information of the annotation information of the training image are obtained from the training set table of the relational database through the back-end program of the ETL tool, and then the training image is obtained from the image folder according to the path information of the training image, and the annotation information is obtained from the annotation folder according to the path information of the annotation information.
[0050] S140 . Training the target detection algorithm with set hyperparameters according to the acquired training images and the labeled information to obtain a target detection model.
[0051] That is, the target detection algorithm with set hyperparameters is trained through training images and annotation information to obtain the specific values of each parameter to be determined in the target detection algorithm, thereby obtaining a target detection model.
[0052] In one embodiment, S140 specifically includes:
[0053] S141. After each training session is completed, path information is obtained from a verification set table in a relational database accessed by a backend program of the ETL tool, and verification images are obtained from the image folder and annotation information corresponding to the verification images is obtained from the annotation folder according to the path information.
[0054] S142. Verify the object detection model obtained through this training based on the obtained verification image and the labeled information, and obtain multiple recall rates and multiple precisions of the object detection model obtained through this training;
[0055] S143. Evaluate the object detection model obtained from this training based on the multiple recall rates and the multiple precisions, and return the evaluation results to the front-end program of the ETL tool for personnel to determine whether to terminate or continue training.
[0056] As can be seen, after training is complete, the object detection model generated from the training images and their corresponding annotations needs to be verified using validation images and their corresponding annotations. Specifically, the validation images are input into the object detection model, which then outputs detection results. These results are then compared with the annotations to determine the recall and precision of the object detection model. The object detection model is then evaluated based on these recall and precision, generating evaluation results that are then fed back to the front-end of the ETL tool, allowing personnel to monitor the model's training progress. If the training results meet their needs, training is terminated. If not, training continues, further adjusting the parameters.
[0057] After model training, you'll get multiple recall rates and multiple precisions. This is because during training, a set of confidence thresholds is set for each parameter of the object detection model to be determined. At each confidence threshold, a recall rate and precision are obtained. The object detection model can be evaluated by taking the average of these multiple recall rates and the average of these multiple precisions.
[0058] Precision refers to the ratio of positive samples to all positive samples, reflecting the object detection algorithm's ability to detect the positive class. Specifically, it measures how many of the samples the algorithm identifies as true ground truth frames are actually ground truth frames. Recall refers to the proportion of all true ground truth frames that are detected, reflecting the algorithm's ability to detect ground truth frames.
[0059] Among them, the higher the precision, the better the performance of the target detection model. The higher the recall rate, the better the performance of the target detection model.
[0060] Furthermore, in S143, the object detection model obtained by this training is evaluated according to the multiple recall rates and the multiple precisions, which may specifically include:
[0061] A1. Forming an average accuracy curve based on the multiple recall rates and the multiple precisions; wherein the horizontal axis coordinate of the average accuracy curve is the recall rate and the vertical axis coordinate is the precision, and the area formed by the average accuracy curve and the first quadrant of the coordinate system is the average accuracy;
[0062] A2. Evaluate the object detection model obtained from this training based on the multiple recall rates, multiple precisions, and the average accuracy.
[0063] It is understandable that the ideal situation is that the target detection model has both high precision and recall rate, but the reality is that it is difficult to have both. People can only make a trade-off based on the characteristics of their actual detection tasks and choose a preference. Considering both precision and recall rate, that is, average accuracy (AP), the average accuracy is obtained by the area enclosed by the PR curve (Precision-Recall curve) and the first quadrant of the coordinate system, as shown in the figure. Figure 3 As shown in Figure 2, the curve reflects the changes in the precision and recall values under different confidence thresholds.
[0064] Among them, the higher the average accuracy, the better the performance of the object detection model.
[0065] Multiple recall rates and multiple precisions can be averaged, and the two averages and one average accuracy can be used to evaluate the object detection model. For example, weights can be set for each of the three values, and the weighted sum of these three values is used to obtain the final evaluation result. The higher the evaluation result, the better the performance of the object detection model.
[0066] In one embodiment, a real-time evaluation result table may also be stored in the relational database; correspondingly, the method provided by the embodiment of the present invention may further include: sending the evaluation results of the target detection model obtained from each training to the real-time evaluation result table in the relational database for storage.
[0067] That is to say, after each training, the evaluation results of the target detection model will be sent to the real-time evaluation result table in the relational database for storage. In this way, each model training process can be recorded, and the front-end program of the ETL tool can access the back-end program to obtain the evaluation results in the relational database and know the performance changes of the model after each training.
[0068] In one embodiment, the front-end program of the ETL tool can be used to: obtain the path information of the training pictures and the corresponding annotation information from the relational database through the back-end program of the ETL tool, obtain the training pictures and annotation information from the picture folder and the annotation information folder according to the path information through the back-end program of the ETL tool, and feed back the training pictures and the annotation information to the front-end program through the back-end program of the ETL tool so that personnel can preview the training pictures and the annotation information.
[0069] That is to say, personnel can call the matplotlib interface through the back-end program in the ETL front-end program to obtain the path information of the training images and annotation information in the relational database. Then the back-end program obtains the training images and annotation information from the image folder and annotation information folder according to the path information. The back-end program feeds the training images and annotation information back to the ETL front-end program, so that personnel can browse and view the training images and annotation information from the front-end page.
[0070] In one embodiment, the pictures in the picture folder are pictures in a public dataset.
[0071] Understandably, dataset selection is crucial when training object detection models. When constructing a dataset, careful attention should be paid to data cleaning and labeling. A high-quality dataset often improves model training quality and prediction accuracy. If data is scarce, consider seeking out publicly available datasets, particularly those that are widely recognized and used. For common tasks such as image recognition, object detection, and image segmentation, corresponding public datasets are available.
[0072] It's understandable that the backend of an ETL tool is equivalent to the controller role in MVC. M refers to the business model, V refers to the user interface, and C is the controller. Its main functions include: the entry point for method calls and the main business processing methods, receiving field parameters passed in the previous step, processing the field configuration of the current step, and merging the results before passing them to the next component. It also receives field parameters passed in the previous step, such as model training information sent by the front-end program, processes this information, for example, processing the model training information to form a JSON request, and transmits it to the application server.
[0073] In summary, the present invention provides a solution for training an object detection model based on an ETL tool. In the above process, model training is implemented using the ETL tool, and the backend of the ETL tool accesses a relational database that stores image path information. This allows the ETL tool to access image data and train an object detection model for images.
[0074] In a second aspect, an embodiment of the present invention provides an object detection model training device based on an ETL tool, wherein a backend program of the ETL tool is installed in an application server, wherein an image folder and an annotation folder are stored in the application server, wherein the annotation folder stores annotation information of each image in the image folder; the backend program of the ETL tool is connected to a relational database, wherein a training set table and a validation set table are stored in the relational database, wherein each of the training set table and the validation set table stores multiple field information of the image, wherein the multiple field information includes path field information, and the path field information is path information for storing the image and annotation information;
[0075] The training device is deployed on the application server, and the training device includes:
[0076] a first acquisition module, configured to, upon receiving a JSON request sent by the backend program of the ETL tool, acquire model training information input by a user in the front-end program of the ETL tool from the JSON request; wherein the model training information includes the type of the target detection algorithm, the hyperparameters of the target detection algorithm, and image setting information;
[0077] A first setting module selects a target detection algorithm of a corresponding type according to the type of the target detection algorithm, and sets hyperparameters of the target detection algorithm according to the hyperparameters;
[0078] A second acquisition module is configured to acquire path information from a training set table of a relational database accessed by a backend program of the ETL tool according to the image setting information, and acquire training images from the image folder and annotation information corresponding to the training images from the annotation folder according to the path information;
[0079] The model training module is used to train the target detection algorithm with set hyperparameters based on the obtained training images and the labeled information to obtain a target detection model.
[0080] In one embodiment, the picture setting information includes a picture selection method and / or the number of pictures; the picture selection method includes a sequential selection method and a random selection method.
[0081] In one embodiment, the model training module includes:
[0082] A first acquisition unit is configured to, after each training session, acquire path information from a verification set table in a relational database accessed by a backend program of the ETL tool, and acquire verification images from the image folder and annotation information corresponding to the verification images from the annotation folder based on the path information;
[0083] A first verification unit is used to verify the target detection model obtained by the current training based on the obtained verification image and the labeled information, and obtain multiple recall rates and multiple precisions of the target detection model obtained by the current training;
[0084] The first evaluation unit is used to evaluate the target detection model obtained from this training according to the multiple recall rates and the multiple precisions, and return the evaluation results to the front-end program of the ETL tool for personnel to determine whether to terminate the training or continue the training.
[0085] Furthermore, the first evaluation unit includes:
[0086] a curve forming subunit, configured to form an average accuracy curve based on the multiple recall rates and the multiple precisions; wherein the horizontal axis coordinate of the average accuracy curve is the recall rate and the vertical axis coordinate is the precision, and the area formed by the average accuracy curve and the first quadrant of the coordinate system is the average accuracy;
[0087] The model evaluation subunit is used to evaluate the target detection model obtained by this training based on the multiple recall rates, multiple precisions and the average accuracy.
[0088] In one embodiment, the types of the target detection algorithm include a single-stage target detection algorithm and a two-stage target detection algorithm.
[0089] In one embodiment, the front-end program of the ETL tool is also used to: obtain path information of training pictures and corresponding annotation information from the relational database through the back-end program of the ETL tool, and obtain training pictures and annotation information from the picture folder and the annotation information folder according to the path information, so that personnel can preview the training pictures and the annotation information.
[0090] In one embodiment, the relational database further stores a real-time evaluation result table; correspondingly, the device further includes:
[0091] The evaluation record module is used to send the evaluation results of the target detection model obtained from each training to the real-time evaluation result table in the relational database for storage.
[0092] In one embodiment, the plurality of field information further includes primary key field information and host name field information, the primary key field information is a picture sequence number, and the host name field information is a host name of the application server.
[0093] In one embodiment, the pictures in the picture folder are pictures in a public dataset.
[0094] It is understandable that the explanation, specific implementation methods, beneficial effects, examples, etc. of the relevant contents in the computer-readable medium provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.
[0095] In a third aspect, an embodiment of the present invention provides a computer-readable medium having computer instructions stored thereon. When the computer instructions are executed by a processor, the processor executes the method provided in the first aspect.
[0096] Specifically, a system or device equipped with a storage medium can be provided, on which software program codes that implement the functions of any of the above-mentioned embodiments are stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program codes stored in the storage medium.
[0097] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute part of the present invention.
[0098] Examples of storage media for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code can be downloaded from a server computer via a communication network.
[0099] In addition, it should be clear that the functions of any of the above embodiments can be achieved not only by executing the program code read by the computer, but also by enabling the operating system operating on the computer to complete part or all of the actual operations based on the instructions of the program code.
[0100] In addition, it can be understood that the program code read from the storage medium is written into a memory provided in an expansion board inserted into the computer or into a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above embodiments.
[0101] It is understandable that the explanation, specific implementation methods, beneficial effects, examples, etc. of the relevant contents in the computer-readable medium provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.
[0102] In a fourth aspect, an embodiment of this specification provides a computing device, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method in any one of the embodiments in the specification.
[0103] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments. In particular, the device embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.
[0104] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention may be implemented using hardware, software, widgets, or any combination thereof. When implemented using software, these functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0105] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A target detection model training method based on ETL tools, characterized in that: The backend program of the ETL tool is installed in an application server, which stores an image folder and an annotation folder, wherein the annotation folder stores annotation information of each image in the image folder; the backend program of the ETL tool is connected to a relational database, wherein the relational database stores a training set table and a validation set table, wherein the training set table and the validation set table both store multiple field information of the images, wherein the multiple field information includes path field information, wherein the path field information is path information for storing the images and the annotation information; The method is executed by the application server, and includes: Upon receiving a JSON request from the backend program of the ETL tool, obtaining model training information input by the user in the front-end program of the ETL tool from the JSON request; wherein the model training information includes the type of target detection algorithm, hyperparameters of the target detection algorithm, and image setting information; According to the type of the target detection algorithm, select a target detection algorithm of a corresponding type, and set hyperparameters of the target detection algorithm according to the hyperparameters; Obtain path information from a training set table of a relational database accessed by a backend program of the ETL tool according to the image setting information, and obtain training images from the image folder and obtain annotation information corresponding to the training images from the annotation folder according to the path information; The target detection algorithm with set hyperparameters is trained according to the obtained training images and the labeled information to obtain a target detection model.
2. The method according to claim 1, characterized in that The picture setting information includes a picture selection method and / or the number of pictures; the picture selection method includes a sequential selection method and a random selection method.
3. The method according to claim 1, characterized in that The target detection algorithm with set hyperparameters is trained based on the acquired training images and the labeled information to obtain a target detection model, including: After each training session, path information is obtained from the verification set table of the relational database accessed by the backend program of the ETL tool, and verification images are obtained from the image folder and annotation information corresponding to the verification images is obtained from the annotation folder according to the path information; Verifying the object detection model obtained by this training based on the obtained verification image and the labeled information, and obtaining multiple recall rates and multiple precisions of the object detection model obtained by this training; The target detection model obtained from this training is evaluated based on the multiple recall rates and multiple precisions, and the evaluation results are returned to the front-end program of the ETL tool for personnel to determine whether to terminate or continue training.
4. The method according to claim 3, characterized in that The evaluating of the target detection model obtained by the training according to the multiple recall rates and the multiple precisions includes: An average accuracy curve is formed based on the multiple recall rates and the multiple precisions; wherein the horizontal axis coordinate of the average accuracy curve is the recall rate and the vertical axis coordinate is the precision, and the area formed by the average accuracy curve and the first quadrant of the coordinate system is the average accuracy; The object detection model obtained from this training is evaluated based on the multiple recall rates, multiple precisions and the average accuracy.
5. The method according to claim 1, characterized in that The types of target detection algorithms include single-stage target detection algorithms and two-stage target detection algorithms.
6. The method according to claim 1, characterized in that The front-end program of the ETL tool is also used to: obtain path information of training pictures and corresponding annotation information from the relational database through the back-end program of the ETL tool, obtain training pictures and annotation information from picture folders and annotation information folders according to the path information through the back-end program of the ETL tool, and feed back the training pictures and the annotation information to the front-end program through the back-end program of the ETL tool so that personnel can preview the training pictures and the annotation information.
7. The method according to claim 1, characterized in that The relational database also stores a real-time evaluation result table; correspondingly, the method further includes: sending the evaluation results of the target detection model obtained from each training to the real-time evaluation result table in the relational database for storage.
8. The method according to claim 1, characterized in that The multiple field information also includes primary key field information and host name field information. The primary key field information is a picture sequence number, and the host name field information is a host name of the application server.
9. The method according to claim 1, characterized in that The images in the image folder are images in the public dataset.
10. An object detection model training device based on ETL tools, characterized in that: The backend program of the ETL tool is installed in an application server, which stores an image folder and an annotation folder, wherein the annotation folder stores annotation information of each image in the image folder; the backend program of the ETL tool is connected to a relational database, wherein the relational database stores a training set table and a validation set table, wherein the training set table and the validation set table both store multiple field information of the images, wherein the multiple field information includes path field information, wherein the path field information is path information for storing the images and the annotation information; The training device is deployed on the application server, and the training device includes: a first acquisition module, configured to, upon receiving a JSON request sent by the backend program of the ETL tool, acquire model training information input by a user in the front-end program of the ETL tool from the JSON request; wherein the model training information includes the type of the target detection algorithm, the hyperparameters of the target detection algorithm, and image setting information; A first setting module selects a target detection algorithm of a corresponding type according to the type of the target detection algorithm, and sets hyperparameters of the target detection algorithm according to the hyperparameters; A second acquisition module is configured to acquire path information from a training set table of a relational database accessed by a backend program of the ETL tool according to the image setting information, and acquire training images from the image folder and annotation information corresponding to the training images from the annotation folder according to the path information; The model training module is used to train the target detection algorithm with set hyperparameters based on the obtained training images and the labeled information to obtain a target detection model.
Citation Information
Patent Citations
Model generation method and device, computer equipment and storage medium
CN111428869A
Power transmission line detection method and device thereof, computer equipment and storage medium
CN114037907A