Barrel-shaped object detection method, device, electronic device and storage medium

Through the pre-trained barrel detection model and classification model, combined with the attention mechanism, accurate detection of barrels and their top cover status is achieved, which solves the problem of insufficient detection accuracy in existing technologies and improves the hygiene and safety of trash can management.

CN114359881BActive Publication Date: 2025-09-26ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111478451.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-06
Publication Date
2025-09-26
Estimated Expiration
2041-12-06

Smart Images

  • Figure CN114359881B_ABST
    Figure CN114359881B_ABST
Patent Text Reader

Abstract

The present invention discloses a barrel-shaped object detection method, device, electronic device, and storage medium. The method involves inputting an image to be detected into a pre-trained barrel-shaped object detection model. Based on the barrel-shaped object detection model, feature extraction is performed on the image to be detected to obtain a first multi-channel feature map group. The first feature map group is then grouped according to the number of channels, and convolution processing is performed on the feature maps within different groups using convolution kernels of different scales to obtain a second feature map group. This allows the barrel-shaped object detection model to focus more on the detailed features in the image to be detected. Finally, barrel-shaped objects in the image to be detected are detected based on the second feature map group. This allows barrel-shaped objects in the image to be detected to be accurately detected even in complex scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a barrel-shaped object detection method, device, electronic equipment and storage medium. Background Art

[0002] With the rapid development of the domestic economy, the consumption level of the people is also constantly improving. More and more people rely on takeout from restaurants to solve their daily diet. Against the background of high consumption in the catering industry, the standardized management of restaurant kitchens has also become a top priority. Many restaurants with bright and beautiful appearances have dirty and messy kitchens, especially the open state of trash cans. If the trash can lids are open due to overflowing or not closed, flies will fly around, accelerating the spread of odor and bacteria. Therefore, it is necessary to regulate the open state of trash can lids in the kitchen. For example, trash cans must be closed in time and the garbage must be cleaned up promptly after overflowing. If effective management is not achieved, it will seriously threaten the hygiene and safety of the kitchen and even have a huge adverse impact on the health of diners. In addition, overflowing trash cans or the dirty and messy environment around the trash cans in residential areas or scenic spots will also affect the visual experience of residents and tourists.

[0003] In order to solve the above problems, it is first necessary to detect barrel-shaped objects (such as trash cans) in the environment. However, due to the complex background of the scene, the accuracy of detecting barrel-shaped objects in the existing technology is poor. How to accurately detect barrel-shaped objects in the scene is a problem that needs to be solved urgently. Summary of the Invention

[0004] Embodiments of the present invention provide a barrel-shaped object detection method, device, electronic device, and storage medium to solve the problem of poor accuracy in barrel-shaped object detection in the prior art.

[0005] An embodiment of the present invention provides a barrel-shaped object detection method, the method comprising:

[0006] Acquire an image to be detected, and input the image to be detected into a pre-trained barrel-shaped object detection model;

[0007] Based on the barrel-shaped object detection model, features are extracted from the image to be detected to obtain a first multi-channel feature map group; the first feature map group is grouped according to the number of channels, and convolution kernels of different scales are used to perform convolution processing on the feature maps in different groups to obtain a second feature map group; and barrel-shaped objects in the image to be detected are detected based on the second feature map group.

[0008] Furthermore, the step of splicing the convolution-processed feature maps to obtain a second feature map group includes:

[0009] The feature map group obtained by splicing the feature maps after convolution processing is used as the third feature map group;

[0010] The third feature map group is grouped according to the number of channels, and the feature map in each group is multiplied by the pre-trained weight parameter to obtain the second feature map group.

[0011] Furthermore, the method further comprises:

[0012] using the barrel-shaped object region image in the image to be detected detected according to the second feature map group as a suspected region image;

[0013] The suspected area image is input into a pre-trained barrel-shaped object classification model, and based on the first branch network structure in the barrel-shaped object classification model, it is detected whether the object in the suspected area image is a barrel-shaped object.

