The interaction experiment, between a robot and a rat, will benefit significantly when the rat's actions can be recognized automatically in real time. Regarding quantitative behavior analysis, the number and duration of a rat's actions should be measured efficiently and accurately. Therefore, aiming at the above-mentioned objectives, a novel cognition system capable of detecting rats' actions has been proposed in this paper. The main function of this cognition system lies on the real-time recognition and offline analysis of rats' behaviors. Basic image processing algorithm as Labeling and Contour Finding were employed to extract feature parameters (body length, body area, body radius, rotational angle, and ellipticity) of rat's actions. These parameters are integrated as the input feature vector of NN (Neural Network) and SVM (Support Vector Machine) training system respectively. Preliminary experiments reveal that the grooming, rotating and rearing actions could be recognized with extremely high rate (more than 90%) by both NN and SVM. Compared to NN, SVM provides better recognition rate and less computational cost.