## 2 Methods
### Slip Detection
#### 2.3.3 Optical Path Occlusion and Remaining Background Noise
The subsequent

Figure 7: Optical flow angles when represented as an HSV image; the marked areas are the angles of OF that do not trigger slip detection to prevent the deformation of compliant objects from triggering the detection of optical flow. layers, representing frame distances of \(-2\), \(-4\), and \(-8\), respectively, introduced additional delays of approximately 0.09 s, 0.16 s, and 0.29 s. This layering approach allowed for a fast reaction time with minimal delay for most slip cases while ensuring robustness to noise and providing a timely reaction for slip cases with low magnitudes. ### Evaluation

The algorithm's performance was evaluated using a dataset specifically designed for slip detection research, which was previously utilized in a paper on slip detection via machine learning by a research group at Waseda University, Tokyo [9]. Unfortunately, a similar dataset from the Massachusetts Institute of Technology (MIT), which could have provided additional comparisons, was not available, and the researchers did not respond to inquiries at the time of writing this paper. The dataset used for evaluation consisted of 35 everyday items that were lifted by a \"Nicebot\" robot arm equipped with a WSG-5 parallel gripper. The objects (Figure 9) were subjected to 30 grasping and lifting trials, each with different opening distances, resulting in a total of 1050 image sequences. These image sequences were then labeled to indicate slip or nonslip cases. It is important to note that all objects used in the experiments were within the gripper's maximum opening distance in size. The gripper was equipped with a 6 \(\times\) 4 matrix uskin tactile sensor, and a RealSense D345i RGBd camera was positioned in front of the gripper. As the camera was not directly attached to the end effector, the captured image data needed to be stabilized relative to the gripper's movement for comparability. To achieve this, template matching was applied to a portion of the gripper in each frame (Figure 10). However, rounding errors resulting from the template matching process introduced high-frequency noise. To mitigate this noise, a temporal filter was applied. The filter utilized a second-order Butterworth filter [21] with a sampling frequency of 1000 Hz and a cutoff frequency of 10 Hz. The resulting transfer function and difference equation can be seen in Equations (3) and (4). \[H(z)=\frac{0.0026+0.0052z^{-1}+0.0026z^{-2}}{1-1.7402z^{-1}+0.8008z^{-1}} \tag{3}\]

\[y[n] =0.0026x[n]+0.0052x[n-1]+0.0026x[n-2] \tag{4}\] \[\quad-1.7402y[n-1]+0.8008y[n-2]\]

Figure 8: Frames stacked at increasing temporal distances, each being compared with the current frame (0) for optical flow calculation. For every step in temporal distance, extra delay is added; however, the reaction time does not have to be fast. The example frames are taken from the dataset published under open access in Ref. [20]. Seven of the objects in the dataset had instances where the gripper left the frame during some or all of the image sequences, making it impossible to stabilize the frames relative to the gripper's movement. Consequently, these objects were excluded from the evaluation, leaving a total of 840 image sequences used for the algorithm's evaluation. Regarding the slip detection algorithm's threshold, it was initially chosen through trial and error. However, after the evaluation, the threshold was optimized using a two-step process. First, a grid search was conducted over a range of thresholds. Then, a gradient descent was performed on the three thresholds that resulted in the highest classification rates. ## 3 Experimental Results

The results of the evaluation, along with threshold optimization, are summarized in Table 1. The algorithm's accuracy on the entire dataset with the optimized threshold is 82.38%. However, it is important to consider the limitations of optical flow when evaluating its performance.