Method and apparatus for object detection

The novel ZSQ framework for object detection networks addresses data generation and fine-tuning challenges by using adaptive sampling and distillation techniques, achieving superior performance with a small synthetic data set, enhancing training efficiency and accuracy.

WO2026065195A1PCT designated stage Publication Date: 2026-04-02ROBERT BOSCH GMBH +1
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2026-04-02

AI Technical Summary

Technical Problem

Existing zero-shot quantization (ZSQ) methods for object detection networks face challenges in optimizing data generation and fine-tuning strategies, making it difficult to synthesize complex and varying objects similar to those in real datasets without relying on real training data, which limits their effectiveness.

Method used

A novel ZSQ framework that generates a condensed synthetic calibration data set using a pre-trained object detection network with adaptive bounding box and category sampling, incorporating prediction-matching and feature-level distillation during quantization aware training to enhance knowledge transfer and convergence speed.

Benefits of technology

The framework achieves state-of-the-art performance in low bit-width quantization, improving metrics like mAP by 4.2% compared to existing methods, with a synthetic data set only 1/60 the size of the original, and accelerates training convergence by about 16 times.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024122161_02042026_PF_FP_ABST
    Figure CN2024122161_02042026_PF_FP_ABST
Patent Text Reader

Abstract

A method for object detection network quantization is disclosed. The method may comprise: generating a calibration data set from a pre-trained object detection network, the calibration data set comprising a plurality of synthetic images and a plurality of labels corresponding to the synthetic images, a label corresponding to a synthetic image comprising at least a category of an object in the synthetic image and a bounding box of the object; and training a quantized object detection network from the pre-trained object detection network with the calibration data set.
Need to check novelty before this filing date? Find Prior Art

Description

METHOD AND APPARATUS FOR OBJECT DETECTIONFIELD

[0001] The present disclosure relates generally to artificial intelligence technology, and more particularly, to objection detection network quantization.BACKGROUND

[0002] Computer vision is a field of artificial intelligence (AI) that enables computers and systems to derive meaningful information from digital images, videos and other visual inputs and take actions or make recommendations based on that information. Object detection is a common task in the field of computer vision. Thus, object detection neural networks play a pivotal role in a wide array of computer vision applications, spanning from autonomous driving to surveillance systems. As the demand grows for deploying deep neural networks on resource-constrained devices, quantization has emerged as a critical technique to reduce network size and computational complexity while maintaining performance.

[0003] However, traditional quantization methods often necessitate access to the original training data, posing challenges due to privacy concerns or the impracticality of storing and transferring large datasets. In this context, Zero-shot Quantization (ZSQ) presents an approach to quantize deep neural networks without the reliance on real training data. Most current research on ZSQ is limited to classification tasks. While ZSQ has achieved remarkable success in classification tasks, the extension of zero-shot techniques to object detection still remains limited currently. Therefore, there exists a need for an approach for object detection network quantization without real training data.SUMMARY

[0004] The following presents a simplified summary of one or more aspects according to the present disclosure in order to provide a basic understanding of such aspects. This summary is not an extensive overview of all contemplated aspects, and is intended to neither identify key or critical elements of all aspects nor delineate the scope of any or all aspects. Its sole purpose is to present some concepts of one or more aspects in a simplified form as a prelude to the more detailed description that is presented later.

[0005] In an aspect of the disclosure, a method for object detection network quantization is provided. The method may comprise: generating a calibration data set from a pre-trained object detection network, the calibration data set comprising a plurality of synthetic images and a plurality of labels corresponding to the synthetic images, a label corresponding to a synthetic image comprising at least a category of an object in the synthetic image and a bounding box of the object; and training a quantized object detection network from the pre-trained object detection network with the calibration data set.

[0006] In another aspect of the disclosure, an apparatus for object detection network quantization is provided. The apparatus may comprise a memory and at least one processor coupled to the memory. The at least one processor may be configured to generate a calibration data set from a pre-trained object detection network, the calibration data set comprising a plurality of synthetic images and a plurality of labels corresponding to the synthetic images, a label corresponding to a synthetic image comprising at least a category of an object in the synthetic image and a bounding box of the object; and train a quantized object detection network from the pre-trained object detection network with the calibration data set.

