Camera-trap images segmentation using multi-layer robust principal component analysis
Jhony-Heriberto Giraldo-Zuluaga Alexander Gomez Augusto Salazar Angélica Diaz-Pulido



         Self-Organizing Systems in Planetary Physics : 
		Harmonic Resonances of Planet and Moon Orbits 
            Markus J. Aschwanden^1
    December 30, 2023
=========================================================================================================




Camera trapping is a technique to study wildlife using automatic triggered cameras. However, camera trapping collects a lot of false positives (images without animals), which must be segmented before the classification step. This paper presents a Multi-Layer Robust Principal Component Analysis (RPCA) for camera-trap images segmentation. Our Multi-Layer RPCA uses histogram equalization and Gaussian filter as pre-processing, texture and color descriptors as features, and morphological filters with active contour as post-processing. The experiments focus on computing the sparse and low-rank matrices with different amounts of camera-trap images. We tested the Multi-Layer RPCA in our camera-trap database. To our best knowledge, this paper is the first work proposing Multi-Layer RPCA and using it for camera-trap images segmentation.










Camera-trap images, Multi-Layer Robust Principal Component Analysis, background subtraction, image segmentation.




§ INTRODUCTION



Studying and monitoring of mammals and birds species can be performed using non-invasive sampling techniques. These techniques allow us to observe animal species for conservation purposes, e.g. to estimate population sizes of endangered species. Camera trapping is a method to digitally capture wildlife images. This method facilitates the register of terrestrial vertebral species, e.g. cryptic species. Consequently, camera traps can generate large volumes of information in short periods of time. Thus, the contributions in camera trapping are important for better species conservation decisions.

Camera traps are devices to capture animal images in the wild. These devices consist of a digital camera and a motion detector. They are triggered when the motion sensor detects movement and dependent on the temperature of the source in relation to the environment temperature. Biologist can monitor wildlife with camera traps for detecting rare species, delineating species distributions, monitoring animal behavior, and measuring other biological rates <cit.>. Camera traps generate large volumes of information, for example a camera trapping study can generate until 200000 images, where 1% of the information is valuable <cit.>. As a consequence, biologists have to analyze thousands of photographs in a manual way. Nowadays, software solutions cannot handle the increment of the number of images in camera trapping <cit.>. Accordingly, it is important to develop algorithms to assist the post-processing of camera-trap images.

Background subtraction techniques could help to segment animals from camera-trap images. There is a significant body research of background subtraction focused in video surveillance <cit.>. Nevertheless, there are not enough methods that can handle the complexity of natural dynamic scenes <cit.>. Camera-trap images segmentation is important for animal detection and classification. Camera-traps images usually have ripping water, moving shadows, swaying trees and leaves, sun spots, scene changes, among others. Consequently, the models used to segment those types of images should have robust feature extractors. There are some segmentation methods in the literature applied to camera-trap images segmentation. Reddy and Aravind proposed a method to segment tigers on camera-trap images, using texture and color features with active contours <cit.>. They do not make an objective evaluation of their method. Ren et al. developed a method to segment images from dynamic scenes, including camera-trap images; the method uses Bag of Words (BoW), Histogram of Oriented Gradients (HOG), and graph cut energy minimization <cit.>. They do not show the results on camera-trap images. Zhang et al. developed a method to segment animals from video sequences, using camera-trap images; the method uses BoW, HOG, and graph cut energy minimization <cit.>. They obtained 0.8695 of average f-measure on their own camera-trap data set.

Robust Principal Component Analysis (RPCA) is a method derived from Principal Component Analysis. RPCA assumes that a data matrix can be decomposed in a low-rank and a sparse matrix. RPCA has newly seen significant activity in many areas of computer sciences, particularly in background subtraction. As a result, there are some algorithms to solve the RPCA problem <cit.>. In this work, we proposed a Multi-Layer RPCA approach in order to segment animals from camera-trap images. Our method combines color and texture descriptors as feature extractor, and solve the RPCA problem with some state-of-the-art algorithms. To our knowledge, this paper is the first work in proposing a Multi-Layer RPCA approach and using it for camera-trap images segmentation.







