Target detection method and device, and computer readable medium

By replacing the residual connection layer with the dense connection layer in the target detection model, the problem of large model size and high computing power requirements in the existing technology is solved, faster target detection is achieved, and it is suitable for edge computing environments.

CN118570626APending Publication Date: 2024-08-30ZTE CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310222336.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

If the existing target detection algorithm wants to achieve higher accuracy, the model size is large, requires a lot of computing power, runs slowly, and cannot meet some real-time requirements, such as edge detection.

Method used

In the target detection model, the dense connection layer is used to replace the residual connection layer in the YOLO model, which shortens the connection length, improves the information reuse rate, and reduces the information loss, thereby compressing the model parameters and reducing the size of the target detection model. volume, reducing the demand for computing power and speeding up operation.

Benefits of technology

While ensuring the accuracy remains unchanged, the size of the target detection model is reduced and the running speed is improved. It is especially suitable for edge computing environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570626A
    Figure CN118570626A
Patent Text Reader

Abstract

The invention provides a target detection method. The method comprises the following steps: inputting an original image into a preset target detection model; receiving a target detection result output by the target detection model; wherein the target detection model comprises a feature extraction module and a detection module; the feature extraction module comprises a plurality of processing layers connected in sequence, the plurality of processing layers are convolution layers, and the plurality of processing layers are feature connection layers used for outputting feature images to the detection module; the feature connection layers are dense connection layers, and the feature images output by different feature connection layers are different in scale; and the detection module is used for performing target detection according to the feature image. The invention further provides target detection equipment and a computer readable medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of target detection, and in particular to a method and device for target detection, and a computer-readable medium. Background Art

[0002] The technology of analyzing images to identify specific targets (such as people, specific objects, etc.) (target detection) is widely used in the fields of intelligent monitoring, intelligent driving, smart classrooms, etc.

[0003] However, if the existing target detection algorithm wants to achieve a higher accuracy, the target detection model must be large, require a lot of computing power, and run slowly. Summary of the invention

[0004] The present disclosure provides a method and device for target detection, and a computer-readable medium.

[0005] In a first aspect, an embodiment of the present disclosure provides a method for target detection, which includes:

[0006] Input the original image into the preset target detection model;

[0007] Receiving a target detection result output by the target detection model;

[0008] Wherein, the target detection model includes a feature extraction module and a detection module;

[0009] The feature extraction module comprises a plurality of processing layers connected in sequence, wherein a plurality of the processing layers are convolutional layers, and a plurality of the processing layers are feature connection layers for outputting feature images to the detection module; the feature connection layers are dense connection layers, and the feature images outputted by different feature connection layers have different scales;

[0010] The detection module is used to perform target detection according to the feature image.

[0011] In some embodiments, the target detection model is a YOLO model, and the detection module is a YOLO detection module.

[0012] In a second aspect, an embodiment of the present disclosure provides a device for target detection, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements any one of the target detection methods of the embodiments of the present disclosure.

[0013] In a third aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for target detection of any one of the embodiments of the present disclosure is implemented.

[0014] The disclosed embodiment uses a dense connection layer (such as replacing the residual connection layer in the YOLO model) in the target detection model to extract feature images, thereby shortening the connection length, improving the information reuse rate, and reducing information loss. Therefore, while ensuring the accuracy rate remains unchanged (especially for small-sized targets or dense targets), the model parameters are compressed, the size of the target detection model is reduced, the demand for computing power is reduced, and the running speed is accelerated. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In the accompanying drawings of the embodiments of the present disclosure:

[0016] Figure 1 It is a structural schematic diagram of a target detection model in the related art;

[0017] Figure 2 A flowchart of a method for target detection provided by an embodiment of the present disclosure;

[0018] Figure 3 A flowchart of another target detection method provided by an embodiment of the present disclosure;

[0019] Figure 4 A schematic diagram of the structure of a target detection model used in a target detection method provided in an embodiment of the present disclosure;

[0020] Figure 5 A schematic diagram of the structure of a densely connected layer of a target detection model used in a target detection method provided in an embodiment of the present disclosure;

[0021] Figure 6 A schematic diagram of the structure of a target detection model used in another target detection method provided by an embodiment of the present disclosure;