[0007] In another aspect of the disclosure, a computer readable medium storing computer program codes for object detection network quantization is provided. The computer program codes, when executed by a processor, may cause the processor to generate a calibration data set from a pre-trained object detection network, the calibration data set comprising a plurality of synthetic images and a plurality of labels corresponding to the synthetic images, a label corresponding to a synthetic image comprising at least a category of an object in the synthetic image and a bounding box of the object; and train a quantized object detection network from the pre-trained object detection network with the calibration data set.

[0008] In another aspect of the disclosure, a computer program product for object detection network quantization is provided. The computer program product may comprise processor executable computer program codes for generating a calibration data set from a pre-trained object detection network, the calibration data set comprising a plurality of synthetic images and a plurality of labels corresponding to the synthetic images, a label corresponding to a synthetic image comprising at least a category of an object in the synthetic image and a bounding box of the object; and training a quantized object detection network from the pre-trained object detection network with the calibration data set.

[0009] In another aspect of the disclosure, a method for object detection is provided. The method may comprise: receiving an image; and performing object detection on the image by a quantized object detection network trained by performing the method for object detection network quantization provided in the present disclosures.

[0010] In another aspect of the disclosure, an apparatus for object detection is provided. The apparatus may comprise a memory and at least one processor coupled to the memory. The at least one processor may be configured to receive an image; and perform object detection on the image by a quantized object detection network trained by performing the method for object detection network quantization provided in the present disclosures.

[0011] In another aspect of the disclosure, a computer readable medium storing computer program codes for object detection is provided. The computer program codes, when executed by a processor, may cause the processor to receive an image; and perform object detection on the image by a quantized object detection network trained by performing the method for object detection network quantization provided in the present disclosures.

[0012] In another aspect of the disclosure, a computer program product for object detection is provided. The computer program product may comprise processor executable computer program codes for receiving an image; and performing object detection on the image by a quantized object detection network trained by performing the method for object detection network quantization provided in the present disclosures.

[0013] Other aspects or variations of the disclosure will become apparent by consideration of the following detailed description and accompanying drawings.BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The following figures depict various embodiments of the present disclosure for purposes of illustration only. One skilled in the art will readily recognize from the following description that alternative embodiments of the methods and structures disclosed herein may be implemented without departing from the spirit and principles of the disclosure described herein.

[0015] FIG. 1 illustrates results of object detection on an image in accordance with one aspect of the present disclosure.

[0016] FIG. 2 illustrates an exemplary diagram of a first calibration data set generation stage of a framework for object detection network quantization in accordance with one  aspect of the present disclosure.

[0017] FIG. 3 illustrates an exemplary diagram of a second quantization aware training stage of a framework for object detection network quantization in accordance with one aspect of the present disclosure.

[0018] FIG. 4 illustrates a flow chart of a method for object detection network quantization in accordance with one aspect of the present disclosure.

[0019] FIG. 5 illustrates a flow chart of a method for object detection in accordance with one aspect of the present disclosure.

[0020] FIG. 6 illustrates a block diagram of an apparatus for object detection in accordance with one aspect of the present disclosure.DETAILED DESCRIPTION

[0021] Before any embodiments of the present disclosure are explained in detail, it is to be understood that the disclosure is not limited in its application to the details of construction and the arrangement of features set forth in the following description. The disclosure is capable of other embodiments and of being practiced or of being carried out in various ways.

[0022] Object detection is one common type of computer vision tasks, which deals with both identifying categories / classes of objects in an image and locating the objects in an image. The objects may be located by coordinates of a bounding box around the object. For example, as shown in the image 100 of Fig. 1, three sheep (sheep 110, sheep 120, and sheep 130) are detected and labeled with a category and a respective bounding box for each sheep. Although Fig. 1 shows only one category of object (i.e., sheep) , there may be more other categories of objects in an image.

[0023] The object detection may be performed by deep neural networks, such as, Fast\Faster\Mask R-CNN, or YOLO (You Only Look Once) network. For example, Faster R-CNN (Region-based Convolutional Neural Network) is a popular object detection model. Faster R-CNN detector consists of two stages. The first stage proposes candidate object bounding boxes through a RPN (Region Proposal Network) . The second stage extracts features using RoI (Region of Interest) Pooling from each candidate box and performs classification and bounding-box regression. Finally, bounding boxes around objects are obtained after the above two stages.

