ABSTRACT: Head motion degrades image quality and causes erroneous parameter estimates in tracer kinetic modeling in brain PET studies. Existing motion correction methods include frame-based image registration (FIR) and correction using real-time hardware-based motion tracking (HMT) information. However, FIR cannot correct for motion within 1 predefined scan period, and HMT is not readily available in the clinic since it typically requires attaching a tracking device to the patient. In this study, we propose a motion correction framework with a data-driven algorithm, that is, using the PET raw data itself, to address these limitations. Methods: We propose a data-driven algorithm, centroid of distribution (COD), to detect head motion. In COD, the central coordinates of the line of response of all events are averaged over 1-s intervals to generate a COD trace. A point-to-point change in the COD trace in 1 direction that exceeded a user-defined threshold was defined as a time point of head motion, which was followed by manually adding additional motion time points. All the frames defined by such time points were reconstructed without attenuation correction and rigidly registered to a reference frame. The resulting transformation matrices were then used to perform the final motion-compensated reconstruction. We applied the new COD framework to 23 human dynamic datasets, all containing large head motion, with 18F-FDG (n = 13) and 11C-UCB-J ((R)-1-((3-(11C-methyl-11C)pyridin-4-yl)methyl)-4-(3,4,5-trifluorophenyl)pyrrolidin-2-one) (n = 10) and compared its performance with FIR and with HMT using Vicra (an optical HMT device), which can be considered the gold standard. Results: The COD method yielded a 1.0% ± 3.2% (mean ± SD across all subjects and 12 gray matter regions) SUV difference for 18F-FDG (3.7% ± 5.4% for 11C-UCB-J) compared with HMT, whereas no motion correction (NMC) and FIR yielded -15.7% ± 12.2% (-20.5% ± 15.8%) and -4.7% ± 6.9% (-6.2% ± 11.0%), respectively. For 18F-FDG dynamic studies, COD yielded differences of 3.6% ± 10.9% in K i value as compared with HMT, whereas NMC and FIR yielded -18.0% ± 39.2% and -2.6% ± 19.8%, respectively. For 11C-UCB-J, COD yielded 3.7% ± 5.2% differences in V T compared with HMT, whereas NMC and FIR yielded -20.0% ± 12.5% and -5.3% ± 9.4%, respectively. Conclusion: The proposed COD-based data-driven motion correction method outperformed FIR and achieved comparable or even better performance than the Vicra HMT method in both static and dynamic studies.