# GCN-Unet: A Computer Vision Method with Application to Industrial Granularity Segmentation

Authors: Shuyang Pang; Xuewen Xiao; Yuao Cui; Shangwei Mao; Xin Cao; Hongsheng Jia; Hao Wang; Fenghua Tong; Xiaohui Zhang
Journal: Mobile Information Systems
 (2022)

---

## Abstract

In the field of metallurgical industry, identifying the granularity of raw materials is an essential process during transportation. We propose an image segmentation method by the GCN (global convolutional network)-Unet to extract the contour edge of raw materials granules. To obtain legible images of raw materials, a stationary industrial high speed camera is used to photograph the operating belt conveyor from above. Then, a well-trained GCN-Unet model is used to compute the images and output the results with the contour edge of granules and tiny parts of the materials segmented. We combined the U-Net with several global convolutional network models and boundary refinement blocks and compared the prediction results of the GCN-Unet and the U-Net, showing that the GCN-Unet has a better prediction ability with fewer parameters (7,876,675, while the U-Net has 31,101,448 parameters) and a higher calculating speed (about twice faster than the U-Net). Based on the CNN (convolutional neural network), our computer version method can almost replace traditional manual sampling inspection method for the corresponding overall analysis and the automatically identification process.


---

## Body

## 1. Introduction

Raw material transportation is an essential link in the field of metallurgical industry. Generally, tubular belt conveyors or belt corridors are used to transport raw materials. With the closed transformation of material transportation, the grain size of materials in the closed corridor is difficult to be detected. Due to the long distance of the corridor, the traditional manual inspection method is inefficient and there are personnel safety problems, which has a great impact on the actual production. Traditional manual inspection mainly operates through the mode of manual collection, manual analysis, and manual written transmission of information. An operator takes a few kilograms of raw materials from several tons as a sample, extracts granular materials by sieve, and manually records the granularity. The most striking drawback of this method is that the sample, which is less than 5% of the amount of whole materials, is too insufficient to be representative. One reason to explain the difficulty of replacing manpower by automation equipment is that the existing various sensors are not able to recognize granularity directly. The other is that the high speed of the conveyor, which is around 2 m/s, causes some difficulties for measuring methods.The material profile can be identified by the image segmentation algorithm, so as to obtain granularity. In order to obtain clear sample images of all raw materials, set up high-definition cameras supplemented by high-brightness relighting lights, take pictures of fast-running materials, detect material particles transported on the current belt in real-time, and use deep learning techniques to split material particles in pictures. A granularity can be well presented through extracting the materials granules and its contour edge.Using computer vision technology, intelligent industrial system based on convolutional neural network algorithm can solve the problem of granularity recognition. To realize the automation in mature modern applications, the research goals of industrial AI are to develop AI algorithms and AI systems in order to get better recognition and prediction result [1].In general, the contributions of the paper are as follows:(1)
A novel segmentation method is proposed to effectively discriminate the granularity. The adopted GCN-Unet structure greatly enhances the inference efficiency and improves the accuracy of classification and localization in semantic segmentation on the basis of GCN method.(2)
The combined structure of U-Net and GCN is of great innovative and practical importance and is successfully applied in industrial scene, greatly increasing the real-time inference efficiency.


## 2. Related Work