[0024] Since object detection is a more complex task involving both localization and classification, it poses unique challenges for ZSQ. On the one hand, existing ZSQ methods lack optimization for object detection network data generation, and thus it is  difficult to synthesize complex and varying objects similar to those present in real datasets. On the other hand, the fine-tuning strategy of the quantized detection network with synthetic calibration data has not been studied, which makes it hard to make full use of limited synthetic data efficiently.

[0025] To address these problems, a novel ZSQ framework for quantizing object detection networks is provided in this disclosure. First, a calibration data set may be synthesized from a pre-trained object detection network with a novel bounding box and category sampling method. A condensed synthetic calibration data set generated in accordance with one aspect of this disclosure, which may be merely 1 / 60 the size of original training data set, can yield comparable or even better results in Quantization Aware Training (QAT) . Then, a prediction-matching distillation and feature-level distillation may be integrated into the QAT process to enhance the effectiveness during quantization fine-tuning. This may provide better knowledge transfer and boost the training convergence speed about ×16 compared to the LSQ (Learned Step Size Quantization) training method with full real data.

[0026] With the above methods, ZSQ may provide us with attractive performance for object detection network quantization. Compared with the existing time and resource intensive QAT method based on the full training set, it is shown that a condensed synthetic calibration data set, such as merely 1 / 60 the size of the original training set, can yield comparable or even better results with the disclosed framework. Extensive experiments conducted on the MS-COCO and VOC datasets demonstrate the state-of-the-art performance of the disclosed method in low bit-width quantization. For instance, when quantizing YOLOv5-m to 5-bit, the mAP metric can be improved by 4.2%compared to LSQ trained with full real data.

[0027] The disclosed framework for object detection network quantization may consist of two stages: a first stage of calibration data set generation and a second stage of quantization aware training. During the first stage, inputs initialized with standard Gaussian distribution (such as, a noise image) are optimized through back-propagation of a pre-trained object detection network using a batch of fixed labels. Unlike image classification tasks where labels only contain information about object categories, labels in object detection tasks also include bounding box coordinates. Synthesized images with randomly generated labels would result in a significant performance decline in quantization. To enhance the quality of both synthesized labels and images, an innovative adaptive sampling approach that incorporates alternating label and image generation processes may be used, together with a label refinement mechanism. In the  second stage of QAT, a prediction-matching distillation and a feature-level distillation may be employed to transfer knowledge from the full precision pre-trained object detection network to a quantized object detection network.

[0028] FIG. 2 illustrates an exemplary diagram of a first calibration data set generation stage of a framework for object detection network quantization in accordance with one aspect of the present disclosure. A method for generating a calibration data set may be performed in the first stage. The method may generate a condensed calibration data set, with a size smaller than the size of a training set for the full precision pre-trained object detection network, to extract features of the data. For example, the MS-COCO data set may comprise 120k images, and the generated calibration data set may comprise 2k synthetic images.

[0029] Given a batch of N inputs x∈RN×3×H×W, where each pixel of an input image may be initialized from random Gaussian noise H and W refer to the height and width of the image, 3 is the number of channels of the image (such as, RGB or YUV) , i is the index of an image in the batch, and given a pre-trained object detection network φ (x) (such as, the pre-trained object detection network 200) , then the framework for calibration data set generation may be regarded as a regularized minimization problem and an optimization of the following loss function:

[0030] where the pre-trained object detection network 200 may comprises a plurality of neural network layers 210~215 and several detection heads 220, the prediction results of the pre-trained object detection network 200 may comprise a category 230 of an object detected in an input image, coordinates 240 of a bounding box of the object, and a confidence value 250 of the prediction,  is a regularization term that prevents the generated images from over-fitting to the pre-trained object detection network 200 and ensures alignment with the distribution of real label targets, and is a loss function between predictions of the pre-trained object detection network and the ground truth targets  (in the case that one object is detected in an image, N objects are detected in N images of a batch, and 6 values are used to label each object as detailed below) .  is the same as the one used to train the object detection network 200, consisting of three components: a box category loss 235, a box dimension loss  245, and a grid location loss  (such as, a confidence loss) 255. The target (i.e., the label of an image) Y may include the batch index (Y [: , 0] ) i, the category of the bounding box (Y [: , 1] ) k 230, and the coordinates of the bounding box  (Y [: , 2: 5] ) x, y, w, h 240, where x, y are used to locate the position of the bounding box, and w, h refer to the width and height of the bounding box, so that the coordinates of each point of the bounding box can be calculated with x, y, w, h. The output of the pre-trained object detection network 200 may also comprise a confidence value 250 for each prediction result.