[0022] Figure 7 A schematic diagram of the structure of a target detection model used in another target detection method provided by an embodiment of the present disclosure;

[0023] Figure 8 A block diagram of a target detection device provided by an embodiment of the present disclosure;

[0024] Fig. 9 A block diagram of a computer-readable medium provided for an embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the technical solution of the present disclosure, the target detection method and device, and computer-readable medium provided by the embodiments of the present disclosure are described in detail below in conjunction with the accompanying drawings.

[0026] The present disclosure will be described more fully below with reference to the accompanying drawings, but the embodiments shown may be embodied in different forms, and the present disclosure should not be construed as being limited to the embodiments set forth below. On the contrary, the purpose of providing these embodiments is to make the present disclosure thorough and complete, and will enable those skilled in the art to fully understand the scope of the present disclosure.

[0027] The accompanying drawings of the embodiments of the present disclosure are used to provide a further understanding of the embodiments of the present disclosure, and constitute a part of the specification, and are used together with the detailed embodiments to explain the present disclosure, and do not constitute a limitation of the present disclosure. By describing the detailed embodiments with reference to the accompanying drawings, the above and other features and advantages will become more apparent to those skilled in the art.

[0028] The present disclosure may be described with reference to plan views and / or cross-sectional views by means of ideal schematic views of the present disclosure. Therefore, the exemplary illustrations may be modified according to manufacturing techniques and / or tolerances.

[0029] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.

[0030] The terms used in the present disclosure are only used to describe specific embodiments and are not intended to limit the present disclosure. The term "and / or" as used in the present disclosure includes any and all combinations of one or more related enumerated items. The singular forms "one" and "the" as used in the present disclosure are also intended to include plural forms, unless the context clearly indicates otherwise. The terms "including", "made of..." as used in the present disclosure specify the presence of the features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof.

[0031] Unless otherwise defined, all terms (including technical and scientific terms) used in this disclosure have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined in this disclosure.

[0032] The present disclosure is not limited to the embodiments shown in the drawings, but includes modifications of the configurations formed based on the manufacturing process. Therefore, the regions illustrated in the drawings have schematic properties, and the shapes of the regions shown in the drawings illustrate the specific shapes of the regions of the elements, but are not intended to be limiting.

[0033] In some related technologies, a YOLO (You Only Look Once) model can be used for target detection.

[0034] Among them, the YOLO model (such as the YOLO V3 model) is a deep learning model of a convolutional neural network (CNN), which is used to analyze the input original image to detect specific targets (target detection), and can also identify the type of target (target recognition), and determine the location of the target (target positioning). Compared with traditional target detection models, such as the Faster R-CNN model, the YOLO model has a higher running speed (real-time) and accuracy.

[0035] For example, refer to Figure 1 In some related technologies, the YOLO model may include a feature extraction module and a detection module.

[0036] The feature extraction module includes a plurality of sequentially connected convolution (Conv) layers and a plurality of residual connection layers. Each convolution layer includes at least one convolution kernel, and uses the convolution kernel to perform convolution operation on the image input therein to generate an output image; and the residual connection layer is used to perform residual operation on the image input therein to generate an output image. In addition to inputting the generated image into the subsequent layer (such as the subsequent convolution layer), the multiple residual connection layers also input the generated image into the detection module as a "feature image (Box information)".

[0037] Among them, the feature images generated by different residual connection layers have different scales (sizes), so that the detection module can obtain the information of the original image at different scales, analyze it, and realize target detection.

[0038] However, the YOLO model in the related technology will cause a lot of information loss, so if the accuracy requirement is to be met, the model is still large in size, requires more computing power, and runs slowly, which cannot meet the needs of some situations (such as edge detection).

[0039] In a first aspect, an embodiment of the present disclosure provides a method for target detection.

[0040] The embodiments of the present disclosure are used to detect specific targets (such as people, specific objects, etc.) in original images (such as images captured by an image acquisition device) to achieve target detection.

[0041] Among them, while detecting a specific target from the original image, it is usually also possible to determine the type of the specific target (such as determining whether the target is a person or a specific object), as well as determine the position of the specific target in the original image. Therefore, the embodiments of the present disclosure can also achieve target recognition and target positioning at the same time.

