An offline quantization method for a 3D point cloud target detection model
By performing layer-by-layer quantization on the 3D point cloud target detection model and converting it into a low-ratio specific point count, the problems of large computational load and long latency in existing technologies are solved, achieving efficient model deployment and performance maintenance.
Patent Information
- Application Number
- CN202310038521.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-04-20
- Filing Date
- 2023-01-26
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2043-01-26
AI Technical Summary
Existing quantization methods for 3D point cloud target detection models cannot effectively reduce computational load and latency while maintaining model performance. In particular, quantization methods for 3D sparse convolutional models have failed to achieve efficient deployment under conditions of limited hardware resources.
By performing layer-by-layer analysis on the 3D point cloud target detection model, statistically distributing zeros and scaling factors, converting floating-point feature values and weights to low-ratio specific point numbers, quantization of 3D sparse convolution and 2D convolution modules is achieved, thus optimizing the model's computation process.
It achieves reduced model latency and computational load while maintaining model performance, improving model inference speed and reducing memory usage under limited hardware resources.
Smart Images

Figure CN116011518B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of artificial intelligence, in particular, to the field of neural grid model quantization, and more particularly, to an offline quantization method for a point cloud target detection model. BACKGROUND
[0002] In the field of autonomous driving, 3D perception models are often designed to be complex in consideration of high-precision performance. However, in actual vehicle applications, due to limited hardware resources, model deployment will try to reduce the occupation of hardware resources through model compression as much as possible, and it is necessary to reduce the calculation amount of the model while improving the inference speed of the model.
[0003] Therefore, there is an urgent need for a model quantization method that reduces the calculation amount of the model while improving the inference speed of the model. SUMMARY
[0004] Model compression mainly includes two parts: model pruning and model quantization, where model quantization refers to representing the data involved in the model with low-bit data, thereby reducing the space occupied during model inference, improving the inference speed of the model, and thus achieving the purpose of compressing the model.
[0005] Model quantization is further divided into offline model quantization and online model quantization, where offline model quantization refers to temporarily static low-bit quantization after model training, and then running a low-bit model during deployment and inference; online model quantization refers to dynamic low-bit quantization during model training, and then running a low-bit model during deployment and inference. Compared with online quantization, offline quantization is more convenient to implement, only needs to count the quantization parameters of the model data after the model training is completed, and quantize the floating-point model parameters to low-bit fixed-point parameters during deployment and inference, complete the inference of the low-bit quantization model, and improve the inference performance of the model. In addition, compared with the calculation between floating-point numbers, low-bit fixed-point number calculation is easier to implement at the hardware level, and the requirement for the hardware platform is limited.
[0006] Currently, point cloud perception models based on 3D sparse convolution are more balanced in speed and accuracy, and have more obvious advantages in on-vehicle deployment. However, considering hardware resources and model efficiency, it is necessary to implement quantization of such 3D perception models during model deployment. In view of this, how to maintain the performance of the model while implementing model quantization has become a key factor in implementing such 3D perception models.
[0007] However, most of the existing disclosed quantization methods are only for image 2D models, and only quantize point cloud data with low bits, divide sub-regions according to the actual positions of point cloud three-dimensional coordinates in space, calculate the quantization coordinates corresponding to the 3D coordinates of each point cloud point by pre-setting the quantization bit number, resolution and calculation error, input the quantization coordinates into the point cloud detection model to output the detection result. This method is strictly speaking only a data processing method, but ignores the quantization of the point cloud detection model. It does not belong to the model level quantization. Although it can achieve certain acceleration effect in data processing, it cannot achieve low latency and low calculation amount effect more efficiently in model inference deployment, and the performance of the quantized model is also significantly reduced.
[0008] Therefore, the present application aims to provide a 3D point cloud target detection model quantization method which can reduce the demand for hardware resources, efficiently achieve low latency and low calculation amount effect while maintaining model performance.
[0009] In the following, a brief summary of the present disclosure is given in order to provide a basic understanding of some aspects of the present disclosure. However, it should be understood that this summary is not a comprehensive overview of the present disclosure. It is not intended to identify key or critical elements of the present disclosure or delineate the scope of the present disclosure. Its sole purpose is to present some concepts of the present disclosure in a simplified form as a prelude to the more detailed description presented later.
[0010] According to a first aspect of the present disclosure, a quantization method for a 3D point cloud target detection model is provided, comprising:
[0011] S1. performing layer-by-layer analysis on the trained 3D point cloud target detection model to determine the layers to be quantized of the 3D sparse convolution module and the 2D convolution module of the 3D point cloud target detection model;
[0012] S2. inputting test data into the trained 3D point cloud target detection model, and calculating the distribution zero point and scaling factor of the data of the layers to be quantized;
[0013] S3. inputting original point cloud data into the trained 3D point cloud target detection model, and calculating a mapping table between the original point cloud data and sparse point cloud data;
[0014] S4. converting the floating point feature values of the sparse point cloud data into a first sparse low bit specific point number according to the distribution zero point and scaling factor of the floating point feature values of the layers to be quantized of the 3D sparse convolution module, and converting the floating point weights of the sparse point cloud data into a second sparse low bit specific point number according to the distribution zero point and scaling factor of the floating point weights of the layers to be quantized of the 3D sparse convolution module; and
[0015] S5. obtaining a convolution output value of the 3D sparse convolution module based on the first sparse low-bit point number and the second sparse low-bit point number.
[0016] According to a second aspect of the present disclosure, an electronic device is provided, comprising: one or more processors, and one or more memories having stored thereon executable instructions that, when executed by the one or more processors, cause the one or more processors to perform the method according to the first aspect of the present disclosure.
[0017] According to a third aspect of the present disclosure, a non-transitory computer-readable storage medium having stored thereon executable instructions that, when executed by one or more processors, cause the one or more processors to perform the method according to the first aspect of the present disclosure.
[0018] Other features and advantages of the present disclosure will become more apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the attached drawings. BRIEF DESCRIPTION OF DRAWINGS
[0019] The accompanying drawings, which form a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0020] The present disclosure can be understood moreappreciably with reference to the following detailed description when considered in conjunction with the accompanying drawings, in which:
[0021] Figure 1 is a schematic diagram illustrating a quantization method for a 3D point cloud object detection model according to an exemplary embodiment of the present disclosure;
[0022] Figure 2 is a block diagram illustrating a configuration for implementing a quantization method for a 3D point cloud object detection model according to an exemplary embodiment of the present disclosure; and
[0023] Figure 3 is a block diagram illustrating an application example of a quantization method for a 3D point cloud object detection model according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] The present disclosure will be described in the following order:
[0025] 1. Embodiments
[0026] 2. Application Examples
[0027] 3. Conclusion
[0028] Hereinafter, preferred embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. Note that, in this specification and the drawings, the same or similar parts are denoted by the same reference numerals, and repeated explanation is omitted. In this specification, like numbers or letters are used to denote like items.
[0029] For ease of understanding, the position, size, range, and the like of each structure shown in the drawings and the like are sometimes not actual position, size, range, and the like. Thus, the disclosed application is not limited to the position, size, range, and the like disclosed in the drawings and the like.
[0030] 1. Embodiment
[0031] The quantization method for a 3D point cloud object detection model according to the exemplary embodiments of the present disclosure will be described in detail below with reference to Figure 1 and Figure 2 A person skilled in the art can understand that the present application is not limited to the steps shown in the figures, but can be implemented according to the same.
[0032] Figure 1 is a schematic diagram showing a quantization method 100 for a 3D point cloud object detection model according to exemplary embodiments of the present disclosure.
[0033] At step 101, the trained 3D point cloud object detection model is analyzed layer by layer to determine the layers of the 3D sparse convolution module and the 2D convolution module of the 3D point cloud object detection model to be quantized.
[0034] In some embodiments according to the present disclosure, the trained 3D point cloud object detection model is obtained by precision training of the original floating point model. For example, the trained 3D point cloud object detection model can be obtained by training the original floating point model at float32 precision.
[0035] In some embodiments according to the present disclosure, when the original floating point data is of float32 type, the original point cloud data is first subjected to voxel normalization processing to generate N*4 float32 normalized voxel features.
[0036] Next, go to step 102. At step 102, test data is input to the trained 3D point cloud object detection model, and the distribution zero point and scaling factor of the data of each layer to be quantized are counted and calculated.
[0037] In some embodiments according to the present disclosure, a distribution histogram of floating-point feature values of test data (such as small-batch point cloud test data) is collected; the distribution histogram is truncated at different truncation lengths to obtain truncated features; a low-bit specific number of the truncated features is created and supplemented to the sample length before truncation to obtain quantized features; the relative entropy of the probability distribution between the truncated features and the quantized features at different truncation lengths is iteratively calculated; and the distribution zero point z and the scaling factor s are calculated by the following formulas (1) and (2):
[0038] s = (F max -F min ) / (Q max -Q min ) … … (1)
[0039]
[0040] wherein,
[0041] F max represents the maximum value of the truncated features at the minimum relative entropy,
[0042] F min represents the minimum value of the truncated features at the minimum relative entropy,
[0043] Q max represents the maximum value of the low-bit specific number, and
[0044] Q min represents the minimum value of the low-bit specific number.
[0045] In some embodiments according to the present disclosure, the low-bit specific number can include at least one of int8, int4, and int2, etc. quantization types.
[0046] Next, go to step 103. At step 103, the original point cloud data is input to the trained 3D point cloud target detection model, and a mapping table between the original point cloud data and the sparse point cloud data is calculated.
[0047] Since the point cloud voxel is sparse, there are mostly blank areas. In the 3D point cloud target detection model according to the present disclosure, a 3D sparse convolution (3D Sparse conv) module and a 2D convolution (2D conv) module are included (for detailed description, please refer to Figure 2 ). The difference between the 3D sparse convolution module and the 3D convolution module is that the 3D sparse convolution module only calculates the input non-empty voxels and outputs 3D sparse point cloud features. According to the position of the input features, the size of the convolution kernel, the step of the convolution kernel, and other attribute information, the correspondence between the input data and the output sparse feature position can be directly calculated, that is, the input-output mapping table, to facilitate convolution acceleration calculation according to the mapping table during calculation.
[0048] Next, go to step 104. At step 104, the float feature values of the sparse point cloud data are converted into first sparse low-bit point numbers according to the distribution zero point and the scaling factor of the float feature values of each layer of the 3D sparse convolution module to be quantized, and the float weights of the sparse point cloud data are converted into second sparse low-bit point numbers according to the distribution zero point and the scaling factor of the float weights of each layer of the 3D sparse convolution module to be quantized.
[0049] In some embodiments, the float feature values and the float weights are converted based on the following formula (3):
[0050]
[0051] wherein,
[0052] x f represents the float numbers of the current layer of the 3D sparse convolution module, including at least one of the float numbers of the float feature values and the float numbers of the float weights,
[0053] s represents the scaling factor of the current layer of the 3D sparse convolution module,
[0054] z represents the distribution zero point of the current layer of the 3D sparse convolution module,
[0055] b represents the bit number, for example, b = 8 when the low-bit point number is in the int8 quantization mode,
[0056] x int represents at least one of the first sparse low-bit point number and the second sparse low-bit point number,
[0057] round represents rounding, and
[0058] clip represents clipping.
[0059] In some embodiments according to the present disclosure, the conversion to the low-bit point number of the int8 quantization type is performed starting from the original float32 point cloud type. In the int8 quantization type mode, both the first sparse low-bit point number and the second sparse low-bit point number are of the int8 quantization type. That is, the first sparse low-bit point number and the second sparse low-bit point number are of the same quantization type.
[0060] Next, go to step 105. At step 105, the convolution output value of the 3D sparse convolution module is obtained based on the first sparse low-bit point number and the second sparse low-bit point number.
[0061] Next, go to step 106. At step 106, the convolution output value of the 3D sparse convolution module is converted into a third sparse low-bit point number according to the scaling factor of each layer of the 2D convolution module to be quantized calculated.
[0062] In some embodiments, the convolution output value of the 3D sparse convolution module is converted based on the following formula (4):
[0063] x int′ =s′×x conv ……(4)
[0064] Wherein,
[0065] s' represents the scaling factor of the current layer of the 2D convolution module,
[0066] x conv represents the convolution output value of the 3D sparse convolution module, and
[0067] x int’ represents the third sparse low-bit point number.
[0068] In some embodiments according to the present disclosure, the output of the convolution output value has two cases: one is when the next layer is a non-neural network quantization layer, the convolution output value of the 3D sparse convolution module is dequantized to the original point cloud type, such as float32 point cloud type, according to the scaling factor and distribution zero point of the non-neural network quantization layer, and then the bias is added as the input of the next layer; the second is when the next layer is a neural network quantization layer, the convolution output value of the 3D sparse convolution module is directly converted into low-bit point number data according to the scaling factor of the next layer as the quantization input of the next layer, as shown in formula (4). In the present application, since the next layer of the 3D sparse convolution module is the quantization layer of the 2D convolution module, it can be directly converted into low-bit point number data, reducing the memory and time consumption caused by repeated data calculation.
[0069] For example, when starting from the original float32 point cloud type and converting to the low-bit point number of the int8 quantization type, the convolution output value of the 3D sparse convolution module is of int32 type, and the third sparse low-bit point number is of int8 type.
[0070] Next, go to step 107. At step 107, the third sparse low-bit point number is mapped to a 2D dense low-bit point number, and the 2D dense low-bit point number is input into the 2D convolution module for feature calculation.
[0071] In some embodiments according to the present disclosure, the third sparse low-bit fixed-point number is a 3D sparse low-bit fixed-point number, for example, a 3D sparse int8 fixed-point number, thus before inputting the 2D convolution model, the third sparse low-bit fixed-point number coordinate needs to be mapped to a 2D dense low-bit fixed-point number, for example, a 2D dense fixed-point number corresponding to the 3D sparse int8 fixed-point number.
[0072] Next, go to step 108. At step 108, the calculated 2D dense low-bit fixed-point number feature is output by the 2D convolution module.
[0073] Next, go to step 109. At step 109, the 2D dense low-bit fixed-point number feature is converted into a target data format, and a final target detection frame is generated.
[0074] In some embodiments, the 2D dense low-bit fixed-point number feature is converted into a target data format based on the following formula (5):
[0075] x f′ =s′×(x int″ -z′)……(5)
[0076] wherein,
[0077] s' represents a scaling factor of a current layer of the 2D convolution module,
[0078] x int” represents the 2D dense low-bit fixed-point number feature,
[0079] z' represents a zero point of the current layer of the 2D convolution module, and
[0080] x f′ represents a float number of the target data format.
[0081] As mentioned above, in some embodiments according to the present disclosure, the 2D dense low-bit fixed-point number feature is a 2D dense int8 fixed-point number, and at this time, the float number of the target data format is a float32 float number.
[0082] Figure 2 A block diagram showing the configuration of a quantization method for a 3D point cloud target detection model according to an exemplary embodiment of the present disclosure is shown. In order to more fully and completely understand the present application, a specific example of the quantization method for a 3D point cloud target detection model according to an exemplary embodiment of the present disclosure will be described in detail below with Figure 2 as an example. Please note that this example is not intended to constitute a limitation on the present application. For example, the present application is not limited to the specific configuration shown, but is applicable to all 3D point cloud target detection models having the same requirements or design considerations. Figure 2
[0083] As Figure 2 shown, the 3D point cloud target detection model 201 includes a 3D sparse convolution module 2011 and a 2D convolution module 2012. After the 3D point cloud target detection model 201 is trained, the 3D sparse convolution module 2011 receives input point cloud data, and after calculation, inputs the calculation result to the 2D convolution module 2012, and the 2D convolution module 2012 outputs a detection frame.
[0084] Still as Figure 2 shown, the quantization method in combination Figure 1 with the 3D point cloud target detection model 201 is tested with small batch point cloud data, and a quantized 3D point cloud target detection model 202 can be obtained. The quantized 3D point cloud target detection model 202 includes a quantized 3D sparse convolution module 2021 and a 2D convolution module 2022. The quantized 3D sparse convolution module 2021 receives input point cloud data, and after calculation, inputs the quantized calculation result to the quantized 2D convolution module 2012. After the quantized 2D convolution module 2012 is dequantized, a detection frame is output.
[0085] In order to avoid unnecessary confusion of the present application, the configuration shown in Figure 2 will not be described in detail. The quantization method for the 3D point cloud target detection model described above in combination Figure 1 is fully applicable to Figure 2 the configuration shown.
[0086] Taking the SECOND model as an example, after offline quantization, the memory space occupied by the model is reduced by about 25%, the model inference speed is improved by 50%, and the detection accuracy of the quantized model is lost by 3 to 6%.
[0087] 2. Application Example
[0088] Figure 3 is a block diagram showing an example of a schematic configuration of a vehicle 300 to which the present disclosure can be applied. The vehicle 300 includes a processor 301, a memory 302, a storage 303, an external connection interface 304, a camera 305, a sensor 306, a microphone 307, an input device 308, a display device 309, a speaker 310, a wireless communication interface 311, and a bus 312.
[0089] The processor 301 can be, for example, a CPU or a system on chip (SoC), and controls functions of the application layer and the other layers of the vehicle 300. The memory 302 includes a RAM and a ROM, and stores data and programs executed by the processor 301. The storage 303 can include a storage medium such as a semiconductor memory and a hard disk. The external connection interface 304 is an interface for connecting an external device such as a memory card and a universal serial bus (USB) device to the vehicle 300.
[0090] The camera 305 includes an image sensor such as a charge-coupled device (CCD) and a complementary metal-oxide semiconductor (CMOS), and generates a captured image. The sensor 306 can include a set of sensors such as a measurement sensor, a gyro sensor, a geomagnetic sensor, and an acceleration sensor. The microphone 307 converts a sound input to the vehicle 300 into an audio signal. The input device 308 includes, for example, a touch sensor configured to detect a touch on a screen of the display device 309, a keypad, a keyboard, a button, or a switch, and receives an operation or information input from a user. The display device 309 includes a screen such as a liquid crystal display (LCD) and an organic light-emitting diode (OLED) display, and displays an output image of the vehicle 300. The speaker 310 converts an audio signal output from the vehicle 300 into a sound.
[0091] The wireless communication interface 311 supports any communication scheme, and performs wireless communication.
[0092] The bus 312 connects the processor 301, the memory 302, the storage 303, the external connection interface 304, the camera 305, the sensor 306, the microphone 307, the input device 308, the display device 309, the speaker 310, and the wireless communication interface 311 to each other.
[0093] In Figure 3 In the vehicle 300 illustrated, the reference Figure 1 The method described can be implemented by the processor 301 and the memory 302.
[0094] Further, it is noted that, although the off-line quantization method for 3D point cloud models according to the present disclosure is described herein with the vehicle as an application example, it does not constitute a limitation on the quantization method according to the present disclosure. That is, the off-line quantization method for 3D point cloud models according to the present disclosure can be used in any similar communication and image processing scenarios.
[0095] 3. Conclusion
[0096] Compared with online quantization, offline quantization is closer to deployment, only a small number of samples (for example, 100-1000) of original training data are needed as a calibration set, complex quantization training is not needed, offline quantization can be completed in a very short time, the effect of compressed model is achieved, and meanwhile, the model is ensured to be within a certain accuracy error range, and is suitable for industrial landing.
[0097] Compared with the original floating point model, the point cloud quantization model realized in the application reduces the memory occupation of the model, brings faster inference speed, and meanwhile, the accuracy loss of the model is small, and the application value is important in actual 3D point cloud model deployment and inference.
[0098] It should be noted that the words "front", "back", "top", "bottom", "over", "under", and the like in the description and claims, if any, are used for descriptive purposes and not necessarily for describing relative positions. It is to be understood that the words so used are interchangeable under appropriate circumstances such that the embodiments of the present disclosure described herein are capable of operation in other orientations than those illustrated or otherwise described herein.
[0099] As used herein, the word "exemplary" means "serving as an example, instance, or illustration," and not "preferred" or "advantageous over other implementations." Furthermore, the disclosure is not intended to be limited to the aspects shown herein, but is to be accorded the widest scope consistent with what is presented herein and the full breadth of the claims.
[0100] As used herein, the word "substantially" is intended to describe the relative difference between two measurements or values, and is not intended to be a literal description of the difference. As used herein, the word "substantially" means including any minor variations as a result of manufacturing tolerances, component or element tolerances, environmental influences, and / or other factors. The word "substantially" also allows for differences from perfect or ideal circumstances due to parasitics, noise, and other practical considerations that can exist in actual implementations.
[0101] In addition, "first", "second", and similar terms can also be used herein, simply for purposes of reference and thus do not necessarily have to refer to anything by that term. For example, unless otherwise noted, the terms "first", "second", and other such numerical terms referring to a structure or element do not necessarily indicate an order or sequence unless specifically stated.
[0102] It should also be understood that the word "comprising" or "including" when used herein is taken to specify the presence of stated features, integers, steps, operations, elements, or components but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0103] In this disclosure, the term "provide" is used broadly to encompass all means of obtaining an object, and thus "providing an object" includes, but is not limited to, "purchasing", "preparing / manufacturing", "arranging / setting", "installing / setting up", and / or "ordering" the object, etc.
[0104] Those skilled in the art will realize that the boundaries between the above described operations merely illustrative. The multiple operations can be combined into a single operation, a single operation can be distributed in additional operations and operations can be executed at least partially overlapping in time. Moreover, alternative embodiments can include a number of instances of a particular operation, and the order of the operations can be altered in other various embodiments. Other modifications, variations, and alternatives are also possible. Accordingly, the specification and drawings should be regarded as illustrative only and not as restrictive.
[0105] It is noted that, while the above describes various steps in a particular order, this is not meant to be limiting. In fact, some of the steps can be executed concurrently, in different orders, or changed up as desired, so as to accomplish the desired functionality.
[0106] The present application can be a system, a method, and / or a computer program product. The computer program product can include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present application.
[0107] The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or punched tape, a
[0108] While certain specific embodiments of the present disclosure have been described through the use of examples, it should be understood that the examples are merely exemplary and are not intended to limit the scope of the disclosure. The embodiments disclosed herein can be combined in any manner without departing from the spirit and scope of the disclosure. It will be apparent to those skilled in the art that many modifications and variations can be made to the disclosed embodiments without departing from the scope and spirit of the disclosed embodiments. The choice of words in this document is intended to best explain the principles of the embodiments, the practical application, or technical improvement over the prior art, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of the disclosure is defined by the appended claims.
Claims
1. A quantization method for a 3D point cloud object detection model, comprising: S1. Perform layer-by-layer analysis on the trained 3D point cloud target detection model to determine the layers to be quantized in the 3D sparse convolution module and 2D convolution module of the 3D point cloud target detection model. S2. Input test data into the trained 3D point cloud target detection model, and statistically calculate the distribution zero points and scaling factors of the data of each layer to be quantized; S3. Input the original point cloud data into the trained 3D point cloud object detection model and calculate the mapping table between the original point cloud data and the sparse point cloud data; S4. Based on the calculated distribution zeros and scaling factors of the floating-point feature values of each layer to be quantized in the 3D sparse convolution module, the floating-point feature values of the sparse point cloud data are converted into a first sparse low-ratio specific number of points; and based on the calculated distribution zeros and scaling factors of the floating-point weights of each layer to be quantized in the 3D sparse convolution module, the floating-point weights of the sparse point cloud data are converted into a second sparse low-ratio specific number of points; and S5. Obtain the convolution output value of the 3D sparse convolution module based on the first sparse ratio specific number of points and the second sparse ratio specific number of points.
2. The method according to claim 1, characterized in that, Also includes: S6. Based on the calculated scaling factors of each layer to be quantized in the 2D convolutional module, convert the convolution output value of the 3D sparse convolutional module into a third sparse low-ratio specific number of points; and S7. Map the third sparse low-ratio specific point count to a 2D dense low-ratio specific point count, and input the 2D dense low-ratio specific point count into the 2D convolution module for feature calculation; S8. The 2D dense low-ratio specific point count feature calculated from the output of the 2D convolution module; and S9. Convert the 2D dense low-ratio specific point count features into target data format and generate the final target detection box.
3. The method according to claim 1, characterized in that, In step S2, Histogram of the distribution of floating-point feature values in the collected test data; Cut off the data according to different cutoff lengths in the distribution histogram to obtain the cutoff features; The truncated feature is created with a low ratio of specific points and padded to the original sample length to obtain the quantized feature; Iteratively calculate the relative entropy of the probability distributions between truncated and quantized features for different truncation lengths; and The distribution zero point z and scaling factor s are calculated using the following formulas (1) and (2): s=(F max -F min ) / (Q max -Q min )……(1) in, F max The maximum value of the truncation feature represents the minimum relative entropy. F min The minimum value of the truncation feature represents the minimum value of the relative entropy. Q max This represents the maximum value of a specific number of points, and Q min This represents the minimum value of a specific point.
4. The method according to claim 1, characterized in that, In step S4, the floating-point eigenvalues and floating-point weights are converted based on the following formula (3): in, x f The floating-point number representing the current layer of the 3D sparse convolution module includes at least one of the floating-point numbers of floating-point feature values and floating-point numbers of floating-point weights. s represents the scaling factor of the current layer of the 3D sparse convolution module. z represents the distribution zero point of the current layer of the 3D sparse convolution module. b represents the number of bits. x int It represents at least one of the first sparse ratio specific number of points and the second sparse ratio specific number of points. round indicates rounding to the nearest whole number, and... "Clip" means to cut off.
5. The method according to claim 2, characterized in that, In step S6, the convolution output value of the 3D sparse convolution module is transformed based on the following formula (4): x int′ =s′×x conv ……(4) in, s' represents the scaling factor of the current layer of the 2D convolution module. x conv This represents the convolution output value of the 3D sparse convolution module, and x int’ This indicates the number of specific points in the third sparse low ratio.
6. The method according to claim 2, characterized in that, In step S9, the 2D dense low-ratio specific point count feature is converted into the target data format based on the following formula (5): x f′ =s′×(x int″ -z′)……(5) in, s' represents the scaling factor of the current layer of the 2D convolution module. x int” This represents the 2D dense low-ratio specific point count feature. z′ represents the zero point of the current layer of the 2D convolutional module, and x f′ A floating-point number representing the target data format.
7. The method according to claim 1, characterized in that, Also includes: The trained 3D point cloud target detection model is obtained by performing precision training on the original floating-point model.
8. The method according to claim 1, characterized in that, The sparse low-ratio specific point count includes at least one of the quantization types int8, int4, and int2.
9. An electronic device, comprising: One or more processors, and One or more memories having executable instructions stored thereon, which, when executed by the one or more processors, cause the one or more processors to perform the method as described in any one of claims 1-8.
10. A non-transitory computer-readable storage medium having executable instructions stored thereon, the executable instructions, when executed by one or more processors, causing the one or more processors to perform the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Neural network quantification method and device, storage medium and terminal
CN114091655A