Introduction
In specialized fields such as neuroscience and sports analytics, the development of machine learning models is often hindered by the requirement for vast amounts of labeled data. Annotating complex behaviors—such as a mouse's social interaction or a basketball player's tactical movement—demands significant domain expertise, making manual labeling both slow and prohibitively expensive.
Weak supervision addresses this by using "labeling functions" (LFs)—heuristics or rules of thumb—to programmatically label data. However, traditional weak supervision still relies on experts to hand-craft these LFs for every new task, creating a "bottleneck of expertise." Existing automated LF generation methods often fail to scale or produce redundant rules that lack the necessary coverage for complex behaviors.
The AutoSWAP Framework
To overcome these challenges, the authors propose AutoSWAP (Automatic Synthesized WeAk SuPervision), a framework that treats the creation of labeling functions as a program synthesis problem. Unlike traditional methods, AutoSWAP automates the generation of high-quality, interpretable LFs from a minimal amount of labeled data.
The framework consists of several key components:
- Domain-Specific Language (DSL): Experts provide a set of "atomic instructions" (e.g., distance between agents, angular velocity) and a DSL that specifies how these can be composed using logical operators like
if-then-else,map, orfold. - Diverse Program Synthesis: AutoSWAP searches for a set of programs rather than a single optimal one.
- Structural Diversity Cost: To prevent the synthesis of redundant LFs, the framework incorporates a cost based on the Zhang-Shasha tree edit distance. This ensures that the synthesized LFs are structurally distinct, providing broader "label coverage" across the dataset.
- Neural Completions: Efficiency is maintained using the NEAR framework, which employs differentiable "neural completions" to estimate the potential of incomplete programs during the search.
Experimental Evaluation
AutoSWAP was evaluated across three challenging behavior analysis domains:
- Fly vs. Fly: Identifying social interactions between fruit flies (e.g., lunging, wing threats).
- CalMS21 (Mouse): Detecting social behaviors in mice (e.g., attack, investigation, mounting).
- Basketball: Analyzing NBA player trajectories to identify ball possession.
These datasets are characterized by rare behaviors, sequential dependencies, and complex multi-agent interactions, making them rigorous benchmarks for automated supervision.
Results and Discussion
AutoSWAP demonstrated significant improvements in data efficiency compared to established baselines such as SNUBA (decision trees) and student networks.
Key findings include:
- Data Efficiency: On the Mouse dataset, AutoSWAP achieved performance parity with baseline methods while using approximately 30x less labeled data. On the Fly dataset, it was consistently 4x more data-efficient than baselines.
- Diversity vs. Optimality: The results suggest that a diverse set of "good" LFs is more effective than a redundant set of "perfect" LFs. By forcing structural diversity, AutoSWAP provides a richer signal for downstream models.
- Interpretability: Because LFs are synthesized in a human-readable DSL, researchers can inspect the generated rules to understand the features driving the model's behavior identification.
Conclusion
AutoSWAP effectively mitigates the expertise bottleneck in behavior analysis by automating the synthesis of diverse, interpretable labeling functions. While the framework currently requires a small "seed" of labeled data and an initial DSL design, it represents a major step toward scalable, expert-in-the-loop machine learning. Future work may explore "library learning" to automatically expand the DSL and integrating raw perception layers to further reduce manual setup.
Summary updated