Verifiable, automated scoring of social interactions in animal groupsΒΆ
vassi can help you to
organize trajectory and posture data in datasets with groups of multiple individuals
extract individual and dyadic spatiotemporal features to describe movement and posture
sample behavioral datasets to train machine-learning algorithms
post-process behavioral classification results for down-stream analyses
interactively visualize and validate behavioral sequences
You can use vassi to implement a full behavioral scoring pipeline in Python, train a machine-learning model, and use it to predict behavioral sequences.
# load training dataset
dataset_train = load_dataset("train", ...)
# configure feature extractor
extractor = FeatureExtractor().read_yaml("feature_config.yaml")
# extract samples from dataset
X, y = dataset_train.subsample(extractor, size=0.1)
# train classifier
from sklearn.ensemble import RandomForestClassifier
classifier = RandomForestClassifier()
classifier.fit(X, dataset_train.encode(y))
# load test dataset and predict
dataset_test = load_dataset("test", ...)
classification_result = predict(dataset_test, classifier, extractor)
# postprocessing
processed_result = classification_result.smooth(
lambda array: sliding_mean(array, window_size=5)
).threshold(
[0.1, 0.8] # assuming two categories
)
# save for downstream behavioral analyses
processed_result.predictions.to_csv("predictions.csv")
Refer to the basic usage page if you want to test vassi on an existing dataset.
The following video gives an overview of the interactive validation tool that complements the classification pipeline.
You can also have a look at the interactive validation notebook that we used to record this video.