Skip to contents

The goal of this vignette is to quickly explain the goals of the SmaxN metric and how to simply compute it using the SmaxN package.


What is the SmaxN metric about?

The SmaxN is a metric which uses a network of synchronised cameras to estimate
species abundance using the distances between the cameras and species maximal speed. It relies on the simple principle that a mobile individual can not be in two places at the same time.


The SmaxN framework needs only few conditions:

  • a network of temporally synchronised cameras: Surveys should be based on a set of at least two fixed cameras which field of view do not overlap. The temporal synchronisation should be realised at a coherent precision according to the study design (at which precision individuals are counted and what distance separate the cameras). Basically, you just need to be able to link the frames from one camera to the frames of the other cameras. The distances between each pair of cameras must be known and you must build a distance data frame with cameras in rows and columns.

  • abundance through time: abundance of the studied species should be retrieved through time. Thus for the studied species, there is a matrix with recorded abundance for each time step (in rows) on each camera (in columns) called the camera × time abundance data frame.

  • species maximal speed: the species maximal speed should be retrieved through experiments or using data available. Yet to our knowledge, speed data is only available for a small number of species Husak et al. 2006 (collared lizard Crotaphytus collaris), Alexander et al. 1977 (ten species of african ungulates), Layne and Benton 1954 (fourteen species of small mammals), Hirt et al. 2017 (474 terrestrial species), Fulton 2007 (117 coral reef fish species belonging to 10 families). If data is missing, we recommend to use conservative estimates that is the maximum of maximal speed among species from the same clade (e.g. family or order)


NB: The species maximal speed and the distances between the cameras must be given using the same metric units (i.e. if using meters for the distance, then use meters per seconds (for instance) for the speed)


Using the minimal time it takes for an individual of the studied species to go from one camera to another camera (using species maximal speed and distance between the cameras), the SmaxN algorithm find the best combination of abundances seen across time and cameras to get the highest possible estimate of abundance.


Let’s compute the SmaxN & other abundance estimates


We will here work with a simple example.

First, let’s build the distance data frame and the abundance data:

# Build distance dataframe for the example:
dist_df_ex <- data.frame("A" = c(0, 2, 5, 5), "B" = c(2, 0, 5, 5), 
                         "C" = c(5, 5, 0, 4), "D" = c(5, 5, 4, 0))
rownames(dist_df_ex) <- c("A", "B", "C", "D")

# Build distance dataframe for the example:
abund_df_ex <- data.frame("A" = c(0, 1, 3, 7, 2, 2, 3, 0, 6, 2, 0, 1), 
                          "B" = c(2, 2, 2, 2, 0, 0, 0, 0, 1, 2, 1, 0), 
                          "C" = c(2, 0, 1, 0, 0, 4, 2, 2, 3, 0, 0, 4), 
                          "D" = c(0, 1, 0, 1, 0, 6, 1, 1, 6, 4, 2, 1))
dist_df_ex
##   A B C D
## A 0 2 5 5
## B 2 0 5 5
## C 5 5 0 4
## D 5 5 4 0

In the distance dataframe there are for instance 2m from camera A to camera B, 5m from camera A to camera C and D etc.


abund_df_ex
##    A B C D
## 1  0 2 2 0
## 2  1 2 0 1
## 3  3 2 1 0
## 4  7 2 0 1
## 5  2 0 0 0
## 6  2 0 4 6
## 7  3 0 2 1
## 8  0 0 2 1
## 9  6 1 3 6
## 10 2 2 0 4
## 11 0 1 0 2
## 12 1 0 4 1

For instance, no individual is seen on the camera A on the first timestep, one individual is seen on the camera A on the second timestep, three individuals are seen on the camera A on the third time step etc.


We can now call the package and apply the SmaxN.computation function to compute the SmaxN metric among other metrics:

SmaxN_results <- SmaxN::SmaxN.computation(abund_df = abund_df_ex, 
                                          speed = 1.6, 
                                          dist_df = dist_df_ex)
## [1] "!!!!!! Starting row  1 on 2"
## [1] "50%"


Let’s now have a look at the results:

  • the maxN value which is the highest abundance seen amon all cameras and time steps:
SmaxN_results$maxN
## [1] 7
  • the SmaxN value: we can see here that by using the SmaxN metric, the abundance estmation is more than doubled than when using the maxN metric
SmaxN_results$SmaxN
## [1] 19
  • the values of abundances along cameras and time steps which have led to the SmaxN metric:
SmaxN_results$path_saved
## [[1]]
## [[1]][[1]]
##   value cam_nm timestep
## 1     7      A        4
## 2     2      B        4
## 3     4      C        6
## 4     6      D        6
  • the number of combinaisons of time steps and cameras which have led to the SmaxN value:
SmaxN_results$number_SmaxN_path
## [1] 1
  • the SmaxN_timestep which is the maximal value of the sum of abundances across all cameras for each time step: Here this metrix equals 16 which is obtained through the ninth time step (6 + 1 + 3 + 6):
SmaxN_results$SmaxN_timestep
## [1] 16
  • the maximal values obtained for each camera across all time steps:
SmaxN_results$maxN_cam
## A B C D 
## 7 2 4 6
  • the maximal values obtained for each time step across all cameras:
SmaxN_results$maxN_timestep
##  1  2  3  4  5  6  7  8  9 10 11 12 
##  2  2  3  7  2  6  3  2  6  4  2  4


For further explanations, see the paper associated with this framework: https://aslopubs.onlinelibrary.wiley.com/doi/full/10.1002/lom3.10606


References


  • Alexander et al. (1977) Fast locomotion of some African ungulates Journal of Zoology, 183, 291-300.

  • Fulton (2007) Swimming speed performance in coral reef fishes: field validations reveal distinct functional groups Coral Reefs, 26, 217-228.

  • Hirt et al. (2017) A general scaling law reveals why the largest animals are not the fastest Nat. Ecol. Evol. 1, 1116–1122.

  • Husak et al. (2006) Faster lizards sire more offspring: sexual selection on whole-animal performance Evolution 60, 2122–2130.

  • Layne & Benton (1954) Some Speeds of Small Mammals Journal of Mammology 1, 103–104.