In recent years, visual perception technology has been successfully applied in industrial production. The authors of [2] proposed the offline-online NARX neural networks to predict the water content of sintering and control the water content in sintering process . An identification method using an automated visual helmet is analysed in [3] based on artificial neural networks (ANN) [3]. Industry AI enables production to adapt to complex and changing industrial environments and perform diverse industrial tasks, thereby improving productivity, product quality, and equipment performance [4].U-Net is an outstanding image segmentation method evolving from FCN (Fully Convolutional Networks). U-Net is constructed with a symmetrical structure, with its left part as an encoder and its right part as a decoder. Every dimension of it can contain more features by patching channels, which can also retain more information for locating the target object. In [5], H-DenseUNet is suggested, which is modeled after the auto-context algorithm for segmenting liver and tumors for effectively extracting intra-slice features for hierarchically aggregating volumetric contexts. All above applications prove the efficiency and accuracy of U-Net on fine image segmentation.The inspiration of dataset annotation method and network designing comes from the medical field. Networks such as CNL-UNet [6] and MC-Net [7] built based on the U-Net [8] are widely used and perform well in semantic segmentation for different objects. Considering the similarity of medical cell images in DIC-HeLa dataset [8] and granular raw materials images, our method of data set annotation also refers to medical images as well, as Figure 1 shows. (b) mainly segment cells by recognizing the monolithic regions, while our methods in (d) focus on the edge of each granularity. By this method, model learns to ignore irregular gaps between granularity that are not clinging to each other and only depict gaps as lines, thus the segmentation speed could be much higher and more applicable in the industrial scene.Figure 1
Data comparison of HeLa cells image (a) and label (b) and granular raw materials image (c) and label (d).
(a)(b)(c)(d)There are three essential parts of our approach: Firstly, we labeled the edge of granular raw materials and the tiny parts of them with white color. We annotated 90 original images and, after diverse augmentation operation, we obtained 1710 images and their labels of the same amount. 2% of them are in the validation set and others are used to train the network. Secondly, we propose the construction of the GCN-Unet by replacing the convolutional layers with several global convolutional network modules and adding an amount of boundary refinement blocks. Additionally, we design a suitable loss function for the situation that the amount of foreground and background pixels is unbalanced and that can avoid the network prediction to be heavily biased towards the background, yielding the GCN-Unet to be trained successfully.


## 3. Methods

### 3.1. Network Architecture

The network architecture and the details of its components are illustrated in Figure2(a). In the input layer, a single-channel image of size 288 × 288 enters. After several steps, including GCN models, boundary refinement blocks, convolutions using 2 × 2 and 1 × 1 kernels, and max-pooling layers, the segmentation results of the images are output. In the output layer, Sigmoid is used to do activation and generate the segmentation results.Figure 2
An overview of GCN-Unet architecture (example for 288 × 288 pixels) (A). The arrows signify different operations. The details of global convolutional network (GCN) and boundary refinement (BR) block are shown in (B) and (C), respectively.
(a)(b)(c)Similar to the U-Net [8], the whole network has a pooling-down path and an up-sampling path on the left and right sides, respectively. The former path conducts contraction while the latter one does extension. That is, after each step of the contraction path, the number of feature channels is doubled, and after each step of the extension path, the number of feature channels is halved. A GCN model followed by a BR block and a 2 × 2 max-pooling down-sampling operation with stride 2 form a contraction step. The GCN module is proposed to improve the accuracy of classification and localization in semantic segmentation, while the BR is introduced to improve the positioning of object boundary. The expansion steps include the activation function based on the corrected linear unit (up-sampling the feature map, and then 2 × 2 convolution), cascade the corresponding feature mapping, GCN model, and BR block. In the last layer, the 1 × 1 convolution reflects the number of feature vector classes in 16 components.Classification tasks require the model to keep the transformation of input (such as ResNet [9] and VGGNet [10]) unchanged, so it is contradictory to verify the excellent performance of GCN model in classification and localization. The classification task uses dense connection layers (such as full connection layer [11]), and the positioning task needs to transform sensitive models (such as FCN [12]). At the same time, deconvolution [12] and depooling are introduced to obtain high-resolution feature maps. In order to achieve classification and location at the same time, the GCN model adopts the fully convolution model structure, retains the spatial information in the original input image, and allows the prediction of each pixel. Finally, each pixel is classified on the feature map [13] of up-sampling. In order to discard location information, an incomplete connection or global pooling layer is used. In addition, in order to make the feature mapping have a dense connection with each pixel classifier, the network structure uses a large convolution kernel size. This method also enhances the ability to handle different transformations [13].A GCN model combines 1 ×k + k × 1 convolution and k × 1 + 1 × k convolution, so that the dense connection region in the feature map is close to [13]. Each expected class obtains the corresponding multi-scale semantic score mapping by this method. Similar to [12], a deconvolution layer is used to sample up lower resolution score maps, which is then combined to higher ones. The combined maps are up-sampled for the last time and the final semantic map is generated to output the final prediction results.BR block can achieve further improvement of the localization ability by modeling the boundary alignment, which refines the predictions near the object boundaries as a residual structure [13]. The details are shown in Figure 2(c).