[0031] In the above equation (1) , the second term may be used to improve image quality, consisting of two parts as shown in the following equation (2) : a prior term  used to steer images away from unrealistic images (such as, the images generated by DeepDream) , and a batch normalization (BN) regularization term that regularizes feature map distributions (such as, DeepInversion) , αBN may be a hyper-parameter to balance the two terms:

[0032] where penalizes the total variance and l2 norm of the input image x, αTV and may be hyper-parameters to balance the two terms:

[0033] Total variation term promotes similarity between adjacent pixels by minimizing their Frobenius norm, such as, xi, c, h+1, w represents a pixel on top of the pixel xi, c, h, wand xi, c, h, w+1 represents a pixel on right of the pixel xi, c, h, win the image x, consequently enhancing the smoothness of the synthetic image:

[0034] takes advantage of the running mean μl and running variance cached in the BN layers of the pre-trained object detection network. It enforces feature similarities at all levels by minimizing the distance between the feature map statistics for the synthesized image x and the real image With L being the number of BN layers:

[0035] In one embodiment, {αdetect , αBN, αTV,  } may be set to {0.5, 0.01, 0, 0.0005} .

[0036] In order to generate a calibration data set based on the loss function of equation (1) , a set of ground truth label targets Y is needed. Accordingly, an adaptive label sampling method 260 to sample bounding box coordinates and categories needed for generating the calibration set is provided in this disclosure. The disclosed adaptive sampling strategy only requires a pre-trained network and does not rely on additional information (e.g. meta-data, feature activation) or additional networks (e.g. pre-trained generative networks) . A calibration data set generation method based on the adaptive sampling strategy may comprise two sub-stages, and integrate soft labels into the data recovery process, making synthetic data and labels more aligned.

[0037] The first sub-stage is responsible for generating labels through a relabeling process. The relabeling process may start from sampling one object for each image x∈R3×H×W of the N images in the batch, where K refers to the number of categories of objects in the label space. In one embodiment, a distribution of objects in each image may be as shown in the following table 1, where both the relative width and the height of an image are assumed as 1, the minimal width W_min and minima height H_min of the bounding box of an object may be set to 0.2, the maximal width W_max and maximal height H_max of the bounding box of the object may be set to 0.2, W and H here refer to the width and height of a sampled bounding box, U denotes an uniform distribution, and K represents the number of categories.

[0038] Table 1

[0039] In the embodiment as shown by table 1, the x and y coordinates refer to the central point of the bounding box, and thus the scope of x and y in an image with a relative width 1 and a relative height 1 may be (W / 2, 1-W / 2) and (H / 2, 1-H / 2) with W and H representing the width and height of the bounding box, in order to make sure the bounding box is within the image. In another embodiment, the x and y coordinates may refer to the left top corner point of the bounding box, and the scope of x and y in the image may be (0, 1-W) and (0, 1-H) accordingly.

[0040] After randomly sampling a label for each image in the batch based on the sampling distribution such as shown in table 1, the input images initialized with e.g.  random Gaussian noise may be optimized toward the sampled label targets using equation (1) . The optimization process may comprise calculating a loss between the prediction of the pre-trained object detection network on the input images and the sampled label targets according to equation (1) , and optimizing the input images to minimize the loss. Such an optimization process may be performed during multiple iterations, and then a relabeling process may be performed. For example, the relabeling process may be performed after every 100 iterations of the optimization process. In another example, the relabeling process may be performed after different times of iterations of the optimization process. In one embodiment, the same pre-trained object detection network 200 may be used in the relabeling process to relabel a synthetic image generated through the optimization process. In another embodiment, another pre-trained object network may be used in the relabeling process.

[0041] In the relabeling process, labels with high confidence in the label space of the pre-trained object detection network’s dataset may be aggregated, and labels with low confidence may be removed, to form relabeled targets, ensuring at least one label in each image. The pseudo codes for a relabeling process in accordance with one embodiment of the disclosure are provided below.

