Automatic Scratching Analyzing System for Laboratory Mice: SCLABA-Real

Small laboratory animals such as mice, rats and rabbits play important roles in the news drugs development for human beings and in disease pathophysiology. Some examples include the NC mouse used as the model of atopic dermatitis, and the WISTAR rats used as the model of clinic depression in the forced swim test. However, the behaviors of small animals are usually very fast and repetitive, and sometimes very difficult to observe by the naked eyes by other common methods.


Introduction
Small laboratory animals such as mice, rats and rabbits play important roles in the news drugs development for human beings and in disease pathophysiology. Some examples include the NC mouse used as the model of atopic dermatitis, and the WISTAR rats used as the model of clinic depression in the forced swim test. However, the behaviors of small animals are usually very fast and repetitive, and sometimes very difficult to observe by the naked eyes by other common methods.
Laboratory mice are widely used as the model of human beings' atopic dermatitis, whose scratching behavior could be induced by itching. For the itching evaluation experiments in animal models, automatic quantification system is needed for objective and accurate results. Mouse scratching is the behavior of rapidly scratches its head or other parts by using its hind leg. It is also known to be a model behavior of disorders as a major symptom of skin disease such as atopic dermatitis and other types of dermatitis.
Mice's scratching is also a periodic behavior inhibited at a frequency of more than 10 times/s, and it is extremely difficult to detect such rapid movement accurately with the naked eye or conventional video tracking system. Furthermore, scratching behavior also has to be distinguished from other behaviors, such as grooming and rearing. Grooming is the mice groom themselves with their teeth and claws. The usual grooming routine may involve a mouse scratching itself with the hind feet, then perhaps washing its face or fur with its hands (spreading saliva on the hands, and rubbing them over the fur), and grooming with the teeth. Rearing is the mice standing up with hind legs and sometimes with exploration. Frequencies of grooming and rearing are lower than scratching but also difficult for manual distinguishing and duration time quantification.
Therefore, for an objective evaluation, it is important to perform the automatic quantification of mice, thereby enabling drug developers to assess the grade of dermatitis and the efficacy of new anti-pruritic drugs in laboratory animal experiments.
In this chapter, we describe a real-time mice scratching detection and quantification system based on a specially designed high-speed vision system. Its recording and processing frame 5 www.intechopen.com rate is much higher than the video signal rate (NTSC 30 fps/PAL 25 fps). The developed system can discriminate the scratching behavior from other behaviors, such as rearing and grooming.
For evaluation, we show the performance of our developed system by experimental results for several laboratory mice in long-time observation. The results also show the objectiveness and accuracy. We estimated the detection correction ratio and compared the scratching times of these mice.

State of the art
Laboratory mice scratching can be artificial induced by administering factors triggering itching K. Kuraishi (1995). For scientific purpose, many experiments have been conducted to evaluate mice scratching. These experiments involve the administration of the compound 48/80 R. C. Benyon (1986), histamine N. Inagaki (1999), and serotonin J. S. Thomsen (2002) and acetone or ether painting on animals to induce a dry skin T. Miyamoto (2002). However, all of these experiments have not been evaluated objectively because many of them relied on manual detection which use naked-eye for observations. In recent years, some automatic systems are also developed for the objective detection and quantification of scratching. Inagaki et al. planted a metal marker under the skin of a laboratory animal N. Inagaki (2003) and reported the benefits of MicroAct. It is a quantitative scratching analysis system that utilizes magnetic field fluctuations when the metal marker vibrates violently as a result of scratching. The marker methods are very invasive to animals, and make it very difficult to obtain an objective result.
It is worth noting that we can consider similarity with human motion, since the vision based human motion analysis has also been studied by many researchers T. B. Moeslund (2006). To solve the inherent complexities in general activity recognition and classification, hierarchical models, spatio-temporal features, temporally aligned pyramid matching and many other advanced methods have been utilized Y. KYan (2007); J. C. Niebles (2007); D. Xu (2008); S. Savarese (2008);L. Wang (2008).
However, there are inherent differences in small laboratory animals' behaviors and primate's behaviors. The primate's behaviors such as human activities are usually contain multiple patterns and the motion is slow. For purpose, the human behavior recognition may be used in surveillance, control, and analysis. However, small laboratory animals such as mice or rats, are observed under constructed environments whose behaviors are usually simplex, but sometimes high frequency and repetitive. Furthermore, small laboratory animal behavior detection and quantification are mainly used for new drugs effect evaluation, and the detection and quantification accuracy and high-throughput are mostly required. Thus the analysis method should be different from human behaviors'.
To detect some periodic human motions, such as gaits characteristics extraction, quite a few researches have been conducted A. Sundaresan (2003); X. Yang (2008); M. H. Cheng (2008). These studies mainly focus on behavior recognition and classification, but all of them based on 30 fps video images.
Real-time automatic visual inspection (AVI) systems have also become widely used in industries. Typical systems such as E. Guerra (2001) ;L. Zhang (2005) used the methods of color space transform and three-dimensional techniques, respectively.
However, these systems are characterized by slow frame rates and low resolutions. A high-speed inspection system presented in I. Ishii (2007) used the coded structured light projection method, but it could not be a solution for behavior detection.
Elliott et al. have applied frequency analysis to a mouse's motion data with a magnetic sensor to extract scratching data G. R. Elliott (2000). However, one of the serious problems associated with these systems is that a magnetic marker needs to be embedded under the skin of the animal, thereby inducing stress. Umeda et al. have reported on an acoustic scratching counting system K. Umeda (2006). The acoustic system eliminates the necessity of planting markers in animals; it requires a special setting to eliminate sound noise because acoustic information is extremely sensitive.
Finally, SCLABA K. Orito (2004) is a vision-based automated scratching detection system. In the SCLABA method, colored markers are painted on a mouse's head and toe. Their positions are extracted from offline 30 fps video images that are not sufficiently fast for accurate recording of mice scratching. Hence, this system often inaccurately identifies non-scratching movements as scratching; these include grooming and rearing that are slower than scratching.

