Abstract
In this article, for the first time, the optical flow and principal component analysis followed independent component analysis are combined for monitoring the motion process of robotic-arm-based system. Two kinds of optical flow, namely dense optical flow and sparse optical flow, extracted from each two successive frames of motion process in forms of video stream are used as the samples of motion-related variables of principal component analysis–independent component analysis algorithm. Relative work illustrates the effectiveness of principal component analysis–independent component analysis method for non-Gaussian process monitoring. The proposed dense optical flow–principal component analysis–independent component analysis and sparse optical flow–principal component analysis–independent component analysis algorithms use three-way array as their data which follows non-Gaussian distribution. Data unfolding, data normalization, and proper definition of the control limit are introduced. Based on dense optical flow–principal component analysis–independent component analysis and sparse optical flow–principal component analysis–independent component analysis algorithms, the corresponding motion process monitoring scheme is developed, and a case study of robotic-arm-based marking system is taken to evaluate the performance of these methods. The results demonstrate the capability and efficiency of the proposed methods.
Keywords
Introduction
More and more robotic arms are applied in industry for improving product quality and reducing product cost. For safety and quality reasons, monitoring the motion process of the robotic arm and its surrounding is of great demand.1–2 Traditionally, monitoring the motion process of robotic arm is performed by analyzing the data collected by sensors attached to the joints or surface of the robotic arms. 3 There are some defects of this method: (1) when some key sensors or all the sensors are broken down, monitoring cannot be performed, (2) sensors can collect only the data of robotic arm itself and cannot be sensitive to other surrounding objects’ motion which can be latent faults sources of the robotic arm, and (3) human appears in the dangerous area of robotic arms’ working range which risk their life. Therefore, the design of motion process monitoring method for solving these problems is of great significance. Data-driven multivariate statistical process monitoring (MSPM) methods have been widely used to capture the characteristics of the process for further establishing accurate and reliable monitoring model,4–10 such as principal component analysis (PCA) and partial least squares (PLS). However, there is a pre-assumption that the data follow Gaussian distribution which can be hardly satisfied in practical application. Independent component analysis (ICA), which reveals higher-order statistical information of the process data, is widely used in coping with non-Gaussian process.11–18 Various methods and successful applications are reported based on PCA-ICA. For example, Berg et al. 19 proposed PCA-ICA to extract Gaussian and non-Gaussian information for blind source separation. Huang and Yan 9 discussed to use variable distribution characteristic (VDSPM) which employs D-test to separate the Gaussian subspace and non-Gaussian subspace. Jiang et al. 10 introduced a PCA-ICA integrated with a Bayesian fault diagnosis method for non-Gaussian process. Megahed et al. 20 published a review on image-based process monitoring methods, which are divided into several groups including multivariate and profile-based techniques, spatial control charts, and multi-variate-image-analysis (MIA) control charts. In the first group, multivariate control charts along with a feature extraction method and profile modeling were used for process monitoring. Wang and Tsung 21 modeled the relationship between a sampled image and a baseline using Q-Q plots and then used profile-monitoring methods to detect changes in these plots. A major disadvantage of this method is that it ignores the information about pixel locations. The spatial control charts, however, consider the spatial information using non-overlapping windows that move across an image. 22 The main disadvantage of profile-based and spatial monitoring methods is that these methods are typically applicable to grayscale images and they cannot be directly used for the monitoring of color images. MIA techniques, on the other hand, can handle color images by extracting features from each color channel. Although MIA can effectively extract color features, it neglects the spatial information of an image. 23 However, new issues in process monitoring arise when it comes to motion process monitoring using vision data captured by a fixed camera which is independent to the process. What kind of feature of the video frames can describe the motion information of the objects in the scene? How to deal with the motion-related feature to model the normal motion process for monitoring has become a challenging problem.
The optical flow is the pattern of apparent motion of objects, surfaces, and edges in a visual scene caused by the relative motion between a camera and the scene. The optical flow information is widely used in image processing and navigation including motion detection, object segmentation, motion compensated encoding, and stereo disparity measurement. Various methods are proposed for calculating the optical flow.24–28 In present article, the optical flow is calculated through two successive frames of a video, and two kinds of optical flow are employed, which are dense optical flow (DOF) and sparse optical flow (SOF). DOF uses every pixel between the two successive frames for calculating the optical flow field. However, SOF only uses some feature points, corner points for example, and search for the same points in current frame for velocity. Obviously, DOF gives DOF field, but needs more computation than SOF.
Based on DOF and SOF, we propose DOF-PCA-ICA and SOF-PCA-ICA methods for monitoring motion process of robotic-arm-based system. Normal motion is captured by fixed camera in form of video stream, and the DOF and SOF are extracted from the video stream for modeling. Unlike traditional MSPM method, the data of DOF-PCA-ICA and SOF-PCA-ICA are a three-way array and motion-related variables follow non-Gaussian distribution. Three-way array is a useful tool, which has been used by the multiway principal component analysis (MPCA) for traditional sensor monitoring for batch process. Data unfolding with normalization needs to be done for performing PCA-ICA algorithm. The control limits of I2 statistic for monitoring cannot be determined using approximate distribution function. Kernel density estimation (KDE) method is an effective tool of estimating the distribution of random variable. In this study, we adopt KDE method to determine the upper control limits of the monitoring statistics. Finally, based on DOF-PCA-ICA and SOF-PCA-ICA, the corresponding fault detection approaches are developed to monitor robotic-arm-based marking system (RABMS) motion process. The results of the proposed monitoring methods show satisfactory monitoring performance.
The remainder of this article is organized as follows. A brief review of optical flow extraction and PCA-ICA algorithm is presented in section “Preliminaries.” Detailed descriptions of the proposed DOF-PCA-ICA and SOF-PCA-ICA methods are presented in section “Optical flow–based PCA-ICA fault detection.” A case study of RABMS motion process demonstrates the capability and efficiency of the proposed method in section “Case study.” Finally, conclusions of the presented work are summarized.
Preliminaries
The basics of optical flow extraction and PCA-ICA process monitoring are briefly reviewed.
Optical flow extraction
The concept of optical flow was first proposed by Gibson in 1950 and the research on optical flow is a hot topic in the field of computer vision and image processing. The optical flow is a simple and practical image motion expression technique. The optical flow field can be simply understood as the velocity vector field of the object, including two component (u(x, y), v(x, y)) which can be written as (u, v) for short. There are four types of methods used for computation of the optical flow: gradient-based methods, matching-based method, energy-based method, and phase-based method. Gradient-based method is the most widely used to calculate the optical flow, for example, Horn–Schunck and Lucas–Kanade (LK) algorithms are all gradient-based algorithms. Here we use pyramid implementation of LK algorithm
25
to get SOF, while using Gunnar Farnebäck’s
26
method to extract DOF from each two successive images in video streams as shown in Figure 1. Fixed points, green points in Figure 1(a), estimates the motion in the adjacent areas according to the size of the image and the interval steps of both vertical and horizontal axes. A close look into the data matrix