[0014] Furthermore, the method further comprises:

[0015] If the object in the suspected area image is detected as a barrel-shaped object based on the first branch network structure in the barrel-shaped object classification model, the switch state of the barrel-shaped object top cover is detected based on the second branch network structure in the barrel-shaped object classification model.

[0016] Furthermore, the method further comprises:

[0017] If the top cover of the barrel is detected to be open based on the second branch network structure in the barrel classification model, the image to be detected is used as a candidate alarm image; when a set number of consecutive frames of candidate alarm images are determined, an alarm prompt message is output.

[0018] Furthermore, based on the barrel-shaped object detection model, feature extraction is performed on the image to be detected to obtain a multi-channel first feature map group; the first feature map group is grouped according to the number of channels, and convolution kernels of different scales are used to perform convolution processing on the feature maps in different groups to obtain a second feature map group; and detecting the barrel-shaped object in the image to be detected according to the second feature map group includes:

[0019] The barrel detection model includes a feature extraction module and an attention mechanism module;

[0020] Based on the feature extraction module in the barrel-shaped object detection model, feature extraction is performed on the image to be detected to obtain a first multi-channel feature map group; based on the attention mechanism module in the barrel-shaped object detection model, the first feature map group is grouped according to the number of channels, and convolution kernels of different scales are used to perform convolution processing on the feature maps in different groups to obtain a second feature map group; and barrel-shaped objects in the image to be detected are detected based on the second feature map group.

[0021] Furthermore, the detecting whether the object in the suspected area image is a barrel-shaped object based on the first branch network structure in the barrel-shaped object classification model includes:

[0022] Based on the feature extraction layer in the barrel classification model, the suspected area image is subjected to multiple convolution processes to obtain multiple feature maps, the multiple feature maps are cross-multiplied, the multiple feature maps obtained by the cross-multiplication are pooled, and the objects in the suspected area image are detected to be barrel-shaped through the fully connected layer and the classification layer.

[0023] On the other hand, an embodiment of the present invention provides a barrel-shaped object detection device, the device comprising:

[0024] An acquisition module is used to acquire an image to be detected and input the image to be detected into a pre-trained barrel-shaped object detection model;

[0025] The detection module is used to extract features of the image to be detected based on the barrel detection model to obtain a first multi-channel feature map group; group the first feature map group according to the number of channels, and use convolution kernels of different scales to convolve the feature maps in different groups to obtain a second feature map group; and detect the barrel in the image to be detected based on the second feature map group.

[0026] Furthermore, the detection module is specifically used to group the first feature map groups according to the number of channels, and use convolution kernels of different scales to convolve the feature maps in different groups to obtain feature groups as the third feature map group; group the third feature map group according to the number of channels, and multiply the feature maps in each group by the pre-trained weight parameters to obtain the second feature map group.

[0027] Furthermore, the detection module is also used to use the barrel area image in the image to be detected according to the second feature map group as a suspected area image; input the suspected area image into a pre-trained barrel classification model, and based on the first branch network structure in the barrel classification model, detect whether the object in the suspected area image is a barrel.

[0028] Furthermore, the detection module is also used to detect that the object in the suspected area image is a barrel-shaped object based on the first branch network structure in the barrel-shaped object classification model, and to detect the switch status of the barrel-shaped object top cover based on the second branch network structure in the barrel-shaped object classification model.

[0029] Furthermore, the device further comprises:

[0030] The alarm module is used to detect that the top cover of the barrel is open based on the second branch network structure in the barrel classification model, and use the image to be detected as a candidate alarm image; when a set number of consecutive frames of candidate alarm images are determined, output an alarm prompt message.

[0031] Furthermore, the detection module is specifically used to perform feature extraction on the image to be detected based on the feature extraction module in the barrel detection model to obtain a first multi-channel feature map group; group the first feature map group according to the number of channels based on the attention mechanism module in the barrel detection model, and use convolution kernels of different scales to convolve the feature maps in different groups to obtain a second feature map group; and detect the barrel in the image to be detected based on the second feature map group.

