Model training method, device, equipment and storage medium based on adversarial learning
Through the adversarial learning model training method, the loss function is used to train the detector and enhancer, which solves the problem of insufficient model recognition accuracy on sparse point cloud data and improves the model's robustness and practical application capabilities.
Patent Information
- Application Number
- CN202011384323.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-01
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2040-12-01
AI Technical Summary
In the existing technology, 3D target detection models trained based on standard data sets have insufficient recognition accuracy on sparse point cloud data in actual scenes, resulting in low detection capabilities.
Adopt a model training method based on adversarial learning, input the original samples into the enhancer and detector, train the detector and enhancer by calculating the first and second loss functions, and sparse the parameters to improve the model's recognition of sparse point cloud data ability.
Through the adversarial learning method of enhancer and detector, training on a high-density standard data set significantly improves the model's robustness to sparse point cloud data and the recognition accuracy in practical applications.
Smart Images

Figure CN114638996B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of image processing technology, and in particular to a model training method, apparatus, device and storage medium based on adversarial learning. Background Art
[0002] 3D object detection plays a key role in many real-world applications (such as autonomous driving, robot control, etc.) and has become a hot research topic in computer vision. This task aims to identify the category of the target object and detect the corresponding 3D bounding box from 3D data (such as point clouds).
[0003] Existing 3D object detection methods have shown good performance on standard point cloud datasets. For example, they can achieve high recognition speed and accuracy on the KITTI point cloud dataset. However, the acquisition cost of 3D object detection data is high (equipment cost and annotation cost), so it is hoped that the model can be trained on a public standard dataset and then directly applied to actual scenarios.
[0004] When the inventor uses the training model obtained based on the public standard data set in actual scenarios, the point cloud data obtained in the actual scene may be sparser than the public standard data set due to various factors (such as haze obstruction, low reflectivity, and the laser radar itself has too low a line number, such as 32 lines or 16 lines). As a result, the trained model performs poorly on these sparse point cloud data, and the recognition accuracy is insufficient in actual use. Summary of the invention
[0005] The present invention provides a model training method, apparatus, terminal device and storage medium based on adversarial learning to solve the technical problem that the model trained based on the standard data set in the prior art has insufficient recognition accuracy when actually used.
[0006] In a first aspect, an embodiment of the present invention provides a model training method based on adversarial learning, comprising:
[0007] Inputting the original sample into the enhancer and the detector, wherein the original sample is 3D point cloud data;
[0008] Performing target detection on the original sample at the detector, and calculating a first loss function, where the first loss function is a loss function of the detector on the original sample;
[0009] The detector performs thinning on the original sample based on the thinning parameter confirmed by the enhancer to obtain a current sample;
[0010] Performing target detection on the current sample at the detector, and calculating the second loss function, where the second loss function is a loss function of the detector on the current sample;
[0011] When the detection capability of the detector is lower than a preset training stop condition, training the detector based on the first loss function and the second loss function, and performing target detection on the original sample and the current sample in the detector;
[0012] The enhancer is trained based on the first loss function and the second loss function to determine the sparsification parameter.
[0013] In a second aspect, an embodiment of the present invention further provides a model training device based on adversarial learning, comprising:
[0014] A sample input unit, used to input an original sample into the enhancer and the detector, wherein the original sample is 3D point cloud data;
[0015] A first detection unit, configured to perform target detection on the original sample in the detector and calculate a first loss function, where the first loss function is a loss function of the detector on the original sample;
[0016] A thinning unit, configured to thin the original sample in the detector based on the thinning parameter confirmed by the enhancer to obtain a current sample;
[0017] A second detection unit, configured to perform target detection on the current sample in the detector and calculate the second loss function, where the second loss function is a loss function of the detector on the current sample;
[0018] A detector training unit, configured to train the detector based on the first loss function and the second loss function when the detection capability of the detector is lower than a preset training stop condition, and perform target detection on the original sample and the current sample in the detector;
[0019] An enhancer training unit is used to train the enhancer based on the first loss function and the second loss function to confirm the sparsification parameter.
[0020] In a third aspect, an embodiment of the present invention further provides a terminal device, including:
[0021] one or more processors;
[0022] A memory for storing one or more programs;
[0023] When the one or more programs are executed by the one or more processors, the one or more processors implement the model training method based on adversarial learning as described in any one of the first aspects.
[0024] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a model training method based on adversarial learning as described in any one of the first aspects.
[0025] The above-mentioned model training method, device, terminal device and storage medium based on adversarial learning input the original sample into the enhancer and the detector, the original sample is 3D point cloud data; the detector performs target detection on the original sample and calculates the first loss function, which is the loss function of the detector on the original sample; the detector performs sparsification on the original sample based on the sparsification parameter confirmed by the enhancer to obtain the current sample; the detector performs target detection on the current sample and calculates the second loss function, which is the loss function of the detector on the current sample; when the detection capability of the detector is lower than the preset training stop condition, the detector is trained based on the first loss function and the second loss function, and the detector performs target detection on the original sample and the current sample; the enhancer is trained based on the first loss function and the second loss function to confirm the sparsification parameter. The model training is carried out in the adversarial manner between the enhancer and the detector, and the recognition of the sparse point cloud is realized in the training based on the standard data set with higher density, which enhances the robustness of the model to the sparse point cloud and effectively improves the practicality of the model in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A flowchart of a model training method based on adversarial learning provided in Example 1 of the present invention;
[0027] Figure 2 The following is a statistical graph of mAP of the existing training model with different sparsity on three difficulty datasets;
[0028] Figure 3 Schematic diagram of the underlying data processing process of the enhancer in an embodiment of the present invention;
[0029] Figure 4 A schematic diagram of the underlying data processing process of the detector in an embodiment of the present invention;
[0030] Figure 5 Schematic diagram of the data processing process of the detector in an embodiment of the present invention;
[0031] Figure 6 It is a schematic diagram of the overall data processing process in an embodiment of the present invention;
[0032] Figure 7 A schematic diagram of the structure of a model training device based on adversarial learning provided in Embodiment 2 of the present invention;
[0033] Figure 8 A schematic diagram of the structure of a terminal device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0034] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only the parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0035] It should be noted that due to space limitations, this application description does not list all optional implementation methods. After reading this application description, those skilled in the art should be able to understand that as long as the technical features do not contradict each other, any combination of technical features can constitute an optional implementation method.
[0036] For example, in one implementation of Example 1, a technical feature is recorded: thinning the extracted features by weights. In another implementation of Example 1, another technical feature is recorded: training the enhancer based on the first loss function and the second loss function to update the sparsification parameters. After reading the description of this application, those skilled in the art should be able to think that an implementation having both of these features is also an optional implementation, that is, after updating the sparsification parameters, the extracted features are thinned according to the new sparsification parameters.
[0037] Each embodiment is described in detail below.
[0038] Embodiment 1
[0039] Figure 1 A flowchart of a model training method based on adversarial learning provided in Example 1 of the present invention. The model training method based on adversarial learning provided in the embodiment can be executed by an operating device corresponding to the model training method based on adversarial learning, and the operating device can be implemented by software and / or hardware, and the operating device can be composed of two or more physical entities, or can be composed of one physical entity.
[0040] The ability of a trained model to recognize objects from 3D point cloud data can be measured by mAP (mean Average Precision k). The higher the mAP, the better the trained model is at recognizing 3D point cloud data. Figure 2The statistical chart shows that the mAP of the model trained by the existing technical solution decreases with the increase of sparsity when facing the sparse 3D point cloud data. That is, the more sparse the data is, the worse the target recognition effect is, which leads to a corresponding decrease in mAP. Regardless of the difficulty level of 3D point cloud data, as the sparsity of 3D point cloud data increases, the recognition accuracy of the existing model decreases significantly.
[0041] Specifically, refer to Figure 1 , the model training method based on adversarial learning specifically includes:
[0042] Step S110: inputting the original sample into the enhancer and detector, the original sample being 3D point cloud data.
[0043] In the field of inspection, the point data set of the product appearance surface obtained by measuring instruments is also called point cloud. Common measuring instruments include 3D coordinate measuring machines, 3D laser scanners, photographic scanners, etc. In terms of the detected 3D point cloud data, the number of points obtained by 3D coordinate measuring machines is generally small, the distance between points is also large, and the point cloud is relatively sparse; the number of points obtained by using 3D laser scanners or photographic scanners is generally large, the distance between points is also small, and the point cloud is relatively dense.
[0044] The enhancer in this scheme is used to obtain the mask after each training as the sparseness parameter of the detector for sparse processing of the original sample. The specific processing process is as follows Figure 3 As shown, for a given original sample N p ×D-dimensional 3D point cloud data, the enhancer first extracts the features of the 3D point cloud data through an MLP (Multi-Layer Perceptron) to obtain N p ×32-dimensional point cloud local features, and then obtain 1×32-dimensional point cloud global features through the maximum pooling layer. The point cloud global features are copied and concatenated with the point cloud local features to fuse the global and local information. Finally, another MLP is used to obtain a sparse mask, which is the sparsification parameter used by subsequent detectors.
[0045] The detector in this scheme achieves the same target function as the detector in the prior art for object detection on 3D point cloud data, but in this scheme, the training process of the detector has enhanced training for sparse point cloud data. Specifically, for a given original sample N p ×D-dimensional 3D point cloud data, the detector first extracts features from the 3D point cloud data through an MLP to obtain N p×64-dimensional point cloud features, and then multiply them with the mask (sparseness parameter) to obtain sparse point cloud features (i.e., the operation within the dotted box), and finally obtain the global features of the 3D point cloud data through maximum pooling. The subsequent target detection on the global features is similar to the detection operation of the prior art, which will not be repeated here.
[0046] Step S120: The detector performs target detection on the original sample and calculates a first loss function, where the first loss function is the loss function of the detector on the original sample.
[0047] As the core unit for implementing the basic functions of 3D object detection, the detector is used to detect objects on sample data. The specific detection objects are not only the original samples, but also the current samples after sparseness and the detection of actual samples after training. Figure 5 As shown, the data to be tested corresponding to the detection object is input into the detector, the detector performs feature extraction on the data to be tested, obtains all features in the data to be tested to generate a complete feature set, performs target detection based on the complete feature set, and marks and displays the target detection results.
[0048] In the specific implementation process of this solution, step S120 can be implemented through steps S121 to S123:
[0049] Step S121: extracting features from the original sample in the detector to obtain multiple features.
[0050] Step S122: Perform target detection on the original sample based on the features.
[0051] Step S123: Calculate a first loss function according to the target detection result.
[0052] In this solution, the focus is not on how to perform target search on the detection data after the model training is completed, but on how to improve the detector's target recognition ability for sparse 3D point cloud data during the model training process. This needs to be achieved through multiple trainings. During the training process, it is necessary to extract features based on the original samples and calculate the loss function in the related processing process. Here, the loss function of the detector on the original samples is defined as the first loss function.
[0053] Step S130: The detector performs thinning on the original sample based on the thinning parameters confirmed by the enhancer to obtain the current sample.
[0054] The sparsification of the original sample can be the sparsification of the point cloud data or the sparsification of the features. If the sparsification is for the point cloud data, the detector needs to perform detection-related processing such as feature extraction and target detection on the sparsified point cloud data; if the sparsification is for the features, the detector sparsifies the features in the complete feature set based on the sparsification parameters, and then performs target detection based on the sparsified features.
[0055] In this solution, if the complete feature set is sparsely processed, step S130 can be specifically implemented through steps S131 and S132:
[0056] Step S131: The detector obtains the sparsification parameters confirmed by the enhancer.
[0057] Step S132: sparsify the features according to the sparse weights.
[0058] For the 3D point cloud data in the original sample, each latitude is a spatial coordinate with physical significance. Multiplying the coordinate by a sparsification parameter is equivalent to changing the original spatial coordinate. Therefore, in this scheme, the complete feature set is sparsely processed by the sparsification parameter to avoid direct changes to the original spatial coordinates. Because the feature extraction of the original sample is to extract features for each point independently, the sparsification of the features is equivalent to avoiding direct changes to the original spatial coordinates while sparsifying the point cloud.
[0059] Step S140: The detector performs target detection on the current sample and calculates a second loss function, where the second loss function is the loss function of the detector on the current sample.
[0060] As an implementation of adversarial learning between the detector and the enhancer, the detector needs to evaluate each training result, specifically by calculating the loss function of the detector on the current sample, which is defined as the second loss function in this scheme.
[0061] Step S150: When the detection capability of the detector is lower than a preset training stop condition, the detector is trained based on the first loss function and the second loss function, and target detection is performed on the original sample and the current sample in the detector.
[0062] In the specific implementation, the detector is trained based on the following loss function:
[0063] L D =L(X)+L(X′))+γ||F p -F′ p ||2
[0064] Where L(X) represents the first loss function, L(X′) represents the second loss function, and γ||Fp -F′ p ||2 represents the visual loss function.
[0065] In order to enable the detector to recognize both original samples and sparse samples, the above loss function is used to train the detector. The last item of the loss function is the visual loss function, which can make the features learned by the detector have a certain degree of sparse invariance.
[0066] Of course, if the detection capability of the detector reaches the preset training stop condition, it means that the training of the detector is completed, and the trained detector can be used for target prediction of actual data to be detected, and the training process in this scheme ends; if the detection capability of the detector is lower than the preset training stop condition, the training continues.
[0067] Step S160: training the enhancer based on the first loss function and the second loss function to confirm the sparsification parameters.
[0068] In the specific implementation, the enhancer is trained based on the following loss function:
[0069] L A =L(X′)+λ|1.0-exp(L(X′)-ρL(X))|
[0070] Where L(X) represents the first loss function, L(X′) represents the second loss function, ρ≥1, and λ represents the weight of |1.0-exp(L(X)-ρL(X))|.
[0071] In order to make the sparse samples more challenging during training, the enhancer can be trained to increase the loss function of the detector on the sparse samples, that is, to increase the second loss function. However, simply increasing the second loss function may cause the current sample obtained by sparseness to become extremely sparse and lose shape information. For example, the enhancer may generate all 0 sparsification parameters to maximize the second loss function. Based on this, the enhancer is trained by the above loss function. The second term of the loss function reaches the minimum value of 0 when L(X′)=ρL(X). Therefore, the difficulty of the current sample can be controlled by controlling ρ≥1 while increasing the second loss function. Finally, the second loss function in the first term can limit the current sample to maintain its shape information. Overall, the weight of the second direction is controlled by λ.
[0072] The overall training process of this program can be referred to Figure 6 Based on the data to be tested, the enhancer continuously adjusts the sparsification parameters during the training process. The detector performs sparsification processing on the extracted complete feature set based on the sparsification parameters, and then realizes target detection based on the sparse feature set. Finally, the detector is trained to accurately detect sparse 3D point cloud data.
[0073] In the above, the original sample is input into the enhancer and the detector, and the original sample is 3D point cloud data; the detector performs target detection on the original sample and calculates the first loss function, which is the loss function of the detector on the original sample; the detector performs sparseness on the original sample based on the sparsification parameter confirmed by the enhancer to obtain the current sample; the detector performs target detection on the current sample and calculates the second loss function, which is the loss function of the detector on the current sample; when the detection capability of the detector is lower than the preset training stop condition, the detector is trained based on the first loss function and the second loss function, and the detector performs target detection on the original sample and the current sample; the enhancer is trained based on the first loss function and the second loss function to confirm the sparsification parameter. The model is trained by the confrontation between the enhancer and the detector, and the recognition of the sparse point cloud is realized in the training based on the standard data set with higher density, which enhances the robustness of the model to the sparse point cloud and effectively improves the practicality of the model in practical applications.
[0074] Embodiment 2
[0075] Figure 7 This is a schematic diagram of the structure of a model training device based on adversarial learning provided in the second embodiment of the present invention. Figure 7 The model training device based on adversarial learning includes: a sample input unit 210, a first detection unit 220, a sparsification unit 230, a second detection unit 240, a detector training unit 250 and an enhancer training unit 260.
[0076] Among them, the sample input unit 210 is used to input the original sample into the enhancer and the detector, and the original sample is 3D point cloud data; the first detection unit 220 is used to perform target detection on the original sample in the detector and calculate the first loss function, which is the loss function of the detector on the original sample; the sparsification unit 230 is used to perform sparsification on the original sample based on the sparsification parameters confirmed by the enhancer in the detector to obtain the current sample; the second detection unit 240 is used to perform target detection on the current sample in the detector and calculate the second loss function, which is the loss function of the detector on the current sample; the detector training unit 250 is used to train the detector based on the first loss function and the second loss function when the detection capability of the detector is lower than the preset training stop condition, and perform target detection on the original sample and the current sample in the detector; the enhancer training unit 260 is used to train the enhancer based on the first loss function and the second loss function to confirm the sparsification parameters.
[0077] Based on the above embodiment, the first detection unit 220 includes:
[0078] A feature extraction module is used to extract features from the original sample in the detector to obtain multiple features;
[0079] The target detection module is used to detect targets on original samples based on features;
[0080] The loss calculation module is used to calculate the first loss function according to the result of target detection.
[0081] Based on the above embodiment, the sparseness unit includes:
[0082] A parameter acquisition module, used by the detector to obtain the sparsification parameters confirmed by the enhancer;
[0083] The feature sparsification module is used to sparse the features according to the sparsification parameters.
[0084] Based on the above embodiment, the detector is trained based on the following loss function:
[0085] L D =L(X)+L(X′)+γ||F p -F′ p ||2
[0086] Where L(X) represents the first loss function, L(X′) represents the second loss function, and γ||F p -F′ p ||2 represents the visual loss function.
[0087] Based on the above embodiment, the enhancer is trained based on the following loss function:
[0088] L A =L(X′)+λ|1.0-exp(L(X′)-ρL(X))|
[0089] Where L(X) represents the first loss function, L(X′) represents the second loss function, ρ≥1, and λ represents the weight of |1.0-exp(L(X)-ρL(X))|.
[0090] The model training device based on adversarial learning provided in an embodiment of the present invention is included in a terminal device and can be used to execute any of the model training methods based on adversarial learning provided in the above-mentioned embodiment 1, and has corresponding functions and beneficial effects.
[0091] It is worth noting that in the above-mentioned embodiment of the model training device based on adversarial learning, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0092] Embodiment 3
[0093] Figure 8 This is a schematic diagram of the structure of a terminal device provided in Embodiment 3 of the present invention. The terminal device is a specific hardware presentation solution of the operating device mentioned above. Figure 8 As shown, the terminal device includes a processor 310, a memory 320, an input device 330, an output device 340 and a communication device 350; the number of processors 310 in the terminal device can be one or more. Figure 8 A processor 310 is taken as an example; the processor 310, the memory 320, the input device 330, the output device 340 and the communication device 350 in the terminal device can be connected via a bus or other means. Figure 8 The example of connecting through bus is taken in the following.
[0094] The memory 320, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the model training method based on adversarial learning in the embodiment of the present invention (for example, the sample input unit 210, the first detection unit 220, the sparsification unit 230, the second detection unit 240, the detector training unit 250 and the enhancer training unit 260 in the model training device based on adversarial learning). The processor 310 executes various functional applications and data processing of the terminal device by running the software programs, instructions and modules stored in the memory 320, that is, realizes the above-mentioned model training method based on adversarial learning.
[0095] The memory 320 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 320 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 320 may further include a memory remotely arranged relative to the processor 310, and these remote memories may be connected to the terminal device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0096] The input device 330 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the terminal device. The output device 340 may include a display device such as a display screen.
[0097] The above-mentioned terminal device includes a model training device based on adversarial learning, which can be used to execute any model training method based on adversarial learning, and has corresponding functions and beneficial effects.
[0098] Embodiment 4
[0099] An embodiment of the present invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform relevant operations in the model training method based on adversarial learning provided in any embodiment of the present application, and have corresponding functions and beneficial effects.
[0100] Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products.
[0101] Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application 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. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 functions in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in 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.
[0102] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory. The memory may include non-permanent memory 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.
[0103] 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.
[0104] 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.
[0105] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A model training method based on adversarial learning, characterized in that: include: Inputting the original sample into the enhancer and the detector, wherein the original sample is 3D point cloud data; Performing target detection on the original sample at the detector, and calculating a first loss function, where the first loss function is a loss function of the detector on the original sample; The detector performs thinning on the original sample based on the thinning parameter confirmed by the enhancer to obtain a current sample; Performing target detection on the current sample at the detector, and calculating a second loss function, where the second loss function is a loss function of the detector on the current sample; When the detection capability of the detector is lower than a preset training stop condition, training the detector based on the first loss function and the second loss function, and performing target detection on the original sample and the current sample in the detector; Training the enhancer based on the first loss function and the second loss function to determine the sparsification parameter; The detector is trained based on the following loss function: Among them, L(X) represents the first loss function, L(X′) represents the second loss function, represents the visual loss function.
2. The method according to claim 1, characterized in that The performing target detection on the original sample in the detector and calculating a first loss function includes: Extracting features from the original sample at the detector to obtain multiple features; Performing target detection on the original sample based on the feature; The first loss function is calculated based on the result of target detection.
3. The method according to claim 2, characterized in that The step of thinning the original sample based on the thinning parameter confirmed by the enhancer in the detector to obtain the current sample includes: The detector obtains the sparsification parameter confirmed by the enhancer; The features are thinned according to the thinning parameters.
4. The method according to any one of claims 1 to 3, characterized in that: The enhancer is trained based on the following loss function: 50 A =L(X′)+λ|1.0-exp( L(X′)-ρL(X))| Where L(X) represents the first loss function, L(X′) represents the second loss function, ρ≥1, and λ represents the weight of |1.0-exp(L(X′)-ρL(X))|.
5. A model training device based on adversarial learning, characterized in that: include: A sample input unit, used to input an original sample into the enhancer and the detector, wherein the original sample is 3D point cloud data; A first detection unit, configured to perform target detection on the original sample in the detector and calculate a first loss function, where the first loss function is a loss function of the detector on the original sample; A thinning unit, configured to thin the original sample in the detector based on the thinning parameter confirmed by the enhancer to obtain a current sample; A second detection unit, configured to perform target detection on the current sample in the detector and calculate a second loss function, where the second loss function is a loss function of the detector on the current sample; A detector training unit, configured to train the detector based on the first loss function and the second loss function when the detection capability of the detector is lower than a preset training stop condition, and perform target detection on the original sample and the current sample in the detector; An enhancer training unit, configured to train the enhancer based on the first loss function and the second loss function to determine the sparsification parameter; The detector is trained based on the following loss function: Among them, L(X) represents the first loss function, L(X′) represents the second loss function, represents the visual loss function.
6. The device according to claim 5, characterized in that The first detection unit comprises: A feature extraction module, used for extracting features from the original sample in the detector to obtain multiple features; A target detection module, used for performing target detection on the original sample based on the features; The loss calculation module is used to calculate the first loss function according to the result of target detection.
7. The device according to claim 6, characterized in that The sparseness unit comprises: A parameter acquisition module, used for the detector to acquire the sparsification parameters confirmed by the enhancer; A feature sparsification module is used to sparsify the feature according to the sparsification parameter.
8. A terminal device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the model training method based on adversarial learning as described in any one of claims 1-4.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the model training method based on adversarial learning as described in any one of claims 1 to 4 is implemented.