Optical flow extracted from two successive frames: (a) dense optical flow extraction and (b) sparse optical flow extraction.
DOF requires the use of some interpolation method in the relatively easy to track the pixels between the pixels to solve the motion is not clear, so it is a considerable computational overhead. For SOF, set points which are easy to keep track of, such as corner points, need to be specified; then the pyramid LK optical flow algorithm can get the SOF of the tracked points.
PCA-ICA process monitoring
Through selected loading vectors, PCA projects the data onto a lower-dimensional subspace that preserves the maximum variance of the original data. Sample data
where
where
Additional details on the ICA monitoring can be found in related works.11,13 A multivariate statistical monitoring framework is proposed, in which PCA is first employed to project the optical flow data onto the dominant subspace and then a subsequent application of ICA is employed to extract ICs from the retained PCs. The current study directly uses this PCA-ICA method to extract the independent components, and the focus is on establishing an optical flow–based motion fault detection system for monitoring the motion process.
Optical flow–based PCA-ICA fault detection
This is the first time we use unfolding optical flow feature as sample variables of PCA-ICA algorithm for motion process monitoring. The variables of the data are motion related. However, monitoring the process directly through these variables is inappropriate for three reasons. First, the motion-related variables can be correlated with each other, which can cloak the motion process behavior. Second, high dimension of the data can exceed the calculation capacity of a general computer. Third, the motion process fault can be reflected more evidently on the latent variables than on the directly variables. Considering these reasons, the present study employs the PCA-ICA method for monitoring motion process. This section displays how to unfold optical flow–based motion data to fit PCA-ICA model, how to calculate the control line of I2 and SPE statistics, as well as the procedures for monitoring.
Data unfolding
The optical flow–based motion data set of a process or video is a three-way array, X(I × J × K), where I represents the number of motion points, J denotes the number of motion-related variables, and K is the number of sampling optical flow instants between each two successive frames in the video stream, which denoted as the total number of the video frames subtract one, and can also be used as time-slice index. Each optical flow item (u, v) in
Motion-related variables.
Time-wise unfolding, X is unfolded such that every slice I × J is placed along the K axis from the first time interval to the last time interval side by side. Then every slice I × J is remapped to a row vector that each row in slice I × J is concatenated from top to bottom end. A two-dimensional matrix X(K × IJ) is then constructed. Unfolding process is illustrated in Figure 2. The variation among time can be analyzed in this unfolding manner. For SOF-PCA-ICA, additional step should be taken as the row vector may not of the same length. Three methods may be employed for solving this problem: (1) align all vectors to the longest vector by filling in zero values, (2) align all vectors to the longest vector by filling in the last value of the vector, and (3) align all vectors to the shortest vector by cutting off redundant data. As the data in the vector are motion-related information, so cutting off means losing part of information and makes the model inaccurate for monitoring. Filling in the last value of the vector for aligning means adding additional nonexistent motion information which may misleading the model. Thus, we adopt align all vectors to the longest vector by filling in zero values. Before modeling, each column in X(K × IJ) needs to be scaled to zero mean and unit variance, because less important variables with large magnitudes can overshadow important variables with small magnitudes. Then, matrix

