GRABBING DETECTION METHOD BASED ON RP-RESNET

20230186056 · 2023-06-15

    Inventors

    Cpc classification

    International classification

    Abstract

    The present invention relates to a grabbing detection method based on an RP-ResNet, which method belongs to the field of computer vision, and in particular relates to recognition and positioning of a grabbing point of a mechanical arm. The method comprises: inputting a target object image; pre-processing data; performing data processing by means of an RP-ResNet model; and finally, generating a grabbing block diagram of a grabbing target. On the basis of a model ResNet 50, a region proposal network is used in the 30th layer of a network, fuzzy positioning is performed on the position of a grabbing point, feature information of high and low layers is fully fused to strengthen the utilization of information of low layers, and an SENet structure is added to the 40th layer of the network, thereby further increasing the detection accuracy of a grabbing point. By means of a grabbing detection framework based on ResNet-50, a residual network, a region proposal idea and SENet are combined, such that it is ensured that rapid target detection is realized, and the accuracy rate of target detection is further improved.

    Claims

    1. A grabbing detection method based on a region proposal-residual network (RP-ResNet), comprising: processing and fusing ResNet-50 data in stages, and using a region proposal network (RPN) and taking advantage of the characteristic that a neural network has weak semantic information and clear target positions in lower layers, and strong semantic information and fuzzy target positions in high layers to make a grabbing proposal more accurate; and by a channel attention squeeze-and-excitation network (SENet) structure, further improving and establishing interdependence between feature channels, enhancing features positive to a grabbing detection task, and suppressing less useful features, so as to further improve detection accuracy.

    2. The grabbing detection method based on the RP-ResNet according to claim 1, wherein in a first stage, an input of the RPN is a convolution feature map, a convolution response image is segmented into regions of interest (ROI) according to a result of the RPN, the regions of interest in a part of channels are divided into k×k grids, each grid is averagely pooled, and then all channels are averagely pooled; for an ROI with a size of w×h, the size of each region is W/h×W/h, a last convolution layer generates k.sup.2 fraction maps for each class, and for an (i, j)th sub-region (0≤i, j≤k−1) of the ROI: r C ( i , j .Math. "\[LeftBracketingBar]" Θ ) = .Math. ( x , y ) 1 n z i , j , C ( x + x 0 , y + y o .Math. "\[LeftBracketingBar]" Θ ) ( 1 ) wherein r.sub.c(i, j|Θ) is a pooling response of an (i, j)th bin of a c class; z.sub.i,j,c is an output in k.sup.2(C+1) fraction maps; (x.sub.0, y.sub.0) is a left top coordinate of the ROI; n is a total number of pixels in the bin; and Θ is a network parameter; and in a second stage, a SENet module enhances attention of a key channel in the grabbing detection task to improve the detection accuracy: z c = F s q ( u c ) = 1 W × H .Math. i = 1 W .Math. j = 1 H u c ( i , j ) ( 2 ) s = F e x ( z , W ) = σ ( W 2 δ ( W 1 , z ) ) ( 3 ) x ~ c = F scale ( u c , s c ) = s c u c ( 4 ) wherein F.sub.sq(u.sub.c) represents compression of a feature map, W×H represents a size of a two-dimensional feature map, F.sub.ex( ) represents feature extraction of the feature map, Z represents a compressed feature vector transformed from the input two-dimensional feature map, W.sub.1 and W.sub.2 are weights of a full connection layer, σ is a sigmoid activation function, and {tilde over (x)}.sub.c is a final output and is used as an input of a next stage.

    3. The grabbing detection method based on the RP-ResNet according to claim 1, comprising: step 1: acquiring an image of a target; step 2: adjusting a size of pixels of the acquired image of the target to 277*277, inputting the adjusted image of the target into an PR-ResNet-50, and performing image processing in sequence from a 1st layer to a 30th layer of the PR-ResNet-50; step 3: inputting a feature map output from the 30th layer of the PR-ResNet-50 into the region proposal network to obtain an image processed by the region proposal network; step 4: performing ROI pooling on the feature map output from the 30th layer of the PR-ResNet-50 and the image processed by the region proposal network; step 5: inputting an image obtained by the ROI pooling into the PR-ResNet-50, and sequentially performing image processing from a 31st layer to a 40th layer of the PR-ResNet-50; step 6: inputting a feature map output from the 40th layer of the PR-ResNet-50 into a ResNet module for squeeze, excitation and feature recalibration to obtain a feature map output by the ResNet module; and step 7: inputting the feature map output from the 40th layer of the PR-ResNet-50 and the feature map output by the ResNet module into the PR-ResNet-50, and performing image processing from a 41st layer to a 50th layer of the PR-ResNet-50 to obtain an image containing grabbing points of the target.

    4. The grabbing detection method based on the RP-ResNet according to claim 3, wherein inputting the feature map output from the 30th layer of the PR-ResNet-50 into the region proposal network to obtain the image processed by the region proposal network, comprises: scanning the entire feature map using a k×k sliding window; and using a convolution kernel with a size of 1×1 to perform a convolution operation on the entire feature map to obtain a fraction map of a 2 k-class channel and a fraction map of a 4 k-bounding-box channel.

    5. The grabbing detection method based on the RP-ResNet according to claim 3, wherein performing ROI pooling on the feature map output from the 30th layer of the PR-ResNet-50 and the image processed by the region proposal network comprises: segmenting a convolution response image into regions of interest (ROI) according to the image processed by the RPN, dividing the regions of interest in a part of channels into k×k grids, averagely pooling each grid, and then averagely pooling all channels; wherein for an ROI with a size of w×h, the size of each region is W/h×W/h, a last convolution layer generates k.sup.2 fraction maps for each class, and the pooling response of an (i, j)th sub-region (0≤i, j≤k−1) of the ROI for a C class is shown in Equation 1: r C ( i , j .Math. "\[LeftBracketingBar]" Θ ) = .Math. ( x , y ) 1 n z i , j , C ( x + x 0 , y + y o .Math. "\[LeftBracketingBar]" Θ ) wherein r.sub.C(i, j|Θ) is a pooling response of an (i, j)th bin of the C class; z.sub.i,j,C is an output in k.sup.2(C+1) fraction maps; (x.sub.0, y.sub.0) is a left top coordinate of the ROI; n is a total number of pixels in the bin; and Θ is a network parameter.

    6. The grabbing detection method based on the RP-ResNet according to claim 3, wherein inputting the feature map output from the 40th layer of the PR-ResNet-50 into the ResNet module for the squeeze, excitation and feature recalibration to obtain the feature map output by the ResNet module comprises: compressing each feature map by global average pooling, and converting a C-class feature map into a 1×1×C real number sequence, such that each real number has a global reception; performing dimensionality reduction and dimensionality raising on the feature map compressed by two convolution layers, wherein a first convolution layer reduces an original feature dimension to C/r of the original feature dimension and then increases nonlinearity by a Relu activation function; and a second convolution layer restores the original feature dimension, and a normalized weight is obtained by a Sigmoid activation function; and weighting the feature map obtained by the dimensionality reduction and dimensionality raising to an original feature channel by multiplication channel by channel to recalibrate an original feature map.

    7. The grabbing detection method based on the RP-ResNet according to claim 6, wherein equations for the squeeze, excitation and feature recalibration are: z c = F s q ( u c ) = 1 W × H .Math. i = 1 W .Math. j = 1 H u c ( i , j ) s = F e x ( z , W ) = σ ( W 2 δ ( W 1 , z ) ) x ~ c = F scale ( u c , s c ) = s c u c wherein F.sub.sq(u.sub.c) represents compression of a feature map, W×H represents a size of a two-dimensional feature map, F.sub.ex( ) represents feature extraction of the feature map, Z represents a compressed feature vector transformed from the input two-dimensional feature map, W.sub.1 and W.sub.2 are weights of a full connection layer, σ is the Sigmoid activation function, {tilde over (x)}.sub.c is a final output, and is used as an input for a next stage; δ is the Relu activation function, u.sub.c is an input feature map of a C dimension; s.sub.c is the feature map after the squeeze and excitation; and F.sub.scale is a weight normalized by recalibration operation.

    Description

    BRIEF DESCRIPTION OF THE DRAWINGS

    [0014] To describe the technical solutions in the embodiments of the present disclosure or in the prior art more clearly, the accompanying drawings required for the embodiments are briefly described below. Apparently, the accompanying drawings in the following description show merely some embodiments of the present disclosure, and persons of ordinary skill in the art may still derive other accompanying drawings from these accompanying drawings without creative efforts.

    [0015] FIG. 1 is a basic schematic diagram of an RP-ResNet according to an embodiment of the present disclosure.

    [0016] FIG. 2 is a schematic diagram of a region proposal network according to an embodiment of the present disclosure.

    [0017] FIG. 3 is a schematic diagram of an SENet enhancement module according to an embodiment of the present disclosure.

    DETAILED DESCRIPTION OF THE EMBODIMENTS

    [0018] The technical solutions of the embodiments of the present disclosure are clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are merely a part rather than all of the embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present disclosure.

    [0019] The objective of the present disclosure is to provide a grabbing detection method based on a region proposal-residual network (RP-ResNet), which has the characteristic of fully fusing information of high and low layers of a deep neural network, and further significantly improves data processing speed and detection accuracy.

    [0020] To make the above objectives, features, and advantages of the present disclosure clearer and more comprehensible, the present disclosure will be further described in detail below with reference to the accompanying drawings and the specific implementations.

    [0021] A basic schematic diagram of the grabbing detection method based on an RP-ResNet of the present embodiment is shown in FIG. 1, and the method specifically includes:

    [0022] 1, first, acquiring depth information and color image information of a target by a Kinect depth camera; and

    [0023] 2, adjusting a size of pixels of the acquired image of the target to 277*277 as an input of a network model, and inputting the processed image into a PR-ResNet to extract image features.

    [0024] The 30th layer of the ResNet is input into a regional proposal network (RPN), a binary label is assigned to each generated box as proposed by Ren S Q et al., and whether a box is a target is determined using the label. One of the following two situations has a positive mark:

    [0025] 1) A specific frame or a frame having the highest intersection and union ratio with an actual frame.

    [0026] 2) A target frame has an intersection and union exceeding 70% of the actual frame. A true frame mark with the combination ratio less than 0.3 is a negative label. A multi-task loss function is used to minimize an objective function. The objective function is organized as follows:

    [00003] L ( { p i } , { t i } ) = 1 N cls .Math. i L cls ( p i , p i * ) + λ 1 N reg .Math. i L reg ( t i , t i * )

    [0027] where i represents an index of a small batch of samples, p.sub.i represents a target probability of the index i of the small batch of samples; when a true label p.sub.i* is 0, it means a negative label; t.sub.i represents a parameter change of a prediction boundary; t.sub.i* represents a coordinate vector of a true frame corresponding to the index i of a small batch of positive-labelled samples; L.sub.cls and L.sub.reg respectively represent loss and regression loss, N.sub.cis and N.sub.reg represent normalization parameters; and λ represents a balance weight.

    [0028] The present disclosure uses a k×k sliding window (3×3 in the RP-ResNet) to scan the entire feature map, as shown in FIG. 2, and then uses a convolution kernel with a size of 1×1 to perform a convolution operation to obtain a fraction map of a 2 k (class) channel and a fraction map of a 4 k (bounding box) channel. In the experiment, a small window predicts a position of a window containing a target to make region proposal more accurate.

    [0029] A convolution response image is segmented into regions of interest (ROI) according to a result of the RPN. The regions of interest in some channels (in each channel of a relative spatial position of each class) are divided into k×k grids, each grid is averagely pooled, and then all channels are averagely pooled. For an ROI with a size of w×h, the size of each region is W/h×W/h, a last convolution layer generates k.sup.2 fraction maps for each class, and a pooling response of an (i, j)th sub-region (0≤i, j≤k−1) of the ROI for a C class is shown in Equation 1:

    [00004] r C ( i , j .Math. "\[LeftBracketingBar]" Θ ) = .Math. ( x , y ) 1 n z i , j , C ( x + x 0 , y + y o .Math. "\[LeftBracketingBar]" Θ ) ( 1 )

    [0030] where r.sub.c(i, j|Θ) is a pooling response of an (i, j)th bin of the c class; z.sub.i,j,c is an output in k.sup.2(C+1) fraction maps; (x.sub.0, y.sub.0) is a left top coordinate of the ROI; n is the total number of pixels in the bin; and Θ is a network parameter.

    [0031] All the grabbing solutions in the ROI are stacked up, and then delivered to a full connection layer and to a residual network at the next stage.

    [0032] The SENet is shown in FIG. 3, and the 40th layer of the ResNet is added to SENet, to perform squeeze, excitation, and feature recalibration to complete adaptive calibration of the feature channel. First, each feature map is compressed by global average pooling, and a C-class feature map is converted into a 1×1×C real number sequence, so that each real number has a global reception. Then two convolution layers are used to complete dimensionality reduction and dimensionality raising, where a first convolution layer reduces an original feature dimension to C/r of the original feature dimension and then increases the nonlinearity by a Relu activation function; and a second convolution layer restores the original feature dimension, then the normalized weight is obtained by a Sigmoid activation function. And finally an original feature channel is weighted by multiplication channel by channel to recalibrate the original feature. Squeeze, excitation, and feature recalibration are shown in equations 2-4.

    [00005] z c = F s q ( u c ) = 1 W × H .Math. i = 1 W .Math. j = 1 H u c ( i , j ) ( 2 ) s = F e x ( z , W ) = σ ( W 2 δ ( W 1 , z ) ) ( 3 ) x ~ c = F scale ( u c , s c ) = s c u c ( 4 )

    [0033] where F.sub.sq(u.sub.c) represents compression of a feature map, W×H represents a size of a two-dimensional feature map, F.sub.ex( ) represents feature extraction of the feature map, Z represents a compressed feature vector transformed from the input two-dimensional feature map, W.sub.1 and W.sub.2 are weights of the full connection layer, σ is a sigmoid activation function, and {tilde over (x)}.sub.c is a final output and is used as an input of a next stage.

    [0034] Finally, the RP-ResNet outputs information of the grabbing points of the target.

    [0035] The present disclosure uses the characteristic that a deep neural network has characteristics of weak semantic information and clear target positions in lower layers, and strong semantic information and fuzzy target positions in higher layers; the 30th layer of the ResNet is input into a regional proposal network (RPN), a network model is shown in FIG. 2, a k×k sliding window (3×3 in the RP-ResNet) is used to scan the entire feature map, and then a convolution kernel with a size of 1×1 is used to perform a convolution operation to obtain a fraction map of a 2 k (class) channel and a fraction map of a 4 k (bounding box) channel. In the experiment, a small window predicts the position of a window containing a target to make region proposal more accurate.

    [0036] Furthermore, by a channel attention SENet structure, feature channel adaptive calibration is completed by means of squeeze, excitation, and feature recalibration, interdependence between feature channels is established, features positive to a grabbing detection task are enhanced, and less useful features are suppressed, thereby improving the detection accuracy.

    [0037] To enable those skilled in the art to understand the technical solutions of the present disclosure more clearly, the detection method of the present disclosure will be described in more detail:

    [0038] The grabbing detection method based on the RP-ResNet includes the following steps 1-7:

    [0039] Step 1: A image of a target is acquired.

    [0040] Step 2: A size of pixels of the acquired image of the target is adjusted to 277*277, the adjusted image of the target is input into a PR-ResNet-50, and image processing is performed in sequence from the 1st to 30th layers of the PR-ResNet-50.

    [0041] Step 3: The feature map output from the 30th layer of the PR-ResNet-50 is input into a region proposal network to obtain an image processed by the region proposal network.

    [0042] Step 3 specifically includes:

    [0043] scanning the entire feature map using a k×k sliding window, and

    [0044] performing a convolution operation on the entire feature map by using a convolution kernel with a size of 1×1 to obtain a fraction map of a 2 k class channel and a fraction map of a 4 k bounding box channel.

    [0045] Step 4: ROI pooling is performed on the feature map output from the 30th layer of the PR-ResNet-50 and the image processed by the region proposal network.

    [0046] Step 4 is specifically implemented as follows:

    [0047] a convolution response image is segmented into regions of interest (ROI) according to the image processed by the RPN; the regions of interest in some channels are divided into k×k grids, each grid is averagely pooled, and then all channels are averagely pooled; for an ROI with a size of w×h, the size of each region is W/h×W/h, the last convolution layer generates k.sup.2 fraction maps for each class, and the pooling response of the (i, j)th sub-region (0≤i, j≤k−1) of the ROI for the C class is shown in Equation 1:

    [00006] r C ( i , j .Math. "\[LeftBracketingBar]" Θ ) = .Math. ( x , y ) 1 n z i , j , C ( x + x 0 , y + y o .Math. "\[LeftBracketingBar]" Θ )

    [0048] where r.sub.C(i, j|Θ) is a pooling response of the (i, j)th bin of the c class; z.sub.i,j,C is the output in k.sup.2(C+1) fraction maps; (x.sub.0, y.sub.0) is the left top coordinate of the ROI; n is the total number of pixels in the bin; and Θ is a network parameter.

    [0049] Step 5: An image after the ROI pooling is input into the PR-ResNet-50, and image processing is sequentially performed from the 31st to 40th layers of the PR-ResNet-50.

    [0050] Step 6: A feature map X output from the 40th layer of the PR-ResNet-50 is input into the ResNet module for squeeze, excitation and feature recalibration to obtain a feature map output by the ResNet module.

    [0051] Step 6 specifically includes:

    [0052] compressing each feature map by global average pooling, and converting a C-class feature map into a 1×1×C real number sequence, such that each real number has a global reception;

    [0053] performing dimensionality reduction and dimensionality raising on the feature map compressed by two convolution layers; where the first convolution layer reduces the original feature dimension to C/r of the original feature dimension and then increases the nonlinearity by a Relu activation function; and the second convolution layer restores the original feature dimension, and obtains the normalized weight by a Sigmoid activation function; and r represents a multiple of the dimensionality reduction;

    [0054] weighting the feature map obtained after the dimensionality reduction and dimensionality raising to the original feature channel by multiplication channel by channel to recalibrate the original feature map,

    [0055] where the equations for squeeze, excitation and feature recalibration are:

    [00007] z c = F s q ( u c ) = 1 W × H .Math. i = 1 W .Math. j = 1 H u c ( i , j ) s = F e x ( z , W ) = σ ( W 2 δ ( W 1 , z ) ) x ~ c = F scale ( u c , s c ) = s c u c

    [0056] where F.sub.sq(u.sub.c) represents compression of a feature map, W×H represents a size of a two-dimensional feature map, F.sub.ex( ) represents feature extraction of the feature map, Z represents a compressed feature vector transformed from the input two-dimensional feature map, W.sub.1 and W.sub.2 are weights of the full connection layer, σ is the sigmoid activation function, {tilde over (x)}.sub.c is the final output, and is used as an input for the next stage; δ is the relu activation function, u.sub.c is an input feature map of the C dimension; s.sub.c is a feature map obtained after the squeeze and excitation; and F.sub.scale is a weight normalized by recalibration operation.

    [0057] Step 7: The feature map output from the 40th layer of the PR-ResNet-50 and the feature map output by the ResNet module are input into the PR-ResNet-50, and image processing is performed from the 41st to 50th layers of the PR-ResNet-50 to obtain an image containing grabbing points of the target.

    [0058] Specific embodiments are used to expound the principle and implementations of the present disclosure. The description of these embodiments is merely used to assist in understanding the method of the present disclosure and its core conception. In addition, those of ordinary skill in the art can make modifications in terms of specific implementations and scope of application based on the conception of the present disclosure. In conclusion, the content of this specification should not be construed as a limitation to the present disclosure.