Frame-to-frame difference feature
Mice scratching, at 10 times per second or more, is a very fast movement for the commonly available 30 fps video cameras recording. Fig. 1 shows the sample images recorded at 30 fps in 167 ms, and 240 fps in 21 ms.
Moreover, it is desirable for accurate quantification of mice scratching to detect scratching patterns by image analysis without any markers on a mouse, because the plant or paint markers on a mouse is difficult, and the markers themselves can affect the mouse's behavior and cause serious problems.
To solve these problems, a non-marker image analysis method has been proposed for scratching detectionI. Ishii (2008). It is based on the fact that mice scratching involves periodic movements of the motor components with a frequency higher than that observed for movements associated with behaviors.
It's assumed that the video camera employed had a frame rate that was sufficiently fast to accurately capture the scratching movements. Then the mice scratching could be detected by extracting high frequency motion components in frame-to-frame difference images. The evaluation experiments of the proposed method demonstrated that the scratching detection accuracy was considerably better than conventional analysis methods.  However, several areas of improvement need to be investigated by laboratory mice experiments. One of concern is that non-scratching behaviors that involves movements of the entire body, such as rearing, is occasionally mistaken for scratching because whole body movements generate high-frequency motion components. Further, the method has not been implemented as a real-time and long-time detection system. The employed high-speed camera is offline which can only record a short interval of 6.0 s. This is far from the requirement of real application.

Mice scratching detection algorithm
In this chapter, we introduce an improved mice scratching detection algorithm for more accurate quantification based on a high-speed vision system for calculating frame-to-frame difference feature at real-time.
Especially we pay attention to the fact that when a mouse scratches, repetitive short-term pulses are generated in frame-to-frame difference feature. A short-term pulses detection method is adopted for extracting scratching behaviors instead of frequency filtering. The flowchart of our method is shown in Fig. 2 and it can be described as in the following.

1) binarization
The input image I(x, y, t) at time t is binarized to segment a silhouette image of a mouse from background. Here θ b is a threshold for binarization.
2) frame-to-frame difference F(x, y, t) is calculated as the absolute value of the frame-to-frame differential images between time t − a and t to extract the motion in the silhouette image. Here a is the time difference in the differential images. If the mouse moves, the motion area could be observed in F(x, y, t).
3) noise reduction by erosion G(x, y, t) is calculated as a erosion image of F(x, y, t) to reduce edge or isolated noises. The noise will appear in F(x, y, t) by fluctuated illumination even if there is no motion.

