## 2 Extreme Learning Machine (ELM)-Based Moving Cast Shadow Detection
### Moving Cast-Shadow Detection Algorithm  
Based on the above discussions, the proposed moving cast shadow detection algorithm based on the extreme learning machine (MCSD-ELM) is summarized in Algorithm 1. ``` Input:\(t\) original frames \(F^{t}\), \(t\) groundtruths \(G^{t}\), background image \(B\) and the \(t\)+1 foreground frame \(F^{t+1}\). Output: The moving cast shadows and moving objects in the foreground frame \(F^{t+1}\). Step 1. Randomly select \(N\) labelled pixels from \(t\) groundtruths \(G^{t}\) and extract pixel-level and region-level features according to Equations (1)-(11). Step 2. Generate the feature descriptor \(x_{i}=[x_{i1},x_{i2},\cdots,x_{il}]\in\Re^{d},i=1,2,\ldots,N\), and the label vector \(y_{i}=[y_{i1},y_{i2},\cdots,y_{iC}]\in\Re^{C}\) with C-dimensions of \(x_{i}\) to obtain the training set \(\{(x_{i},y_{i})\}_{i=1}^{N}\). Step 3. Initiate an ELM with \(L\) hidden neurons, random input weights and bias values, and compute the output vector \(h_{i}(x)\) of the hidden layer. Then the output matrix \(H\in\Re^{N\times L}\) is formed. Step 4. Compute the output weights \(W\) using Equation (14). Step 5. For one new testing foreground frame \(F^{t+1}\), extract pixel-level and region-level features according to Equations (1)-(11) and form the feature descriptor \(x_{m}^{t+1}\) for each foreground pixel (\(m=1,2,\ldots,fp\), \(fp\) is the number of moving pixels in \(F^{t+1}\)). Step 6. Calculate the network response of each foreground pixel according to the obtained output weights \(W\), denoted by \(o_{m}^{t+1}=W^{T}\varphi(x_{m}^{t+1})\) in which \(\varphi(x_{m}^{t+1})\) is the network hidden layer output for \(x_{m}^{t+1}\) of the \(m\)th pixel in \(F^{t+1}\). Step 7. Determine the class label \(y_{m}^{t+1}\) according to Equation (16) and generate the candidate moving shadow mask \(M^{S}\) and candidate moving objects mask \(M^{O}\). Step 8. Perform the post-processing on the candidate \(M^{S}\) and \(M^{O}\) to obtain the refined classification results. ## 3 Experiments and Result Analysis

In this section, we first introduce two common datasets which are used to validate the superiority of the proposed method. Then, the quantitative evaluation metrics are illustrated. Finally, we compare the proposed method with several representative well-known methods quantitatively and qualitatively. ### Datasets

In our experiments, we assume that the foreground detection masks (including the moving cast shadows and moving objects) are available and select two datasets consisting of 13 scenes (indoor and outdoor) to test the performance of our proposed method. The first dataset [56; 57] has six popular and widely tested scenes, which is summarized as follows. Moreover, the details of the first popular dataset are listed in Table 1.

(1) **Campus**: It is an outdoor scene, in which the shadow is relatively large and weak because of the presence of multi-light effects. (2) **Highway**: It is an outdoor scene of the traffic with different lighting conditions, in which the shadow is relatively large and strong. (3) **Intelligent Room**: It is an indoor scene with different perspectives and lighting conditions, in which the shadow is medium and weak. (4) **Laboratory**: It is an indoor scene with various lighting conditions, in which the shadow is medium and weak. (5) **Hallway**: It is an indoor scene with a textured background, in which the shadow is variable and weak. (6) **CAVIAR**: It is an indoor scene with different lighting conditions, in which the shadow is variable and weak. Besides, it has an obvious shadow color blending because of a strong background reflection. The second dataset is selected from the CDnet dataset [58] including a large number of benchmarks, which is illustrated in Table 2 in detail.