### 3.2. Weighted Loss Function

The weighted loss function consists of the dice loss function [14] and a binary cross-entropy (BCE) loss function. After conducting several experiments, the coefficients of the two components are decided to be 1 and 0.2. The weighted loss function is written as follows:(1)Totalloss=bceloss+0.2diceloss.BCE loss function is widely used in binary classification tasks [15]. These are tasks that answer a question with only two choices. Several independent such questions can be answered at the same time, as in binary image segmentation. The BCE loss here is based on sigmoid to do binary classification, as [14] shows, where N is the number of samples, as this loss is equal to the average of the categorical cross-entropy loss on the two-category task.(2)bceloss=−1N∑i=1NyiInyi¯+1−yiIn1−yi.The loss function of the dice coefficient appeared frequently with outstanding performance in granularity segmentation networks, such as Fully Convolutional Networks [16]. Dice loss was first proposed in the article VNet [14]. Dice loss is beneficial for image segmentation involving an extreme imbalance of the positive and negative samples [17]. For granular raw materials data, the contour edge of granules as well as tiny materials of interest occupies only a small area in the scan. This often leads to the loss or partially detection of the foreground and the network prediction is heavily biased towards the background. To solve the problem, the loss function based on the dice coefficient is used to reweight the sample and enhance the importance of the foreground area, making it higher than the background area. The dice coefficient D is written as follows:(3)D=2∑iNpigi∑iNpi2+∑iNgi2.where N is the total number of pixels, pi is a single component of the predicted binary segmentation area P, and gi is that of the ground truth binary area G. This formulation of dice can be differentiated, yielding the gradient computed with respect to the j-th pixel of the prediction [14].(4)∂D∂pj=2gi∑i=1Npi2+∑i=1Ngi2−2pi∑i=1Npigi∑i=1Npi2+∑i=1Ngi22.


## 3.1. Network Architecture

The network architecture and the details of its components are illustrated in Figure2(a). In the input layer, a single-channel image of size 288 × 288 enters. After several steps, including GCN models, boundary refinement blocks, convolutions using 2 × 2 and 1 × 1 kernels, and max-pooling layers, the segmentation results of the images are output. In the output layer, Sigmoid is used to do activation and generate the segmentation results.Figure 2
An overview of GCN-Unet architecture (example for 288 × 288 pixels) (A). The arrows signify different operations. The details of global convolutional network (GCN) and boundary refinement (BR) block are shown in (B) and (C), respectively.
(a)(b)(c)Similar to the U-Net [8], the whole network has a pooling-down path and an up-sampling path on the left and right sides, respectively. The former path conducts contraction while the latter one does extension. That is, after each step of the contraction path, the number of feature channels is doubled, and after each step of the extension path, the number of feature channels is halved. A GCN model followed by a BR block and a 2 × 2 max-pooling down-sampling operation with stride 2 form a contraction step. The GCN module is proposed to improve the accuracy of classification and localization in semantic segmentation, while the BR is introduced to improve the positioning of object boundary. The expansion steps include the activation function based on the corrected linear unit (up-sampling the feature map, and then 2 × 2 convolution), cascade the corresponding feature mapping, GCN model, and BR block. In the last layer, the 1 × 1 convolution reflects the number of feature vector classes in 16 components.Classification tasks require the model to keep the transformation of input (such as ResNet [9] and VGGNet [10]) unchanged, so it is contradictory to verify the excellent performance of GCN model in classification and localization. The classification task uses dense connection layers (such as full connection layer [11]), and the positioning task needs to transform sensitive models (such as FCN [12]). At the same time, deconvolution [12] and depooling are introduced to obtain high-resolution feature maps. In order to achieve classification and location at the same time, the GCN model adopts the fully convolution model structure, retains the spatial information in the original input image, and allows the prediction of each pixel. Finally, each pixel is classified on the feature map [13] of up-sampling. In order to discard location information, an incomplete connection or global pooling layer is used. In addition, in order to make the feature mapping have a dense connection with each pixel classifier, the network structure uses a large convolution kernel size. This method also enhances the ability to handle different transformations [13].A GCN model combines 1 ×k + k × 1 convolution and k × 1 + 1 × k convolution, so that the dense connection region in the feature map is close to [13]. Each expected class obtains the corresponding multi-scale semantic score mapping by this method. Similar to [12], a deconvolution layer is used to sample up lower resolution score maps, which is then combined to higher ones. The combined maps are up-sampled for the last time and the final semantic map is generated to output the final prediction results.BR block can achieve further improvement of the localization ability by modeling the boundary alignment, which refines the predictions near the object boundaries as a residual structure [13]. The details are shown in Figure 2(c).


