# Image Semantic Segmentation Fusion of Edge Detection and AFF Attention Mechanism
## 2 Method
### Hybrid Model of Improved PSP-Net Network Combined with Improved HED
#### 2.1.4 Experiment of Hybrid Model  
Dataset Selection  
Training  
Distributed training is used to train our improved PSP-Net network combined with improved HED, which is showed in Figure 1. First, the improved HED network is trained independently. Set batch_size to 5, 50 rounds, every 10 rounds of a cycle, learning rate set to 0.001, momentum coefficient set to 0.9. After the training, the model is transplanted to the semantic segmentation network through transfer learning, and the final training of the whole model is completed. Experiments were conducted on NYU-V2 dataset and CamVid dataset, respectively. Model training LOSS values  
Compared with the Seg-Net network, our semantic and edge feature fusion network improves the segmentation accuracy by 15.2%, and the processing speed is also greatly improved. Compared with PSP-Net, the segmentation accuracy is improved by 6.8% because our semantic and edge feature fusion network uses improved HED so that the model can better obtain edge features. Compared with the Deeplabv3+ network, our semantic and edge feature fusion network slightly improves the segmentation accuracy. Table 3 shows the segmentation accuracy and MIOU for each subclass in the NYU-V2 dataset for the four networks mentioned above. \begin{table}
\begin{tabular}{l l l l l} \hline \hline
**Method** & **Input** & **BaseNet** & **MIOU(Val)** & **MIOU(Test)** & **FPS** \\ \hline
**Seg-Net** & 640 \(\times\) 480 & VGG-16 & 50.7 & 58.1 & 14 \\
**PSP-Net** & 640 \(\times\) 480 & ResNet50 & 65.8 & 66.5 & 80.5 \\
**Deeplabv3+** & 640 \(\times\) 480 & Xception & 70.1 & 72.5 & 79.2 \\ Our semantic and edge & 640 \(\times\) 480 & MobileT3 & 70.1 & 73.3 & 52.65 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Accuracy and speed of image semantic segmentation network on NYU-V2 dataset. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Name** & **Seg-Net** & **PSP-Net** & **DeepLabV3+** & **Our Semantic and Edge** \\ \hline Wall & 67.2 & 59.4 & 62.4 & 65.2 \\ Floor & 73.8 & 66.2 & 70.3 & 70.1 \\ Closet & 49.6 & 39.1 & 43.9 & 43.8 \\ Bed & 51.4 & 28 & 40.1 & 37.8 \\ Chair & 41.2 & 26.6 & 36 & 31.2 \\ Sofa & 46.2 & 19.8 & 33.6 & 36.2 \\ Table & 31.3 & 20.5 & 24.2 & 25.6 \\ Door & 22.6 & 13.9 & 18.1 & 18.2 \\ Window & 32.8 & 23.4 & 26.4 & 25.2 \\ Bookshelf & 32.1 & 26.9 & 28 & 35.2 \\ Painting & 49.6 & 41.2 & 43.8 & 50.3 \\ Counter & 42.9 & 21.1 & 29.5 & 41.5 \\ Shutters & 50 & 40.1 & 26.1 & 51.2 \\ Table & 11.1 & 5.6 & 6.8 & 11.2 \\ Shelf & 5.9 & 2.3 & 4 & 6.2 \\ Curtain & 34 & 14.9 & 19.1 & 37.2 \\ Comb table & 25.3 & 7.6 & 14.9 & 25.4 \\ Pillow & 27.9 & 12.8 & 18.7 & 28.3 \\ Mirror & 10.8 & 0.8 & 1.3 & 19.5 \\ Carpet & 16.7 & 10.6 & 11 & 19.4 \\ Clothing & 11.4 & 2 & 4.6 & 13.2 \\ Ceiling & 54.6 & 40.9 & 46.2 & 58.2 \\ Book & 28 & 21 & 25.8 & 31.2 \\ Refrigerator & 16.7 & 4.9 & 7.5 & 20.4 \\ TV set & 28.5 & 12.7 & 25.3 & 30.1 \\ Paper & 20.5 & 10.7 & 15 & 21.3 \\ Box & 7.2 & 2.5 & 3.6 & 9.7 \\ Whiteboard & 42.9 & 11 & 40.6 & 45.3 \\ People & 24.5 & 1.2 & 11 & 30.1 \\ Bedside table & 34.9 & 4.8 & 14.5 & 32.2 \\ Toilet & 59.4 & 25 & 46.8 & 60.6 \\ Sink & 41.7 & 12.8 & 35.1 & 43.4 \\ Lamp & 3.05 & 12.1 & 22.8 & 39.1 \\ Tub & 30.6 & 14 & 8.5 & 24.7 \\ Handbag & 4.3 & 1.6 & 3.4 & 5.2 \\ Person & 14.3 & 4.7 & 9.6 & 18.8 \\ Bath towel & 30.6 & 10.4 & 13.5 & 32.6 \\ Towel & 23.3 & 6.6 & 10.2 & 24.2 \\ Other & 21.2 & 20.6 & 4.8 & 10.2 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: MIOU comparison of different image segmentation networks. It can be seen from Table 3 that our semantic and edge feature fusion network is better than others. As shown in Figure 10.  
The results in Figure 10 show that our semantic and edge feature fusion network is more effective, and that small objects are clear. In the second line, the \"Office\" scene, the objects are many and small, which poses a significant challenge to image semantic segmentation. However, the improved model is used to segment the small objects, and it can be seen that the practical effect is better.