A method and system for detecting extremely small objects in an image, a storage medium and a terminal
By performing multiple sets of convolution, pooling and non-linear activation operations on the image, combined with upsampling and connection operations, a neural network capable of detecting extremely small objects is formed, which solves the problem of poor detection of extremely small objects in the existing technology. The reliability and effectiveness of image detection are achieved.
Patent Information
- Application Number
- CN202011004320.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-22
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2040-09-22
AI Technical Summary
Existing target detection algorithms are not effective in detecting extremely small objects with dimensions less than 20*20 pixels, resulting in frequent missed detections and failing to ensure the reliability and effectiveness of image detection.
A method for detecting very small objects in images is adopted. By performing multiple sets of convolution, pooling and nonlinear function activation operations on the input image, combined with upsampling and connection operations, a feature map is generated to detect very small objects, specifically including multiple times Convolution, pooling and non-linear activation operations, as well as a preset number of convolution and pooling operations, form a neural network capable of detecting extremely small objects.
It effectively avoids missed detection of extremely small objects, improves the reliability and effectiveness of image detection, and ensures accurate detection of extremely small objects.
Smart Images

Figure CN112183291B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method and system for detecting extremely small objects in an image, a storage medium and a terminal. Background Art
[0002] Object detection is to accurately find the location of an object in a given image and mark the category of the object. In the prior art, object detection algorithms are mainly based on deep learning models, which mainly include the following two categories:
[0003] (1) One-stage detection algorithm, which does not require the region proposal stage, directly generates the category probability and position coordinate value of the object. The final detection result can be obtained directly after a single detection, so it has a faster detection speed. Typical algorithms include YOLO, SSD, and Retina-Net.
[0004] (2) Two-stage detection algorithm: Use the corresponding Region Proposal algorithm to generate proposed target candidate regions from the input image and send all candidate regions to the classifier for classification.
[0005] The main performance indicators of the target detection model are detection accuracy and speed. For accuracy, target detection should consider the accuracy of object positioning, not just classification accuracy. Generally speaking, the two-stage algorithm has an advantage in accuracy, while the one-stage algorithm has an advantage in speed.
[0006] However, both the one-stage detection algorithm and the two-stage detection algorithm only have good effects on detecting objects of normal size in the image, and do not consider the detection of extremely small objects such as those with a size less than 20*20 pixels, which leads to the omission of extremely small objects. Summary of the invention
[0007] In view of the shortcomings of the prior art described above, the purpose of the present invention is to provide a method and system for detecting extremely small objects in an image, a storage medium and a terminal, which realize the detection of extremely small objects in an image based on a neural network capable of detecting extremely small objects, thereby ensuring the reliability and effectiveness of image detection.
[0008] To achieve the above-mentioned purpose and other related purposes, the present invention provides a method for detecting extremely small objects in an image, comprising the following steps: obtaining an input image; continuously performing at least four groups of convolution, pooling and nonlinear function activation operations on the input image; wherein the feature maps obtained by the last four groups of convolution, pooling and nonlinear function activation operations are respectively a first feature map, a second feature map, a third feature map and a fourth feature map; performing a first numerical upsampling operation on the second feature map to obtain a fifth feature map, performing a second numerical upsampling operation on the third feature map to obtain a sixth feature map, and performing a third numerical upsampling operation on the fourth feature map to obtain a seventh feature map; connecting the first feature map, the fifth feature map, the sixth feature map and the seventh feature map to obtain an eighth feature map; performing a first preset number of convolution, pooling and nonlinear function activation operations on the eighth feature map to obtain a ninth feature map; performing a second preset number of convolution, pooling and nonlinear function activation operations on the ninth feature map to obtain a tenth feature map; and detecting extremely small objects in the input image based on the tenth feature map.
[0009] In one embodiment of the present invention, the method further includes preprocessing the input image to perform six convolution, pooling and nonlinear function activation operations based on the preprocessed input image.
[0010] In one embodiment of the present invention, the last four groups of convolution, pooling and non-linear function activation operations correspond to two, eight, eight and four consecutive convolution, pooling and non-linear function activation operations respectively.
[0011] In one embodiment of the present invention, the first number of times, the second number of times and the third number of times are once, twice and three times respectively; the first preset number of times is five times, and the second preset number of times is once.
[0012] Correspondingly, the present invention provides a system for detecting extremely small objects in an image, comprising an acquisition module, a first convolution module, an upsampling module, a connection module, a second convolution module, a third convolution module and a detection module;
[0013] The acquisition module is used to acquire an input image;
[0014] The first convolution module is used to continuously perform at least four groups of convolution, pooling and non-linear function activation operations on the input image; wherein the feature maps obtained by the last four groups of convolution, pooling and non-linear function activation operations are respectively the first feature map, the second feature map, the third feature map and the fourth feature map;
[0015] The upsampling module is used to perform a first digital upsampling operation on the second feature map to obtain a fifth feature map, perform a second digital upsampling operation on the third feature map to obtain a sixth feature map, and perform a third digital upsampling operation on the fourth feature map to obtain a seventh feature map;
[0016] The connection module is used to connect the first characteristic map, the fifth characteristic map, the sixth characteristic map and the seventh characteristic map to obtain an eighth characteristic map;
[0017] The second convolution module is used to perform a first preset number of convolution, pooling and nonlinear function activation operations on the eighth feature map to obtain a ninth feature map;
[0018] The third convolution module is used to perform a second preset number of convolution, pooling and non-linear function activation operations on the ninth feature map to obtain a tenth feature map;
[0019] The detection module is used to detect extremely small objects in the input image based on the tenth feature map.
[0020] In one embodiment of the present invention, the method further includes preprocessing the input image to perform six convolution, pooling and nonlinear function activation operations based on the preprocessed input image.
[0021] In one embodiment of the present invention, the last four groups of convolution, pooling and non-linear function activation operations correspond to two, eight, eight and four consecutive convolution, pooling and non-linear function activation operations respectively.
[0022] In one embodiment of the present invention, the first number of times, the second number of times and the third number of times are once, twice and three times respectively; the first preset number of times is five times, and the second preset number of times is once.
[0023] The present invention provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for detecting extremely small objects in an image is implemented.
[0024] Finally, the present invention provides a terminal, including: a processor and a memory;
[0025] The memory is used to store computer programs;
[0026] The processor is used to execute the computer program stored in the memory, so that the terminal executes the above-mentioned method for detecting extremely small objects in an image.
[0027] As described above, the method and system for detecting extremely small objects in an image, the storage medium and the terminal of the present invention have the following beneficial effects:
[0028] (1) Detecting extremely small objects in images based on a neural network that can detect extremely small objects;
[0029] (2) It avoids missing very small objects during image detection and ensures the reliability and effectiveness of image detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 Shown is a flow chart of a method for detecting extremely small objects in an image according to an embodiment of the present invention;
[0031] Figure 2 It is a schematic diagram showing the structure of a method for detecting very small objects in an image in one embodiment of the present invention;
[0032] Figure 3 Shown is a schematic structural diagram of a system for detecting extremely small objects in an image according to an embodiment of the present invention;
[0033] Figure 4 Shown is a schematic structural diagram of a terminal in one embodiment of the present invention.
[0034] Component number description
[0035] 31 Get Module
[0036] 32 First convolution module
[0037] 33 Upsampling module
[0038] 34 Connection module
[0039] 35 Second convolution module
[0040] 36 The third convolution module
[0041] 37 Detection module
[0042] 41 Processor
[0043] 42 Memory DETAILED DESCRIPTION
[0044] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention.
[0045] It should be noted that the illustrations provided in this embodiment are only used to illustrate the basic concept of the present invention in a schematic manner. Therefore, the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0046] The method and system for detecting extremely small objects in images, the storage medium and the terminal of the present invention realize the detection of extremely small objects in images by detecting a neural network for extremely small objects, thereby effectively avoiding the missed detection of extremely small objects, thereby ensuring the reliability and effectiveness of image detection.
[0047] like Figure 1 As shown, in one embodiment, the method for detecting extremely small objects in an image of the present invention comprises the following steps:
[0048] Step S1, obtaining an input image.
[0049] Specifically, the input image contains a very small object. Preferably, the very small object is an object smaller than 20*20 pixels.
[0050] Step S2, continuously performing at least four groups of convolution, pooling and non-linear function activation operations on the input image; wherein the feature maps obtained by the last four groups of convolution, pooling and non-linear function activation operations are respectively the first feature map, the second feature map, the third feature map and the fourth feature map.
[0051] Specifically, Figure 2 As shown, taking the input image of 416*416*3 pixels as an example,
[0052] First, a convolution kernel of size 32*3*3 is used to perform convolution, pooling, and nonlinear function activation operations on the input image of 416*416*3 pixels to obtain a feature map of 416*41*32 pixels.
[0053] Next, a convolution kernel of size 64*3*3 is used to perform convolution, pooling, and nonlinear function activation operations on the feature map of 416*41*32 pixels to obtain a feature map of 208*208*64 pixels.
[0054] Then, a convolution kernel of size 128*3*3 is used to perform convolution, pooling, and nonlinear function activation operations on the feature map of 208*208*64 pixels. This is performed twice in a row to obtain a feature map A of 104*104*128 pixels.
[0055] Then, using a convolution kernel of size 256*3*3, convolution operation, pooling operation and nonlinear function activation operation are performed on feature map A of 104*104*128 pixels for eight consecutive times to obtain feature map B of 52*52*256 pixels.
[0056] Then, using a convolution kernel of size 512*3*3, convolution operation, pooling operation and nonlinear function activation operation are performed on feature map B of 52*52*256 pixels for eight consecutive times to obtain feature map C of 26*26*512 pixels.
[0057] Finally, a convolution kernel of size 1024*3*3 is used to perform convolution, pooling, and nonlinear function activation operations on the feature map C of 26*26*512 pixels for four consecutive times to obtain a feature map D of 13*13*1024 pixels.
[0058] Step S3: performing a first digital upsampling operation on the second feature map to obtain a fifth feature map, performing a second digital upsampling operation on the third feature map to obtain a sixth feature map, and performing a third digital upsampling operation on the fourth feature map to obtain a seventh feature map.
[0059] Specifically, feature map B is upsampled once to obtain feature map E of 104*104*256 pixels; feature map C is upsampled twice to obtain feature map F of 104*104*512 pixels; feature map D is upsampled three times to obtain feature map G of 104*104*1024 pixels.
[0060] Step S4: connect the first characteristic map, the fifth characteristic map, the sixth characteristic map and the seventh characteristic map to obtain an eighth characteristic map.
[0061] Specifically, feature map A, feature map E, feature map F, and feature map G are concatenated to obtain a feature map H of 104*104*1920 pixels.
[0062] Step S5: performing a first preset number of convolution, pooling, and nonlinear function activation operations on the eighth feature map to obtain a ninth feature map.
[0063] Specifically, a convolution kernel of size 128*3*3 is used to perform convolution operations, pooling operations, and nonlinear function activation operations on the feature map H of 104*104*1920 pixels for five consecutive times to obtain a feature map J of 104*104*128 pixels.
[0064] Step S6: performing a second preset number of convolution, pooling, and nonlinear function activation operations on the ninth feature map to obtain a tenth feature map.
[0065] Specifically, a convolution kernel of size 75*3*3 is used to perform a convolution operation, a pooling operation, and an activation of a nonlinear function on the feature map J of 104*104*128 pixels to obtain a feature map K of 104*104*75 pixels.
[0066] Step S7: Detect extremely small objects in the input image based on the tenth feature map.
[0067] Specifically, a feature map K of 104*104*75 pixels is used to detect extremely small objects in the input image.
[0068] In one embodiment of the present invention, the method for detecting extremely small objects in an image of the present invention further comprises preprocessing the input image to perform six convolution, pooling and nonlinear function activation operations based on the preprocessed input image, thereby ensuring the accuracy of extremely small object detection. Preferably, the preprocessing operation comprises one or a combination of denoising and contrast enhancement.
[0069] like Figure 3 As shown, in one embodiment, the extremely small object detection system in an image of the present invention includes an acquisition module 31, a first convolution module 32, an upsampling module 33, a connection module 34, a second convolution module 35, a third convolution module 36 and a detection module 37.
[0070] The acquisition module 31 is used to acquire an input image.
[0071] The first convolution module 32 is connected to the acquisition module 31, and is used to continuously perform at least four groups of convolution, pooling and non-linear function activation operations on the input image; wherein the feature maps obtained by the last four groups of convolution, pooling and non-linear function activation operations are respectively the first feature map, the second feature map, the third feature map and the fourth feature map.
[0072] The upsampling module 33 is connected to the first convolution module 32, and is used to perform a first numerical upsampling operation on the second feature map to obtain a fifth feature map, perform a second numerical upsampling operation on the third feature map to obtain a sixth feature map, and perform a third numerical upsampling operation on the fourth feature map to obtain a seventh feature map.
[0073] The connection module 34 is connected to the first convolution module 32 and the upsampling module 33, and is used to connect the first feature map, the fifth feature map, the sixth feature map and the seventh feature map to obtain an eighth feature map.
[0074] The second convolution module 35 is connected to the connection module 34, and is used to perform a first preset number of convolution, pooling and non-linear function activation operations on the eighth feature map to obtain a ninth feature map.
[0075] The third convolution module 36 is connected to the second convolution module 35, and is used to perform a second preset number of convolution, pooling and non-linear function activation operations on the ninth feature map to obtain a tenth feature map.
[0076] The detection module 37 is connected to the third convolution module 36 and is used to detect extremely small objects in the input image based on the tenth feature map.
[0077] Among them, the structures and principles of the acquisition module 31, the first convolution module 32, the upsampling module 33, the connection module 34, the second convolution module 35, the third convolution module 36 and the detection module 37 correspond one by one to the steps in the above-mentioned method for detecting extremely small objects in the image, so they are not repeated here.
[0078] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the x module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0079] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0080] The storage medium of the present invention stores a computer program, which is characterized in that when the program is executed by a processor, the above-mentioned method for detecting extremely small objects in an image is implemented. The storage medium includes: ROM, RAM, disk, USB flash drive, memory card or optical disk, etc., which can store program codes.
[0081] like Figure 4 As shown, in one embodiment, the terminal of the present invention includes: a processor 41 and a memory 42 .
[0082] The memory 42 is used to store computer programs.
[0083] The memory 42 includes: ROM, RAM, disk, USB flash drive, memory card or CD and other media that can store program codes.
[0084] The processor 41 is connected to the memory 42 and is used to execute the computer program stored in the memory 42 so that the terminal executes the above-mentioned method for detecting extremely small objects in an image.
[0085] Preferably, the processor 41 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0086] In summary, the method and system for detecting extremely small objects in images, the storage medium and the terminal of the present invention realize the detection of extremely small objects in images based on a neural network capable of detecting extremely small objects; the omission of extremely small objects during image detection is avoided, and the reliability and effectiveness of image detection are ensured. Therefore, the present invention effectively overcomes various shortcomings in the prior art and has a high industrial utilization value.
[0087] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A method for detecting extremely small objects in an image. Features: The following steps are involved: Get the input image; Continuously performing at least four groups of convolution, pooling and non-linear function activation operations on the input image; wherein the feature maps obtained by the last four groups of convolution, pooling and non-linear function activation operations are respectively a first feature map, a second feature map, a third feature map and a fourth feature map; Performing a first digital upsampling operation on the second feature map to obtain a fifth feature map, performing a second digital upsampling operation on the third feature map to obtain a sixth feature map, and performing a third digital upsampling operation on the fourth feature map to obtain a seventh feature map; Connecting the first characteristic map, the fifth characteristic map, the sixth characteristic map, and the seventh characteristic map to obtain an eighth characteristic map; Performing a first preset number of convolution, pooling, and nonlinear function activation operations on the eighth feature map to obtain a ninth feature map; Performing convolution, pooling, and nonlinear function activation operations for a second preset number of times on the ninth feature map to obtain a tenth feature map; Detecting extremely small objects in the input image based on the tenth feature map; The method also includes preprocessing the input image to perform at least four groups of convolution, pooling and non-linear function activation operations based on the preprocessed input image; The last four groups of convolution, pooling and non-linear function activation operations correspond to two, eight, eight and four consecutive convolution, pooling and non-linear function activation operations respectively; The first number of times, the second number of times and the third number of times are one, two and three respectively; the first preset number of times is five times, and the second preset number of times is one time; The size of the extremely small object is less than 20*20 pixels.
2. A system for detecting very small objects in images, Features: It includes an acquisition module, a first convolution module, an upsampling module, a connection module, a second convolution module, a third convolution module and a detection module; The acquisition module is used to acquire an input image; The first convolution module is used to continuously perform at least four groups of convolution, pooling and non-linear function activation operations on the input image; wherein the feature maps obtained by the last four groups of convolution, pooling and non-linear function activation operations are respectively the first feature map, the second feature map, the third feature map and the fourth feature map; The upsampling module is used to perform a first digital upsampling operation on the second feature map to obtain a fifth feature map, perform a second digital upsampling operation on the third feature map to obtain a sixth feature map, and perform a third digital upsampling operation on the fourth feature map to obtain a seventh feature map; The connection module is used to connect the first characteristic map, the fifth characteristic map, the sixth characteristic map and the seventh characteristic map to obtain an eighth characteristic map; The second convolution module is used to perform a first preset number of convolution, pooling and nonlinear function activation operations on the eighth feature map to obtain a ninth feature map; The third convolution module is used to perform a second preset number of convolution, pooling and non-linear function activation operations on the ninth feature map to obtain a tenth feature map; The detection module is used to detect extremely small objects in the input image based on the tenth feature map; The method also includes preprocessing the input image to perform at least four groups of convolution, pooling and non-linear function activation operations based on the preprocessed input image; The last four groups of convolution, pooling and non-linear function activation operations correspond to two, eight, eight and four consecutive convolution, pooling and non-linear function activation operations respectively; The first number of times, the second number of times and the third number of times are one, two and three respectively; the first preset number of times is five times, and the second preset number of times is one time; The size of the extremely small object is less than 20*20 pixels.
3. A storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method for detecting extremely small objects in an image as claimed in claim 1 is implemented.
4. A terminal, It is characterized in that include: Processor and memory; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory so that the terminal executes the method for detecting extremely small objects in an image as described in claim 1.