[0032] Furthermore, the detection module is specifically used to perform multiple convolution processes on the suspected area image based on the feature extraction layer in the barrel classification model to obtain multiple feature maps, cross-multiply the multiple feature maps, pool the multiple feature maps obtained by cross-multiplication, and detect whether the object in the suspected area image is a barrel through a fully connected layer and a classification layer.

[0033] In another aspect, an embodiment of the present invention provides an electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0034] Memory for storing computer programs;

[0035] The processor is configured to implement any of the above method steps when executing a program stored in the memory.

[0036] On the other hand, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of the above are implemented.

[0037] An embodiment of the present invention provides a barrel-shaped object detection method, device, electronic device and storage medium. The method includes: obtaining an image to be detected, and inputting the image to be detected into a pre-trained barrel-shaped object detection model; based on the barrel-shaped object detection model, performing feature extraction on the image to be detected to obtain a first multi-channel feature map group; grouping the first feature map group according to the number of channels, and using convolution kernels of different scales to convolve feature maps in different groups to obtain a second feature map group; and detecting barrel-shaped objects in the image to be detected based on the second feature map group.

[0038] The above technical solution has the following advantages or beneficial effects:

[0039] In this embodiment of the present invention, an image to be detected is input into a pre-trained barrel-shaped object detection model. Feature extraction is performed on the image based on the barrel-shaped object detection model to obtain a multi-channel first feature map group. The first feature map group is then grouped by channel number, and convolution processing is performed on the feature maps within each group using convolution kernels of different scales to obtain a second feature map group. This allows the barrel-shaped object detection model to focus more on the detailed features in the image to be detected. Finally, barrel-shaped objects in the image to be detected are detected based on the second feature map group. This enables accurate detection of barrel-shaped objects in images to be detected even in complex scenes. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0041] Figure 1 A schematic diagram of a barrel-shaped object detection process provided by an embodiment of the present invention;

[0042] Figure 2 A flowchart of barrel-shaped object detection based on a barrel-shaped object detection model provided in an embodiment of the present invention;

[0043] Figure 3 A schematic diagram of the barrel-shaped object detection model structure provided by an embodiment of the present invention;

[0044] Figure 4 A schematic diagram of the barrel classification model structure provided by an embodiment of the present invention;

[0045] Figure 5 A schematic structural diagram of a barrel-shaped object detection device provided in an embodiment of the present invention;

[0046] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0047] The present invention will be further described in detail below with reference to the accompanying drawings. It is apparent that the embodiments described are only some, not all, of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are intended to fall within the scope of protection of the present invention.

[0048] Example 1:

[0049] Figure 1A schematic diagram of a barrel-shaped object detection process provided by an embodiment of the present invention includes the following steps:

[0050] S101: Acquire an image to be detected, and input the image to be detected into a pre-trained barrel-shaped object detection model.

[0051] S102: Based on the barrel-shaped object detection model, feature extraction is performed on the image to be detected to obtain a first multi-channel feature map group; the first feature map group is grouped according to the number of channels, and convolution kernels of different scales are used to convolve the feature maps in different groups to obtain a second feature map group; and the barrel-shaped object in the image to be detected is detected according to the second feature map group.

[0052] The barrel-shaped object detection method provided by an embodiment of the present invention is applied to an electronic device, which can be a PC, tablet computer, server or other device, or an intelligent image acquisition device. If the electronic device is an intelligent image acquisition device, a pre-trained barrel-shaped object detection model is stored in the electronic device. After the electronic device acquires the image to be detected, the image to be detected is input into the pre-trained barrel-shaped object detection model, and barrel-shaped object detection is performed based on the barrel-shaped object detection model. If the electronic device is a PC, tablet computer, server or other device. After the image acquisition device acquires the image to be detected, the image to be detected is first sent to the electronic device, and the electronic device obtains the image to be detected. Thereafter, the image to be detected is input into the pre-trained barrel-shaped object detection model, and barrel-shaped object detection is performed based on the barrel-shaped object detection model.

