Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Introduction to Target Detection Series 2: RCNN training course

Shulou Source: shulou.com Published: 2022-06-02 23:00:21 09月27日 Update

> > when downloading the e-book here immediately = 0.5, it is considered to be a positive sample, and the rest are negative samples.

At this point, the second step of R-CNN feature extractor can start training, but in the training process, it should be noted that negative samples need to be sampled, because too few positive samples in the training data will lead to extreme imbalance between positive and negative samples. Finally, the feature extractor of a convolution neural network is obtained in this step, and its feature is a 4096-dimensional feature vector.

(3) training the final classifier

Here a separate SVM classifier is trained for each category. There is a trick in this. The training of SVM also needs to select positive and negative samples. The proposer of R-CNN did an experiment to select the optimal IOU threshold, and finally only chose the true rectangle as the positive sample.

Note: the selection of positive and negative samples is more fastidious. Fast R-CNN and Faster R-CNN select positive and negative samples according to the size of IOU. Section 2.2.3 is described in detail.

(4) A regression model is trained for each class to fine-tune the deviation between the position and size of the ROI and the real rectangle, as shown in figure 2-6.

Here is a piece of code that will be used to detect all problems: the calculation of IOU.

Def bboxIOU (bboxA, bboxB):

A_xmin = bboxA [0]

A_ymin = bboxA [1]

A_xmax = bboxA [2]

A_ymax = bboxA [3]

A_width = A_xmax-A_xmin

A_height = A_ymax-A_ymin

B_xmin = bboxB [0]

B_ymin = bboxB [1]

B_xmax = bboxB [2]

B_ymax = bboxB [3]

B_width = B_xmax-B_xmin

B_height = B_ymax-B_ymin

Xmin = min (A_xmin, B_xmin)

Ymin = min (A_ymin, B_ymin)

Xmax = max (A_xmax, B_xmax)

Ymax = max (A_ymax, B_ymax)

A_width_and = (A_width + B_width)-(xmax-xmin) # wide intersection

A_height_and = (A_height + B_height)-(ymax-ymin) # High intersection

If (A_width_and

Tags: Training feature method rectangle sample target picture process adjustment category network classification detection two size position vector size plus or minus potential Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Huawei OPPO Reno Microsoft Xiaomi