Semantic segmentation method and device based on lightweight multi-scale information fusion network
Through a lightweight multi-scale information fusion network, combined with pyramid refinement connections and lightweight information fusion modules, it solves the problems of high resource consumption and low performance of semantic segmentation in the existing technology, and achieves efficient and accurate semantic segmentation effects, which is applicable to for IoT applications.
Patent Information
- Application Number
- CN202111484331.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-12-07
AI Technical Summary
Existing semantic segmentation methods consume large computing resources and are slow in inference when processing high-resolution images. Accuracy-oriented methods require a large number of convolutional layers, and efficiency-oriented methods ignore contextual information, resulting in performance degradation.
Using a lightweight multi-scale information fusion network, through the pyramid thinning connection module and lightweight information fusion module, combined with jump learning, pyramid attention mechanism and multi-scale dense splicing module, shallow and deep features are extracted and fused to eliminate Semantic gap,learning multi-scale contextual information.
It achieves efficient and accurate semantic segmentation, reduces calculation time and memory usage, is suitable for resource-constrained Internet of Things applications, and maintains high segmentation accuracy and low computational complexity.
Smart Images

Figure CN114332094B
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular to a semantic segmentation method and device based on a lightweight multi-scale information fusion network. Background Art
[0002] Semantic segmentation is a pixel-level classification task that is mainly used to identify the content and location in an image. Scene understanding can accurately classify roads, people, etc., which is particularly important for autonomous driving. Semantic segmentation technology has also been widely used in the Internet of Things, such as autonomous driving, medical images, robots, etc. In the Internet of Things environment, it is difficult for mobile terminals or other resource-constrained edge computing platforms to quickly process semantic segmentation tasks. When processing high-resolution inputs, it will result in long response times and high resource consumption. In addition, with the rise of neural networks, semantic segmentation based on deep learning methods has become mainstream. Current semantic segmentation methods are generally divided into two categories: accuracy-oriented methods and efficiency-oriented methods. Existing technologies usually design a large number of convolutional layers or extract high-level features of complex structures. For example, using a U-shaped network structure can merge high-level features and low-level features through a skip connection mechanism, but it will result in a lot of memory usage. In addition, existing technologies use various pyramid modules to encode multi-scale information of high-level feature images, or learn contextual information to improve performance, but they rely on deep backbone networks to extract high-level feature maps, which requires a large number of 3×3 regular convolutional layers. The asymmetric encoding and decoding structure of the existing technology is also small and simple, and the network channel is pruned to achieve the purpose of fast image processing, or to achieve extremely high inference speed by compressing the size of a large number of models, but ignores the context information, resulting in the loss of spatial details. In addition, the existing technology uses a multi-branch structure to learn multi-level features to achieve multilateral spatial information fusion, or learns multi-scale context features, and obtains pixel-level attention vectors through the attention pyramid network, which completes multi-scale information fusion to a certain extent.
[0003] After analyzing the above-mentioned prior art, the present application found that the prior art still has the following problems: (1) For accuracy-oriented methods, extracting spatial information at different levels requires a large number of convolutional layers and expensive computing resources, resulting in low inference speed. (2) For efficiency-oriented methods, compressing the network and simply fusing multi-level semantic information can save computing costs, but ignoring multi-level semantic gaps will lead to performance degradation. Summary of the invention
[0004] The present application provides a semantic segmentation method and device based on a lightweight multi-scale information fusion network to improve the accuracy of model recognition and reduce the calculation time of the model.
[0005] In a first aspect, an embodiment of the present application provides a semantic segmentation method based on a lightweight multi-scale information fusion network, the method comprising:
[0006] Input a high-resolution image, and perform image feature extraction on the high-resolution image to obtain shallow spatial semantic information and deep spatial semantic information;
[0007] Performing feature information fusion on the shallow spatial semantic information and the deep spatial semantic information through skip learning to obtain fused semantic information;
[0008] Eliminating the semantic gap of the fused semantic information through a pyramid attention mechanism;
[0009] For the fused semantic information after eliminating the semantic gap, multi-scale context information is learned through a multi-scale dense splicing module with different dilation rates and multi-scale dense connection methods.
[0010] Furthermore, eliminating the semantic gap of the fused semantic information by using the pyramid attention mechanism includes:
[0011] Converting the original low-level features of the fused semantic information into high-level features through depth-wise separable convolution; and
[0012] The fused semantic information is transformed from original low-level features into high-level features through an adaptive average pooling path and an adaptive maximum pooling path.
[0013] Furthermore, the learning of multi-scale context information by using a multi-scale dense splicing module with different expansion rates and dense connection methods specifically includes:
[0014] The input feature map reduces the channel dimension of the semantic information through 1×1 co-evolution;
[0015] Learning objects at multiple levels of semantic information through four paths with different expansion rates;
[0016] The semantic information learned by the four paths is integrated to obtain local multi-scale contextual information.
[0017] Furthermore, the learning of multi-scale context information by using a multi-scale dense concatenation module with different dilation rates and dense connections also includes: modifying the local multi-scale context information by using prior knowledge of residual connections.
[0018] Furthermore, the learning of multi-scale context information using a multi-scale dense splicing module with different dilation rates and dense connection methods also includes: extracting global context information of the high-resolution image through a global context module.
[0019] In a second aspect, an embodiment of the present application provides a semantic segmentation device based on a lightweight multi-scale information fusion network, characterized in that the device includes:
[0020] The pyramid refinement connection module is used to extract image features from high-resolution images to obtain shallow spatial semantic information and deep spatial semantic information; perform feature information fusion on the shallow spatial semantic information and the deep spatial semantic information through skip learning to obtain fused semantic information; and eliminate the semantic gap of the fused semantic information through the pyramid attention mechanism;
[0021] The lightweight information fusion module is used to learn multi-scale context information through a multi-scale dense splicing module with different expansion rates and multi-scale dense connection methods for the fused semantic information after eliminating the semantic gap.
[0022] Furthermore, the pyramid refinement connection module is also used for:
[0023] Converting the original low-level features of the fused semantic information into high-level features through depth-wise separable convolution; and
[0024] The fused semantic information is transformed from original low-level features into high-level features through an adaptive average pooling path and an adaptive maximum pooling path.
[0025] Furthermore, the lightweight information fusion module is also used for:
[0026] The input feature map reduces the channel dimension of the semantic information through 1×1 co-evolution;
[0027] Learning objects at multiple levels of semantic information through four paths with different expansion rates;
[0028] The semantic information learned by the four paths is integrated to obtain local multi-scale contextual information.
[0029] Furthermore, the lightweight information fusion module is also used to: modify the local multi-scale context information through prior knowledge of residual connections.
[0030] Furthermore, the lightweight information fusion module is also used to: extract global context information of the high-resolution image through a global context module.
[0031] The semantic segmentation method and device based on the lightweight multi-scale information fusion network provided in the embodiment of the present application have been tested on multiple data sets. Through a large number of experiments, MIFNet has the characteristics of low memory usage and high computing efficiency, and obtains good segmentation results. It has great application value in the resource-constrained IoT application field. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0033] Figure 1 is a schematic diagram of a semantic segmentation device based on a lightweight multi-scale information fusion network provided in an embodiment of the present application;
[0034] Figure 2 is a schematic diagram of a pyramid attention mechanism module provided in an embodiment of the present application;
[0035] Figure 3 is a schematic diagram of a lightweight information fusion module provided in an embodiment of the present application;
[0036] Figure 4 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0038] The present application provides a lightweight multi-scale information fusion network (Multi-scale Information Fusion Network, MIFNet), which aims to achieve a balance between accuracy and efficiency. MIFNet consists of two components: a pyramid refinement connection module (Pyramid Refinement Connection Module PRCM) and a lightweight information fusion module (Lightweight Information Fusion Module, LIFM). In order to obtain better results, the present application first fuses the feature information of the shallow and deep layers of the model through jump learning. At the same time, the semantic gap is eliminated through the pyramid attention mechanism, the feature extraction ability of the backbone network is improved, and the robustness of the feature representation is enhanced. Then, the multi-scale dense concatenation (Multi-scale Dense Concatenation, MDC) module learns multi-scale context information in a densely connected manner in LIFM through different expansion rates, and adds residual connections between multi-scale features and prior knowledge. At the same time, global information is added to LIFM through a global pooling layer to complete global-local feature fusion. In addition, the present application uses an extended convolution strategy to expand the field of view of MobileNet V2 (MobileNet V2). In order to improve the inference efficiency of the model, MIFNet uses a lightweight network as the backbone without any additional branches. In particular, this application uses depthwise separable convolution and group convolution to optimize MDC and LIFM to reduce the number of redundant parameters. Finally, the feature image is upsampled by bilinear interpolation output without additional computational overhead. The parameters in MIFNet contain only 2.0M bytes and only 7GLOPs. MIFNet not only has efficient computing speed, but also maintains very high accuracy, which is suitable for resource-constrained devices. This application evaluates MIFNet on the Cityscapes, Camvid and Helen datasets, and can achieve 72.2%% mIoU on the Cityscapes test set, including 65.7% mIoU on the Camvid test set and 71.9% mIoU on the Helen test set. In addition, this application can also process 640×360 resolution images at 76.9 frames per second on a single GTX 1080Ti graphics card.
[0039] The semantic segmentation proposed in this application is divided into attention mechanism, multi-scale context information and real-time semantic segmentation. The attention mechanism (Pyramid Attention Mechanism, PAM) proposed in this application can adaptively learn important shallow features from the comprehensive perceptual feature mapping relationship of space and channel, and establish long-distance dependencies to narrow the semantic gap. Regarding multi-scale context information, the prior art relies on cascaded pyramid structures, resulting in a large number of parameters and high memory consumption. Or it relies on heavy backbones and uses traditional convolutions to fuse multi-scale context information, resulting in high computational complexity and reduced reasoning speed. In order to solve the above problems, this application uses deep separation convolution to replace regular convolution in MDC in terms of multi-scale context information acquisition. In addition, the number of channels in MDC decreases exponentially, thereby compressing the number of model parameters. MDC is combined with prior knowledge to obtain multi-scale information and improve the robustness of the model. Regarding real-time semantic segmentation, the prior art lacks multi-level feature fusion or increases the computational burden due to additional branch structures. Therefore, in IoT applications, the practicality of the prior art is limited in limited computing resources. The MIFNet proposed in this application is a lightweight semantic segmentation model that can efficiently and accurately encode multi-level features and multi-scale information through PRCM and LIFM, thereby improving the robustness of the model.
[0040] The embodiment of the present application provides a semantic segmentation method based on a lightweight multi-scale information fusion network, comprising the following steps:
[0041] Step S101, input a high-resolution image, and perform image feature extraction on the high-resolution image to obtain shallow spatial semantic information and deep spatial semantic information;
[0042] Step S102, performing feature information fusion on the shallow spatial semantic information and the deep spatial semantic information through skip learning to obtain fused semantic information;
[0043] Step S103, eliminating the semantic gap of the fused semantic information through a pyramid attention mechanism;
[0044] This step specifically includes: converting the original low-level features of the fused semantic information into high-level features through depth-wise separable convolution; and converting the original low-level features of the fused semantic information into high-level features through an adaptive average pooling path and an adaptive maximum pooling path.
[0045] Step S104, for the fused semantic information after the semantic gap is eliminated, multi-scale context information is learned through a multi-scale dense splicing module with different expansion rates and multi-scale dense connection methods.
[0046] This step specifically includes: reducing the channel dimension of the semantic information through 1×1 co-evolution of the input feature map; learning objects at multiple levels of the semantic information through four paths with different expansion rates; integrating the semantic information learned by the four paths to obtain local multi-scale context information.
[0047] This step also includes: modifying the local multi-scale context information through prior knowledge of residual connection.
[0048] This step also includes: extracting global context information of the high-resolution image through a global context module.
[0049] In addition, an embodiment of the present application provides a semantic segmentation device based on a lightweight multi-scale information fusion network, including: a pyramid refinement connection module, used to extract image features from high-resolution images to obtain shallow spatial semantic information and deep spatial semantic information; perform feature information fusion on the shallow spatial semantic information and the deep spatial semantic information through jump learning to obtain fused semantic information; eliminate the semantic gap of the fused semantic information through a pyramid attention mechanism; a lightweight information fusion module, used to learn multi-scale context information from the fused semantic information after eliminating the semantic gap through a multi-scale dense splicing module with different expansion rates and multi-scale dense connection methods.
[0050] Among them, the pyramid refinement connection module is also used to: convert the original low-level features of the fused semantic information into high-level features through depth-separable convolution; and convert the original low-level features of the fused semantic information into high-level features through an adaptive average pooling path and an adaptive maximum pooling path. The lightweight information fusion module is also used to: reduce the channel dimension of the semantic information through 1×1 co-evolution of the input feature map; learn objects at multiple levels of the semantic information through four paths with different expansion rates; integrate the semantic information learned by the four paths to obtain local multi-scale context information. The lightweight information fusion module is also used to: correct the local multi-scale context information through the prior knowledge of residual connection. The lightweight information fusion module is also used to: extract the global context information of the high-resolution image through the global context module.
[0051] The specific process of the above method will be combined with Figure 1 Provide explanation.
[0052] See also Figure 1 , shown is a schematic diagram of a semantic segmentation device based on a lightweight multi-scale information fusion network provided in an embodiment of the present application.
[0053] The overall structure of MIFNet in this application is mainly composed of a pyramid refinement connection module (PRCM) and a lightweight information fusion module (LIFM). The specific structures and functions of PRCM and LIFM will be combined Figure 1 Provide detailed explanation.
[0054] like Figure 1 As shown in the figure, a high-resolution image is first given as input, and then the improved MobileNetV2 is selected as the backbone network and encoder for image feature extraction. The output stride (OS) of the encoder is set to 8 (that is, Figure 1 From stage 0 to stage 7 in the network), more detailed semantic information can be retained in the shallow layer during the encoding process. In addition, in order to increase the receptive field, dilated convolution is used instead of the backbone tail, and the dilation rate is set to {2, 3, 5, 7} to avoid additional computational burden. Next, the network performs PRCM, and the first step is to pass the shallow spatial semantic information to the deep layer through jump connections. At the same time, the channel dimension of the shallow semantic feature map is increased by depthwise separable convolution; in the second step, the shallow feature map is converted into a set of weight vectors through the self-attention mechanism and multiplied with the high-level semantic information of the channel dimension to narrow the semantic gap. Finally, PRCM fuses the refined shallow features with high-level features. This application not only facilitates the propagation of shallow information, but also directly alleviates the semantic gap between feature maps at different levels. PAM refines the shallow spatial features and improves the feature extraction capability of the backbone. Then, LIFM is performed, which mainly consists of four parallel MDC modules to learn multi-scale local contextual information. At the same time, in order to improve the robustness and recognition ability of the module, this application also provides a residual connection to fuse prior knowledge, and provides a lightweight global context module (Global Context) to extract global context information with extremely low computational overhead. Finally, the global information is sampled through the upsampling layer, and then the local information is connected to the global information. The output of LIFM is fed into the designed segmentation head module and reshaped to the size of the input through the upsampling layer.
[0055] The PRCM and LIFM provided in this application are as follows:
[0056] Regarding the pyramid refinement connection module, in order to improve the performance of the model, this application provides a PRCM that effectively fuses shallow and deep maps through PAM, which is beneficial to the information propagation from shallow to deep layers and the feature extraction of the backbone network.
[0057] In the prior art, the U-shaped network has acceptable model performance. This is because the U-shaped structure uses multiple skip connection modules to aggregate multi-level information. However, the U-shaped structure greatly increases the amount of calculation, resulting in a slower calculation speed. The present application directly establishes skip connections at different levels. At the same time, in order to improve the segmentation efficiency, the present application uses deep separable convolution to solve the multi-parameter problem. According to the parameter calculation and ablation experiments of the present application, a skip connection learning module stage3 and stage5 is established to achieve a better balance in efficiency and accuracy.
[0058] Regarding the pyramid attention mechanism, although the jump connection learning of the prior art is conducive to the propagation of shallow features, the shallow features mainly include the edge information of the object, while the deep features mainly include the semantic information of the object. There is a direct semantic difference between the two stages. Therefore, the performance effect of directly adding low-level features to high-level feature elements is average. In order to solve this problem, the application provides a pyramid attention mechanism to achieve feature refinement to reduce the interference of shallow feature noise information. The structure of the PAM provided in this application is as follows Figure 2 As shown in Figure 2, PAM consists of two paths, one of which is the original low-level feature F l , transformed into high-level features F through depth-wise separable convolution h , F l and F h They are shown in the following formulas:
[0059]
[0060]
[0061] Another branch is a self-attention mechanism. The self-attention mechanism path includes an adaptive average pooling (AAP) path and an adaptive maximum pooling (AMP) path. Specifically, the prior art uses average pooling and maximum pooling to greatly improve the representation ability of the network, but only focuses on the relationship between image channels and lacks spatial relationships. In order to solve the above-mentioned problems of the prior art, the present application provides a pyramid attention strategy that can generate attention to the image space. PAM learns channel attention and spatial attention in a comprehensive manner.
[0062] The detailed composition of the pooling path of this application is as follows: First, for feature matching, the low-level feature map F l Transformed into high-level feature maps through 1×1 convolution Then the high-level feature map Transformed into channel vector V through adaptive average pooling ca and the spatial tensor V sa, and obtain similar channel vectors V through adaptive maximum pooling cm and the spatial tensor V sm . F l , V ca 、V sa and V sm The expressions are as follows:
[0063]
[0064]
[0065]
[0066]
[0067]
[0068]
[0069] Next, the spatial tensor V is calculated by the following formula sa and V sm Reshape into a vector and add it to the channel vector V ca and V cm Concatenate to get the final vector V a and V m :
[0070]
[0071]
[0072] Among them, C[…] refers to channel concatenation, R(…) refers to reshaping a tensor into a vector, AAP refers to adaptive average pooling, and AMP refers to adaptive maximum pooling.
[0073] Next, both Va and Vm are learned jointly by a shared multi-layer perceptron (MLP) and a hidden layer to generate a pyramid attention vector. The two pyramid attention vectors are added to obtain a mixed pyramid attention vector, which is normalized by a sigmoid activation function. Finally, the weight of the mixed pyramid attention vector is multiplied by the high-level feature map to get the output. The above process can be calculated by the following formula:
[0074]
[0075]
[0076] in, refers to the addition of elements, Refers to element multiplication. In summary, the PAM provided in this application can be based on the method of self-attention mechanism, which combines spatial learning and channel learning and obtains the attention vector by pyramid refinement. PAM makes up for the defects of previous studies that only focus on channel attention and spatial attention, alleviates the semantic gap in jump learning with lower computational overhead, and improves the effectiveness of feature fusion at different levels.
[0077] Regarding the lightweight information fusion module, in order to further improve the classification ability of the model, this application provides LIFM to process objects of different sizes in the image, and learn multi-perspective contextual information from global and local perspectives. In addition, this application also provides a multi-scale dense splicing module to capture object information at different levels in a dense sampling manner. In order to further reduce the parameters of the model, this application optimizes the model through deep separable convolution, which can reduce the number of model parameters and improve reasoning efficiency.
[0078] Regarding multi-scale feature extraction, in order to learn the semantic information of the scene from multiple perspectives, the LIFM provided by this application is as follows: Figure 3 As shown in . First, the input feature map reduces the channel dimension through 1×1 co-evolution. Then, objects at multiple levels are learned through four parallel residual convolution layers with different expansion rates. Finally, multi-scale information is integrated from the four paths. It is worth noting that this application adds a residual connection and uses prior knowledge to correct the semantic information of multi-scale views, thereby ensuring the accuracy of feature extraction without increasing parameters. The above process can be calculated by the following formula:
[0079]
[0080]
[0081] Among them, pW(…) refers to 1×1 point-by-point convolution, MDC refers to the multi-scale dense connection module, It means element-wise addition. Finally, the four paths are fused together.
[0082] Regarding multi-scale densely connected blocks, the existing technology proposes a spatial pyramid model to alleviate the problem of target object size variation, mainly through sparse sampling to capture multi-scale background. The MDC of this application is a dense sampling method that can effectively obtain multi-scale context information and increase the receptive field, such as Figure 3 As shown in Figure 2. In MDC, the number of channels decreases while the dilation rate increases. First, given an input I H×W×C , and then learn the hidden features at all levels Finally, learn the output The above process can be calculated by the following formula:
[0083]
[0084]
[0085] in, It refers to the depth-wise separable convolution with dilation, and C[…] refers to channel concatenation.
[0086] Regarding the fusion of global and local information, the dilated convolutions with different dilation rates in the MDC module can capture local pixel information, but lack global information. To solve this problem, this application adds a global feature extraction branch to LIFM, which consists of only an adaptive average pooling layer and a 1×1 point-by-point convolution layer, with low computational complexity. The feature map is reconstructed to the input image size through the upsampling layer. The above process can be calculated by the following formula:
[0087]
[0088]
[0089] Among them, GAP(…) refers to global average pooling, U(…) refers to bilinear interpolation, pw(…) refers to 1×1 point-by-point convolution, and C[…] refers to channel concatenation. After extracting global information, feature maps of different scales are fused with global information to obtain the output map
[0090] Regarding the performance of the method provided in this application, MIFNet is mainly used to solve the real-time semantic segmentation problem of street scenes, mainly targeting multi-scale contextual information. This application is evaluated on the Cityscapes, CamVid and Helen datasets, and compared with other existing technologies, and related ablation experiments are performed on the city landscape validation set. The experimental results show that this application has achieved very good performance on the three datasets. The following are the specific datasets and evaluation methods, as well as the training process.
[0091] The Cityscapes dataset is an urban landscape dataset that contains street scenes in 50 different cities and about 25,000 annotated images, of which about 5,000 are high-quality pixel-level annotated images. The above images can be used for semantic segmentation training in 19 valid categories, and the resolution of each image is 2048×1024. The embodiment of the present application uses 5,000 images with fine annotations for training, of which 2,957 images are used for training, 500 images are used for verification, and 1,525 images are used for testing, and all images are randomly sampled to 1024×512 for training. The embodiment of the present application submits the results to the official online testing platform for testing. The CamVid dataset is another urban landscape dataset shot from the perspective of a driving car. It consists of 691 images, including 12 categories, of which 367 are used for training, 101 are used for verification, and 223 are used for testing. The embodiment of the present application samples the images of the dataset with a resolution of 960×720 to images with a resolution of 480×360 for training. Halen dataset is a facial object parsing dataset, which consists of 2330 facial images and contains 11 categories, of which 2000 images are used for training, 230 images are used for verification, and 100 images are used for testing. In the embodiment of the present application, the image resolution is randomly rescaled to 512×512 for training.
[0092] The performance evaluation metrics of the embodiment of the present application include segmentation accuracy (mIoU), inference speed, network parameters, computational complexity, etc.
[0093] mIoU is a widely recognized standard metric in semantic segmentation. Assuming n is the number of classes, the segmentation accuracy can be calculated as:
[0094]
[0095] p ii is the real quantity, p ij 、p ji represent false positives and false negatives, respectively.
[0096] Inference speed refers to the forward pass time it takes for the network to process an image, generally measured in milliseconds. Inference speed is usually measured in frames per second (FPS). Network parameters refer to the sum of parameters of each layer of the network. Computational complexity is the number of floating point operations (FLOPs), which is used to measure the working speed and efficiency of CNN models.
[0097] Training Details of this Application: This application uses an NVIDIA 1080Ti GPU to perform all experiments in the pytorch framework. In order to enhance the robustness of the experiment, the images were randomly scaled by 0.5 to 1.5 times, and all images were randomly flipped left and right to achieve image enhancement. In addition, the dataset was randomly cropped during training. This embodiment uses The initial learning rate is set to 0.005, the stochastic gradient descent (SGD) optimization algorithm is used to update the network parameters with a momentum of 0.9 and a weight decay of 0.0005, and the pixel cross entropy error is used as the loss function.
[0098] The ablation experiment of the pyramid refinement connection module in this application is shown in Table 2, and the internal mark is the jump connection stage (the stage is already in Figure 2 Indicated in the figure). First, it is proved that the pyramid refinement skip connection learning method is superior to the baseline learning method. Among them, stage3 and stage4 are set as shallow low-frequency semantic feature layers, and stage5 to stage7 are set as deep fusion feature layers. Moreover, the results of method e in Table 1 show that this method is superior to other groups. However, by comparing method e and method a, it can be intuitively found that method a has 0.05M parameters and 0.06GFLOPs, which is higher than the baseline method. Compared with the baseline method, the increase in the number of parameters of method e is three times that of method a, and the MIoU is about twice that of method a. In addition, by observing methods c and d, it can be proved that there is more high-level feature information in the deep stage. There are two defects in using the skip connection mechanism in the system stage7: (1) multi-level semantic information gap; (2) shallow noise information interference. In this way, method a leads to unsatisfactory segmentation results. Therefore, this application selects method e as the best method, and its balance between efficiency and accuracy has achieved satisfactory results.
[0099] Table 2
[0100]
[0101] Where Model is the name of different experimental settings. Sn is the different levels of the backbone network. PAM is the pyramid attention mechanism. Params is the number of parameters. FLOPs is evaluated on 3×640×360 input.
[0102] The ablation experiment results of the lightweight information fusion module of this application are shown in Table 3. First, for the selection of the dilation rate in MDC, method c does not set the dilation rate and only uses 3×3 regular convolution. Based on this design, the local receptive field is small, does not contain various scale information, and the segmentation effect is not ideal. For method b and method d, the multi-scale learning strategy is significantly better than method c. By comparing the two methods b and d, the results show that in the dense multi-scale sampling layer of MDC, the excessive scale span introduces noise information, resulting in poor semantic relevance and reducing the performance of the model. By comparing method a and method d, the increasing dilation rate in MDC performs better than the fixed value. This shows that in the process of semantic segmentation, it is necessary to learn the features of the changing objects, so the denser sampling strategy has obvious advantages. Finally, the method a and method e are compared. Method a adds a global context path to LIFM. The results show that the learning strategy of global local information fusion is the best choice. Based on these observations, this application adopts method e as the optimal solution, which can reach 73.31% of one million users with only 0.16M parameters and 8.58GLOPs.
[0103] Table 3
[0104]
[0105] Table 3 shows the performance comparison of different LIFM designs when using the improved MobileNetV2 as the backbone. Model is the name of the different experimental settings. Dn is the setting of the dilation rate. GAP is the global average pooling. FLOPs is evaluated on 320×256×128 input.
[0106] The comparison results of LIFM of this application and the existing multi-scale modules are shown in Table 4. Although vortex and ASPP have outstanding MIoU, the network parameters of both are relatively large, and the amount of calculation is very large, resulting in slow reasoning speed. Compared with the lighter ASPP, the parameters of LIFM of this application are reduced by 30 times and the triggers are reduced by 42 times. The accuracy of LIFM of this application is 1.07% MIOU higher than that of vortex. In addition, although FPA and PPM have a small advantage in reasoning speed, LIFM of this application has an accuracy of 2.31% MIOU, so it is more accurate than FPA and PPM. Similarly, when compared with MCIM with almost the same reasoning speed and model parameters, this application has a better MIoU than MCIM. The results in Table 4 show that the multi-scale module itself is more in line with the requirements of real-time semantic segmentation in IoT applications due to its lightweight characteristics. In addition, compared with the prior art, the LIFM method of this application has great advantages in efficiency and accuracy.
[0107] Table 4
[0108]
[0109] Among them, Model is the name of the multi-scale module, FPT is the forward propagation time, Params is the number of parameters, and FLOPs is evaluated on 320×256×128 input.
[0110] Finally, as shown in Table 5, the results of the balancing experiment of the PRCM and LIFM components, compared with the baseline method in the prior art, the PRCM and LIFM provided by this application only increase 0.21m parameters and 0.55 GLOPs, and can achieve an increase of 5.44% MIoU.
[0111] Table 5
[0112]
[0113] Among them, the baseline is the backbone network MobileNetV2, PRCM is the pyramid refinement connection module, and LIFM is the lightweight information fusion module.
[0114] Table 6 below shows the performance comparison of the Cityscapes test set.
[0115] Table 6
[0116]
[0117]
[0118] This application is evaluated on the Cityscapes dataset. In addition to the ablation experiments, MIFNet is used to compare existing methods on the Cityscapes dataset. The results are uniformly evaluated on the test set. As shown in Table 6, the inference speed is the average of 100 runs on NVIDIA 1080TI, and "-" means that the corresponding value is not published.
[0119] Compared with efficiency-oriented methods such as ENet and FSSNet, they perform satisfactorily in terms of model efficiency (e.g., execution speed, memory usage, or computational complexity). Since the model parameters are compressed, many important semantic information is ignored in semantic segmentation, resulting in poor model segmentation effect. Recently, some advanced methods such as CIFReNet and DFFNet have achieved acceptable results in terms of efficiency and accuracy by proposing some lightweight context information integration modules. The difference is that the proposed MIFNet makes full use of shallow and deep information refinement and multi-scale context information fusion, and achieves a satisfactory balance between efficiency and accuracy through effective model compression techniques. In addition, the accuracy of MIFNet is better than all the above advanced methods.
[0120] For accuracy-oriented methods such as RefineNet and PSPNet, despite their improved accuracy, the deep model design leads to a large number of model parameters and expensive computation. These defects make the model take more than 2 seconds to process an image. In practical IoT applications, the low efficiency is unacceptable. In contrast, MIFNet can achieve 71.4 frames per second for 640×360 images and achieve a satisfactory performance of 72.2% MIoU. This proves that MIFNet has better potential in practical IoT applications.
[0121] The evaluation of this application in the CamVid dataset is shown in Table 7. The model was tested on the CamVid dataset and obtained a satisfactory score (65.7% MIoU) compared with the existing methods. In addition, MIFNet still maintains a fairly high efficiency, with a processing speed of 71.4 frames and 7.5 GLOPs for 640×360 resolution images. Although the parameters of MIFNer are slightly higher than DFFNet, the accuracy of MIFNet is much higher. When processing small-resolution inputs, MIFNet can still adaptively adjust the network to perceive contextual information, thereby improving the accuracy of high-level semantic information.
[0122] Table 7
[0123]
[0124] This application is evaluated in the Helen dataset. As shown in Table 8, compared with many existing methods, MIFNet obtains excellent scores (MIoU is 71.9%, GFLOPs is 8.5, and FPS is 62.5 on 512×512 resolution images). This is mainly because LIFM can learn the features of objects at multiple scales from a global-local perspective. The results fully reflect the versatility and effectiveness of the model.
[0125] Table 8
[0126]
[0127] The beneficial effects of the embodiments of the present application are as follows:
[0128] 1. The lightweight network MIFNet provided by this application is used to achieve a balance between accuracy and efficiency. Compared with the prior art, MIFNet achieves significant accuracy and satisfactory efficiency.
[0129] 2. The PRCM component provided in this application uses skip learning to promote the propagation of shallow information and deep information. Specifically, PRCM can adaptively adjust spatial and channel features through PAM to reduce computational overhead, thereby narrowing the semantic gap.
[0130] 3. The LIFM provided by this application uses MDC blocks to capture multi-scale local context information and global context information. In addition, MDC can effectively identify multi-perspective targets through different extended convolutional layers, and has an acceptable amount of computation through depth-separable convolution.
[0131] In summary, this application proposes a lightweight multi-scale information fusion network (MIFNet) for real-time semantic segmentation. MIFNet consists of two core components: pyramid refinement connection module (PRCM) and lightweight information fusion module (LIFM). The purpose of PRCM design is to improve the feature extraction ability of the backbone and refine the underlying features through the pyramid attention mechanism (PAM). LIFM is designed to increase the receptive field and learn multi-scale contextual information, and adopts depthwise separable convolution and channel number reduction to improve efficiency. The designed PRCM and LIFM effectively fuse multi-scale information and improve the network recognition ability. Extensive experimental results on Cityscapes, CamVid and Helen datasets show that the performance of MIFNet is always better than the state-of-the-art methods. MIFNet has the characteristics of low memory usage, high computational efficiency and good segmentation effect. It has strong application value in resource-constrained IoT applications. In future work, we will further study model compression techniques to improve the efficiency of multi-scale feature extraction. In addition, we will also study multi-resolution image fusion to improve the performance of backbone feature extraction.
[0132] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown, the electronic device 500 is, for example, the above-mentioned semantic segmentation device based on lightweight multi-scale information fusion network, and the electronic device 500 includes:
[0133] Processor 51 and memory 52;
[0134] The memory 52 stores computer instructions;
[0135] The processor 51 executes the computer instructions stored in the memory 52, so that the processor 51 executes the semantic segmentation method based on the lightweight multi-scale information fusion network as above; or, the processor 51 executes the semantic segmentation method based on the lightweight multi-scale information fusion network as above.
[0136] The specific implementation process of the processor 51 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0137] Optionally, the electronic device 500 further includes a communication component 53 , wherein the processor 51 , the memory 52 and the communication component 53 may be connected via a bus 54 .
[0138] An embodiment of the present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed by a processor, they are used to implement the above semantic segmentation method based on a lightweight multi-scale information fusion network.
[0139] An embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the semantic segmentation method based on the lightweight multi-scale information fusion network as described above.
[0140] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0141] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A semantic segmentation method based on lightweight multi-scale information fusion network, It is characterized in that The method comprises: Input a high-resolution image, and perform image feature extraction on the high-resolution image to obtain shallow spatial semantic information and deep spatial semantic information; Performing feature information fusion on the shallow spatial semantic information and the deep spatial semantic information through skip learning to obtain fused semantic information; Eliminating the semantic gap of the fused semantic information through a pyramid attention mechanism; For the fused semantic information after eliminating the semantic gap, multi-scale context information is learned through a multi-scale dense splicing module with different dilation rates and multi-scale dense connection methods; Eliminating the semantic gap of the fused semantic information by using the pyramid attention mechanism includes: The original low-level features F of the fused semantic information 1 Transformed into high-level features F through depth-wise separable convolution h ;as well as The low-level feature map F l Transformed into high-level feature maps through 1×1 convolution Then the high-level feature map Transformed into channel vector V through adaptive average pooling ca and the spatial tensor V sa , and obtain similar channel vectors V through adaptive maximum pooling cm and the spatial tensor V sm , the spatial tensor V sa and V sm Reshape into a vector and add it to the channel vector V ca and V cm Concatenate to get a new vector V a and V m ; V a and V m A shared multi-layer perceptron and a hidden layer are jointly learned to generate a pyramid attention vector; the two pyramid attention vectors are added to obtain a mixed pyramid attention vector, which is normalized by a sigmoid activation function; finally, the weight of the mixed pyramid attention vector is multiplied with the high-level feature map to obtain the output.
2. The method according to claim 1, It is characterized in that The method of learning multi-scale context information by using a multi-scale dense splicing module with different expansion rates and dense connection methods specifically includes: The input feature map reduces the channel dimension of the semantic information through 1×1 co-evolution; Through four paths with different expansion rates, objects at multiple levels of semantic information are learned; The semantic information learned by the four paths is integrated to obtain local multi-scale contextual information.
3. The method according to claim 2, It is characterized in that The learning of multi-scale context information by using a multi-scale dense splicing module with different dilation rates and dense connection methods also includes: correcting the local multi-scale context information by using prior knowledge of residual connections.
4. The method according to claim 2, It is characterized in that The learning of multi-scale context information using a multi-scale dense splicing module with different dilation rates and dense connection methods also includes: extracting global context information of the high-resolution image using a global context module.
5. A semantic segmentation device based on a lightweight multi-scale information fusion network, It is characterized in that The device comprises: The pyramid refinement connection module is used to extract image features from high-resolution images to obtain shallow spatial semantic information and deep spatial semantic information; perform feature information fusion on the shallow spatial semantic information and the deep spatial semantic information through skip learning to obtain fused semantic information; and eliminate the semantic gap of the fused semantic information through the pyramid attention mechanism; A lightweight information fusion module, used for learning multi-scale context information through a multi-scale dense splicing module with different expansion rates and multi-scale dense connection modes for the fused semantic information after eliminating the semantic gap; The pyramid refinement connection module is specifically used to transform the original low-level features F of the fused semantic information 1 Transformed into high-level features F through depth-wise separable convolution h ; and the low-level feature map F 1 Transformed into high-level feature maps through 1×1 convolution Then the high-level feature map Transformed into channel vector V through adaptive average pooling ca and the spatial tensor V sa , and obtain similar channel vectors V through adaptive maximum pooling cm and the spatial tensor V sm , the spatial tensor V sa and V sm Reshape into a vector and add it to the channel vector V ca and V cm Concatenate to get a new vector V a and V m ; V a and V m A shared multi-layer perceptron and a hidden layer are jointly learned to generate a pyramid attention vector; the two pyramid attention vectors are added to obtain a mixed pyramid attention vector, which is normalized by a sigmoid activation function; finally, the weight of the mixed pyramid attention vector is multiplied with the high-level feature map to obtain the output.
6. The device as claimed in claim 5, It is characterized in that The lightweight information fusion module is also used for: The input feature map reduces the channel dimension of the semantic information through 1×1 co-evolution; Learning objects at multiple levels of semantic information through four paths with different expansion rates; The semantic information learned by the four paths is integrated to obtain local multi-scale contextual information.
7. The device according to claim 6, It is characterized in that The lightweight information fusion module is also used to: modify the local multi-scale context information through prior knowledge of residual connection.
8. The device according to claim 7, It is characterized in that The lightweight information fusion module is further used to extract global context information of the high-resolution image through a global context module.
Citation Information
Patent Citations
Real-time high-performance street-view image semantic segmentation method based on deep learning
CN110188817A
CNN-based DDoS attack multivariate information fusion method and device
CN110381052A
Semantic segmentation method for up-sampling decoding of convolution attention mechanism
CN113486897A
Panoptic segmentation
US20210326656A1
Full-automatic natural image matting method
WO2021139062A1