[0042] The input existing image and labels may comprise current existing label targets (which may be initially sampled label targets or relabeled targets generated in a previous relabeling process) and an image optimized in previous multiple iterations. The pre-trained object detection network used in the relabeling process may also be called as a teacher network, and may be the same as the pre-trained object detection network used in the optimization process of above equation (1) . The pre-trained object detection network may perform an object detection on an input image, and the prediction results with confidence values greater than a threshold may be identified as new targets, as shown in line 1 of the pseudo codes.

[0043] In line 2, IoU metric reflecting the similarity between the current label targets and the predicted new targets may be calculated. For example, the IoU may reflect the  scale of overlapping between the existing bounding box in the current label targets and the predicted bounding box in the predicted new targets. If the IoU is below a threshold, the predicted bounding box may be regarded as not overlapping the existing bounding box. In line 3, the labels in the predicted new targets that do not overlap with the existing targets may be identified as add targets. In lines 4-5, the labels in the existing targets that are not in the predicted new targets, such as an object with a particular category, may be removed from the existing targets. Then, in line 6, the remained existing targets may be combined together to generate the relabeled targets.

[0044] In the second sub-stage of synthetic, the generated labels may be fixed and the input image may be optimized towards the label targets using equation (1) . The main difference from the calibration set generation process is that the labels used in the second sub-stage are obtained through relabeling samples, rather than real labels. The main difference of the optimization in the second sub-stage from the optimization in the first sub-stage is that, in the second sub-stage the target labels are fixed, while in the first sub-stage the targets will be relabeled every multiple iterations.

[0045] As compared to merging the updates of labels and images into a single stage, the two sub-stage adaptive sampling method, comprising conducting a rapid sampling of labels and relabeling at a low resolution (such as, 160) and then using the fixed labels to generate images at a high resolution (such as, 640) can improve the quality of the generated images.

[0046] With this sampling strategy, the access to real detection labels can be eliminated. The disclosed approach can generate bounding box categories that closely match the real distribution, and also objects of varying scales, and counts to facilitate downstream tasks in a data-free scenario, e.g. quantization-aware training performed in the next stage.

[0047] FIG. 3 illustrates an exemplary diagram of a second quantization aware training stage of a framework for object detection network quantization in accordance with one aspect of the present disclosure. The pre-trained object detection network 310 may be the teacher network, and may comprise a plurality of neural network layers 312~314 (also called as distilling layers) and several detection heads 316. The prediction results 320 of the pre-trained object detection network 310 may comprise a category (K) 322 of an object detected in an input image, coordinates (x, y, w, h) 324 of a bounding box of the object, and a confidence value (range from 0~1) 326 of the prediction results. The coordinates of the bounding box may represent position, shape and size of the bounding box. Generally, a bounding box is in a shape of rectangle, and thus all  coordinates of the outline of the bounding box can be determined based on the 4 values of x, y representing a central or left-top point of the bounding box and w, h representing width and height of the bounding box. Similarly, the quantized object detection network 350 may be the student network to be trained, and may comprise a plurality of neural network layers 352~354 (also called as distilling layers) and several detection heads 356. The prediction results 360 of the quantized network 350 may comprise a category (K) 362 of an object detected in an input image, coordinates (x, y, w, h) 364 of a bounding box of the object, and a confidence value (range from 0~1) 366 of the prediction results. The difference is that the parameters of the teacher network 310 are fixed, while the parameters of the student network 350 will be trained and quantized.

[0048] In the QAT stage, the quantizer settings may follow the existing LSQ method (see Learned step size quantization, arXiv preprint arXiv: 1902.08153, 2019) . We may adopt per-tensor symmetric quantization on both weights and activations. Given a floating-point tensor wfp, step size s and quantization bit width b, the quantized representation of the data can be defined as:

[0049] Here, wint denotes the quantized integer representation of the data,  rounds the input to its nearest integer. We may conduct quantization on a 32-bit floating-point full-precision pre-trained object detection network (such as, YOLO, Mask R-CNN, etc. ) . During optimization fine-tuning, we may follow LSQ method to update the weight parameters and step size.

