## 2 Related Work  
Video segmentation has attracted great attention and many researchers have proposed to use DNN methods to solve this problem due to its impressive performance in this field. However, DNN is obviously not suitable for scenarios with a small/no training samples. Background subtraction, a crucial step in video object segmentation has attracted great attention in the last two decades. The main idea of background subtraction is to build a background model with a fixed number of frames. This model can be designed by different methods, such as statistical, fuzzy, neuro-inspired, and so forth. Among these methods, statistical methods have been intensively studied and widely used in various applications [8; 9; 10; 11]. For example, [PERSON] et al. developed a message passing algorithm termed offline denoising-based turbo message passing subtracting the background successfully with a lower mean squared error and better visual quality for both offline and online compressed video background subtraction [12]. [PERSON] and [PERSON] implemented a parametric probabilistic background model [13]. In this model, distributions of each pixel color updated through an online expectation-minimization algorithm, were represented by a sum of weighted Gaussian distributions defined in a given color space: the Gaussian Mixture Model (GMM). [PERSON] et al. adopted a neural network to determine whether each pixel of the image belongs to the foreground or the background [14]. [PERSON] et al. established a spatio-color model based on both foreground and background, which used Expectation Maximization (EM) to track the parameters of GMM [15]. [PERSON] et al. used EM in the same way but modeled foreground and background at the region level and pixel level, respectively [16]. [PERSON] and [PERSON] proposed an algorithm for foreground extraction and background updating using fuzzy functions and modeled both foreground and background in a non-parametric way [17]. These algorithms mainly implemented foreground detection on each pixel of a frame and may not be able to segment some parts of the background into foreground, resulting in a lower accuracy than DNN methods. However, these algorithms can provide some real-time results to meet some time-sensitive tasks. In addition, it is useful to first segment an ROI by frame difference before clustering and classification. In this paper, we propose RoiSeg, an effective object segmentation method based on ROI, which utilizes unsupervised learning to improve the accuracy of foreground segmentation and ensure the real-time performance. RoiSeg includes two crucial designing methods, namely clustering and classification methods. Cluster analysis is a statistical multivariate analysis technique which is a common method of unsupervised machine learning [18]. It divides a set of data points into several classes, with the data points in each cluster being very similar but the data points in different clusters being very different [19]. K-means is an excellent clustering method based on segmentation. It iteratively calculates the distance from each point to the K-cluster center, so that K clusters can be found in a given data set [20]. [PERSON] et al. presented an efficient initial seed selection method, RDBI, to improve the performance of the K-means filtering method by locating the seed points at dense, well-separated areas of the dataset [21]. [PERSON] et al. presented an improved, density-based version of K-Means, the key idea of which is to select as the initial centroids data points which belong to dense regions and which are adequately separated in feature space [22]. The Gaussian mixed model (GMM) is a classic statistical model, in which samples are generated by a Gaussian mixture distribution and the expectation maximization (EM) algorithm is used to update the parameters of the model [23]. Unlike traditional methods of cluster analysis based on heuristic or distance-based procedures, finite mixture modeling provides a formal statistical framework on which to base the clustering procedure [24].