4) count the nonzero pixels
By counting the number of nonzero pixels in G(x, y, t) as a frame-to-frame difference feature, the area of movement g(t) is quantified. The G(x, y, t) means whether there is motion or not at each pixel.
By thresholding g(t), S g (t) are calculated as pulses. It shows whether there is motion or not at time t.H e r eθ c is a threshold to remove small-scale movements. Here, Fig.3 shows the detail of pulse processing in 5)∼8).
. ( 5 ) 6) short-term pulses detection C g (t) are extracted short-term pulses from S g (t), which contain repetitive short-term pulses generated in mice scratching and reject other large-scale or long-term pulses generated in other mice movements. Here d(t) is a duration time of C g (t)=1 involving time t,andτ 0 is a threshold to reject long-term pulses.
. ( 6 ) 7) long-term duration detection Duration time is calculated to detect repetitive short pulses. First, short intervals are compensated to make the repetitive pulses as a whole one. Here duration time is a threshold interval to decide whether the repetitive pulses are compensated as one pulse or not.
Here the scratching is judged when duration time is over than a threshold interval, supposing that multiple short-term pulses exist in a certain interval when a mouse scratches. Then, scratching time is extracted by reducing pulses with short duration times.
8) scratching time quantification The total scratching time T scr (t 1 ; t 2 ) between t = t 1 and t 2 is counted by integrating the time of C2 g (t)=1 ,b e c a u s ew ec a ns u p p o s eC2 g (t) contain only repetitive short-term pulses related to mice scratching.

Real-time scratching quantification system
Based on the scratching detection algorithm, a mice scratching quantification system for real-time and long-time observation is developed. It can quantify the behaviors of a mouse in a cage without painting markers on it by calculating frame-to-frame differential feature on a specially designed high-speed vision system INCS1020. Fig. 4 shows the measurement set-up: the mouse is enclosed in a transparent acrylic cage with dimensions of 12 cm × 12 cm. The high-speed vision system INCS1020 is installed at a height of 50 cm from the bottom of the cage. On the background of the transparent cage, we set an IR flat illuminator IR95-DF from CCS Corporation from Japan, and the dimensions of 30 cm × 30 cm are larger than those of the bottom of the cage. The peak wavelength in the illuminator is 950 nm. By introducing the background illuminator, the clear silhouette images of a mouse can be captured regardless of the kind of mouse. This system also has a feature that adopt to dark night experimental condition as well as day light condition for scratching quantification, because a mouse has no vision to the IR light.  INCS(Intelligent Network Camera System)1020 is a high-speed vision system. It is specially designed for calculating frame-to-frame difference feature for mice scratching. Fig. 6.

Fig. 5 shows the images of INCS1020. INCS1020 is configured by four internal functional boards, i) image sensor board (IMGR board), ii) main processing board(FPGA board), iii) Image Output board(NTSC board), and iv) Interface board(CPUL board) as shown in
The IMGR board has a CMOS imager MT9V403 from Micron Technology Inc., and the size is 659 × 494 pixels.10 bit gray-level video images of 640 × 480 pixels at 240 fps or 640 × 480 pixels at 120 fps can be transmitted from the IMGR board to the FPGA board.
The FPGA board has a FPGA LSI XC2VP100 of Xilinx and frame memories for image processing that requires image size computation as hardware logics. The processing results are transmitted to the NTSC board and the CPUL board.
The FPGA board can calculate frame-to-frame difference feature as described subprocessings Eqs.
The NTSC board outputs monitor images to a NTSC video signal output, which can be selected from an original 10 bit image, a binarized image, or a frame differential image.
The CPUL board has a LAN device and CPU for network communication between external personal computers(PCs), which can send frame-to-frame difference features to external PC and control the FPGA board by using setting parameters sent from the external PC.
Then, an external PC can obtain frame-to-frame difference features and send several setting parameters of INCS1020 by using network connection. Here API functions library is available for parameter settings and data transmission to control INCS1020, which works on Windows XP/Vista and Windows 7 both 32 bit and 64 bit.
The specification of INCS1020 are listed in Table 1.