[0050] In the QAT stage, the knowledge discrepancy between full-precision pre-trained network 310 (teacher) and quantized network 350 (student) can be reduced through knowledge distillation. Knowledge distillation is a commonly used method for knowledge transfer. Some existing methods applied knowledge distillation to classification tasks with quantized CNNs and LLMs for better performance, rather than the more complicated object detection tasks. The backbone and prediction head of a full-precision pre-trained object detection network contains much of the statistical information from real training data, which cannot be fully explored by object detection loss. Therefore, this disclosure proposes using feature-level distillation to match intermediate features and prediction-matching distillation to align the predictions of the quantized network and pre-trained network.

[0051] As described above in the stage of calibration data set generation, the generated  synthetic calibration set 300, denoted by is the result of the network back propagating through pre-defined labels. Directly aligning predictions of the quantized network with the targets may lead to over-fitting issues. Therefore, in the QAT stage, Kullback-Leibler (KL) divergence loss between the predictions 360 of quantized network 350 and the predictions 320 of full-precision network 310 as soft labels and object detection loss between the predictions 360 of quantized network and targets as hard labels may be used for training the quantized network, to recover the performance of the quantized network, which is represented as:

[0052] where is a batch of the calibration set images, N is the number of images in the batch,  are output predictions from full-precision / quantized network, θ / θ′ are parameters of full-precision / quantized network, τ is the distilling temperature, φ′ is the quantized network, βKL and βdetect are hyper-parameters to balance the two terms.

[0053] The knowledge transfer manner may also be extended to the feature level. A feature level distillation method to match intermediate features from teacher and student explicitly is provided. The benefits are two-fold. On the one hand, it accelerates the network convergence. Typical LSQ methods train the network’s weight parameters and quantization step size with a whole set of real images. In contrast, through finer knowledge transfer, the disclosed method enable the quantized student to train on a synthetic calibration set of merely 1 / 60 of the original size and boost the convergence speed by about 16×. On the other hand, QAT training at ultra-low bit width always leads to rapid error accumulation. Feature distillation ensures the similarity of features extracted by the teacher and student, thereby minimizing error accumulation during the training process.

[0054] For example, given a batch of synthetic images the feature level distillation method may impose mean squared error constraints between the feature maps from each layer (312~314) of teacher network 310 and each layer (352~354) of student network 350. With L being the number of distilling network layers of the teacher and student, the feature distillation loss can be expressed as:

[0055] where are the feature maps from layer l of the full-precision / quantized network, and θ / θ′ are parameters of the full-precision / quantized network.

[0056] To this end, the total loss for quantization-aware training can be summarized as:

[0057] where βfeat is a hyper-parameter to balance the two terms of and In one embodiment, {βdetect , βKL, βfeat } may be set to {0.04, 0.1, 1} .

[0058] FIG. 4 illustrates a flow chart of a method 400 for object detection network quantization in accordance with one aspect of the present disclosure. The method 400 may be performed by an apparatus for training a quantized object detection network. The apparatus may comprise at least one processor and a memory coupled to the at least on processor.

[0059] Generally, the method 400 for object detection network quantization may comprise two steps respectively corresponding to the first stage of calibration data set generation described above in connection with Fig. 2 and the second stage of quantization aware training described above in connection with Fig. 3.

[0060] As shown in Fig. 4, in block 410, the method 400 may generate a calibration data set from a pre-trained object detection network. The calibration data set comprises a plurality of synthetic images and a plurality of labels corresponding to the synthetic images. Each of the synthetic image may comprise multiple channels, such as, 3 channels of RGB or 3 channels of YUV. The label corresponding to a synthetic image may comprise at least a category of an object in the synthetic image and a bounding box of the object. The bounding box may be represented by its coordinates of outlines consisting of 4 values x, y, w, h, where x, y are used to locate the position of the bounding box, and w, h refer to the width and height of the bounding box. The label corresponding to a synthetic image may further comprise an index of the synthetic image in a batch of data for training a quantized object detection network.

[0061] The pre-trained object detection network is a full precision network, such as 32bit float point network. The pre-trained object detection network may be YOLO, or Mask R-CNN. The pre-trained object detection network may comprise a plurality of layer, including one or more batch normalization layers.