Optical flow data unfolding.
Optical flow–based PCA-ICA motion process monitoring
Reconsidering the unfolded matrix
where the loading matrix is
where
The eigenvalues are arranged in descending order. The principal components are ordered in the same manner as eigenvalues, such that each one describes the amount of variation in original data also in descending order. Determine R principal components, so that
P is then separated into two parts:
The PCS can be scaled as
where
where
where
In practice, the bandwidth parameter
where
where
where
The optical flow–based PCA-ICA approach for online process monitoring is illustrated in Figure 3, and its detailed step-by-step procedure is given in the following:
Off-line modeling
1. Extract optical flow and unfold X(I × J × K) to X(K × IJ).
2. Obtain
3. Determine R,
4. Whiten the data in PCS to get unmixing matrix
5. Calculate I2 statistic.
6. Using KDE to estimate the control limit I2_line of I2.
Online monitoring
1. Normalize the test sample x, extracted optical flow data between k – 1 and k frames of test video, using the same data of the model.
2. Project the data into PCS. Calculate SPE in RS.
3. Do ICA in PCS to get ICs.
4. Calculate I2 statistic.
5. Monitor whether the value of I2 exceeds the I2_line and SPE exceeds the SPE_line.

Flow chart of process monitoring.
Case study
In this section, the proposed DOF-PCA-ICA and SOF-PCA-ICA motion process monitoring approaches are evaluated through the RABMS. Robotic-arm-based system is widely used in industry, and the marking system which is used in steel enterprises is an example of this kind. Steel enterprises need to mark important parameters, the mintmark, size, batch number, date, and other information, to meet the standard management rules. Traditionally, the marking work is done by human workers. Because of the bad working conditions, high temperate, hazardous, and noxious substances, and repetitive work for a long time in fast speed, it is unavoidable for human workers to mark occasionally the wrong label on the products. So, RABMS shown in Figure 4 is designed for replacing human labor to enhancing marking efficiency with high quality. As can be seen in Figure 4, the RABMS holds a spray gun at its robotic arm’s end and the spay gun can be freely moved by its arm to any position along the half arc surface of the coil toward the robot to mark the information. The coil is taken by walking beam soon after being bundled; therefore, it is of high temperature about 300°C. During the 1-min stay, the RABMS will use radius measure end of the spray gun to touch three different spots of the coil surface to calculate the radius of the coil if radius meets the demand and then the spray end will be rotated to mark the information; otherwise, the robot will refuse to mark and get back to its rest room where there is a partition diving off the hot coil. Finally, the coil will be moved to another area by the walking beam waiting for electromagnet crane to carry away to the stacking area.

Robotic-arm-based marking system
We capture a video stream of 1 min and 12 s, which contains 1727 frames whose size is 624 × 416 pixels to do a model of normal motion of the RABMS. If we use DOF-PCA-ICA model, and both horizontal and vertical interval steps are 16 pixels, we get X(1080 × 4 × 1727), then after unfolding and normalization, we get
Fault descriptions of RABMS.
Effects of the faults are analyzed as follows. Human workers move in the area around the robot which may be dangerous for safety reasons. Fault 2 is quality related that may cause flaw mark or even wrong mark due to the motion data that do not in accordance with the normal model motion data. The total number of fault frame is 922.
Both the DOF-PCA-ICA and SOF-PCA-ICA are applied to monitor the motion process, and the performance of these methods is compared. We do the PCA algorithm to normal model to extract principle component, and through the sample points we get each component’s contribution according to formula (8). Therefore, we select the first 769 and 10 variables for DOF-PCA-ICA and SOF-PCA-ICA as our principal components, and the contributions of the selection over that of the total are above 90%. The corresponding 769 and 10 columns of