[0053] The barrel-shaped object provided in the embodiment of the present invention includes a barrel-shaped object with a top cover, such as a trash can in a kitchen, a community, or a scenic area, and barrel-shaped objects with top covers in other scenarios are obtained.

[0054] Specifically, the electronic device performs feature extraction on the image to be detected based on a barrel-shaped object detection model to obtain a first multi-channel feature map group. The barrel-shaped object detection model includes a feature extraction module and an attention mechanism module. The attention mechanism module is a pyramid separation attention mechanism module. Based on the feature extraction module in the barrel-shaped object detection model, feature extraction is performed on the image to be detected to obtain a first multi-channel feature map group. The feature extraction module can be, for example, a YOLO-based backbone network, or other network structures capable of extracting features from the image to be detected. The attention mechanism module is a plug-and-play separation attention mechanism module. Based on the attention mechanism module in the barrel-shaped object detection model, the first feature map group is grouped according to the number of channels, and convolution kernels of different scales are used to convolve the feature maps within different groups to obtain a second feature map group. For example, if the first feature map group is divided into four groups according to the number of channels, four convolution kernels of different scales can be used to convolve these four feature map groups, with the convolution kernels of the same scale used for the feature maps within each group. Convolution kernels of different scales are used to convolve the feature maps in different groups, and then the convolved feature maps are spliced ​​together to obtain a second feature map group. Finally, barrel-shaped objects in the image to be detected are detected based on the second feature map group.

[0055] Among them, the barrel detection model is trained using sample images with barrel location information labels and sample images without barrels.

[0056] In this embodiment of the present invention, an image to be detected is input into a pre-trained barrel-shaped object detection model. Feature extraction is performed on the image based on the barrel-shaped object detection model to obtain a multi-channel first feature map group. The first feature map group is then grouped by channel number, and convolution processing is performed on the feature maps within each group using convolution kernels of different scales to obtain a second feature map group. This allows the barrel-shaped object detection model to focus more on the detailed features in the image to be detected. Finally, barrel-shaped objects in the image to be detected are detected based on the second feature map group. This enables accurate detection of barrel-shaped objects in images to be detected even in complex scenes.

[0057] Example 2:

[0058] In order to make the barrel-shaped object detection more accurate, based on the above embodiment, in an embodiment of the present invention, the first feature map group is grouped according to the number of channels, and convolution kernels of different scales are used to perform convolution processing on the feature maps in different groups to obtain the second feature map group, which includes:

[0059] The first feature map groups are grouped according to the number of channels, and convolution kernels of different scales are used to perform convolution processing on the feature maps in different groups to obtain feature groups as the third feature map group;

[0060] The third feature map group is grouped according to the number of channels, and the feature map in each group is multiplied by the pre-trained weight parameter to obtain the second feature map group.

[0061] In an embodiment of the present invention, the first feature map group is grouped according to the number of channels, and the feature groups obtained by convolving the feature maps in different groups with convolution kernels of different scales are used as the third feature map group, and then the third feature map group is grouped according to the number of channels. It should be noted that the number of groups at this time can be the same as or different from the number of groups for grouping the first feature map group according to the number of channels. When the third feature map group is grouped according to the number of channels, the feature maps that have been convolved with convolution kernels of the same scale can be grouped together. The third feature map group is grouped according to the number of channels, and the feature maps in each group are multiplied by the weight parameters obtained by pre-training to obtain the second feature map group. Finally, the barrel-shaped objects in the image to be detected are detected based on the second feature map group.

