@article {Yang2021.01.06.21249350, author = {Yuan-Chi Yang and Mohammed Ali Al-Garadi and Jennifer S. Love and Jeanmarie Perrone and Abeed Sarker}, title = {Automatic Gender Detection in Twitter Profiles for Health-related Cohort Studies}, elocation-id = {2021.01.06.21249350}, year = {2021}, doi = {10.1101/2021.01.06.21249350}, publisher = {Cold Spring Harbor Laboratory Press}, abstract = {Objective Biomedical research involving social media (SM) data is gradually moving from population-level to targeted, cohort-level data analysis. Though crucial for biomedical studies, SM user{\textquoteright}s demographic information (e.g., gender) is often not explicitly known from profiles. Here we present an automatic gender classification system for SM and we illustrate how gender information can be incorporated into a SM-based health-related study.Materials and Methods We used two large Twitter datasets: (i) public, gender-labeled users (Dataset-1), and (ii) users who have self-reported nonmedical use of prescription medications (Dataset-2). Dataset-1 was used to train and evaluate the gender detection pipeline. We experimented with machine-learning algorithms including support vector machines (SVMs) and deep-learning models, and released packages including M3. We considered user{\textquoteright}s information including profile and tweets for classification. We also developed a meta-classifier ensemble that strategically uses the predicted scores from the classifiers. We applied the best-performing pipeline to Dataset-2 to assess the system{\textquoteright}s utility.Results and Discussion We collected 67,181 and 176,683 users for Dataset-1 and Dataset-2, respectively. A meta-classifier involving SVM and M3 performed the best (Dataset-1 accuracy: 94.4\% [95\%-CI: 94.0\%-94.8\%]; Dataset-2: 94.4\% [95\%-CI: 92.0\%-96.6\%]. Including automatically-classified information in the analyses of Dataset-2 revealed gender-specific trends{\textemdash} proportions of females closely resemble data from the National Survey of Drug Use and Health 2018 (tranquilizers: 0.50 vs. 0.50; stimulants: 0.50 vs. 0.45), and the overdose Emergency Room Visit due to Opioids by CDC (pain relievers: 0.38 vs. 0.37).Conclusion Our publicly-available, automated gender detection pipeline may aid cohort-specific social media data analyses (https://bitbucket.org/sarkerlab/gender-detection-for-public).Competing Interest StatementThe authors have declared no competing interest.Funding StatementResearch reported in this publication was supported by the National Institute on Drug Abuse (NIDA) of the National Institutes of Health (NIH) under award number R01DA046619. The content is solely the responsibility of the authors and does not necessarily represent the official views of the NIH.Author DeclarationsI confirm all relevant ethical guidelines have been followed, and any necessary IRB and/or ethics committee approvals have been obtained.YesThe details of the IRB/oversight body that provided approval or exemption for the research described are given below:This study was approved by the Emory University institutional review board (IRB00114235).All necessary patient/participant consent has been obtained and the appropriate institutional forms have been archived.YesI understand that all clinical trials and any other prospective interventional studies must be registered with an ICMJE-approved registry, such as ClinicalTrials.gov. I confirm that any such study reported in the manuscript has been registered and the trial registration ID is provided (note: if posting a prospective study registered retrospectively, please provide a statement in the trial ID field explaining why the study was not registered in advance).YesI have followed all appropriate research reporting guidelines and uploaded the relevant EQUATOR Network research reporting checklist(s) and other pertinent material as supplementary files, if applicable.YesThe source code for all experiments described will be made open source. https://bitbucket.org/sarkerlab/gender-detection-for-public}, URL = {https://www.medrxiv.org/content/early/2021/01/08/2021.01.06.21249350}, eprint = {https://www.medrxiv.org/content/early/2021/01/08/2021.01.06.21249350.full.pdf}, journal = {medRxiv} }