Normality check of ninth score obtained from PCA.
FastICA is performed after projecting the data onto the PCS, 769 ICs for DOF-PCA-ICA and 10 ICs for SOF-PCA-ICA are used for calculating I2 statistic. All the 1727 frames of model video are used for estimating the normal distribution of I2 statistic. The I2 is within [39,622] for DOF-PCA-ICA and [0,7] for SOF-PCA-ICA as shown in Figures 6 and 7.

Distribution of I2 using DOF-PCA-ICA.

Distribution of I2 using SOF-PCA-ICA model.
Interval [39,622] is divided into 100 subintervals, and the frequency ratio of I2 within each subinterval is derived. Then, KDE is used for fitting these discrete points for DOF-PCA-ICA in Figure 8. The same is done to interval [0,7]. The frequency ratio of I2 within each subinterval and the KDE for fitting these discrete points for SOF-PCA-ICA is shown in Figure 9. Finally, the I2_line of I2 statistic with 99% confidence is 441.22 and 0.067 for DOF-PCA-ICA and SOF-PCA-ICA monitoring, respectively.

Estimation of I2 control limit using DOF-PCA-ICA.

Estimation of I2 control limit using SOF-PCA-ICA model.
Figures 10 and 11 demonstrate the monitoring performance for faults in Table 2 through I2 statistic using DOF-PCA-ICA method. As can be seen in Figure 10, when the worker moves fast in dangerous area, the value of I2 statistic is large, for example, frames 2414–2358, frames 2737–2957, and frames 3155–3280. Similarly, when the worker moves slowly in dangerous area, the value of I2 statistic is small, for example, frames 2538–2737 and frames 2967–3155. The performance for the same faults in Table 2 through I2 statistic using SOF-PCA-ICA method is shown in Figure 12. It obtains similar results as DOF-PCA-ICA model. But some points of I2 statistic value is zero, because some minor movement cannot be detected by the SOF extraction.

Plot of I2 using DOF-PCA-ICA for monitoring fault 1.

Plot of I2 using DOF-PCA-ICA for monitoring fault 2.

Plot of I2 using SOF-PCA-ICA for monitoring.
The fault detection rates of the proposed DOF-PCA-ICA and SOF-PCA-ICA methods are listed in Table 3. To make a contrast with the PCA algorithm, the detection results by T2 and SPE statistics are also listed in Table 3. From Table 3, the DOF-PCA-ICA method using I2 statistic has the best performance. While the SOF-PCA-ICA method using I2 statistic, DOF-ICA and SOF-ICA also have well enough performance. Although the DOF-ICA and SOF-ICA perform well enough on detection rate and false alarm rate, the process time takes far more than the proposed method, in case study more than 48 h for processing DOF-ICA model and 5 h for SOF-ICA model. Therefore, it may be impossible for applying the DOF-ICA and SOF-ICA in real-time application.
Comparison results of given faults.
DOF: dense optical flow; PCA: principal component analysis; ICA: independent component analysis; SOF: sparse optical flow.
Significance of bold values are for highlighting the results compared to other methods.
The performance of data size and process time is of great value in real application, and the results are shown in Table 4. Data size means the occupied memory space on hard disk. Process time means consumed time for processing the data. The performance of data size and process time for the proposed methods is given in Table 4.
Comparison results of performance.
From Table 4, DOF-PCA-ICA method needs more space and consumes more time for processing both model and test data than SOF-PCA-ICA method. The reason for DOF-PCA-ICA’s good performance for fault detection is that it contains more detail information than SOF-PCA-ICA. On the other hand, SOF-PCA-ICA also has the ability for detecting all faults in Table 2 with fewer space and faster speed. All in all, it depends on your need to choose which method to use for motion monitoring.
Conclusion
In this article, for the first time, optical flow feature and PCA-ICA algorithm are combined for developing motion process monitoring algorithms. Two kinds of optical flow, DOF and SOF, are employed as the samples of motion-related variables for forming models of DOF-PCA-ICA and SOF-PCA-ICA. Based on the model, the corresponding motion process monitoring scheme is proposed. The proposed monitoring approaches are applied to monitor robotic-arm-based spray marking system. The case study results demonstrate that both DOF-PCA-ICA and SOF-PCA-ICA can detect the faults designed in Table 2. Compared to SOF-PCA-ICA, the DOF-PCA-ICA model is more accurate but consumes more time and memory space. So, when accuracy is most important index, we should choose DOF-PCA-ICA model. Otherwise, when speed is most important index, we should choose SOF-PCA-ICA model.
Footnotes
Handling Editor: Kuei Hu Chang
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: The work is supported by NSF in China (61325015 and 61733003).
