Does getting pay to be a subject in an experiment violate an F1 visa in the US?
You need to ask the international students' office at your university, because


It's a delicate legal issue of the type they are trained to navigate, and
The answer may depend on the particulars of how the university handles its students and how your experiment handles compensation, and
The answers to these questions change frequently, as visa and immigration regulations mutate.


Even if somebody on this site could give a correct answer and take legal responsibility for it, it would not be safe for somebody else to rely on it in the future.