The paper is organized as follows. Section <ref> shows material and methods. Section <ref> describes the experimental framework. Section <ref> presents the experimental results and the discussion. Finally, Section <ref> shows the conclusions.



§ MATERIALS AND METHODS



This section shows a brief explanation of the algorithms and metrics used in this paper.



 §.§ Robust Principal Component Analysis


An image can be decomposed in a low-rank and sparse matrix. Equation <ref> shows the RPCA problem, where M is the data matrix, L_0 is the low-rank matrix, and S_0 is the sparse matrix. The low-rank matrix is the background and the sparse matrix is the foreground in background subtraction.


    M=L_0+S_0


The RPCA problem can be solved with the convex program Principal Component Pursuit (PCP). This program computes L and S, taking the objective function in the Equation <ref>, where ||L||_* denotes the nuclear norm of the low-rank matrix, ||S||_1 denotes the l_1-norm of the sparse matrix, and λ is a regularizing parameter. There are some algorithms to perform PCP such as Accelerated Proximal Gradient (APG), and Augmented Lagrange multiplier (ALM) <cit.>.


    minimize       ||L||_* + λ ||S||_1 
       subject to       L+S=M




 §.§ Multi-Layer Robust Principal Component Analysis


Equation <ref> shows the data matrix M in our Multi-Layer RPCA method, where β∈ [0,1] is a weight value indicating the contribution of the texture function to the overall data matrix. Function f_t(x,y) denotes the texture descriptor extracted from each image, using the classic Local Binary Pattern (LBP) <cit.>. LBP describes the texture of an image using the neighborhood of each pixel. Function f_c(x,y) denotes the color transformation for each image, converting to gray scale in this case. Our Multi-Layer RPCA computes the L and S matrices from the M matrix in the Equation <ref>. Texture descriptors can work robustly into rich texture regions with light variation. However, they do not work in a efficient way on uniform regions such as water, the sky, and others. Color descriptors could overcome the texture descriptor limitation <cit.>. The Multi-Layer approach proposed in this paper was tested in camera traps for wildlife image segmentation.


    M(x,y) = β f_t(x,y) + (1-β) f_c(x,y)








 §.§ Evaluation Metrics



The f-measure metric was chosen to evaluate the performance of the Multi-Layer RPCA. Equation <ref> shows the f-measure, where precision and recall are extracted from the confusion matrix. Precision is the proportion of predicted positives that are correctly real positives. In the same way, recall denotes the proportion of the real positives that are correctly predicted <cit.>. The confusion matrix is computed comparing the ground truth (GT) with the automatic segmented images.


    f-measure = 2precision*recall/precision + recall




§ EXPERIMENTAL FRAMEWORK



This section introduces the database used in this paper, the experiments executed, and the implementation details of our Multi-Layer RPCA.



 §.§ Database



The Alexander von Humboldt Institute realizes samplings with camera traps in different regions of the Colombian forest. We select 25 cameras from 8 regions, where each camera has a relative unalterable environment. Each camera was placed in its site between 1 to 3 months. We extract 30 days and 30 nights of images from those cameras, in daytime color and nighttime infrared formats respectively. The database consists of 1065 GT images from the 30 days and 30 nights. The images have a spatial resolution of 3264x2448 pixels. The length of each day or night data set varies from 9 to 72 images, depending on the animal activity that day or night. Figure <ref> shows an example of the GT images.





 §.§ Experiments


The experiments computed the background models with different conditions and amount of images, observing the robustness of the Multi-Layer RPCA and the influence of pre-processing in the results. All experiments performed our method with β=[0,0.05,0.1,0.15,…,1]. Accordingly, Experiment 1 uses histogram equalization as pre-processing in the color transformed image, Figure <ref> shows the pre-processing for each raw image. The background model is computed with entire days e.g. we take all images of day 1 and solve the RPCA problem in the Experiment 1. Experiment 2 computes the background model with entire nights; Figure <ref> shows the pre-processing for each raw image. Experiment 3 takes entire days and nights e.g. we take all images of day 1 and night 1 to solve the RPCA problem. Experiment 3 uses two pre-processes, daytime images uses the pre-process in Figure <ref> and nighttime images uses the pre-process in Figure <ref>. Experiment 4 takes entire days and nights such as the Experiment 3, but it only uses the pre-processing in Figure <ref> for all images.



