Edge detection method, device and equipment based on dense sensing network
Through a method based on dense sensing network, using dense starting network and upsampling module to process RGB images, the problem of incomplete edge information is solved and better edge detection effect is achieved.
Patent Information
- Application Number
- CN202011197809.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-30
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2040-10-30
AI Technical Summary
When the edge information is incomplete, existing edge detection methods make training difficult and cannot achieve ideal results.
Using a method based on dense sensing network, by constructing a dense starting network and an upsampling module, RGB images are obtained for feature extraction and edge image generation to avoid deep edge loss and achieve complete fusion of edge information.
It effectively avoids the problem of incomplete edge information and improves the effect of edge detection.
Smart Images

Figure CN112365515B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to an edge detection method, device and equipment based on a dense sensing network. Background Art
[0002] Edge detection is a classic computer vision process that is repeatedly performed in modern tasks such as image-to-image translation, photo-painting, etc. Moreover, edge detectors are needed for most of their heartbeats in fields such as medical image analysis or remote sensing. Despite a lot of work done on edge detection, it is still a problem that needs to be improved. Since the Sobel operator, many edge detectors have been proposed, and most of the techniques such as Canny are still in use today. Recently, in the era of deep learning, edge detectors based on convolutional neural networks (CNNs) such as DeepEdge, HED, RCF, BDCN, etc. have been proposed. These models are able to predict edge maps from a given image with good performance. The success of these methods is mainly due to the combination of CNNs of different scales with training regularization techniques. However, these methods have some disadvantages, such as if the edge information is incomplete, which makes training difficult and does not achieve the desired results.
[0003] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide an edge detection method, device and equipment based on a dense sensing network, aiming to solve the technical problems in the prior art that the edge detection method has incomplete edge information, making training difficult, failing to achieve ideal results, and incomplete edge detection.
[0005] The technical solution of the present invention is as follows:
[0006] An edge detection method based on a dense sensing network, the method comprising:
[0007] Building dense sensing networks;
[0008] Obtain the RGB image to be recognized, input the RGB image into the dense perception network for feature extraction, and generate a feature map;
[0009] Sampling the feature map to generate an edge image;
[0010] All edge images of the target to be detected are fused to generate a target edge information image.
[0011] Furthermore, the dense perception network includes a dense starting network and an upsampling module,
[0012] The step of constructing a dense sensing network includes:
[0013] Constructing the network structure of dense initiation network;
[0014] The upsampling module is constructed according to the network structure of the dense inception network.
[0015] Further preferably, the step of obtaining an RGB image to be identified, inputting the RGB image into a dense perception network for feature extraction, and generating a feature map includes:
[0016] Get the RGB image to be recognized, input the RGB image into the dense inception network for feature extraction, and generate a feature map.
[0017] Further preferably, the step of sampling the feature map to generate an edge image comprises:
[0018] The feature map is input into the upsampling module for sampling to generate an edge image.
[0019] Preferably, the building of a dense sensing network includes:
[0020] Construct an encoder consisting of two stacked convolutional layers of a predetermined size and perform batching.
[0021] Furthermore, the construction of the upsampling module according to the network structure of the dense starting network includes
[0022] Constructing conditional stacking sub-blocks according to the network structure of the dense initiation network, wherein the sub-block types include a first sub-block and a second sub-block;
[0023] Constructing the first sub-block and the second sub-block;
[0024] The input of the first sub-block is preset to be the output of the dense inception network or the output of the second sub-block.
[0025] Further, the constructing of the first sub-block includes:
[0026] The first sub-block is preset to have two layers, wherein the first layer from the sub-block is a convolutional layer, and the second layer from the sub-block is a deconvolutional layer.
[0027] Another embodiment of the present invention provides an edge detection arrangement based on a dense sensing network, the apparatus comprising:
[0028] Network building module, used to build dense sensing networks;
[0029] The feature extraction module is used to obtain the RGB image to be identified, input the RGB image into the dense perception network for feature extraction, and generate a feature map;
[0030] A sampling module, used to sample the feature map to generate an edge image;
[0031] The image fusion module is used to fuse all edge images of the target to be detected to generate a target edge information image.
[0032] Another embodiment of the present invention provides an edge detection device based on a dense sensing network, the device comprising at least one processor; and
[0033] a memory communicatively connected to the at least one processor; wherein,
[0034] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned edge detection method based on dense perception network.
[0035] Another embodiment of the present invention also provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the one or more processors can execute the above-mentioned edge detection method based on dense perception network.
[0036] Beneficial effect: The embodiment of the present invention avoids the loss of deep edges, so the problem of incomplete edge information will not occur, thereby improving the effect of edge detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0038] Figure 1 A flowchart of a preferred embodiment of an edge detection method based on a dense sensing network of the present invention;
[0039] Figure 2 A schematic diagram of functional modules of a preferred embodiment of an edge detection device based on a dense sensing network of the present invention;
[0040] Figure 3 The figure is a schematic diagram of the hardware structure of a preferred embodiment of an edge detection device based on a dense sensing network of the present invention. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. The embodiments of the present invention are described below in conjunction with the accompanying drawings.
[0042] The embodiment of the present invention provides an edge detection method based on a dense sensing network. Figure 1 , Figure 1 FIG. 1 is a flow chart of a preferred embodiment of an edge detection method based on a dense sensing network of the present invention. Figure 1 As shown, it includes the steps of:
[0043] Step S100: constructing a dense sensing network;
[0044] Step S200, obtaining an RGB image to be recognized, inputting the RGB image into a dense perception network for feature extraction, and generating a feature map;
[0045] Step S300, sampling the feature map to generate an edge image;
[0046] Step S400: All edge images of the target to be detected are fused to generate a target edge information image.
[0047] In specific implementation, the present invention is mainly aimed at edge detection of human bodies and other objects in online live classes. The present invention proposes an edge detection method based on a dense perception network. The method of the present invention is composed of an innovative dense perception network, which is mainly composed of some learning filters. These filters receive the input image and then predict the edge feature map with the same resolution. When the network of the present invention is input into an RGB image, the features are extracted, and the feature map of each block of the input network is sampled to generate a thin edge feature map, thereby avoiding the loss of deep edges. Therefore, the problem of incomplete edge information will be avoided, thereby improving the effect of edge detection.
[0048] Furthermore, the dense perception network includes a dense initiation network and an upsampling module.
[0049] The step of constructing a dense sensing network includes:
[0050] Constructing the network structure of dense initiation network;
[0051] The upsampling module is constructed according to the network structure of the dense inception network.
[0052] In specific implementation, the network includes a dense inception network and an upsampling module, and the dense inception network and the upsampling module main blocks are connected by 1x1 convolution blocks. Each main block consists of sub-blocks, which are closely connected through the output of the previous main block. The output of each main block is fed into an upsampling block, which produces an intermediate edge map to build a scaled spatial volume, which is used to form a final fused edge map.
[0053] Furthermore, an RGB image to be identified is obtained, and the RGB image is input into a dense perception network for feature extraction to generate a feature map, including:
[0054] Get the RGB image to be recognized, input the RGB image into the dense inception network for feature extraction, and generate a feature map.
[0055] In the specific implementation, the RBG image is fed into a dense inception network for feature extraction, and the dense inception network can effectively avoid the loss of edge information.
[0056] Furthermore, the feature map is sampled to generate an edge image, including:
[0057] The feature map is input into the upsampling module for sampling to generate an edge image.
[0058] In specific implementation, the extracted feature map is fed into the upsampling module to generate the edge image, and finally the edge images generated by these upsampling modules are fused to generate the final edge information image.
[0059] Furthermore, a dense sensing network is constructed, including:
[0060] Construct an encoder consisting of two stacked convolutional layers of a predetermined size and perform batching.
[0061] In practice, the Dense Inception Network consists of an encoder with 6 main modules, and the results of the 6 modules are fused to get the final result. The blue block is composed of two convolutional layers with a kernel size of 3×3, followed by batch normalization and ReLU (Rectified Linear Unit) as the activation function (only the last convolution in the last sub-block is not activated). The max pooling is set to 3×3 kernel and stride=2. Since the architecture follows multi-scale learning, like HED, an upsampling process follows. Since the deeper the convolutional layer, the module will lose important edge features. Therefore, starting from the 3rd block, the output of the sub-block is edge-connected average.
[0062] Furthermore, the upsampling module is constructed according to the network structure of the dense inception network, including
[0063] Constructing conditional stacking sub-blocks according to the network structure of the dense initiation network, wherein the sub-block types include a first sub-block and a second sub-block;
[0064] Constructing the first sub-block and the second sub-block;
[0065] The input of the first sub-block is preset to be the output of the dense inception network or the output of the second sub-block.
[0066] In specific implementation, the sampling module is composed of conditionally stacked sub-blocks. There are two types of sub-blocks. Sub-block 1 is fed by the dense inception network or sub-block 2, and is only used when the scale difference between the feature map and the ground truth is equal to 2; sub-block 2 is considered for use only when the scale difference is greater than 2, and sub-block 2 is used iteratively until the scale difference is equal to 2. The structure of sub-block 1 is 1x1 convolution-ReLU activation function-SxS size deconvolution, s is equal to the input feature map size. The last convolution layer has no activation function. Sub-block 2 is set similarly to sub-block 1, except for the number of filters.
[0067] Furthermore, the first sub-block is constructed, including:
[0068] The first sub-block is preset to have two layers, wherein the first layer from the sub-block is a convolutional layer, and the second layer from the sub-block is a deconvolutional layer.
[0069] In specific implementation, each sub-block has 2 layers, one convolution and one deconvolution. Taking the first sub-block as an example with two layers, the upsampling process of the first layer from the sub-block can be performed by bilinear interpolation, sub-pixel convolution and transposed convolution. Specifically, the loss function is as follows:
[0070]
[0071]
[0072] Where W is the set of all network parameters, w is the n corresponding parameters, and δ is the weight at each scale level.
[0073] β=|Ynegative| / |Ypositive+Ynegative|, (1-β)=|Ypositive| / |Ypositive+Ynegative|, where Ynegative and Ypositive represent edges and non-edges in GT (GroudTruth) respectively.
[0074] The embodiment of the present invention proposes an edge detection method based on a dense perception network. The method of the present invention is composed of an innovative dense perception network, which is mainly composed of some learning filters, which receive the input image and then predict the edge feature map with the same resolution. The network of the present invention can be regarded as composed of two sub-networks: a dense starting network and an upsampling area. When the network is input with an RGB image, the upsampling area is input with the feature map of each block of the network. The generated network generates a thin edge feature map, avoiding the loss of deep edges. Therefore, the problem of incomplete edge information is avoided, thereby improving the effect of edge detection.
[0075] It should be noted that there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present invention, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.
[0076] Another embodiment of the present invention provides an edge detection device based on a dense sensing network, such as Figure 2 As shown, the device 1 comprises:
[0077] A network construction module 11, used for constructing a dense sensing network;
[0078] The feature extraction module 12 is used to obtain the RGB image to be identified, input the RGB image into the dense perception network for feature extraction, and generate a feature map;
[0079] A sampling module 13, used for sampling the feature map to generate an edge image;
[0080] The image fusion module 14 is used to fuse all edge images of the target to be detected to generate a target edge information image.
[0081] The specific implementation method is shown in the method embodiment, which will not be described in detail here.
[0082] Another embodiment of the present invention provides an edge detection device based on a dense sensing network, such as Figure 3 As shown, the device 10 includes:
[0083] One or more processors 110 and memory 120, Figure 3 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a bus or other means. Figure 3 The example of connecting through bus is taken in the following.
[0084] The processor 110 is used to complete various control logics of the device 10, which can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISCMachine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration.
[0085] The memory 120, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the edge detection method based on dense sensing network in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the device 10 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, implementing the edge detection method based on dense sensing network in the above method embodiment.
[0086] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store applications required for operating the device and at least one function; the data storage area may store data created according to the use of the device 10, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0087] One or more units are stored in the memory 120, and when executed by one or more processors 110, the edge detection method based on the dense sensing network in any of the above method embodiments is executed, for example, the edge detection method based on the dense sensing network described above is executed. Figure 1 The method comprises steps S100 to S400.
[0088] An embodiment of the present invention provides a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, for example, to execute the above-described Figure 1 The method comprises steps S100 to S400.
[0089] As an example, non-volatile storage media can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) as external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.
[0090] Another embodiment of the present invention provides a computer program product, the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a processor, the processor executes the edge detection method based on a dense sensing network of the above method embodiment. For example, executing the above described Figure 1 The method comprises steps S100 to S400.
[0091] The embodiments described above are merely illustrative, in which the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0092] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can exist in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0093] Conditional language such as "can," "can," "might," or "may," among other things, unless specifically stated otherwise or otherwise understood within the context as used, is generally intended to convey that particular embodiments can include (while other embodiments do not) particular features, elements, and / or operations. Thus, such conditional language is also generally intended to imply that features, elements, and / or operations are anyway required for one or more embodiments or that one or more embodiments must include logic for determining, with or without input or prompting, whether such features, elements, and / or operations are included or will be performed in any particular embodiment.
[0094] What has been described herein in this specification and the accompanying drawings includes examples that can provide edge detection methods and devices based on dense sensing networks. Of course, it is not possible to describe every conceivable combination of elements and / or methods for the purpose of describing the various features of the present disclosure, but it can be recognized that many other combinations and permutations of the disclosed features are possible. Therefore, it is obvious that various modifications can be made to the present disclosure without departing from the scope or spirit of the present disclosure. In addition, or in an alternative, other embodiments of the present disclosure may be obvious from consideration of this specification and the accompanying drawings and from the practice of the present disclosure as presented herein. It is intended that the examples proposed in this specification and the accompanying drawings are considered to be illustrative and not restrictive in all respects. Although specific terms are used herein, they are used in a general and descriptive sense and are not used for the purpose of limitation.
Claims
1. An edge detection method based on a dense sensing network, characterized in that: The method comprises: Building dense sensing networks; Obtain the RGB image to be recognized, input the RGB image into the dense perception network for feature extraction, and generate a feature map; Sampling the feature map to generate an edge image; All edge images of the target to be detected are fused to generate a target edge information image; The dense perception network includes a dense initiation network and an upsampling module, The step of constructing a dense sensing network includes: Constructing the network structure of dense initiation network; Construct an upsampling module based on the network structure of the dense inception network; The construction of the upsampling module according to the network structure of the dense starting network includes: Constructing conditional stacking sub-blocks according to the network structure of the dense initiation network, wherein the types of the sub-blocks include a first sub-block and a second sub-block; Constructing the first sub-block and the second sub-block; Presetting the input of the first sub-block to be the output of the dense inception network or the output of the second sub-block; The constructing of the first sub-block includes: The first sub-block is preset to have two layers, wherein the first layer from the sub-block is a convolutional layer, and the second layer from the sub-block is a deconvolutional layer.
2. The edge detection method based on dense sensing network according to claim 1 is characterized in that: The step of obtaining an RGB image to be identified, inputting the RGB image into a dense perception network for feature extraction, and generating a feature map includes: Get the RGB image to be recognized, input the RGB image into the dense inception network for feature extraction, and generate a feature map.
3. The edge detection method based on dense sensing network according to claim 2 is characterized in that: The step of sampling the feature map to generate an edge image comprises: The feature map is input into the upsampling module for sampling to generate an edge image.
4. The edge detection method based on dense sensing network according to claim 3 is characterized in that: The step of constructing a dense sensing network includes: Construct an encoder consisting of two stacked convolutional layers of a predetermined size and perform batching.
5. An edge detection device based on a dense sensing network, characterized in that: The device comprises: Network building module for building dense sensing networks; The feature extraction module is used to obtain the RGB image to be identified, input the RGB image into the dense perception network for feature extraction, and generate a feature map; A sampling module, used to sample the feature map to generate an edge image; An image fusion module is used to fuse all edge images of the target to be detected to generate a target edge information image; The dense perception network includes a dense initiation network and an upsampling module, The step of constructing a dense sensing network includes: Constructing the network structure of dense initiation network; Construct an upsampling module based on the network structure of the dense inception network; The construction of the upsampling module according to the network structure of the dense starting network includes: Constructing conditional stacking sub-blocks according to the network structure of the dense initiation network, wherein the types of the sub-blocks include a first sub-block and a second sub-block; Constructing the first sub-block and the second sub-block; Presetting the input of the first sub-block to be the output of the dense inception network or the output of the second sub-block; The constructing of the first sub-block includes: The first sub-block is preset to have two layers, wherein the first layer from the sub-block is a convolutional layer, and the second layer from the sub-block is a deconvolutional layer.
6. An edge detection device based on a dense sensing network, characterized in that: The device comprises at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the edge detection method based on a dense perception network as described in any one of claims 1-4.
7. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the edge detection method based on a dense perception network as described in any one of claims 1-4.