[0062] The calibration data set may be generated from a pre-trained object detection network based on a loss function between the predictions of the pre-trained object detection network on an input image and the corresponding labels. The loss function  may further comprise a first regularization term for steering the synthetic image away from unrealistic images and a second batch normalization regularization term for regularizing feature map distributions. For example, the loss function for generating the calibration data set may be expressed as equation (1) . The first regularization term may penalize the total variance and l2 norm of the input image. The second batch normalization regularization term may enforce feature similarities at all levels by minimizing the distance between the feature map statistics for the synthesized image and the real image.

[0063] Although not shown in Fig. 4, the block 410 of generating a calibration data set from a pre-trained object detection network may further comprise a first sub block corresponding to the first sub-stage of relabeling and a second sub block corresponding to the second sub-stage of synthetic as described above in connection with Fig. 2.

[0064] In the first sub block, the method 400 may first sample an object label for each synthetic image as a label target under a uniform distribution of a category of an object and coordinates of a bounding box of the object. For example, the distribution of label samples may be as shown in Table 1. Next, the method 400 may optimize a synthetic image by minimizing a loss function between a predicted label from the pre-trained object detection network and the label target; and generate the label corresponding to the synthetic image by relabeling the synthetic image after every multiple iterations of the optimizing. In one embodiment, the loss function may be expressed by equation (1) . The label target may be initially sampled label target or relabeled target generated in a previous relabeling step. The optimizing step may be performed in multiple iterations, the relabeling step may be performed every multiple (such as, 100) iterations of the optimizing step. Both the optimizing iterations and the relabeling may be performed for a pre-determined times to generate the final labels corresponding the synthetic images in the calibration data set.

[0065] In one embodiment, the relabeling step may comprise adding a label predicted from the pre-trained object detection network with a confidence higher than a threshold and not overlapping with an existing label in the label target to the label target; and removing an existing label in the label target not detected by the pre-trained object detection network from the label target. For example, the adding and removing operations may be based on calculated IoU metrics between the predicted labels and the current labels previously relabeled.

[0066] In the second sub block, the method 400 may optimize the synthetic image by minimizing a loss function between a predicted label from the pre-trained object  detection network and the generated label. In this process, the generated label may be the labels finally generated in the first sub block, and may be fixed. In one embodiment, the loss function may be expressed by equation (1) . The calibration data set generated in block 410 may comprise the synthetic images optimized in the second sub block and the corresponding labels generated in the first sub block.

[0067] In block 420, the method 400 may train a quantized object detection network from the pre-trained object detection network with the calibration data set generated in block 410. The training may be quantization aware training. The quantizer settings may follow the existing LSQ method.

[0068] In one embodiment, the quantized object detection network may be trained based on a first loss function comprising a loss between predictions of the pre-trained object detection network and the quantized object detection network and an object detection loss between predictions of the quantized object detection network and corresponding labels. For example, the first loss function may be expressed by equation (8) .

[0069] In another embodiment, the quantized object detection network may be trained based on a second loss function comprising a feature distillation loss between intermediate feature maps from the pre-trained object detection network and the quantized object detection network. For example, the second loss function may be expressed by equation (9) . In another embodiment, the quantized object detection network may be trained based on a combination of the first loss function and the second loss function, as shown by equation (10) .

[0070] FIG. 5 illustrates a flow chart of a method 500 for object detection in accordance with one aspect of the present disclosure. The method 600 may be performed by an intelligent apparatus comprising at least on processor and a memory coupled to the at least on processor. The intelligent apparatus may be used for detecting objects in a capture image. The intelligent apparatus may be a smart robot or an automatic drive car.

[0071] In block 510, the method 500 may receive an image. The image may be captured by a camera mounted on such as a smart robot or an automatic drive car. The received image may comprise multiple channels, such as, 3 channels of RGB or 3 channels of YUV. In block 520, the method 500 may perform object detection on the image by a quantized object detection network. The quantized object detection network may be trained through the method 400 for object detection network quantization described above in connection with Fig. 4. The quantized object detection network trained in accordance with the disclosed method can provide better performance on object  detection.

[0072] FIG. 6 illustrates a block diagram of an apparatus 600 for object detection in accordance with one aspect of the present disclosure. In one embodiment, the apparatus 600 may be an intelligent device, such as, a smart robot or an automatic drive car, or a central control unit therein. The apparatus 600 may comprise a memory 610 and at least one processor 620. The processor 620 may be coupled to the memory 610 and configured to perform the method 500 described above with reference to Fig. 5. The processor 620 may be a general-purpose processor, a graphic processor, a neural processor, or may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration. The memory 610 may store the input data (such as, images) , output data, data generated by processor 620, and / or instructions executed by processor 620. In another embodiment, the apparatus 600 may be used for object detection network quantization, and the processor 620 may be configured to perform the method 400 in order to train a quantized network for performing object detection.

