aifantry
Back to Case Studies

Gender Inference at Scale: Mapping Scientist Migration for Max Planck MPIDR

How we built MPIDR's 8M-record bibliometric pipeline — three-source gender inference ensemble, author disambiguation at scale, and 25-year scientist migration analysis. Published at ISSI 2021.

Industry:Research
Published:May 20, 2026
Tools Used
  • Python
  • Pandas
  • Dask
  • XGBoost
  • NamSor
  • Genderize.io
  • R
  • NetworkX
  • Docker
  • SLURM
  • NumPy
  • SciPy
gender inference featured image

Who MPIDR Are

The Max Planck Institute for Demographic Research (MPIDR) in Rostock is one of the world's leading population science institutions, operating as part of the Max Planck Society - Germany's foremost independent research organisation, funding 86 institutes across the natural, life, and social sciences.

MPIDR's Digital and Computational Demography department, led by Director Emilio Zagheni, is unusual among demographic research groups. It treats large-scale digital trace data - publication records, social media traces, administrative datasets - as primary research instruments rather than supplements to surveys.

The department's work has appeared in Nature, PNAS, and the proceedings of major data science and informatics conferences. ISSI - the International Society for Scientometrics and Informetrics - publishes biennial conference proceedings; the scientist migration and gender disparity research supported by this engagement was published in the ISSI 2021 proceedings.

What makes MPIDR technically demanding as a research partner: findings have to meet two standards simultaneously - rigorous enough to survive peer review from demographic scientists, and computationally reproducible enough to satisfy the open science requirements increasingly enforced by major funders including the German Research Foundation (DFG) and the European Research Council (ERC). A result that cannot be replicated from published code is not an acceptable result.

The Problem

The study covered scientist migration to and from Germany from 1996 to 2020 - 25 years of Scopus bibliometric data. Scopus is the world's largest curated abstract and citation database; 8 million records over that period represented a substantial fraction of the world's published scientific output relevant to the study scope.

Two problems had to be solved simultaneously.

Migration detection: tracking affiliation changes across an author's publication history over time. If a researcher publishes from a German institution in 2008 and from a Swiss institution in 2013, that is candidate evidence of emigration - but it requires resolving that both records belong to the same person, and that the affiliation change reflects actual relocation rather than a visiting position, sabbatical, or multi-affiliation co-authorship. At 8 million records, there was no manual path through this.

Gender inference: assigning a gender label to over 1 million distinct researcher records drawn from 80+ countries. Scopus records contain author names but not gender. Names are the only available signal. For a study specifically examining whether gender composition differs between migrating and non-migrating researchers, gender inference accuracy is not a data quality nicety - it is the measurement instrument for the central hypothesis.

According to UNESCO's Institute for Statistics (UIS) 2024 data on women in science, women represent approximately 33% of researchers worldwide, but this figure masks sharp variation: Central Asia and Latin America approach gender parity in research, while East Asia, South Asia, and sub-Saharan Africa remain below 25% female in most STEM disciplines. The global average conceals the national-level variation that studies like this one are designed to quantify.

If the gender inference pipeline has systematic error concentrated on specific national name corpora, the study is not measuring what it claims to measure.

According to the OECD's Science, Technology and Innovation Outlook 2024, international researcher mobility is concentrated in high-income country corridors, with Germany consistently ranking among the world's top destinations for internationally mobile researchers - making it one of the most important cases for understanding how international recruitment intersects with gender composition at the discipline level.

What We Built

The engagement delivered a complete research data platform: pipeline, models, analysis, visualisations, and a fully reproducible package published alongside the ISSI 2021 conference paper.

  • ETL pipeline: 8M+ Scopus records ingested, cleaned, and normalised using Python (Pandas, Dask). Dask's out-of-core DataFrames handled stages where in-memory processing was not feasible on the available hardware.
  • Author disambiguation: custom entity resolution combining fuzzy string matching for institution name deduplication and embedding-similarity clustering for author identity resolution across name variants and transliteration differences.
  • Three-source gender inference ensemble: NamSor API + Genderize.io + custom XGBoost classifier trained on character n-grams and country-of-origin features - 89% overall accuracy on the held-out evaluation set.
  • Migration flow matrices: 1M+ researcher trajectories mapped across 80+ source/destination country pairs, with discipline-level disaggregation across 27 Scopus subject classifications.
  • Statistical analysis: R (tidyverse, ggplot2) for regression modelling, chi-squared tests, and citation impact comparisons.
  • Network visualisation: NetworkX migration graphs, Matplotlib/Seaborn/Plotly for publication-ready figures, Dash for interactive dashboards.
  • Reproducibility infrastructure: Docker-containerised analysis environment, SLURM job scripts for HPC cluster execution, full code and data pipeline published alongside the paper.