[0042] Reference Figure 2 , the target detection method of the embodiment of the present disclosure includes:

[0043] S101, inputting the original image into a preset target detection model.

[0044] S102: Receive the target detection result output by the target detection model.

[0045] Among them, the target detection model includes a feature extraction module and a detection module; the feature extraction module includes multiple processing layers connected in sequence, among which multiple processing layers are convolution layers, and multiple processing layers are feature connection layers for outputting feature images to the detection module; the feature connection layers are densely connected layers, and the feature images output by different feature connection layers have different scales; the detection module is used to perform target detection based on the feature image.

[0046] In an embodiment of the present disclosure, the original image to be detected is input into a preset target detection model (such as a deep learning model), and processed by the target detection model to obtain a corresponding target detection result. The target detection result may include whether there is a specific target in the original image, and the type and location of the specific target.

[0047] Reference Figure 4 , the target detection model used in the embodiment of the present disclosure includes a feature extraction module and a detection module.

[0048] Among them, the feature extraction module is used to extract multiple feature images of different scales (sizes) from the original image, and input these feature images into the detection module. The feature image of each scale mainly reflects the feature information of the original image at that scale.

[0049] The detection module is used to analyze the received feature images of various scales to detect specific targets in the original image and obtain target detection results.

[0050] Among them, the specific forms of the detection module are various. For example, it can adopt the detection module in the target detection model of the related technology, which will not be described in detail here.

[0051] And refer to Figure 4 The feature extraction module includes multiple processing layers connected in sequence, that is, the output of the pre-processing layer is connected to the input of the post-processing layer. Among them, the specific types of processing layers are various, and multiple processing layers are in the form of convolutional layers, and multiple processing layers are in the form of feature connection layers. Due to the convolutional layers, the target detection model is a convolutional neural network (CNN).

[0052] Each convolution layer includes at least one convolution kernel, which is used to perform convolution operations on the input image through the convolution kernel to generate an output image. Depending on the convolution kernel size, stride, padding, etc., the output image of the convolution layer may remain the same or may be reduced in size relative to the input image.

[0053] Among them, the feature connection layer is a connection layer, which can be used to extract features in the image. In addition to outputting the generated image to the next processing layer (such as the convolution layer), the feature connection layer also outputs the generated image to the detection module, and the image output to the detection module is called a feature image.

[0054] The processing layer includes multiple feature connection layers, and at least one convolution layer that can reduce the image scale is arranged between any adjacent feature connection layers, so that the scales of the feature images generated by each feature connection layer are different, specifically, the later the feature connection layer, the smaller the scale of the feature image generated.

[0055] In the disclosed embodiment, the feature connection layer is in the form of a dense connection layer.

[0056] Densely connected layer is also called densely connected network (Dense Net), which is a form of connection layer.

[0057] Reference Figure 5 The densely connected layer includes one or more densely connected blocks (Dense Block), each densely connected block includes at least three dense convolutional layers connected in sequence (each dense convolutional layer includes at least one convolution kernel); in each densely connected block, the output of each dense convolutional layer is simultaneously connected to the input of all subsequent dense convolutional layers, and correspondingly, the input of each dense convolutional layer is also simultaneously connected to the output of all previous dense convolutional layers.

[0058] In some embodiments, each densely connected layer includes a densely connected block, each densely connected block includes at least three dense convolutional layers connected in sequence; each dense convolutional layer is used to receive the output data of all dense convolutional layers before it in the densely connected block, perform a convolution operation on the received output data to generate its own output data, and output its own output data to all dense convolutional layers after it in the densely connected block.

[0059] It can be seen that the work performed by each dense convolutional layer is actually to simultaneously receive the output data of all the densely connected layers in the same densely connected block as its own input data, convolve its own input data to obtain its own output data, and output its own output data to all the densely connected layers in the same densely connected block.

[0060] It should be understood that the first dense convolution layer in each densely connected block only receives the input data of the densely connected block as a whole; and the last dense convolution layer in each densely connected block only outputs its own output data outside the densely connected block, that is, as the output data of the densely connected block as a whole.