[0073] The various operations, modules, and networks described in connection with the disclosure herein may be implemented in hardware, software executed by a processor, firmware, or any combination thereof. According an embodiment of the disclosure, a computer program product for object detection network quantization and / or object detection may comprise processor executable computer program codes for performing the method 400 and / or 500 described above with reference to Figs. 4-5. According to another embodiment of the disclosure, a computer readable medium may store computer program codes for object detection network quantization and / or object detection. The computer program codes when executed by a processor may cause the processor to perform the method 400 and / or 500 described above with reference to Figs. 4-5. The computer readable media includes both non-transitory computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. Any connection may be properly termed as a computer-readable medium. Other embodiments and implementations are within the scope of the disclosure.

[0074] The preceding description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the various embodiments. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without  departing from the scope of the various embodiments. Thus, the claims are not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the following claims and the principles and novel features disclosed herein.

Claims

1.A method for object detection network quantization, comprising:generating a calibration data set from a pre-trained object detection network, the calibration data set comprises a plurality of synthetic images and a plurality of labels corresponding to the synthetic images, a label corresponding to a synthetic image comprises at least a category of an object in the synthetic image and a bounding box of the object; andtraining a quantized object detection network from the pre-trained object detection network with the calibration data set.2.The method of claim 1, wherein the pre-trained object detection network comprises a batch normalization layer, andwherein the generating a calibration data set from a pre-trained object detection network is based on a loss function comprising a first regularization term for steering the synthetic image away from unrealistic images and a second batch normalization regularization term for regularizing feature map distributions.3.The method of claim 1, wherein the generating a calibration data set from a pre-trained object detection network comprises:sampling an object label for each synthetic image, under an uniform distribution of a category of an object and coordinates of a bounding box of the object, as a label target.4.The method of claim 3, wherein the generating a calibration data set from a pre-trained object detection network comprises:optimizing a synthetic image by minimizing a loss function between a predicted label from the pre-trained object detection network and the label target; andgenerating the label corresponding to the synthetic image by relabeling the synthetic image after every multiple iterations of the optimizing.5.The method of claim 4, wherein the relabeling the synthetic image comprises:adding a label predicted from the pre-trained object detection network with a confidence higher than a threshold and not overlapping with an existing label in the label target to the label target; andremoving an existing label in the label target not detected by the pre-trained object detection network from the label target.6.The method of claim 4, wherein the generating a calibration data set from a pre-trained object detection network comprises:optimizing the synthetic image by minimizing a loss function between a predicted label from the pre-trained object detection network and the generated label.7.The method of claim 1, wherein the training a quantized object detection network is based on a loss function comprising a loss between predictions of the pre-trained object detection network and the quantized object detection network and an object detection loss between predictions of the quantized object detection network and corresponding labels comprised in the calibration data set.8.The method of claim 1, wherein the training a quantized object detection network is based on a loss function comprising a feature distillation loss between intermediate feature maps from the pre-trained object detection network and the quantized object detection network.9.An apparatus for object detection network quantization, comprising:a memory; andat least one processor coupled to the memory and configured to perform the method of one of claims 1-8.10.A computer program product for object detection network quantization, comprising: processor executable computer program codes for performing the method of one of claims 1-8.11.A method for object detection, comprising:receiving an image; andperforming object detection on the image by a quantized object detection network trained by performing the method of one of claims 1-8.12.An apparatus for object detection, comprising:a memory; andat least one processor coupled to the memory and configured to perform the method of claim 11.13.A computer program product for object detection, comprising: processor executable computer program codes for performing the method of claim 11.

Citation Information

Patent Citations

  • Detection method and device, equipment, storage medium and program product

    CN112749978A

  • Target detection method and device, electronic equipment and storage medium

    CN117523313A

  • Sensor-based object-detection optimization for autonomous vehicles

    US20170123428A1

  • Method to improve accuracy of quantized multi-stage object detection network

    US20220147753A1