Experimental results
We quantified scratching in the behavior of 4 laboratory mice, namely, ICR1, ICR2, ICR3, and ICR4. The laboratory mouse we used was the ICR mouse which is a Swiss mouse that is widely used in oncological and pharmaceutical research as well as in studies associated with atopic dermatitis.
All the 4 ICR mice were administered with 100 mg of compound 48/80 in the heads to induce frequent scratching. Then they were placed the cage without any further treatment. Then the frame-to-frame difference was calculated on INCS1020 for 20 min for each ICR mouse, and the processed images had 640 × 400 pixels recorded at a frame rate of 240 fps. Duration time of each experiment is 20 min.
In these experiments, parameters were set as follows: the threshold for gray-level video image binarization, θ b , was adjusted for each mouse; the maximum value is 255, and the threshold value range is 150±30. The frame rate is set at 240 fps, thus the time difference a in the frame differencing of two consecutive frames is 4.2 ms.
For scratching behavior detection, parameters are suggested by experienced experts: the threshold for removing small scale movements, θ c , was 55 pixels; the threshold for rejecting long-term pulse, τ 0 , was 21 ms; the threshold interval for combined pulses, τ 1 , was 83 ms; and the threshold for reducing short duration pulses, τ 2 , was 208 ms. All the parameters except θ b were applied to all the 4 experimental ICR mice.  Table 2. Evaluation for scratching quantification (unit: s). Fig. 7 shows the 1-min analysis result from t = 2 to 3 during the 20-min observation for ICR1: (a) shows the frame-to-frame difference g(t);(b)showsthepulseS g (t) that determines the presence or absence of motion; (c) shows the pulse C g (t) that indicates the automated detection result for scratching; and (d), shows the manual naked-eye observation results for scratching, grooming, and rearing.
The start time of this experiment was set to t = 0. The data in 1 min contained 5 periods of scratching, 1 period of grooming, and several periods of rearing, as shown in Fig. 7(d).
To understand the principle underlying the working of our scratching detection algorithm, we also show a magnified graph in 1 s with regard to scratching, grooming, and rearing. Fig. 9 shows the detection result for scratching for the duration t = 2m05s40 to 2m06s40, Fig. 10 exhibits the result for grooming for the duration t = 2m00s30 to 2m01s30, and Fig. 11 exhibits the results for rearing for the duration t = 2m39s60 to 2m40s60. In all the graphs, (a), (b), and (c) indicate g(t), S g (t),andC g (t), respectively.
From Table 2, we could compare the behavior difference of each mouse and calculate the correctness ratio of scratching detection. The ICR1 mouse is active at grooming and rearing, and for duration of 15.6 s of these behaviors was misdetected as scratching. Thus, the correctness ratio of ICR1 experiment is 92.4%. The ICR2 and ICR3 mice are particularly active moving and scratching. Their total scratching times are up to 461.5 s and 734.0 s, while their total misdetection times are 39.1 s and 35.7 s, respectively. The correctness ratio of ICR2 and ICR3 are 92.0% and 95.1%, respectively. Here, we ignore the counteraction of sc→no with other misdetections, which may help to increase the correctness ratio. The ICR4 mouse likes grooming and scratching, and the scratching motion is more "standard" than that of the other 3 mice. Thus, misdetection occurred for only 3.0 s from grooming to scratching during the total 377.0 s scratching time. Thus, the correctness ratio of ICR4 is as high as 99.2%.
In our experiments, the correctness ratios vary from 92.0% to 99.2%, and the mean is 94.7%. We consider it is sufficiently high for most quantification requirements.
The scratching times for all 4 ICR mice are quantified in Fig. 13, where the bar graphs indicate scratching times T scr /min. It confirmed that the mice scratching duration times are quantified as numerical values, even in real-time and long-time observation.
Results of these experiments also demonstrate that the proposed method is objective and accurate. The developed system has the ability to automatically detect mice scratching, even in long periods of observation such as 20 min or even longer.

Conclusions
In this chapter, we have developed a real-time scratching behavior quantification system for laboratory mice; for this purpose, we introduced a specially designed high-speed vision system that can calculate the frame-to-frame difference for a 640 × 400 pixel image at a rate of 240 fps. An improved scratching quantification algorithm is implemented in the system and demonstrated experiment for detecting scratching behavior for 20 min in 4 ICR mice. The analysis results demonstrate the system's effectiveness with regard to accurate mice scratching quantification for real-time and long-time observation.
For next step, the current method will be improved and an automated system will be developed for objective and quantitative evaluations of laboratory animal behaviors for practical use such as the development of new drugs for various diseases including atopic dermatitis. Recently, the algorithms for the processing of the visual information have greatly evolved, providing efficient and effective solutions to cope with the variability and the complexity of real-world environments. These achievements yield to the development of Machine Vision systems that overcome the typical industrial applications, where the environments are controlled and the tasks are very specific, towards the use of innovative solutions to face with everyday needs of people. The Human-Centric Machine Vision can help to solve the problems raised by the needs of our society, e.g. security and safety, health care, medical imaging, and human machine interface. In such applications it is necessary to handle changing, unpredictable and complex situations, and to take care of the presence of humans.