[0062] Figure 2 This is a flowchart of barrel-shaped object detection based on a barrel-shaped object detection model provided in an embodiment of the present invention. Figure 2 The input is a multi-channel first feature map group obtained by extracting features from the image to be detected based on the barrel detection model. The first feature map group is first divided into multiple groups based on channel C. The features of different groups are convolved at different scales and then concatenated using a concatenation operation to obtain new feature maps, thus completing the SPC module. The spatial visual attention vector SEWeight is then used to extract target features from the multi-scale response map of the new feature maps. The Softmax function is used to redistribute the feature map weight vector. Finally, the weight vector is multiplied by the feature map using an element-wise multiplication operation to obtain the final feature map.

[0063] Figure 3 This is a schematic diagram of the barrel detection model structure provided by an embodiment of the present invention. Figure 3 The Focus, slice, Concat, CBL, SPP, Maxpool, Conv, BN, relu and other modules in it are the backbone network of YOLO. This part has the same function as the existing YOLO network and will not be repeated here. Figure 3 The EPSA module in the figure is the attention mechanism module in the barrel detection model.

[0064] In this embodiment of the present invention, based on the barrel-shaped object detection model, feature extraction is performed on the image to be detected to obtain a multi-channel first feature map group; the first feature map group is grouped according to the number of channels, and convolution processing is performed on the feature maps in different groups using convolution kernels of different scales to obtain a third feature map group; the third feature map group is grouped according to the number of channels, and the feature maps in each group are multiplied by pre-trained weight parameters to obtain a second feature map group. Barrel-shaped objects in the image to be detected are detected based on the second feature map group. This allows for better extraction of detailed features in the image to be detected, further enhancing the accuracy of barrel-shaped object detection.

[0065] Example 3:

[0066] In order to further make the barrel-shaped object detection more accurate, based on the above embodiment, in an embodiment of the present invention, the method further includes:

[0067] using the barrel-shaped object region image in the image to be detected detected according to the second feature map group as a suspected region image;

[0068] The suspected area image is input into a pre-trained barrel-shaped object classification model, and based on the first branch network structure in the barrel-shaped object classification model, it is detected whether the object in the suspected area image is a barrel-shaped object.

[0069] The electronic device includes a pre-trained barrel classification model, which consists of two branch networks. The first branch performs secondary barrel detection to ensure accuracy, while the second branch detects whether the barrel lid is open or closed.

[0070] In an embodiment of the present invention, if a barrel-shaped object is detected in the image to be detected based on the second feature map group, the barrel-shaped object area image in the image to be detected is used as the suspected area image, and then the suspected area image is input into a pre-trained barrel-shaped object classification model, and based on the first branch network structure in the barrel-shaped object classification model, it is detected whether the object in the suspected area image is a barrel-shaped object. If, based on the first branch network structure in the barrel-shaped object classification model, it is detected that the object in the suspected area image is not a barrel-shaped object, then it is determined that there is no barrel-shaped object in the image to be detected. If, based on the first branch network structure in the barrel-shaped object classification model, it is detected that the object in the suspected area image is a barrel-shaped object, that is, based on the barrel detection model and the first branch network structure in the barrel classification model, both detect that there is a barrel-shaped object in the image to be detected, then it is determined that there is a barrel-shaped object in the image to be detected.

[0071] The detecting whether the object in the suspected region image is a barrel-shaped object based on the first branch network structure in the barrel-shaped object classification model includes:

[0072] Based on the feature extraction layer in the barrel classification model, the suspected area image is subjected to multiple convolution processes to obtain multiple feature maps, the multiple feature maps are cross-multiplied, the multiple feature maps obtained by the cross-multiplication are pooled, and the objects in the suspected area image are detected to be barrel-shaped through the fully connected layer and the classification layer.

[0073] If the object in the suspected area image is detected as a barrel-shaped object based on the first branch network structure in the barrel-shaped object classification model, the switch state of the barrel-shaped object top cover is detected based on the second branch network structure in the barrel-shaped object classification model.

[0074] The first branch network structure in the barrel classification model is trained using sample images labeled with whether they are barrels. The second branch network structure in the barrel classification model is trained using sample images labeled with the on / off status of the top cover.