[0061] It can be seen that for a regular connection layer with (N+1) convolutional layers, the total number of connections (one connection between every two adjacent convolutional layers) is N, while for a dense connection block with (N+1) dense convolutional layers, the total number of connections is N(N+1) / 2. Therefore, the dense connection layer realizes the "dense connection" between different parts, increases the information exchange between different parts, alleviates the vanishing gradient problem, thereby improving the information reuse rate, reducing information loss, and compressing model parameters.

[0062] Among them, the dense connection layer can only include one dense connection block; Figure 5 When a densely connected layer includes multiple densely connected blocks, a connected convolution layer, a downsampling layer, etc. may also be provided between different densely connected blocks.

[0063] Reference Figure 1 In some related technologies (such as the YOLO model), the residual connection layer can be used as a feature connection layer to output a feature image. The residual connection layer is also a connection layer. Compared with the dense connection layer, it has certain limitations in extracting and transmitting feature information, which will cause more information loss and easily lead to false detection problems, especially for the detection of small targets or dense targets.

[0064] The disclosed embodiment uses a dense connection layer (such as replacing the residual connection layer in the YOLO model) in the target detection model to extract feature images, thereby shortening the connection length, improving the information reuse rate, and reducing information loss. Therefore, while ensuring the accuracy rate remains unchanged (especially for small-sized targets or dense targets), the model parameters are compressed, the size of the target detection model is reduced, the demand for computing power is reduced, and the running speed is accelerated.

[0065] In some related technologies, after an image acquisition device (such as a camera) acquires an image, it can send the image to a server in the cloud, which will perform target detection on the image and then send the target detection result to the application scenario. However, this method occupies a large amount of transmission bandwidth, reduces the real-time performance of target detection, and causes excessive pressure on the server.

[0066] To this end, edge computing technology can be used, that is, edge devices (such as image acquisition devices) can be used to directly detect targets. However, edge devices are not dedicated servers, so their storage space and computing power are often limited. The target detection model used in the embodiments of the present disclosure is small in size and has a small demand for computing power, so it is particularly suitable for target detection in edge computing.

[0067] In some embodiments, the target detection model is a YOLO model, and the detection module is a YOLO detection module.

[0068] As one method of the embodiment of the present disclosure, the target detection model can specifically adopt the basic form of the YOLO (You Only Look Once) model in the related art (of course not completely the same), for example, the basic form of the YOLO V3 model. Accordingly, the detection module in the target detection model of the embodiment of the present disclosure can also be the YOLO detection module in the YOLO model.

[0069] It should be understood that since the feature extraction module of the target detection model of the embodiment of the present disclosure uses a dense connection layer as a feature connection layer, it is different from the existing YOLO model. Therefore, the target detection model used in the embodiment of the present disclosure can be regarded as a new YOLO model, such as a DE-YOLO model.

[0070] In some embodiments, at least one processing layer is an auxiliary connection layer; the auxiliary connection layer is a dense connection layer; and at least one convolution layer is provided between any auxiliary connection layer and the feature connection layer.

[0071] Reference Figure 6 In the embodiment of the present disclosure, some processing layers may be auxiliary connection layers, which are also in the form of dense connection layers, but the images they generate are not output to the detection module, so they do not belong to the feature connection layers; and any auxiliary connection layer and the feature connection layer are also provided with at least one convolution layer (belonging to the processing layer).

[0072] In some embodiments, each feature connection layer corresponds to multiple sequentially connected repeating units; each repeating unit includes n sequentially connected convolutional layers and a densely connected layer located after all the convolutional layers, where n is an integer greater than or equal to 2; among all the repeating units corresponding to each feature connection layer, the densely connected layer in the last repeating unit is the feature connection layer, and the densely connected layers in other repeating units are auxiliary connection layers.

[0073] Reference Figure 1In some related technologies, the output of each scale may correspond to multiple repeating units with the same structure connected in series in sequence (i.e., a "group" of repeating units), wherein each repeating unit has a convolutional layer and a connection layer (residual connection layer), but only the connection layer of the last repeating unit outputs the image (i.e., the feature connection layer).

[0074] Among them, "2*, 8*" etc. before the dotted box in each figure indicates the number of times the structure of the dotted box is repeated in series (2 times, 8 times), and for the repeating unit, it indicates the number of repeating units in the group of repeating units.