## 3.2. Weighted Loss Function

The weighted loss function consists of the dice loss function [14] and a binary cross-entropy (BCE) loss function. After conducting several experiments, the coefficients of the two components are decided to be 1 and 0.2. The weighted loss function is written as follows:(1)Totalloss=bceloss+0.2diceloss.BCE loss function is widely used in binary classification tasks [15]. These are tasks that answer a question with only two choices. Several independent such questions can be answered at the same time, as in binary image segmentation. The BCE loss here is based on sigmoid to do binary classification, as [14] shows, where N is the number of samples, as this loss is equal to the average of the categorical cross-entropy loss on the two-category task.(2)bceloss=−1N∑i=1NyiInyi¯+1−yiIn1−yi.The loss function of the dice coefficient appeared frequently with outstanding performance in granularity segmentation networks, such as Fully Convolutional Networks [16]. Dice loss was first proposed in the article VNet [14]. Dice loss is beneficial for image segmentation involving an extreme imbalance of the positive and negative samples [17]. For granular raw materials data, the contour edge of granules as well as tiny materials of interest occupies only a small area in the scan. This often leads to the loss or partially detection of the foreground and the network prediction is heavily biased towards the background. To solve the problem, the loss function based on the dice coefficient is used to reweight the sample and enhance the importance of the foreground area, making it higher than the background area. The dice coefficient D is written as follows:(3)D=2∑iNpigi∑iNpi2+∑iNgi2.where N is the total number of pixels, pi is a single component of the predicted binary segmentation area P, and gi is that of the ground truth binary area G. This formulation of dice can be differentiated, yielding the gradient computed with respect to the j-th pixel of the prediction [14].(4)∂D∂pj=2gi∑i=1Npi2+∑i=1Ngi2−2pi∑i=1Npigi∑i=1Npi2+∑i=1Ngi22.


## 4. Experiment

In the experiment part, several original scenes of industrial raw materials transported by belt conveyor were obtained. Dozens of the images were selected and annotated as the original images of the dataset. In the data preparation stage, the original label after annotation is normalized and adjusted to generate the standard label. After data enlargement and segmentation of the standard label and original large image, the training set is generated. With the same data set, U-Net and GCN-Unet were trained to segment the granular raw materials, and the accuracy and speed of them are compared.


### 4.1. Dataset

The dataset used in this project are single-channel images of ore, coke, pellet, and sinter scenes. The size of these images is 2048 × 2448. Besides belt convey as the background, one type contains only particles. The other contains particles and extremely small materials. The purpose of the algorithm is to recognize the contour of the particles. The particle contour and tiny materials are labeled with white (pixel value 255). The background and the particle area color are labeled with black (pixel value 0) as shown in Figure3. The size of these single-channel labels is 2048 × 2448.Figure 3
Images and corresponding labels of granular raw materials. Use two colors to annotate images with particle and background and three colors for those with particle, background, and tiny materials. (a) Image of sinter. (b) Label of sinter (c) Image of coke. (d) Label of coke. (e) Image of pellet. (f) Label of pellet. (g) Image of ore. (h) Label of ore.
(a)(b)(c)(d)(e)(f)(g)(h)


### 4.2. Image Augmentation

