Received 2 February 2016; accepted 26 February 2016; published 29 February 2016
Monitoring of a patient has been an important but tedious work for medical staffs. The automatic anomaly detection for respiratory motion is very critical to conduct radiation therapy safely.
The difficulty of anomaly detection causes from the fact that 1) almost all of respiratory curves show base- line drift, 2) amplitudes of respiratory motions vary sometimes up to 300%, 3) frequency of respiratory cycle sometimes changes  . Because of these characteristics, simple threshold method tends to fail for detection of anomaly motion.
There has been some useful anomaly detection algorithm for industrial use. Those algorithms are classified into two categories: model based algorithm and model free algorithm. Typical examples of model based approach are auto regressive (AR) model  and Kalman filter algorithm  -  . An example of model-free approach is singular spectrum analysis. The merit of model-free approach is an ability to deal with unexpected motion error and easy implementation. An example of this type of approach is singular spectrum analysis. It is a non-parametric method to extract characteristics of time-series data. There have been a few examples for an application of change point detection   , however, few researchers have reported on anomaly detection of respiratory motion.
In this paper, we tried to apply an anomaly detection algorithm based on singular spectrum analysis to a respiratory curve of a patient.
2. Materials and Methods
In this study, we applied the singular decomposition technique to measured respiratory motion obtained by a depth camera (Microsoft Kinect v1). First, we will describe how we measured respiratory curve. In the next section, we will explain the detail of algorithm to detect anomaly motion.
To monitor the respiratory motion, contact-less sensor was desirable. As a low-price sensor, our group has been using a Kinect sensor. Kinect sensor obtained depth data to a target from a shift of projected infrared patterns and the accuracy was 3 - 4 mm. To reduce the noise, we applied Ueda’s algorithm to the raw data of Kinect sensor. The sampling rate was 5 fps. The detail of this system was described in Kumagai et al.  .
For testing performance, one of the authors simulated two types of anomaly motion, e.g. cough, sudden stop of breathing.
2.2. Anomaly Detection Method
To detect an anomaly motion, we first extracted the feature of the time-series data with window length w based on singular value spectrum analysis   .
Let normal (or reference) time-series data be. We can define a trajectory matrix as
The matrix holds the feature of normal time series data at a reference time with look-back time of w. k was set to   .
Similarly, we can define a matrix representing current states (at time t) of respiratory motion as,
For example, window length w was set to 40 (= 8 sec). k was set to.
Next, we decomposed the matrix and using singular value decomposition
here is an orthogonal matrix and is an orthogonal matrix and W is a diagonal matrix with singular values of and there is a constraint of.
From this decomposition of matrix, the matrix can be approximated as
This is an example of well-known spectrum decomposition of a matrix. For, in the similar manner, we obtain the following formula
Figure 1 shows the singular values of and. From this figure, we set m to 5 to approximate the time series data. Therefore, the matrices were approximated as
Then we defined a matrix representing the feature of time series of the reference signals as
Similarly, a matrix representing features of current status was defined as
To measure the similarity of two time series, we calculated canonical angle of two matrices as
where is a two norm of a matrix calculated by a root of the maximum singular value of the matrix. Note that the cosine of canonical angle is within 0 and 1, as an anomaly score, we can define
This score represents the anomaly of the current time window compared with the reference time window.
Figure 1. Singular values of X1 (circle) and X2 (cross).
2.3. Performance Test
The anomaly detection can be divided into six steps.
1. Measurement of normal (not including anomaly events) respiratory motion.
2. Calculation of
3. Measurement of respiratory motion.
4. Calculation of
5. Calculation of anomaly score from and
6. If the anomaly score exceeds the threshold, then the algorithm judged anomaly event occurred.
In the Step1, we measured a respiratory curve of a patient under normal situation (not suffered from anomaly events).
To test our algorithm, we measured the reference respiratory motion and normal respiratory motion by a volunteer. Then the time-series data were retrospectively analyzed using our algorithm. All algorithms were implemented using R language  .
Based on the algorithm, we performed real-time prediction of respiratory motion using our respiratory monitoringsystem  . The algorithm was implemented by python language.
In our study, we applied an anomaly detection algorithm based on singular spectrum analysis.
Measurement data was obtained by a depth camera.
As a reference of normal respiratory curve, a normal respiratory motion was recorded with a depth camera. The obtained data was shown in Figure 2. The interval of dashed lines represents an interval to be used for singular spectrum analysis. Obviously, the length of interval strongly affects calculation results of anomaly score. The choice of window length w will be discussed in the discussion section later.
To simulate anomaly motions, the four types of anomaly motion were tested. Figure 3 shows an anomaly score when cough events occurred. Figure 4 shows an anomaly score when breathing was suddenly stopped. As
Figure 2. A reference respiratory curve obtained by a depth camera. An interval between dashed lines were used to calculate the trajectory matrix X1.
Figure 3. An example of cough events simulated by a volunteer. Two peaks at around 60 s and 120 s represent the cough events. The blue curve repre- sents the respiratory curve, while the red curve represents the anomaly score calculated by Equation (10).
Figure 4. An example of breathing stop simulated by a volunteer. The red curve represents the respiratory curve, while the blue curve represents the anomaly score calculated by Equation (10).
can be seen, the two types of events (cough and sudden stop of breathing) was successfully detected as a sudden increase of anomaly score. On the other hand, gradual increase of respiratory period was not clearly detected by this method.
Real-time anomaly detection was tested as shown in Figure 5. The red curve represents the anomaly score. Simulated breathing stop was successfully detected by this algorithm.
Prior works have suggested that a general algorithm to detect anomaly motion would be difficult. This paper tried to overcome the difficulty using singular spectrum analysis.
Figure 5. A snapshot of real-time anomaly detection. Depth data (blue curve) and Anomaly score (red curve) are shown.
Figure 6. Window length dependencies of anomaly score in the case of breathing stop.
The window length w is a main parameter of the analysis. The result depends on the parameter. However, there has been no universal selection rule. Therefore, we analyzed a respiratory curve with different length and compared them by visual inspection.
Figure 6 shows anomaly scores with different time window w for a sudden stop of breathing event. As shown in Figure 6, smaller window length tends to increase time resolution of anomaly detection, while the score itself tends to be noisy. Therefore, window length of 8 sec (w = 40) seemed to be appropriate for this situation. We did the same way to the cough events and obtained the Figure 7. We found the same tendency in the figure and determined the window length to be 8 sec. The optimum window length, however, depends on a patient.
There has a limitation, however, in this algorithm. One of the demerit in our method is the difficulty of the simple and explicit interpretation of the anomaly model. There has no clear-cut threshold to alarm an error. Users should be aware of these difficulties.
The merit of this approach is the fact that no a priori modeling of anomaly motion is required. Because anomaly motion is defined as a deviation from the normal motion, an explicit pre-implementation of anomaly mode is considered to be difficult. Using this algorithm, an unexpected anomaly motion could be detected. Hence, this algorithm will be a good supporting tool for medical staffs.
We have demonstrated that automatic anomaly detection of respiratory motion using singular spectrum analysis was successful in the cough and sudden stop of breathing. The clinical use of this algorithm will be very hopeful.
Figure 7. Window length dependencies of anomaly score in the case of cough.
This work was supported by JSPS KAKENHI Grant Number 15K08703 and partly supported by JSPS Core-to- Core Program (No. 23003).