[0075] It can be seen that, in addition to the repeating units corresponding to the characteristic connection layer which can be repeated multiple times, other structures can also be repeated multiple times, which are also represented by the above "8*" form.

[0076] And refer to Figure 6 In the embodiment of the present disclosure, the output of each scale (i.e., each feature connection layer) may also correspond to a set of repeating units, wherein the dense connection layer in the last repeating unit is the feature connection layer, and the dense connection layers in other repeating units are all auxiliary connection layers without output. It can be seen that by adding more auxiliary connection layers (dense connection layers) without output, the information in the generated feature image can be richer.

[0077] In order to ensure that the contents are clearly visible in the limited size of the attached drawings, Figure 6 In the figure, only a group of repeating units corresponding to the output of the first scale is represented separately (the repeating units of other groups are still represented in the form of "8*"), and the group of repeating units includes only two repeating units, and each repeating unit has only one convolutional layer; however, it should be understood that the above specific numbers, etc., are not limitations on the protection scope of the embodiments of the present disclosure.

[0078] In some embodiments, reference Figure 3 , before the original image is fed into the preset target detection model, it also includes:

[0079] S1001: clustering a preset training sample set using a clustering algorithm to obtain a plurality of candidate training samples.

[0080] The training sample set includes multiple training samples.

[0081] S1002: Use the candidate training samples to train the preset original model to obtain a target detection model.

[0082] In some embodiments, the clustering algorithm includes a K-means clustering algorithm.

[0083] Before using the target detection model for target detection, the target detection model can be trained first (of course, the trained target detection model can be used for multiple target detections). The training process of the target detection model usually includes:

[0084] A101. Set a training sample set.

[0085] The training sample set includes a large number of preset training samples (different images), and specific targets in the training samples have been marked.

[0086] A102. Input a training sample as the original image into the original model for target detection.

[0087] A103. Adjust the parameters in the original model based on the gap between the target detection results of the original model for the training samples and the labeled standard results (loss function loss).

[0088] A104. If the training end condition is met, the training is ended; if the training end condition is not met, a new training sample is selected and the training is continued by returning to step A102.

[0089] Among them, the training end conditions may be that the model achieves a certain effect (such as reaching a certain accuracy), the model parameters converge, a predetermined number of training times is reached, etc., which will not be described in detail here.

[0090] For example, verification samples can be set in advance (such as using part of the training samples as verification samples), and the verification samples can be input into the trained model. According to the accuracy of the model's detection of the verification samples, it is determined whether the training end conditions are met.

[0091] In the disclosed embodiment, a cluster analysis is first performed on a large number of training samples in the training sample set, such as a k-means cluster analysis, to select training samples with similar features that are suitable for training the target detection model as candidate training samples for use in the actual training process.

[0092] Research has found that compared with the method of directly using all training samples for training, using clustered training samples for training can effectively improve training efficiency, achieve rapid convergence of model parameters, fully compress model parameters, reduce the size of the target detection model, and improve its detection accuracy.

[0093] It should be understood that before the feature connection layer (repeating unit), other forms of connection layers (no feature image output, so it is not a feature connection layer; and it is not in the form of a dense connection layer, so it is not an auxiliary connection layer) and convolution layers, etc. may be provided. For example, the connection layer may specifically be a residual connection layer, or a residual network.

[0094] It should be understood that in order to achieve edge computing, it is necessary to reduce the size of the target detection model, so refer to Figure 4 , Figure 6 , Figure 7 Etc., in the embodiment of the present disclosure, there may only be a structure corresponding to the feature connection layer (such as a repeating unit) without other structures such as a residual connection layer.

[0095] In some embodiments, the target detection model further includes:

[0096] Feature convolution layers that correspond one-to-one to feature connection layers;

[0097] The feature convolution layer is connected between the output of the feature connection layer and the input of the detection module, and is used to convolve the feature image output by the feature connection layer and input it into the detection module.

[0098] Reference Figure 6 As one method of an embodiment of the present disclosure, each feature connection layer also has a corresponding feature convolution layer (each feature convolution layer includes at least one convolution kernel), and the feature convolution layer is arranged between the corresponding feature connection layer and the detection module, so that the feature image generated by the feature connection layer needs to undergo a convolution operation before entering the detection module.