How We Built It

The ETL Pipeline for 8 Million Records

Scopus export data arrives as structured but messy CSV files: inconsistent encoding, multiple affiliation fields per record, name variants that differ by transliteration convention, diacritic handling, and abbreviation style. Pandas handled initial load and normalisation. Dask was introduced for the affiliation deduplication stage - fuzzy matching across millions of institution name strings exceeded available RAM on the analysis workstation.

The pipeline was designed for full re-runs from raw data: no manual steps, no intermediate files without checksums, no undocumented transformations. MPIDR's open science commitments required the pipeline to be runnable by a reviewer from a clean repository checkout.

Author Disambiguation and Affiliation Tracking

Author disambiguation in bibliometrics combines name similarity with co-authorship network analysis - authors who share co-authors are more likely to be the same person. We used this alongside institution name matching and ORCID linkage where available (ORCID coverage was sparse in the 1996–2005 period of the dataset).

Affiliation tracking required a separate decision layer: not every affiliation change is a migration. We defined migration operationally as a change in primary institutional affiliation country persisting for at least two consecutive publication years - filtering out single-paper visiting positions. This threshold was calibrated against a manually verified sample of approximately 500 researcher records where migration status was independently determined.

Building the Gender Inference Ensemble

The ensemble architecture is worth describing in full, because this is where most of the iteration happened.

How the three-source ensemble works:

  • NamSor API - Strength: excellent on European, Latin American, and South Asian names; calibrated confidence scores. Weakness: systematic error on transliterated East Asian and Arabic names.
  • Genderize.io - Strength: broader name coverage; useful where NamSor data is sparse. Weakness: lower per-name model sophistication; same transliteration blind spot.
  • Custom XGBoost classifier - Strength: character n-grams + country-of-origin features; trained on underperforming name subsets. Weakness: requires curated training data; slower to run than API calls.

Decision logic - first attempt: confidence-weighted voting between NamSor and Genderize. Where both agreed above a confidence threshold, accept. Where they disagreed or fell below threshold, mark as unknown.

This produced acceptable aggregate accuracy - but the audit by national naming corpus revealed the failure. Both APIs returned high-confidence, concordant labels for a significant fraction of transliterated East Asian and Arabic names, and those labels were systematically wrong.

High confidence plus agreement is normally a reliable signal. For this name population, trained predominantly on Western name data, it was misleading: the models were pattern-matching on features that associated certain name structures with a gender, and those associations did not hold across transliteration systems.

The XGBoost classifier was trained on character n-grams (2–4 character windows) from the romanised name string, plus country-of-origin features extracted from the Scopus institutional affiliation field. Country of origin shifts the classification prior - a name that is ambiguously gendered in isolation becomes more predictable given knowledge that the researcher is affiliated with a Chinese, Egyptian, or Polish institution.

The classifier achieved 89% overall accuracy on the held-out evaluation set, with the largest accuracy gains on exactly the East Asian and Arabic transliterated name subsets where the API ensemble failed.

Final decision logic: where NamSor and Genderize agreed above threshold AND the XGBoost classifier agreed, accept with high confidence. Where the APIs disagreed or the classifier dissented, use the XGBoost output where country-of-origin signal was strong; otherwise mark as uncertain and exclude from precision-critical analysis.

Statistical Modelling and Migration Flow Matrices

Migration flow matrices were constructed at country-pair and discipline level for each five-year cohort in the study window. Gender ratios were computed separately for inflow, outflow, and non-migrating researcher populations within each discipline, with chi-squared tests for significance of ratio differences. Regression models predicted citation impact from migration status and gender, controlling for discipline and cohort. All models were written as reproducible R Markdown documents with figures generated directly from analysis code.

Reproducibility Infrastructure