We tested 9 algorithms to solve the RPCA problem in this paper. Active Subspace RPCA (AS-RPCA) <cit.>; Exact ALM (EALM), Inexact ALM (IALM), Partial APG (APG-PARTIAL) and APG <cit.>; Lagrangian Alternating Direction Method (LSADM) <cit.>; Non-Smooth Augmented Lagrangian v1 (NSA1) and Non-Smooth Augmented Lagrangian v2 (NSA2) <cit.>; Probabilistic Robust Matrix Factorization (PRMF) <cit.>.





The foreground was obtained applying a post-process to the sparse matrix. The post-processing was the same for all experiments. This stage includes a hard threshold, morphological filters, and an active contours with a negative contraction bias <cit.>. Figure <ref> shows the post-processing used. Finally, The f-measure was computed comparing each GT with each foreground. The average f-measure was computed as the mean of all f-measures. The results are displayed as a plot of the average f-measure vs β.





 §.§ Implementation Details


The RPCA algorithms were computed using the Sobral et al. library <cit.>. The rest of the source code was developed using the image processing toolbox of Matlab.



§ RESULTS



This section shows the results and discussions of the experiments introduced in the Section <ref>. These results use the metrics explained in the Section <ref>.

Figures <ref> and <ref> show the average f-measure vs β of the Experiments 1 and 2 for all RPCA algorithms chosen. Table <ref> shows the summary of the best results for each experiment. APG-PARTIAL was the best algorithm in the Experiments 1 and 2. Daytime images have rich texture regions. In contrast, nighttime images have uniform color. Texture representations are more important on daytime images in the Experiment 1 due to β=0.6. On the contrary, color descriptors are more important on nighttime images in the Experiment 2 due to β=0.3. Those results show the importance of combining the color and texture descriptors. Figure <ref> shows the performances of the RPCA normal algorithms when β=0. Thus, our Multi-Layer RPCA outperforms the RPCA normal methods.



Figures <ref> and <ref> show the average f-measure vs β of the Experiments 3 and 4. Table <ref> shows that dividing the pre-processing per daytime or nighttime in the Experiment 3 does not make a big difference in the results, but it increases the fine-tuning parameters. Table <ref> shows that NSA2 was the best algorithm in the Experiments 3 and 4, contrary to the Experiments 1 and 2 where APG-PARTIAL was the best. NSA2 algorithm is a better choice than other RPCA algorithms, if we cannot differentiate between daytime and nighttime images, or if it is difficult to do so. On the other hand, APG-PARTIAL is better, if we have information about the infrared activation.







Figure <ref> shows two visual results of the Multi-Layer RPCA. Figure <ref> shows a daytime image without any pre-processing. Figure <ref> shows an original nighttime image. Figures <ref> and <ref> show the sparse matrix after the hard threshold. Figures <ref> and <ref> show the foreground image. These color results are made with the GT images. Yellow-colored regions mean pixels that are on the GT and the automatic segmented images. Red and green regions are visual representations of the under and over segmentation.









§ CONCLUSIONS



We proposed a Multi-Layer RPCA for camera-trap image segmentation, using texture and color descriptors. The proposed algorithm is composed of pre-processing, RPCA algorithm, and post-processing. The pre-processing uses histogram equalization, Gaussian filtering, or a combination of both. The RPCA algorithm computes the sparse and low-rank matrices for background subtraction. The post-processing computes morphological filters and an active contours with a negative contraction bias. We proved the Multi-Layer RPCA algorithm in a camera-trap images database from the Colombian forest. The database was manually segmented to extract the f-measure of each automatic segmented image. We reach 0.7539 and 0.7393 of average f-measure in daytime and nighttime images respectively. The average f-measure was computed with all GT images. To our best knowledge, this paper is the first work in proposing Multi-Layer RPCA and using it for camera-trap images segmentation.



Acknowledgment. This work was supported by the Colombian National Fund for Science, Technology and Innovation, Francisco José de Caldas - COLCIENCIAS (Colombia). Project No. 111571451061.

ieeetr