[0099] In some embodiments, except for the feature connection layer that outputs the feature image of the largest scale, the output of each other feature connection layer is also merged with the output of the feature connection layer that outputs the feature image of a scale larger than the feature connection layer through the upsampling layer.

[0100] As a method of the embodiment of the present disclosure, in order to strengthen the information exchange between different scales, refer to Figure 6 Except for the feature connection layer corresponding to the feature image of the largest scale (scale 3), the feature images generated by each other feature connection layer must be output to the detection module at its own scale (such as through the feature convolution layer), and at the same time, they must be increased in scale through an up-sampling layer, merged with the feature image of the larger scale, and then input into the detection module together (such as through the feature convolution layer).

[0101] For example, see Figure 7 , the feature image of 8*8 scale (scale 1) is upsampled and merged with the feature image of 16*16 scale (scale 2), and then output to the detection module through convolution; similarly, the feature image of 16*16 scale is upsampled and merged with the feature image of 32*32 scale (scale 3), and then output to the detection module through convolution; and the feature image of 32*32 scale does not need to be upsampled again.

[0102] In some embodiments, the number of feature connection layers is 3.

[0103] Reference Figure 6 , Figure 7 As a specific embodiment of the present disclosure, the number of feature connection layers may be three, that is, the feature extraction module may extract feature information at three different scales (such as the above 8*8 scale, 16*16 scale, and 32*32 scale).

[0104] As a specific embodiment of the present disclosure, the structure, training, and use of a target detection model are introduced below.

[0105] In the disclosed embodiment, Win10 operating system is used, and the target detection model is developed in python3.6 language on the Anaconda3+keras platform. The central processing unit (CPU) model of the operating device is Inter(R)Core(TM), and the memory size is 4G.

[0106] In the embodiment of the present disclosure, the target detection model adopts the basic form of the YOLO V3 model, and its detection module adopts the YOLO detection module (such as the SOFT classifier), but the feature connection layer in its feature extraction module is replaced by a residual connection layer with a dense connection layer. Therefore, the target detection model of the embodiment of the present disclosure can be a DE-YOLO model.

[0107] Reference Figure 7 The feature extraction module of the DE-YOLO model of the embodiment of the present disclosure includes multiple processing layers connected in sequence.

[0108] Figure 7 (include Figure 1 ), the multiple processing layers from top to bottom represent the multiple processing layers in the DE-YOLO model, where Type represents the type of the corresponding processing layer; Filter depth is also called filter dimension, which represents the number of convolution kernels in the convolution layer; Convolution size represents the size of a single convolution kernel; Output size represents the size of the image output by the corresponding processing layer.

[0109] Reference Figure 7 , the DE-YOLO model can output feature images of 3 scales, such as scale 1 is 8*8 scale, scale 2 is 16*16 scale, and scale 3 is 32*32 scale.

[0110] Among them, scale 3 corresponds to a group of eight repeating units, scale 2 corresponds to a group of eight repeating units, and scale 1 corresponds to a group of eight repeating units; each repeating unit includes three processing layers connected in sequence, the first two are convolutional layers, and the last one is a densely connected layer; the densely connected layer of the last repeating unit in each group of repeating units is a feature connection layer for outputting feature images, while the densely connected layers of other repeating units are auxiliary connection layers.

[0111] Among them, the feature image of 8*8 scale (scale 1) is merged with the feature image of 16*16 scale (scale 2) after passing through the upsampling layer (such as the pooling layer), and then output to the detection module through the feature convolution layer; similarly, the feature image of 16*16 scale is merged with the feature image of 32*32 scale (scale 3) after passing through the upsampling layer, and then output to the detection module through the feature convolution layer; and the feature image of 8*8 scale (scale 1) is also directly output to the detection module through the feature convolution layer.

[0112] Among them, feature images of different scales contain different amounts of feature information and different learning capabilities. For example, feature images of scales 1 and 2 contain more representation information, while the learning capability of scale 3 is limited. Therefore, in the DE-YOLO model of the embodiment of the present disclosure, the feature connection layers of the three scales no longer use residual connection layers (Residual Network), but use dense connection layers (Dense Net) that match their dimensions.