[0075] The first and second branch network structures in the barrel classification model both extract features from the suspected area image, and therefore share the same Resnet backbone network structure, with branch differentiation performed at the fully connected layer and softmax layer. To address fine-grained issues such as the need to subdivide trash cans and other barrels within the barrel class, and the need to subdivide the local lid state into open and closed, a hierarchical bilinear pooling structure (HBP) is added to the Resnet backbone network. By cascading multiple cross-layer bilinear pooling modules, more convolutional layer features are included. The structure is as follows: Figure 4 The output of the HBP model is

[0076]

[0077] like Figure 4 As shown in the figure, the left part is the U, V, Y convolution layer features obtained by Resnet convolution, which are cross-concatenated through the x, y, z projection matrix in the middle part, and finally the corresponding feature fusion is obtained through P pooling. Without adding additional training parameters, a stronger representation ability is obtained, so that the classification between classes can be more refined.

[0078] The method further comprises:

[0079] If the top cover of the barrel is detected to be open based on the second branch network structure in the barrel classification model, the image to be detected is used as a candidate alarm image; when a set number of consecutive frames of candidate alarm images are determined, an alarm prompt message is output.

[0080] It should be noted that the electronic device can output an alarm prompt message after detecting that the top cover of a barrel is open. To avoid false alarms caused by misjudgment, the second branch network structure in the barrel classification model can detect that the top cover of the barrel is open and use the image to be detected as a candidate alarm image. When a set number of consecutive frames of candidate alarm images are determined, the alarm prompt message is output. The set number can be 10 frames, 20 frames, etc.

[0081] The electronic device can be equipped with a built-in alarm module. When an alarm message is required, the alarm message is output through the built-in alarm module. Alternatively, a separate alarm module, such as an audible or visual alarm, can be installed in an appropriate location as needed. Ensure that the alarm module and the electronic device are able to communicate. When the electronic device determines that an alarm message needs to be output, the alarm module is controlled to output the alarm message.

[0082] Example 4:

[0083] Figure 5 This is a schematic structural diagram of a barrel-shaped object detection device provided by an embodiment of the present invention, the device comprising:

[0084] An acquisition module 51 is used to acquire an image to be detected and input the image to be detected into a pre-trained barrel-shaped object detection model;

[0085] The detection module 52 is used to extract features of the image to be detected based on the barrel detection model to obtain a first multi-channel feature map group; group the first feature map group according to the number of channels, and use convolution kernels of different scales to convolve the feature maps in different groups to obtain a second feature map group; and detect the barrel in the image to be detected based on the second feature map group.

[0086] The detection module 52 is specifically used to group the first feature map groups according to the number of channels, and use convolution kernels of different scales to convolve the feature maps in different groups to obtain feature groups as the third feature map group; group the third feature map group according to the number of channels, and multiply the feature map in each group by the pre-trained weight parameters to obtain the second feature map group.

[0087] The detection module 52 is also used to use the barrel area image in the image to be detected according to the second feature map group as a suspected area image; input the suspected area image into a pre-trained barrel classification model, and based on the first branch network structure in the barrel classification model, detect whether the object in the suspected area image is a barrel.

[0088] The detection module 52 is also used to detect that the object in the suspected area image is a barrel-shaped object based on the first branch network structure in the barrel-shaped object classification model, and to detect the switch status of the barrel-shaped object top cover based on the second branch network structure in the barrel-shaped object classification model.

[0089] The device further comprises:

[0090] The alarm module 53 is used to detect that the top cover of the barrel is open based on the second branch network structure in the barrel classification model, and use the image to be detected as a candidate alarm image; when a set number of consecutive frames of candidate alarm images are determined, output an alarm prompt message.

[0091] The detection module 52 is specifically used to perform feature extraction on the image to be detected based on the feature extraction module in the barrel detection model to obtain a first multi-channel feature map group; group the first feature map group according to the number of channels based on the attention mechanism module in the barrel detection model, and use convolution kernels of different scales to convolve the feature maps in different groups to obtain a second feature map group; and detect the barrel in the image to be detected based on the second feature map group.

