Introduction
In behavioral neuroscience, the identification of complex behaviors—such as "aggression" or "social interaction" in mice—is fundamental to understanding brain function. Currently, the "ground truth" for these behaviors relies on manual annotations from human experts. However, these experts often disagree; one might define aggression by a sudden burst of speed, while another focuses on sustained physical proximity.
While standard machine learning models, such as Deep Neural Networks, are highly effective at mimicking these labels, they operate as "black boxes." They fail to explain why a specific classification was made, making it difficult to determine if a model has captured a biological reality or merely the subjective bias of a single annotator. This lack of interpretability hinders the reproducibility of behavioral studies across different laboratories.
Methods: Neurosymbolic Program Synthesis
To address this challenge, we propose a neurosymbolic approach that combines program synthesis with learnable temporal filters. Instead of a standard neural network, the system searches for a program written in a specialized Domain-Specific Language (DSL). This language includes operations for selecting movement features (e.g., speed, distance between animals) and applying transformations.
A key innovation in our method is the inclusion of Morlet wavelets within the DSL. These temporal filters can be mathematically tuned via gradient descent to identify specific patterns over time, such as rhythmic oscillations or smooth increases in velocity. We utilize the Neural Electronic Architecture Search (NEAR) algorithm to perform a top-down search through the space of possible program architectures while simultaneously optimizing the continuous parameters of these filters. Furthermore, the model can learn "disjunctions" (OR logic), allowing it to combine multiple filters to capture behaviors with diverse visual signatures.
Results and Key Insights
We evaluated our approach using a subset of the MARS (Mouse Action Recognition System) dataset, which contains videos of interacting mice independently labeled by nine domain experts. Our programmatic models achieved F1-scores comparable to or better than established baselines like XGBoost (Decision Trees) and 1D Convolutional Neural Networks (1D ConvNets), particularly on the challenging "aggression" task.
Beyond raw performance, the synthesized programs provide several critical advantages:
- Annotator Style Discovery: The programs act as a "fingerprint" for an expert's subjective style. For instance, one expert’s labels might be best explained by an
AccelerationSelectprogram, while another’s rely onSpeedSelect. - Enhanced Interpretability: Unlike the noisy filters produced by 1D ConvNets, the learned Morlet filters are smooth and asymmetric. This allows biologists to visually inspect the filters and understand exactly which temporal windows (e.g., 0.5 seconds prior to an event) the annotator prioritized.
- Data Efficiency: Because the DSL provides a strong inductive bias tailored to movement patterns, these programmatic models require significantly fewer examples than 1D ConvNets to reach high accuracy.
Discussion
Our results demonstrate that interpretability does not have to come at the cost of performance. By integrating these programs into visualization tools like Bento, we have found that domain experts find the resulting temporal filters qualitatively easier to interpret and more scientifically useful than standard machine learning outputs.
While the current model is constrained by the predefined operations in the DSL and the computational expense of searching large program spaces, it represents a significant step toward resolving subjective differences in behavioral neuroscience. Future work will focus on expanding the DSL to include more complex multi-animal interactions and applying this method to other high-dimensional biological datasets where expert disagreement is common.
Summary updated