[0113] Reference Figure 5 The densely connected layer includes one or more densely connected blocks, and within each densely connected block, the output of each dense convolutional layer is connected to the input of all subsequent dense convolutional layers.

[0114] A processing layer may include n layers connected in sequence, where the lth layer performs a nonlinear transformation Hl(·) on the input image, and Hl(·) may specifically be one or more composite functions such as batch normalization (BN), activation function (Relu), pooling sampling, and convolution.

[0115] Among them, the output of the i-th layer is represented as x i , so for the densely connected layer (densely connected block), the i-th layer (i-th dense convolutional layer) will receive the output x0,…,x0 of all previous layers. i-1 , so the output is:

[0116] x l =Hl([(x0,x1,…,x l-1 ]);

[0117] Among them, [x0,…,x i-1] is the concatenation of the images generated in layers 0,…,i-1.

[0118] Thus, for other processing layers with n layers, there are n connections (one connection between each layer and the subsequent layer), and a densely connected layer with n layers has n(n+1) / 2 connections, that is, each layer takes the output of all previous layers as input and uses its own output as input for all subsequent layers. Therefore, the densely connected layer has "dense connectivity" and is therefore called a densely connected layer.

[0119] In the densely connected layer, when the scale of the image changes, the above formula does not apply, but changing the image size is an important operation in convolution. Figure 5 , the densely connected layer is divided into multiple densely connected blocks, and adjacent densely connected blocks are connected through convolutional layers and downsampling (such as pooling) layers.

[0120] Among them, refer to Figure 7 Since the densely connected layer brings more inputs, the convolution layer may include an effective convolution layer (such as a 3*3 convolution kernel) and a previous convolution layer with reduced input (such as a 1*1 convolution kernel) to reduce the number of inputs and improve computational efficiency; and after the last densely connected block, full pooling can be performed.

[0121] To further compress the size of the DE-YOLO model, the number of images in the transition layer (feature convolution layer) can be appropriately reduced. For example, assuming that the densely connected layer generates a total of m images, the number of images generated by the subsequent transition layer can be set to λm, where λ is the compression factor, which can be set in the range of 0.2<λ≤0.8.

[0122] It can be seen that in the embodiment of the present disclosure, feature images of scales 1, 2, and 3 are generated through densely connected layers, so that the feature information learned at different scales can be fully utilized and aggregated, providing an effective guarantee for the next step of obtaining a DE-YOLO model that can achieve accurate detection.

[0123] Specifically, when training the above DE-YOLO model, 10,000 different images can be randomly selected from VOC2017, 8,200 of which are randomly selected as training sample sets, 800 images are selected as validation sample sets, and 1,000 images are selected as test sample sets.

[0124] The training process may include:

[0125] Step 1: Preprocess the training sample set and the validation sample set (such as Anchors selection).

[0126] Step 2: Perform K-means clustering on the training sample set to obtain the training samples to be used.

[0127] Step 3: Use the training samples to be used to train the original model of the DE-YOLO model, and use the training samples of the unclustered training sample set to train the YOLO V3 model; use the verification sample set to determine whether the training is complete.

[0128] Step 4: Test the obtained DE-YOLO model and YOLO V3 model separately.

[0129] The parameters of the original model can be the parameters of the pre-trained YOLOV3 model on the COCO dataset provided by the Keras framework; the Adma+Momentum optimization algorithm is used in the training, and the initial momentum is set to 0.9, the initial learning rate of the weight is 0.001, the weight decay coefficient is 0.0005, and the number of iterations is 1000; the scale of the input image is unified to 416*416, and the compression factor λ is 0.5; to avoid overfitting, the model is saved every 50 iterations, and the output file is suffixed with .h5.

[0130] In the disclosed embodiment, when the DE-YOLO model iterates 800 times, the accuracy has reached 89.1%, which has exceeded the accuracy of the YOLO V3 model of the same period; when iterates 1000 times, the accuracy of the DE-YOLO model is further improved and basically reaches saturation.

[0131] In the end, the trained DE-YOLO model is 33Mb, while the YOLO V3 model is 258Mb.

[0132] It can be seen that the size of the target detection model used in the embodiment of the present disclosure is reduced by more than 80%, and the detection speed is significantly improved.

[0133] Second, refer to Figure 8 An embodiment of the present disclosure provides a target detection device, which includes one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements any one of the target detection methods of the embodiments of the present disclosure.

[0134] Thirdly, refer to Fig. 9 The embodiment of the present disclosure provides a computer-readable medium on which a computer program is stored. When the computer program is executed by a processor, any target detection method of the embodiment of the present disclosure is implemented.

[0135] Among them, the processor is a device with data processing capabilities, including but not limited to the central processing unit (CPU); the memory is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) is connected between the processor and the memory, and can realize information exchange between the memory and the processor, including but not limited to the data bus (Bus), etc.