Image augmentation increases scene diversity. As for the image, the most commonly used methods to increase the training sample include affine transformation, such as rotation, distortion, and mirror transformation. Several types of data augmentation are applied: three flip operations towards a different direction, two histogram equalization operations, contrast enhancement, mean blur, change of light intensity, and elastic deformation as Figure4 shows.Figure 4
Data augmentations. (a) Original image, (b) vertical rotation, (c) horizontal flip, (d) diagonal rotation, (e) histogram equalization, (f) adaptive histogram, equalization, (g) contract enhancement, (h) fuzzy, (i) light enhancement, and (j) elastic deformation.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)The purpose of image augmentation is to avoid overfitting and increase the generalization ability of the model. Here, another important reason to use image augmentation is to balance the uniqueness of contour shape and increase training data set. Based on the purpose, we have test the best training set number to be around 1500–2000 for U-Net to learn the contour pattern of granularity, so we augment the volume of training dataset 89 to 1691. With different angles, brightness, contrast, and granules distortion, the dataset is more extensive and universal than the original one.


### 4.3. Data Cutting

One original image has around 5 million pixels, which makes it unfriendly for computation speed. The original image should not be scaled because details would be lost. Therefore, cutting the original image into small ones is a good way to fasten the computation speed without losing the details. As shown in Figures5 and 6, images and labels of size 2048 × 2448 are cut into 72 288 × 288 partial images. Totally 6480 partial images are obtained for 90 original images.Figure 5
Image cutting before training. (a) Original image and (b) cutten images.
(a)(b)Figure 6
Image cutting before training. (a) Original label and (b) cutten labels.
(a)(b)


### 4.4. Training Details

As Figure7 shows, the accuracy of the GCN-Unet in validation set starts from 86.43% and reaches 92.77% after training 20 epochs while the U-Net starts from 78.21% and ends at 87.45%. Two training accuracy lines shows an upward trend, while GCN-Unet reaches higher. Figure 8 shows the prediction results compared to the ground truth.Figure 7
Accuracy increases during training.Figure 8
Precise contrast: (a) original images; (b) prediction by the Unet; (c) prediction by the GCN-Unet; and (d) the ground truth. Degree of confidence is represented by grayscale.


## 4.1. Dataset

The dataset used in this project are single-channel images of ore, coke, pellet, and sinter scenes. The size of these images is 2048 × 2448. Besides belt convey as the background, one type contains only particles. The other contains particles and extremely small materials. The purpose of the algorithm is to recognize the contour of the particles. The particle contour and tiny materials are labeled with white (pixel value 255). The background and the particle area color are labeled with black (pixel value 0) as shown in Figure3. The size of these single-channel labels is 2048 × 2448.Figure 3
Images and corresponding labels of granular raw materials. Use two colors to annotate images with particle and background and three colors for those with particle, background, and tiny materials. (a) Image of sinter. (b) Label of sinter (c) Image of coke. (d) Label of coke. (e) Image of pellet. (f) Label of pellet. (g) Image of ore. (h) Label of ore.
(a)(b)(c)(d)(e)(f)(g)(h)


## 4.2. Image Augmentation

Image augmentation increases scene diversity. As for the image, the most commonly used methods to increase the training sample include affine transformation, such as rotation, distortion, and mirror transformation. Several types of data augmentation are applied: three flip operations towards a different direction, two histogram equalization operations, contrast enhancement, mean blur, change of light intensity, and elastic deformation as Figure4 shows.Figure 4
Data augmentations. (a) Original image, (b) vertical rotation, (c) horizontal flip, (d) diagonal rotation, (e) histogram equalization, (f) adaptive histogram, equalization, (g) contract enhancement, (h) fuzzy, (i) light enhancement, and (j) elastic deformation.
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)The purpose of image augmentation is to avoid overfitting and increase the generalization ability of the model. Here, another important reason to use image augmentation is to balance the uniqueness of contour shape and increase training data set. Based on the purpose, we have test the best training set number to be around 1500–2000 for U-Net to learn the contour pattern of granularity, so we augment the volume of training dataset 89 to 1691. With different angles, brightness, contrast, and granules distortion, the dataset is more extensive and universal than the original one.


## 4.3. Data Cutting

One original image has around 5 million pixels, which makes it unfriendly for computation speed. The original image should not be scaled because details would be lost. Therefore, cutting the original image into small ones is a good way to fasten the computation speed without losing the details. As shown in Figures5 and 6, images and labels of size 2048 × 2448 are cut into 72 288 × 288 partial images. Totally 6480 partial images are obtained for 90 original images.Figure 5
Image cutting before training. (a) Original image and (b) cutten images.
(a)(b)Figure 6
Image cutting before training. (a) Original label and (b) cutten labels.
(a)(b)