[0092] The detection module 52 is specifically used to perform multiple convolution processes on the suspected area image based on the feature extraction layer in the barrel classification model to obtain multiple feature maps, cross-multiply the multiple feature maps, pool the multiple feature maps obtained by cross-multiplication, and detect whether the object in the suspected area image is a barrel through a fully connected layer and a classification layer.

[0093] Example 5:

[0094] On the basis of the above embodiments, an electronic device is further provided in an embodiment of the present invention, such as Figure 6 As shown, it includes: a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304;

[0095] The memory 303 stores a computer program. When the program is executed by the processor 301, the processor 301 performs the following steps:

[0096] Acquire an image to be detected, and input the image to be detected into a pre-trained barrel-shaped object detection model;

[0097] Based on the barrel-shaped object detection model, features are extracted from the image to be detected to obtain a first multi-channel feature map group; the first feature map group is grouped according to the number of channels, and convolution kernels of different scales are used to perform convolution processing on the feature maps in different groups to obtain a second feature map group; and barrel-shaped objects in the image to be detected are detected based on the second feature map group.

[0098] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present invention. Since the principle of solving the problem by the above electronic device is similar to that of the barrel-shaped object detection method, the implementation of the above electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0099] The electronic device provided in the embodiment of the present invention may specifically be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), a network side device, etc.

[0100] The communication bus mentioned in the electronic device mentioned above may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.

[0101] The communication interface 302 is used for communication between the electronic device and other devices.

[0102] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk memory. Alternatively, the memory may be at least one storage device located away from the processor.

[0103] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0104] In an embodiment of the present invention, when the processor executes the program stored in the memory, it obtains the image to be detected and inputs the image to be detected into a pre-trained barrel detection model; based on the barrel detection model, features are extracted from the image to be detected to obtain a first multi-channel feature map group; the first feature map group is grouped according to the number of channels, and convolution kernels of different scales are used to perform convolution processing on the feature maps in different groups to obtain a second feature map group; and the barrel in the image to be detected is detected based on the second feature map group.

[0105] Example 6:

[0106] Based on the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by an electronic device. When the program is executed on the electronic device, the electronic device implements the following steps:

[0107] Acquire an image to be detected, and input the image to be detected into a pre-trained barrel-shaped object detection model;

[0108] Based on the barrel-shaped object detection model, features are extracted from the image to be detected to obtain a first multi-channel feature map group; the first feature map group is grouped according to the number of channels, and convolution kernels of different scales are used to perform convolution processing on the feature maps in different groups to obtain a second feature map group; and barrel-shaped objects in the image to be detected are detected based on the second feature map group.

[0109] Based on the same inventive concept, a computer-readable storage medium is also provided in an embodiment of the present invention. Since the principle of solving the problem when the processor executes the computer program stored on the above-mentioned computer-readable storage medium is similar to that of the barrel-shaped object detection method, the implementation of the computer program stored on the above-mentioned computer-readable storage medium by the processor can refer to the implementation of the method, and the repeated parts will not be repeated.

[0110] The above-mentioned computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor in the electronic device, including but not limited to magnetic storage such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc., optical storage such as CDs, DVDs, BDs, HVDs, etc., and semiconductor storage such as ROMs, EPROMs, EEPROMs, non-volatile memories (NANDFLASH), solid-state drives (SSDs), etc.

[0111] A computer program is stored in a computer-readable storage medium provided in an embodiment of the present invention. When the computer program is executed by a processor, it obtains an image to be detected, inputs the image to be detected into a pre-trained barrel detection model; based on the barrel detection model, performs feature extraction on the image to be detected to obtain a first multi-channel feature map group; groups the first feature map group according to the number of channels, and uses convolution kernels of different scales to perform convolution processing on the feature maps in different groups to obtain a second feature map group; and detects barrels in the image to be detected based on the second feature map group.