[0136] Those skilled in the art will appreciate that all or some of the steps, systems, and functional modules / units in the apparatus disclosed above may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0137] In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation.

[0138] Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit (CPU), a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-temporary medium) and a communication medium (or temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH) or other disk storage; read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical disk storage; magnetic cassettes, magnetic tapes, disk storage or other magnetic storage; any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0139] The present disclosure has disclosed example embodiments, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly stated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.

Claims

1. A method for target detection, comprising: Input the original image into the preset target detection model; Receiving a target detection result output by the target detection model; Wherein, the target detection model includes a feature extraction module and a detection module; The feature extraction module comprises a plurality of processing layers connected in sequence, wherein a plurality of the processing layers are convolutional layers, and a plurality of the processing layers are feature connection layers for outputting feature images to the detection module; the feature connection layers are dense connection layers, and the feature images outputted by different feature connection layers have different scales; The detection module is used to perform target detection according to the feature image.

2. The method according to claim 1, wherein: At least one of the processing layers is an auxiliary connection layer; the auxiliary connection layer is a dense connection layer; At least one convolutional layer is provided between any of the auxiliary connection layers and the feature connection layer.

3. The method according to claim 2, wherein: Each of the characteristic connection layers corresponds to a plurality of sequentially connected repeating units; Each of the repeating units includes n sequentially connected convolutional layers and a densely connected layer located after all the convolutional layers, where n is an integer greater than or equal to 2; In all the repeating units corresponding to each characteristic connection layer, the dense connection layer in the last repeating unit is the characteristic connection layer, and the dense connection layers in the other repeating units are the auxiliary connection layers.

4. The method according to claim 1, wherein: Each of the densely connected layers includes a densely connected block, and each of the densely connected blocks includes at least three dense convolutional layers connected in sequence; Each of the dense convolutional layers is used to receive the output data of all the dense convolutional layers located before it in the densely connected block where it is located, perform a convolution operation on the received output data to generate its own output data, and output its own output data to all the dense convolutional layers located after it in the densely connected block where it is located.

5. The method according to claim 1, wherein: Before the original image is input into the preset target detection model, the method further includes: Using a clustering algorithm to cluster a preset training sample set to obtain a plurality of candidate training samples; the training sample set includes a plurality of training samples; The preset original model is trained using the candidate training samples to obtain the target detection model.

6. The method according to claim 1, wherein: The target detection model also includes: A feature convolution layer corresponding one-to-one to the feature connection layer; The feature convolution layer is connected between the output of the feature connection layer and the input of the detection module, and is used to convolve the feature image output by the feature connection layer and then input it into the detection module.

7. The method according to claim 1, wherein: Except for the feature connection layer that outputs the feature image of the largest scale, the output of each other feature connection layer is also merged with the output of the feature connection layer that outputs the feature image of a scale larger than the feature connection layer through an upsampling layer.

8. The method according to any one of claims 1 to 7, wherein: The target detection model is a YOLO model, and the detection module is a YOLO detection module.

9. A target detection device, comprising one or more memories and one or more processors; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements the target detection method described in any one of claims 1 to 8.

10. A computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for target detection according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Multi-target detection method and device and mobile terminal

    CN109902697A

  • Pedestrian detection system and method based on improved YOLOv3 algorithm

    CN111898432A

  • Downhole pipeline abnormal target identification method and system based on densely connected Yolov3 network

    CN113298181A