## 4.4. Training Details

As Figure7 shows, the accuracy of the GCN-Unet in validation set starts from 86.43% and reaches 92.77% after training 20 epochs while the U-Net starts from 78.21% and ends at 87.45%. Two training accuracy lines shows an upward trend, while GCN-Unet reaches higher. Figure 8 shows the prediction results compared to the ground truth.Figure 7
Accuracy increases during training.Figure 8
Precise contrast: (a) original images; (b) prediction by the Unet; (c) prediction by the GCN-Unet; and (d) the ground truth. Degree of confidence is represented by grayscale.


## 5. Discussion: Compared with U-Net

As Table1 shows, the traditional U-Net has 31,101,448 parameters, while the GCN-Unet gets 7,876,675 ones, around 25% of the former. The substantial reduction in parameters greatly improves the network operation rate. As Table 2 shows, the computation speed of GCN-Unet of a 2048 × 2448 pixels image is twice as fast as the U-Net. Moreover, after introducing appropriate loss function and proper training, the segmentation results are far better than the original network. The prediction time of the GCN-Unet is more or less than half of that of the U-Net. The result is obtained by operating on NVIDIA Tesla V100-PCIE-16 GB.Table 1
Hyper-parameters of GCN-Unet.
Batch size16Input image size288Kernel_initializerhe_normalLossMSEActivationReluTable 2
Parameter and speed contrast.
GCN-UnetU-NetAverage speed0.515 s1.08 sTotal params787667531101448Compared with the U-Net, the GCN-Unet can identify the tiny parts of the materials. Therefore, particle can be seen more clearly. For the splice between each small image, the GCN-Unet can make the outline of the particle connect more smoothly. The compartment is shown in Figure8. As Figures 8(b) and 8(c) shows, degree of confidence is represented by grayscale. Pure white indicates a confidence of 100%. For original large images captured by camera, the result predicted by GCN-Unet is shown in Figure 9. Column Figure 9(a) shows the original images, Figure 9(b) shows predict images, and Figure 9(c) shows the ground truth.Figure 9
Prediction results by GCN-Unet: (a) original images; (b) predict images; and (c) ground truth.


## 6. Conclusion

Artificial intelligence technology is rapidly and profoundly affecting various industries, through visual perception technology real-time monitoring of closed corridor is the inevitable trend of the development of green manufacturing of intelligent raw materials field. At present, the visual intelligence perception technology in the intelligent raw material field is still in the early stage of development, cannot meet the need for automatic identification of the production anomalies of raw material transportation, and cannot be used as a commercial technology for large-scale promotion.To identify the granularity of raw materials during transportation, a computer vision method based on the GCN-Unet algorithm is presented to replace traditional manual sampling inspection method for the corresponding overall analysis and the automatic identification process. The GCN-Unet, based on the traditional U-Net [8], combined with 8 several global convolutional network models [13] and boundary refinement blocks [13], has a better prediction ability with fewer parameters (7,876,675, while the U-Net has 31,101,448 parameters) and a higher calculating speed (about twice faster than the U-Net).Because of data augmentation, our dataset is of good universality. After training the dataset, our model can perform good recognition under different brightness scenes.Compared to the traditional U-Net model with a precise 88.45% and 1s per image, the GCN-Unet has 5.32% higher precision and uses half of the original computation time. It is certain that the improved U-Net architecture can be applied successfully to many industrial tasks.The visual intelligence perception technology to be developed in this project can effectively promote the process of green manufacturing of steel raw materials and the development of industrial solutions of intelligent raw materials, promote the deep integration of artificial intelligence technology and industry, and then drive the innovation and transformation of the steel industry.As has been mentioned above, our proposed GCN-Unet is of great practical and innovative importance for the following reason: compared with the traditional UNet, our method not only increases inference speed with fewer parameters but also has finer segmentation performance, which enables the proposed structure to be applied in universal industrial scenes.



---

*Source: 1466261-2022-08-25.xml*