[0112] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0113] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0114] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0115] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0116] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. A barrel-shaped object detection method, characterized in that: The method comprises: Acquire an image to be detected, and input the image to be detected into a pre-trained barrel-shaped object detection model; Based on the barrel-shaped object detection model, features are extracted from the image to be detected to obtain a first multi-channel feature map group; the first feature map group is grouped according to the number of channels, and convolution kernels of different scales are used to convolve the feature maps in different groups to obtain feature groups as a third feature map group; the third feature map group is grouped according to the number of channels, and the feature map in each group is multiplied by a pre-trained weight parameter to obtain a second feature map group; and barrel-shaped objects in the image to be detected are detected based on the second feature map group.

2. The method according to claim 1, wherein The method further comprises: using the barrel-shaped object region image in the image to be detected detected according to the second feature map group as a suspected region image; The suspected area image is input into a pre-trained barrel-shaped object classification model, and based on the first branch network structure in the barrel-shaped object classification model, it is detected whether the object in the suspected area image is a barrel-shaped object.

3. The method according to claim 2, wherein The method further comprises: If the object in the suspected area image is detected as a barrel-shaped object based on the first branch network structure in the barrel-shaped object classification model, the switch state of the barrel-shaped object top cover is detected based on the second branch network structure in the barrel-shaped object classification model.

4. The method according to claim 3, wherein The method further comprises: If the top cover of the barrel is detected to be open based on the second branch network structure in the barrel classification model, the image to be detected is used as a candidate alarm image; when a set number of consecutive frames of candidate alarm images are determined, an alarm prompt message is output.

5. The method according to claim 1, wherein Based on the barrel-shaped object detection model, feature extraction is performed on the image to be detected to obtain a multi-channel first feature map group; the first feature map group is grouped according to the number of channels, and convolution kernels of different scales are used to perform convolution processing on the feature maps in different groups to obtain a second feature map group; Detecting the barrel-shaped object in the image to be detected according to the second feature map group includes: The barrel detection model includes a feature extraction module and an attention mechanism module; Based on the feature extraction module in the barrel-shaped object detection model, feature extraction is performed on the image to be detected to obtain a first multi-channel feature map group; based on the attention mechanism module in the barrel-shaped object detection model, the first feature map group is grouped according to the number of channels, and convolution kernels of different scales are used to perform convolution processing on the feature maps in different groups to obtain a second feature map group; and barrel-shaped objects in the image to be detected are detected based on the second feature map group.

6. The method according to claim 2, wherein The detecting whether the object in the suspected region image is a barrel-shaped object based on the first branch network structure in the barrel-shaped object classification model includes: Based on the feature extraction layer in the barrel classification model, the suspected area image is subjected to multiple convolution processes to obtain multiple feature maps, the multiple feature maps are cross-multiplied, the multiple feature maps obtained by the cross-multiplication are pooled, and the objects in the suspected area image are detected to be barrel-shaped through the fully connected layer and the classification layer.

7. A barrel-shaped object detection device, characterized in that: The device comprises: An acquisition module is used to acquire an image to be detected and input the image to be detected into a pre-trained barrel-shaped object detection model; The detection module is used to extract features of the image to be detected based on the barrel detection model to obtain a multi-channel first feature map group; group the first feature map group according to the number of channels, and use convolution kernels of different scales to convolve the feature maps in different groups to obtain feature groups as a third feature map group; group the third feature map group according to the number of channels, multiply the feature map in each group by a pre-trained weight parameter to obtain a second feature map group; and detect barrel-shaped objects in the image to be detected based on the second feature map group.

8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory for storing computer programs; A processor, configured to implement the method steps described in any one of claims 1 to 6 when executing a program stored in a memory.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Target detection method and device, computer readable storage medium and computer device

    CN110309876A

  • Target detection method and apparatus, computer-readable storage medium, and computer device

    WO2020038205A1