SLURM job scripts managed compute-intensive stages on the HPC cluster. Docker containerised the full Python and R environment at specific package versions. A researcher with cluster access and the published repository could reproduce the full analysis from raw Scopus exports - a requirement, not a goal.

What Made It Hard

The Gender Inference Confidence Problem

The core issue is in the opening - but the fix required a step most pipelines skip: auditing accuracy broken down by country of origin, not just in aggregate.

The API ensemble's overall accuracy looked fine initially. It was only when we stratified the accuracy metrics by national naming corpus that the failure became visible. European names - where both APIs had the most training data - performed well. Transliterated East Asian and Arabic names had error rates three to four times higher. In a study specifically about internationally mobile researchers, whose names disproportionately come from exactly those underperforming categories, that accuracy gap was not an acceptable residual.

Building the XGBoost classifier required sourcing and curating a name-nationality-gender training dataset that covered the underperforming subsets adequately. This was a data curation problem before it was a modelling problem. The headline accuracy number from any single-source gender inference tool is almost always more optimistic than the number for the specific name subset your research depends on.

Author Disambiguation at 8 Million Records

The "J. Smith" problem is well-documented in bibliometrics - multiple distinct people sharing a common name.

Less documented is the inverse: the same researcher appearing under different name representations across 25 years. A Chinese researcher whose name appears in pinyin in early publications and in an anglicised form in later ones.

An Eastern European researcher whose name retains diacritics in some journals and loses them in others. An author who publishes under a maiden name through 2008 and a married name thereafter.

The disambiguation system had to handle both directions simultaneously: splitting records that share a name but belong to different people, and merging records that share a person but not a consistent name string. Errors in either direction compound across the migration detection layer - a split creates a false migration event; a merge creates a false non-migration.

Embedding-similarity handled romanisation variants effectively; ORCID linkage was valuable where it existed; a manually verified validation sample provided the benchmark for tuning merge and split thresholds.

The False Migration Signal

Defining migration from affiliation changes in publication records is inherently noisy. Researchers take sabbaticals, visiting positions, bilateral exchange fellowships, and extended international collaborations - all of which generate affiliation changes that look like migration in the raw data but are not.

The two-consecutive-year threshold filtered the most obvious cases but did not eliminate all noise. Researchers on two-year visiting positions at German institutions appeared as inflows; researchers on extended international fellowships appeared as outflows.

We ran sensitivity analysis across threshold definitions - one year, two years, three years - and reported findings under multiple threshold conditions rather than presenting a single operational definition as ground truth. This is the correct approach for a conference paper where the measurement definition is itself a methodological choice, not a fixed fact.

What Changed

Three findings were directly relevant to MPIDR's policy research agenda:

1. Migration concentration - the US, UK, and Switzerland together account for approximately 58% of German researcher emigration in the 1996–2020 period. Bilateral corridor concentration is higher than prior estimates had suggested, and has remained stable across five-year cohorts rather than diversifying over time. 2. Gender balance in international flows - internationally mobile researchers arriving in Germany are measurably more gender-balanced than the domestic German researcher population in disciplines with the most severe gender skew - Engineering (11:1 male-to-female domestic ratio) and Physics (8:1). The arrival of internationally recruited researchers is associated with modest discipline-level improvement over the study period. 3. Citation impact and mobility - internationally mobile researchers have statistically higher citation impact than non-mobile researchers matched on discipline, cohort, and institutional prestige - consistent with prior bibliometric literature, here demonstrated at national scale with a 25-year longitudinal window.

The reproducible pipeline became a research infrastructure asset: subsequent MPIDR researchers working on related bibliometric questions reused the disambiguation and gender inference components without rebuilding them. For population-level data analysis for health and demographic outcomes, the infrastructure you leave behind often has longer-term value than the specific findings it was built to generate.

What's Next

  • Rolling analysis as new publication records arrive
  • Better coverage through Web of Science, OpenAlex, and ORCID
  • A policy dashboard for exploring possible changes in talent flows

The most important quality check was splitting accuracy by national naming corpus. The global score looked healthy, but it hid the exact biases that mattered to the study.

View more case studies or talk to us about a research data pipeline.

Written By

Abrar

Founder, AIfantry | AI Engineer

Ready to achieve similar results?

Our team of AI experts is ready to help you transform your business with tailored AI solutions.

Contact Us Today