\section*{Acknowledgments}

\input{bias_and_pii_arxiv.bbl}

\clearpage

\input{sections/appendix}

\end{document}

\section{Introduction}

In a time of extensive data collection and distribution, privacy is a vitally important but elusive goal. In 2021, the US-based Identity Theft Resource Center reported a 68\% increase in data breaches from the previous year, with 83\% involving sensitive information{\footnote{\href{https://www.idtheftcenter.org/post/identity-theft-resource-center-2021-annual-data-breach-report-sets-new-record-for-number-of-compromises/}{https://www.idtheftcenter.org/post/identity-theft-resource-center-2021-annual-data-breach-report-sets-new-record-for-number-of-compromises/}}}. The exposure of personally identifiable information (PII), such as names, addresses, or social security numbers, leaves individuals vulnerable to identity theft and fraud. In response, a growing number of companies provide data protection services, including PII detection, redaction (masking), and anonymization.

PII masking offers assurances of security. However, this paper considers whether the models powering these services perform fairly across individuals, regardless of race, ethnicity, and gender. Historically, the US ``Right to Privacy'' concept has been centered around Whiteness, initially to protect White women from the then-emergent technology of photography and visual media \citep{osucha2009whiteness}. Black individuals have had less access to privacy and face greater risk of harm due to surveillance, including algorithmic surveillance \citep{browne2015dark, fagan2016stops}.

In this paper, we evaluate the detection and masking of names, which are the primary indexer of a person's identity. We sample datasets of names and demographic information to measure the performance of off-the-shelf PII maskers. Although model bias or unfairness can be the result of a number of factors, including training data or presuppositions encoded in the algorithms themselves, the commercial systems we examine fail to provide details about training data or implementation. Therefore, we do not hypothesize a causal relationship between these factors and our findings.

Our work quantifies disparities in the name detection of PII masking systems where poor performance can directly and negatively impact individuals.  We demonstrate significant disparities in the recognition of names based on demographic characteristics, especially for names associated with Black and Asian/Pacific Islander groups.

\section{PII Masking}

This study analyzes personally identifiable information (PII) masking systems which aim to detect and redact sensitive personal information, particularly names, from text. This has been an important problem in the biomedical domain, in terms of preparing de-identified patient data for research \citep{kayaalp2018patient}, but is also increasingly important in an age of language models trained from web-scraped text, which have been shown to reveal private information that was not removed from the underlying training data \citep{carlini2021extracting}.

Since early efforts masking data by hand, automated methods have been employed, from using word lists or dictionaries \citep{thomas2002successful}, which do not generalize to unseen names and locations, to rule-based or regular expression systems \citep{beckwith2006development,friedlin2008software}, which are generalizable, but can be brittle. These have been replaced with machine learning systems \citep{szarvas2006multilingual,uzuner2008identifier} and most recently neural networks \citep{dernoncourt2017identification,adams2019anonymate}.

Modern PII maskers rely on Named Entity Recognition (NER) to identify entities (e.g. name and location) for redaction. NER has had recent success with hybrid bi-directional long short term memory (BiLSTM) and conditional random field (CRF) models \citep{huang2015bidirectional}, and following the general trend in NLP, fine-tuning on large language models such as BERT \citep{li2019unified}. Additional discussion on NER architectures can be found in \citet{li2020survey}.

Previous research in Named Entity Recognition (NER) has illuminated race and gender-based disparities. \citet{mishra2020assessing} evaluates a number of NER models which consider performance according to gender and race/ethnicity. The analysis considers 15 names per intersectional group, finding that White-associated names are more likely to be recognized across all systems. Our work differs from and extends this work in key aspects: focusing on off-the-shelf PII masking, providing analysis on over 4K names, and reporting on significance and additional metrics.

Recent PII masking models perform extremely well in certain contexts. The recurrent neural network of \citet{dernoncourt2017identification} achieves 99\% recall overall and just below 98\% for names on patient discharge summaries in the medical domain. The commercial models we consider do not advertise performance metrics, and as shown in Section~\ref{sec:results}, do not achieve such high performance across our datasets.

It is important to note that removing names alone is insufficient to fully protect individuals from being identified from data. Data sets can still reveal just enough information to re-identify individuals, as in the case of Massachusetts Governor William Weld, whose medical records, although not connected directly to his name in a de-identified data set, were traceable back to him by matching information from an easily attained external data resource \cite{sweeney2002k}. Here we focus on names as they are a primary identifier for an individual.

\section{What's in a Name?}

The primary goal of this paper is to understand whether, and to what degree, the performance of PII masking models is influenced by correlates of race, ethnicity, and gender. We frame bias in terms of significant discrepancies in performance based on race/ethnicity and gender, looking specifically to instances where private information was not masked (false negative rates, described in Section \ref{sec:metrics}). PII masking is a primary mechanism for protecting personal data, and a systematic failure to mask information belonging to marginalized subgroups can cause undue harm to those populations, through identity theft, identity fraud, and loss of privacy. Names are not a proxy for gender or race/ethnicity, but our rationale is as follows: if most of the people with Name $N$ have self-identified as belonging to Group $G_1$, and Name $N$ is frequently miscategorized by PII systems at a rate that is higher than that for a name more commonly used by individuals in Group $G_2$, then we argue that members of Group $G_1$ bear a higher privacy risk.

We focus our analysis on given names (sometimes known as `first names') and family names (sometimes known as `surnames' or `last names'). Naming conventions vary in different cultural and linguistic contexts. In many cultures, given names and/or family names can be gendered, or disproportionately associated with a particular gender, religious or ethnic group. In the present study, gender, race and ethnicity are considered with respect to a defined set of categories for the purpose of analysis, but we acknowledge that such labels are socially constructed and mutable over time and space \citep{sen2016race}.

Previous research has uncovered racial and gender discrimination  based on individual names. \citet{bertrand2004emily} found that, given identical resumes with only a change in name, resumes with Black-associated names received fewer callbacks than White-associated names. \citet{sweeney2013discrimination} found that internet searches for Black (in contrast to White) names were more likely to trigger advertisements that suggested the existence of arrest records for people with those names.

We do not attempt to infer personal information tied to names in our data, but rather, rely on real, self-reported information. However, there are limitations to using standardized gender and racial categories in studying algorithmic fairness, even when individuals are able to self-identify \citep{hanna2020towards}. Within each racial/ethnicity category made available on the standardized forms in the data we use (described in Section \ref{sec:data}), for example, there is a large variety in the linguistic cultures and naming practices encompassed in each group. Our intent is not to conflate race and ethnicity and language, but rather to get a coarse-grained look at performance of PII masking systems on names that are strongly associated with the demographic groupings that are available. Similarly, the available data limits gender categories to the binary `male' and `female,' and while names are not a good proxy for gender, we look for strong associations in the data, as described further in Section \ref{sec:data}.

\section{Data}\label{sec:data}

In this section, we describe our method for creating test sentences for evaluating name detection in PII masking models. In our evaluation, we use a sentence perturbation technique which is employed in previous studies to test model performance across sensitive groups \citep{garg2019counterfactual, hutchinson2020social}.  Using a variety of templates, we fill slots with names from the datasets, allowing us to measure performance across race/ethnicity and gender.

Reliable sources of demographically labeled names are difficult to find and using real names is an issue of privacy. Therefore, we consider datasets of names with aggregate demographic information as a proxy. We also evaluate on the names of US Congress members, whose identity and self-reported demographic information is publicly available. Templates and source datasets are described in the following sections.

\subsection{Templates}

We collected a set of 32 templates from real-world customer service messaging conversations (see examples in Table \ref{tab:template} and the full set in Appendix \ref{sec:appendix_templates}). These include dialog between customers and conversational AI or human agents. Customer service data is especially vulnerable to security threat, carrying potentially sensitive personal information such as credit card or social security numbers. Topics of discussion in the dataset include placing or tracking a purchase or paying a bill. Each template contains a name, which we replace with a generic \textsc{name} slot. Various identifiers from the dataset (e.g. location or reference numbers)
are swapped to protect personal information.

\begin{table}
\begin{center}
    \begin{tabular}{ |l| }
         \hline
         Sample Templates \\ \hline
         This was from $<$\textsc{name}$>$ \\ \hline
         The response is signed $<$\textsc{name}$>$ \\ \hline
         it’s YGDFEA the reservation. \\ $<$\textsc{name}$>$ \\
         \hline
    \end{tabular}
\caption{Sample of templates used for analysis.}
\label{tab:template}
\end{center}
\end{table}

\subsection{LAR Data}
The LAR dataset from \citet{tzioumis2018demographic} contains aggregate names with self-reported race/ethnicity from US Loan Application Registrars (LARs). It includes 4.2K given names from 2.6M observations across the US. Race/ethnicity categories are shown in Table \ref{tab:source-data-groups}.

There are limitations to the \citet{tzioumis2018demographic} dataset. Because the sample is drawn from mortgage applications and there are known racial and socioeconomic differences in who applies for mortgage applications \citep{charles2002transition}, the data is likely to contain representation bias. However, the LAR dataset is the largest available set of names and demographics, estimated to reflect 85.6\% of names in the US population \citep{tzioumis2018demographic}. Due to its large size, we are able to control for the frequency of names, as described in Section \ref{sec:sampling}.

\subsection{NYC Data}

The NYC dataset was created using the New York City (NYC) Department of Health and Mental Hygiene's civil birth registration data \citep{NYCOpenData} and contains 1.8K given names from 1.2M observations. Data is available from 2011-2018 and includes self-reported race/ethnicity of the birth mother (other parents' information is not available). The sex of the baby is included, which permits an intersectional analysis.\footnote{Although the NYC data includes the child's \textit{sex assigned at birth}, we use this variable to approximate the \textit{gender} associated with the name.} The race/ethnicity groups are shown in Table \ref{tab:source-data-groups}.

While the other datasets report on adult names, the NYC data aggregates the names of children who are between 4-11 at the time of this writing. This adds diversity in terms of age, as data privacy is an important issue for both children and adults.

\subsection{Congress Data}\label{subsec:congress}

The Congress dataset allows for evaluation over the given and family names of real individuals. The 540 current members of US Congress provide self-reported demographic information.\footnote{See \href{www.senate.gov}{www.senate.gov} and \\ \href{https://pressgallery.house.gov/member-data/demographics}{https://pressgallery.house.gov/member-data/demographics}.}
Race/ethnic groups are described in Table \ref{tab:source-data-groups}. 76\% of congress members do not report membership in the race/ethnicity groups listed, and are grouped as ``White/Other''.

This dataset provides a naturalistic analysis of full names. Alternatively, one could programmatically generate given and family name pairs from datasets of first names and a dataset of last names. However, the broad race/ethnic groups used for classification do not account for the variance in the cultural backgrounds of the names (e.g. Pakistani and Native Hawaiian backgrounds are listed under the umbrella of Asian and Pacific Islander).

\begin{table*}
\begin{center}
    \begin{tabular}{ |l|l|l| }
         \hline
         Data & Dataset Race/Ethnicity Group & Mapped label \\ \hline
         LAR & NH Asian or Native Hawaiian or Other Pacific Islander & Asian and Pacific Islander \\
         & NH Black or African American & Black \\
         & Hispanic or Latino & Hispanic \\
         & NH American Indian or Alaska Native & Indigenous \\
         & NH Multi-race & Multi-race \\
         & NH White & White \\ \hline
         NYC &  Asian and Pacific Islander & Asian and Pacific Islander \\
         & Black & Black \\
         & Hispanic White & Hispanic \\
         & NH White & White \\ \hline
         Cong. & Asian & Asian and Pacific Islander \\
         & Black & Black \\
         & Hispanic & Hispanic \\
         & Indigenous & Indigenous \\
         & White/Other & White \\
         \hline
    \end{tabular}
\caption{Race/ethnicity categories used for each data source and the mapped set of race/ethnic group labels each category is mapped to for our analysis. The term ``Non-Hispanic'' is abbreviated NH.}
\label{tab:source-data-groups}
\end{center}
\end{table*}

\section{Sampling Process} \label{sec:sampling}
This section describes the process of sampling the source names. The LAR and NYC datasets aggregate name counts and frequencies per race/ethnicity. We sample names which have a strong `association' with a particular race/ethnicity and gender. Because frequency (i.e. popularity) of a name could contribute to spurious performance disparities between groups, we sample the LAR data so that all names are frequency matched across groups.

\subsection{Demographic categorization}
For each group, we sample names that are ``associated'' with that particular group. We define ``association'' as when $>$75\% of people with the same name self-report within the same race/ethnicity. In the LAR dataset, the NH American Indian or Alaska Native and NH Multi-race names reflect 1\% of individuals in the dataset \citep{tzioumis2018demographic}. No names were found with strong associations in these groups, and for this reason, we do not include them in the analysis. We map race/ethnicity groups across datasets to a common set of labels, which are based on categories of the 2010 US Census dataset of surname and race/ethnicity information \citep{comenetz2016frequently}.  Race/ethnicity categorization for all datasets is shown in Table \ref{tab:source-data-groups}.

The NYC dataset also includes gender. Using a 90\% threshold for our definition of `association', 99\% of names in the source set are strongly association with one gender.

\subsection{Frequency matching}

Because the LAR dataset has a large sample size, it is possible to control for the frequency of names while maintaining a minimum threshold of 20 names per category. To standardize based on frequency, we use counts from the 2010 US Census Bureau. We did not use observation counts directly from the LAR data, due to the aforementioned potential for representational bias.

We sample the LAR dataset to align the mean observation counts of Black-associated names and other groups, as there are few Black-associated names in the dataset (n=21).  However, there is limited overlap in the frequency distributions of API-associated names with Hispanic and Black-associated names.  Therefore, we sample a second set with API and White-associated names only.  We refer to these datasets as LAR1 (Black, Hispanic, and White) and LAR2 (API and White).  The frequency matching process is described in more detail in Appendix \ref{sec:appendix_freq}.

\section{Experiment Setup}

The following sections discuss the PII masking systems we evaluate. We use several metrics to investigate the PII masking performance across name subsets.\footnote{Experiment code is publically available at \href{https://github.com/csmansfield/pii-masking-bias}{https://github.com/csmansfield/pii-masking-bias}.}

\subsection{Models}\label{sec:models}

We select two commercial and one open-source PII masking system for evaluation. The commercial systems we consider are Amazon Web Services (AWS) Comprehend and Google Cloud Platform Data Loss Prevention (GCP DLP). We choose these systems for their potentially large reach, with AWS and GCP holding a combined 43\% market share of cloud services.\footnote{\href{https://www.statista.com/chart/18819/worldwide-market-share-of-leading-cloud-infrastructure-service-providers/}{https://www.statista.com/chart/18819/worldwide-market-share-of-leading-cloud-infrastructure-service-providers/}} Amazon Comprehend provides an English model with a \textsc{Name} entity for PII redaction. GCP DLP offers redaction and includes a global \textsc{PERSON\_NAME} entity. Microsoft's Presidio is an open-source service for PII detection. We use the default English model which uses logic such as regex matching and Named Entity Recognition (NER). For the Presidio model we use a spaCy 3.2 en\_core\_web\_trf model for NER, which utilizes the RoBERTa-base Transformer model trained on OntoNotes 5.

\subsection{Evaluation metrics}\label{sec:metrics}

We measure false negative rates (FNRs), the rate at which a PII system does not detect a name that is present in the dataset (and therefore is unable to mask it).\footnote
Whereas false positive rates are useful for evaluating the precision of a model, our focus is the failure to detect person names, rather than the incorrect identification of tokens that are not person names. Furthermore, we report no false positives in our findings.}  Following \citet{dixon2018measuring} we report on the False Negative Equality Difference, which measures differences between the false negative rate over the entire dataset and across each demographic subgroup $g$. We add a normalization term to compare the FNED of datasets with different numbers of groups, as shown in equation \ref{eq:normFNER}.

\begin{equation}
    \frac{1}{|G|}\sum_{g\in G} |FNR-FNR_{g}|
    \label{eq:normFNER}
\end{equation}

We also measure the statistical significance of performance differences across subgroups. We conduct Friedman and Wilcoxon signed-rank tests following \citet{czarnowska2021quantifying}.  The Friedman test is used for cases with more than 2 subgroups, and provides a single \textit{p}-value for each dataset and system pair. The \textit{p}-value determines whether to reject the null hypothesis that FNR of a given system is the same across all demographic groups. The statistic is calculated considering $j$ demographic subsets $g$. First, we calculate the average FNR for a template $t$, over all names belonging to a particular subset $g$. The averages for each of the 32 templates considering group $g$ are contained in $X_{g}$. The Friedman statistic is calculated for all $X_{g}$.

\begin{align}

    & X_{g} = (FNR(x_{g}^{1}),...,FNR(x_{g}^{32})) \nonumber \\
    & Friedman(X_{1},..., X_{j})
    \label{eq:sig}
\end{align}

\noindent Nemenyi post-hoc testing is used for further pairwise analysis. For cases with only 2 subgroups, we alternatively perform Wilcoxon signed-rank tests. In order to control for multiple comparisons, we apply a Bonferroni correction across all \textit{p}-values (at p$<$0.05 and n=15, our adjusted significance threshold is 0.003).

\section{Results}\label{sec:results}

We present the results of the evaluation, considering overall performance and performance related to race/ethnicity, gender, and intersectional factors.  The section concludes with an analysis of errors.

\subsection{Overall Performance}

The average performance on the datasets can be seen in Table \ref{tab:means_race}. System performance varies according to the dataset, with no single system performing best on all sets. All systems have lower FNR on the Congress dataset, where both given and family names are available, likely due to the increased information load of full names. The LAR2 and NYC names prove the most challenging across all systems.

\begin{table
\begin{center}
   \begin{tabular}{ |l|l|r|r|r|r| }
         \hline
          & Group & N &  \multicolumn{3}{c|}{FNR (\%)} \\
          & & & \multicolumn{1}{c}{AWS} & \multicolumn{1}{c}{GCP} & \multicolumn{1}{c|}{MP} \\ \hline
         LAR1 & Black & 20 & 20.0 & 18.1 & \textbf{29.5} \\
          & Hisp. & 172 & \textbf{28.4} & 12.4 & 24.7 \\
          & White & 1000 & 21.3 & \textbf{18.5} & 20.0 \\
          & \cellcolor{light-gray}All & \cellcolor{light-gray}1192 & \cellcolor{light-gray}22.3 & \cellcolor{light-gray}17.6 & \cellcolor{light-gray}20.8 \\
          \hline
         LAR2 & API & 441 & \textbf{38.2} & \textbf{51.2} & \textbf{29.2} \\
          & White & 1000 & 25.3 & 18.6 & 25.8 \\
          & \cellcolor{light-gray}All & \cellcolor{light-gray}1441 & \cellcolor{light-gray}29.3 & \cellcolor{light-gray}28.6 & \cellcolor{light-gray}26.8 \\
          \hline
          NYC & API & 165 & 21.3 & 43.6 & 22.0 \\
           & Black & 226 & \textbf{28.9} & \textbf{56.3} & \textbf{32.6} \\
           & Hisp. & 389 & 20.1 & 34.2 & 21.2 \\
           & White & 592 & 26.9 & 29.2 & 25.9 \\
          & \cellcolor{light-gray}All & \cellcolor{light-gray}1359 & \cellcolor{light-gray}24.6 & \cellcolor{light-gray}36.8 & \cellcolor{light-gray}25.2 \\
          \hline
          Cong. & API & 16 & \textbf{23.0} & \textbf{12.1} & \textbf{11.7} \\
           & Black & 56 & 15.2 & 9.7 & 9.5 \\
           & Hisp. & 48 & 13.9 & 8.3 & 9.4 \\
           & Indig.$\dagger$ & 3 & 7.0 & 6.3 & 7.8 \\
           & Multi.$\dagger$ & 6 & 8.3 & 6.3 & 10.9 \\
           & White/ & 419 & 12.1 & 6.7 & 7.7 \\
           & Other & & & & \\
          & \cellcolor{light-gray}All & \cellcolor{light-gray}530 & \cellcolor{light-gray}12.8 & \cellcolor{light-gray}7.3 & \cellcolor{light-gray}8.1 \\
           \hline
    \end{tabular}
\caption{Support and average false negative rate (FNR) by race/ethnicity group across datasets. Groups marked with `$\dagger$' are not included in formal statistical analysis due to low support.  Maximum FNR per dataset/sytem is shown in bold.}
\label{tab:means_race}
\end{center}
\end{table}

The average performance of the names per each template is shown in Figure \ref{fig:template_performance}.  Performance varies considerably, with average FNR per template ranging between 6\%. and 100\%. The mean FNR for all templates is 22\%.

\begin{figure}[ht]
    \includegraphics[width=0.48\textwidth]{figures/template_performance_avgs.png}
    \caption{Average FNR across each template per dataset.}
    \label{fig:template_performance}
\end{figure}

\subsection{Performance by Race/Ethnicity}

The normalized false negative equality differences (FNEDs) are shown in Table \ref{tab:FNED}.

\begin{table}
\begin{center}
    \begin{tabular}{ |ll|r|r|r| }
         \hline
         & & \multicolumn{3}{c|}{FNED} \\
         & & \multicolumn{1}{c}{AWS} & \multicolumn{1}{c}{GCP} & \multicolumn{1}{c|}{MP} \\ \hline
         & LAR1 & *3.1 & *2.2 & \textbf{*4.4} \\
         Race/ & LAR2 & \textbf{*6.4} & \textbf{*16.3} & 1.7 \\
         ethnicity & NYC & *3.6 & *8.9 & *3.7 \\
         & Congress & *3.6 & *2.2 & 1.7 \\ \hline
        \multirow{ 2}{*}{Gender} & NYC & *3.2 & *4.4 & 0.8 \\
         & Congress & *1.3 & *0.6 & 0.2 \\
         \hline
    \end{tabular}
\caption{The normalized false negative equality difference (FNED) for race/ethnicity and gender subsets of the data. Asterisks indicate significance (p$<$0.003) in FNR differences by group. Maximum FNED per system is shown in bold.}
\label{tab:FNED}
\end{center}
\end{table}

The highest FNED, which is an 82\% increase over the second highest FNED, is seen in GCP's performance over the LAR2 dataset which includes frequency controlled API and White-associated names. The FNRs in Table \ref{tab:means_race} show high FNR for API names in LAR2 across all systems. The error rate for GCP is 175\% higher for API-associated names in this set. A Wilcoxon signed-rank test shows significant differences in FNR for AWS and GCP, with better performance on White-associated names. The Presidio transformer model has a smaller gap which is not found to be significant.

Performance on LAR1, which includes frequency-balanced Black, Hispanic, and White-associated names, also shows variability in FNR across race/ethnicity groups. However, the performance differences across groups are dependent on the system. For example, the Presidio transformer model shows poor performance on Black-associated names, and post-hoc tests (see Appendix \ref{sec:posthoc}) reveal significant differences between Black vs. Hispanic and White groups. On the other hand, AWS performs best on Black-associated names but significantly worse on Hispanic-associated names. GCP peforms worst on White-associated names.

The NYC dataset shows more consistency in terms of performance across groups, with Black-associated names having higher FNRs across all systems. This is further confirmed by statistical testing on AWS and GCP, where Black-associated names have statistically higher FNR than Hispanic-associated names. GCP also performs significantly worse on Black-associated names than White-associated names. Although significant FNR differences are found in the performance of Presidio on the basis of race/ethnicity, post-hoc tests did not indicate pair(s) which met the threshold for significance.

Finally, the Congress dataset, which includes given and family names, has the lowest FNED rates in terms of race/ethnicity. However, there are still significant differences in performance across groups for AWS and GCP maskers. Here, API-associated names again show high FNRs. Friedman tests and post-hoc testing support differences between API and other groups in the case of AWS and GCP. Performance on Black-associated names was also significantly worse than on White-associated names for GCP. There were no significant differences associated with the Presidio model.

\subsection{Performance by Gender}

The NYC and Congress datasets also include information about gender, which allows for a comparison of gender-based subsets. The FNEDs in Table \ref{tab:FNED} are generally lower for gender than for race. However, some gender-based differences are shown to be significant.

The average FNR grouped by gender is shown in Table \ref{tab:means_gender}. The NYC dataset shows female-associated, male-associated, and `other' names, which are not strongly associated with a particular gender. FNR is highest for such unassociated names. Performance on female and male-associated names varies, with AWS performing significantly better on female-associated names, and GCP performing significantly better on male-associated names.

\begin{table}
\begin{center}
    \begin{tabular}{ |l|l|r|r|r|r| }
         \hline
          & Gender & N & \multicolumn{3}{c|}{FNR (\%)} \\
          & & & \multicolumn{1}{c}{AWS} & \multicolumn{1}{c}{GCP} & \multicolumn{1}{c|}{MP} \\
         \hline
          NYC & F & 741 & 23.7 & 39.8 & 25.1 \\
           & M & 618 & 25.6 & 33.1 & 25.3 \\
           & Other $\dagger$ & 13 & \textbf{32.2} & \textbf{43.3} & \textbf{27.4} \\
           & \cellcolor{light-gray}All & \cellcolor{light-gray}1359 & \cellcolor{light-gray}24.5 & \cellcolor{light-gray}36.8 & \cellcolor{light-gray}25.2 \\ \hline
          Cong. & F & 145 & 11.0 & \textbf{8.2} & \textbf{10.0} \\
           & M & 385 & \textbf{13.6} & 7.0 & 8.5 \\
          & \cellcolor{light-gray}All & \cellcolor{light-gray}530 & \cellcolor{light-gray}12.9 & \cellcolor{light-gray}7.3 & \cellcolor{light-gray}8.9 \\
           \hline
    \end{tabular}
\caption{Support and average false negative rate (FNR) by gender across datasets. `Other' specifies names which are not strongly associated with one gender.  Groups marked with `$\dagger$' are not included in formal statistical analysis due to low support. Maximum FNR per dataset/system is shown in bold.}
\label{tab:means_gender}
\end{center}
\end{table}

\subsection{Intersectional Analysis} \label{sec:intersectional_results}

We analyzed the NYC results for differences across both race/ethnicity and gender. Table \ref{tab:means_nyc} shows FNR averages associated with intersectional groups. FNR for Black female-associated names is highest among all groups, and error rates are on average 13.7\% higher than that of the full dataset. Black male-associated names have the second highest FNR for GCP and MP. Pairwise testing does not reveal significant differences between Black male and female-associated names. The subsets with the lowest FNR vary across systems. Hispanic-associated names have the lowest FNR in AWS and Presidio. For GCP, White male-associated names have the lowest FNR.

\begin{table}
\begin{center}
    \begin{tabular}{ |l|l|r|r|r|r| }
         \hline
          Group & Gender & N &  \multicolumn{3}{c|}{FNR (\%)} \\
          & & & \multicolumn{1}{c}{AWS} & \multicolumn{1}{c}{GCP} & \multicolumn{1}{c|}{MP} \\
         \hline
         API & F & 86 & 20.1 & 43.0 & 22.2  \\
          & M & 77 & 22.1 & 43.9 & 22.2 \\
         Black & F & 122 & \textbf{30.1} & \textbf{62.8} & \textbf{34.7} \\
          & M & 101 & 27.0 & 47.2 & 29.2 \\
         Hisp. & F & 212 & 18.4 & 35.7 & 21.3 \\
          & M & 175 & 22.2 & 32.2 & 21.1 \\
         White & F & 321 & 25.7 & 32.9 & 24.8 \\
          & M & 265 & 28.2 & 25.2 & 27.4 \\
         \cellcolor{light-gray}All & \cellcolor{light-gray}- & \cellcolor{light-gray}1359 & \cellcolor{light-gray}24.5 & \cellcolor{light-gray}36.8 & \cellcolor{light-gray}25.2 \\
         \hline
    \end{tabular}
\caption{Support and average false negative rate (FNR) by race/ethnicity and gender in the NYC dataset. Maximum FNR per system is shown in bold.}
\label{tab:means_nyc}
\end{center}
\end{table}

\subsection{Analysis of Names}

The previous findings in this section captured a few general patterns. One pattern that held across most systems and datasets was high false negative rates of API names. In the LAR2 and Congressional datasets, API names were especially hard for systems to detect. This was not simply due to API names being less common, as the LAR2 set included names balanced by their frequency in the general US population.

Table \ref{tab:name-examples} shows examples of names with the highest and lowest FNRs. It is worth noting that API names in LAR2 with high FNR are nearly all 2 characters long. Figure \ref{fig:name_len_FNR} shows the relationship between average FNR across all systems, name length, and group. FNR is lowest for 6-7 character names, and increases as length decreases. However, when matched by character length, API-associated names have higher FNRs than Hispanic and White-associated names nearly across the board. There appear to be higher penalties for short names in the API and Black groups.

\begin{table*}
\begin{center}
    \begin{tabular}{ |p{1.5cm}|p{6cm}|p{6cm}| }
         \hline
          & Low FNR & High FNR \\ \hline
         LAR1 & Bob (H), Kristan (W), Vicki (W), Nickie (W), Bethann (W) & German (H), Houston (W), Denver (W), Royal (W), Said (W) \\ \hline
         LAR2 & Maher (W), Nguyen (A), Rajesh (A), Nicoletta (W), Jayesh (A) & Man (A), My (A), In (A), Do (A), So (A)\\ \hline
         NYC & Kaylie (H/F), Keith (W/M), Lena (W/F), Brody (W/M), Brendan (W/F) & Egypt (B/F), Empress (B/F), Asia (B/F), Major (B/M), Malaysia (B/F) \\ \hline
          Congress & Louie Gohmert (W/M), Deborah Ross (W/F), Diana DeGette (W/F), Fred Keller (W/M), Dianne Feinstein (W/F) & Lisa Blunt Rochester (A/F), Aumua Amata Radewagon (A/F), A. Ferguson (W/M), A. McEachin (B/M), Young Kim (A/F) \\
          \hline
    \end{tabular}
\caption{A sample of names with the highest and lowest FNR on average per each dataset.  Race/ethnicity is abbreviated as API (A), Black (B), Hispanic (H), and White (W), while gender is abbreviated female (F), male (M).}
\label{tab:name-examples}
\end{center}
\end{table*}

\begin{figure}[ht]
    \includegraphics[width=0.48\textwidth]{figures/length_FNR_group.png}
    \caption{Average FNR across all systems by character length and race/ethnic group.}
    \label{fig:name_len_FNR}
\end{figure}

High FNR names in Table \ref{tab:name-examples} tend to coincide with other word senses in English. Many are location words (e.g. German, Rochester, Asia). Others double as verbs (`Said'), adjectives (`Young'), nouns (`Major'), and function words (`In'). Using WordNet \citep{wordnet}, a lexical database of English, we examine given names that have overlapping (non-person) senses. Potentially ambiguous given names have a 42\% FNR compared to 24\% for non-ambiguous names. However, the penalty of having an ambiguous name is not the same across groups. Figure \ref{fig:name_ambig} shows that there is a large performance disparity for Black names with multiple senses. This is seen anecdotally in names with similar syntactic/semantic content. For instance, the name `Joy' (API) has a 60\% lower FNR (averaged across systems) than `Blessing' (Black), and `Georgia' (White) has a 25\% lower FNR than `Egypt' (Black).

\begin{figure

    \includegraphics[width=0.49\textwidth]{figures/wordnet_FNRs.png}
    \caption{FNR for names with one or multiple word senses (i.e. including non-person word senses)}
    \label{fig:name_ambig}
\end{figure}

\section{Discussion}\label{sec:discussion}

This paper considers differences in the performance of three PII maskers on recognizing and redacting names based on demographic characteristics. Supported by quantitative results and error analysis, we find disparities in the fairness of name masking across groups.

In terms of race and ethnicity, API-associated names are often poorly masked. Disparities are shown to be significant for AWS and GCP systems. This is not simply a result of the popularity of the names, as the frequency-controlled LAR1 dataset revealed disparities between API and White-associated names. Name length is considered as a performance factor, but it does not entirely account for the gap between API and White-associated names.

Several systems and datasets show poor performance on the masking of Black-associated names. GCP and Presidio revealed significant differences between Black and White-associated names. Error rates are especially high on the NYC dataset, and are highest for Black women. This is in line with previous research which demonstrates the poor performance of NLP systems on Black women \citep[see inter alia][]{buolamwini2018gender}.

Race and ethnicity were the strongest factors related to PII masking performance, but gender-based differences were also noted. Names which were not strongly associated with gender had the highest error rates. This underscores the importance of considering categories outside the traditional gender binary when evaluating systems for bias.

Of all PII masking systems, the Presidio model (with roBERTa NER) shows fewer significant discrepancies based on demographics. However, all systems demonstrate some significant disparities. Across datasets, the performance difference between groups is not consistent. For instance, the AWS model has poor performance on API names in the LAR2 dataset but not in NYC. We consider this not an issue, but a feature of our evaluation across datasets. The datasets we've chosen contain variety in age groups, locations, and contexts. We argue that evaluating NLP systems responsibly requires careful curation of data, including steps to consider the context of the system and the diverse set of system users and stakeholders.

The aggregate name data used here is openly available and can be used for testing on PII masking, NER, and related systems. We are releasing our templates and code used for sampling data. However, we strongly condemn the use of these datasets for predictive purposes, such as identifying a person's race/ethnicity or gender on the basis of their name without their consent. While our collection of name data forms one of the most comprehensive sets of aggregate names and demographic information available, we are limited by availability of data. The sample of Indigenous and mixed-race names was small, and names were sampled almost exclusively from US-born citizens. In the future, we would like to consider collaborating with the public by developing a database where individuals may actively choose to contribute their name and self-identified information for research.

\section{Conclusion}\label{sec:conclusion}

This work considers the performance of PII masking systems on names sourced from real data. We find disparities related to demographic characteristics, especially race and ethnicity, across all systems. While features such as name length and ambiguity play a role in recognition, they do not fully account for performance differences. Disparities in the performance of PII masking systems reflect historical inequities in the ``Right to Privacy''. The NLP community, as a commodifier of both models and data, has a responsibility to develop more equitable systems to protect the data privacy of all individuals.

\section*{Acknowledgments}\label{sec:acks}
The authors thank Emily M. Bender, Joe Bradley, Chris Brew, Andrew Maurer, and the anonymous reviewers for their helpful comments.

At different points over the course of the work presented in this paper, A.P. was supported by a research internship at LivePerson, Inc. and also by the National Institutes of Health, National Library of Medicine (NLM) Biomedical and Health Informatics Training Program at the University of Washington (Grant Nr. T15LM007442). The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health.
\section{Appendices}
\label{sec:appendix}

\subsection{Post-hoc testing} \label{sec:posthoc}

\smallskip

\begin{strip}
Nemenyi post-hoc significance testing for each dataset.  Significance for each respective system is marked with their respective abbreviation: AWS Comprehend (A), GCP DLP (G), and Microsoft Presidio (P). A `-' indicates a \textit{p}-value above the significance threshold
\end{strip}

\begin{table}[htbp
    \begin{tabular}{ |l|c|c|c| }
         \hline
          & Black & Hispanic & White \\ \hline
          Black & - - - & AG - & - GP \\
          Hispanic & AG - & - - - & AG - \\
          White & - GP & AG - & - - - \\
         \hline
    \end{tabular}
\caption{LAR1 dataset with race/ethnicity}
\end{table}

\begin{table}[htbp
    \begin{tabular}{ |l c|l l|l l|l l|l l| }
         \hline
          & & \multicolumn{2}{c|}{API} & \multicolumn{2}{c|}{Black} & \multicolumn{2}{c|}{Hispanic} & \multicolumn{2}{c|}{White} \\
          & & F & M & F & M & F & M & F & M \\ \hline
          API & F & - - - & - - - & AG - & A - - & - - - & - G - & A - - & AG - \\
           & M & - - - & - - - & A - - & A - - & - - - & - G - & - G - & AG - \\ \hline
          Black & F & AG - & A - -  & - - -  & - - -  & AG - & AG - & - G - & - G - \\
           & M & A - - & A - - & - - - & - - - & AG - & AG - & - G - & - G - \\ \hline
          Hispanic & F & - - - & - - - & AG - & AG - & - - - & - - - & A - - & AG - \\
           & M & - G - & - G - & AG - & AG - & - - - & - - - & - - - & A - - \\ \hline
          White & F & A - - & - G - & - G - & - G - & A - - & - - - & - - - & - - - \\
           & M & AG - & AG - & - G - & - G - & AG - & A - - & - - - & - - - \\
         \hline
    \end{tabular}
\caption{NYC dataset with gender, race/ethnicitiy}
\end{table}

\begin{table}[htbp]
    \begin{tabular}{ |l|c|c|c|c| }
         \hline
          & API & Black & Hispanic & White \\ \hline
          API & - - - & A - - & AG - & AG - \\
          Black & A - - & - - - & - - - & - G - \\
          Hispanic & AG - & - - - & - - - & - - - \\
          White & AG - & - G - & - - - & - - - \\
         \hline
    \end{tabular}
\caption{Congress dataset with race/ethnicity.  The Presidio model did not differ significantly based on race/ethnic group.}
\end{table}

\clearpage

\subsection{Frequency sampling}\label{sec:appendix_freq}

This appendix describes in more detail the frequency matching between race/ethnicity groups in the LAR dataset.  The mean observation frequencies for each group are shown in Table \ref{tab:LAR_commonness}. Because there are initially fewer Black-associated names (n=21), we sample all groups to target this smaller distribution. By filtering with a minimum observation size of 2K and maximum observation size of 150K, we achieve similar distributions across groups. However, API names are too sparse under these conditions to be included, and we choose to resample them separately. A Mann-Whitney U test does not find significant differences in frequency between Black, Hispanic, and White-associated names under these conditions (with a threshold of $p=0.05$). A plot of the distributions of this set, which we refer to as LAR1, is shown in Figure \ref{fig:norm_LAR1}.

For API names, we generate a second name set, which we refer to as LAR2. We sample from other groups, using an exponential distribution ($\lambda=480$) that best approximates the API distribution. Only White-associated names maintain $>$20 names under these sampling conditions. A Mann-Whitney U test does not find significant differences between frequencies of API and White groups. Distributions of this set are shown in Figure \ref{fig:norm_LAR2}.

\medskip

\begin{table}[hb]
\begin{center}
    \begin{tabular}{ |l|r| }
         \hline
         Group & N \\ \hline
         API & 488 \\
         Black & 21573 \\
         Hispanic & 25122 \\
         White & 41060 \\
         \hline
    \end{tabular}
\caption{Average observation size per name for each race/ethnicity group in the LAR dataset without resampling.}
\label{tab:LAR_commonness}
\end{center}
\end{table}

\newsavebox{\tempbox}
\begin{figure}
\centering
\sbox{\tempbox}{\includegraphics[width=0.48\textwidth]{figures/pii-lar1.png}}
\subfloat[Black, Hispanic, and White race/ethnicity groups in LAR1]{\usebox{\tempbox}\label{fig:norm_LAR1}}%
\qquad
\subfloat[API and White race/ethnicity groups in LAR2]{\vbox to \ht\tempbox{%
  \vfil
  \includegraphics[width=0.45\textwidth]{figures/pii-lar2.png}
  \vfil}\label{fig:norm_LAR2}}%
  \caption{Plots of frequency distributions for frequency-matched names from LAR.}
\end{figure}

\clearpage

\subsection{Templates}
\label{sec:appendix_templates}

\begin{table}[ht]
\begin{tabular}{|p{0.8cm}|p{14cm}|}
\hline
\# & Template \\ \hline
1  & Name: \{\{Name\}\} Vouchers:10000200007400001 10000200005000001 \\ \hline
2  & sysmsg1\_\{\{Name\}\}\_ has joined the conversation, \\ \hline
3  & Craig G: 1F to LAS and 2F to SAN \{\{Name\}\} 1D to LAS and 2D to SAN \\ \hline
4  & \{\{Name\}\}    03 caramel beige    is my another foundation \\ \hline
5  & i put in an order on line for \{\{Name\}\} original large size and a code for 20 present off of the 117.00 but it would not take \\ \hline
6  & Hi \{\{Name\}\}! Can you help me with my above question? \\ \hline
7  & hi im \{\{Name\}\} \\ \hline
8  & \{\{Name\}\} isle Jake window \\ \hline
9  & Virtual Assistant : Hi \{\{Name\}\}, how can I help you today? \\ \hline
10 & Thank you, \{\{Name\}\} \\ \hline
11 & this was from \{\{Name\}\} \\ \hline
12 & I think it’s \{\{Name\}\} \\ \hline
13 & Ok, will we receive \{\{Name\}\}’s by that date and at that address as well? \\ \hline
14 & \{\{Name\}\}. Very upset at the moment. I placed two request online to have this order cancelled and I just refused an item from FedEX from your store. \\ \hline
15 & Hello \{\{Name\}\}, Im just trying to get some info on the item I ordered \\ \hline
16 & \{\{Name\}\} (I) paid for the ticket \\ \hline
17 & sysmsg2\_\{\{Name\}\}\_ has left the conversation \\ \hline
18 & hey I lost connection from my previous chat with \{\{Name\}\} \\ \hline
19 & Virtual Assistant : Hi \{\{Name\}\}, we’ll use automated messages to chat with you and Customer Care Professionals are standing by. In a short sentence, let me know how I can help you today \\ \hline
20 & thank you very much \{\{Name\}\}. nice chatting with you! \\ \hline
21 & well .. thank u so much \{\{Name\}\} .. \\ \hline
22 & Did \{\{Name\}\} catch you up on everything? \\ \hline
23 & I was working with \{\{Name\}\} earlier on this chat \\ \hline
24 & The response is signed \{\{Name\}\} \\ \hline
25 & it's YGDFEA the reservation. \{\{Name\}\} \\ \hline
26 & My name is \{\{Name\}\}. I messaged yesterday and have not received a response from anyone \\ \hline
27 & \{\{Name\}\} and I divorced. \\ \hline
28 & do you care that something holy to me was in my food \{\{Name\}\}? \\ \hline
29 & \{\{Name\}\} was very kind and helpful! \\ \hline
30 & oh no \{\{Name\}\} sorry to confuse you \\ \hline
31 & the order is under \{\{Name\}\} \\ \hline
32 & \{\{Name\}\}, one question, when i logged into the App, it shows balance as \$50.. is it USD or CAD?\\ \hline
\end{tabular}
\end{table}


\subsection{SUMO}
\label{sub:sumo}

SUMO is an open source traffic simulation tool that offers macroscopic as well as microscopic simulation of vehicle mobility~\cite{lopez2018microscopic}.
SUMO includes models for different types of ``vehicles'', including, among others, cars, bicycles, and even pedestrians.
Due to its large feature set, it has become the de-facto standard for traffic simulation and is used even beyond the transport community, e.g., \cite{beilharz2021towards}.

Traffic scenarios are, among other things, defined by road networks and vehicle traffic.
The road network includes roads and their (sub-)lanes as well as exclusive lanes for cyclists and pedestrians, or road-side infrastructure such as traffic lights.
Furthermore, connections between these lanes and traffic lights can be configured.

When modeling vehicle traffic, users specify demand for a specific road segment per vehicle type and can adjust vehicle-specific parameters of SUMO's simulation model to control their respective behavior.
In general, vehicle parameters are usually specified in the vehicle type declaration (\textit{vType}), applying the changes to all instances of the respective \textit{vType}, e.g., to all cars.
An alternative, however, is to obtain multiple \textit{vType} realizations which typically differ in at least one parameter by using so-called \textit{vTypeDistributions}.
This way, when spawning a new vehicle, SUMO randomly picks a specific \textit{vType} from the \textit{vTypeDistribution} and instantiates the vehicle's parameters accordingly, e.g., cars can thus have individual maximum velocities.

In SUMO, vehicle behavior is, among other things, defined by
\textit{Car Following (CF) models} for the longitudinal kinematic behavior,
\textit{Lane Change (LC) models} for the lateral kinematic behaviour,
and \textit{junction models} for the behavior at junctions and intersections.

Despite including several of these models for cars and trucks, SUMO does not provide a dedicated movement model for cyclists.
Instead, cyclists are simulated by modeling them either as slow cars or fast pedestrians.
Both of these approaches use movement models of the corresponding vehicle type and adapt their respective shape and kinematic characteristics (e.g., velocity and acceleration profiles) to match cyclists.
While this is obviously a rough approximation, it is unlikely to reflect the behavior of real-world cyclists~\cite{grigoropoulos2019modelling}.

\subsection{SimRa}
\label{sub:simra}

SimRa is an open source project started in 2019 which aims to identify hotspots of near miss incidents in bicycle traffic~\cite{karakaya2020simra, temmen2022crowdsourcing}.
For this, the project follows a crowdsourcing approach in which cyclists record their daily rides using a smartphone application available for both Android and iOS.
Today, the project has managed to record more than 65,000 rides, most of them in Germany, approximately half of them in Berlin.

During the ride, SimRa records the GPS trace at 1/3Hz and the motion sensors, i.e., (linear) accelerometer, gyroscope, and rotation vector at 50Hz;
the motion sensor readings are aggregated by calculating a moving average with a window size of 30 and then keeping only every fifth value.
This was done for saving memory, battery, and mobile data usage while still being able to reconstruct the ride and detect near miss incidents.
After the ride, SimRa shows the recorded ride as a route on the map which is then annotated, cropped (for privacy reasons), and uploaded by the user.
In this paper, we only use measured data from the ride files and disregard user-annotated data on near miss incidents.

\subsection{Intersection Behavior of Cyclists}
\label{sec:rw_intersection}

\textcite{kaths2016integration} aim to address the shortcomings of SUMO's intersection model for cyclists.
For this, they record video footage of an example intersection in Munich and derive cyclist trajectories.
From the set of trajectories, they select one representative trajectory for each combination of start and end points in the intersection and make it available to SUMO via an external API.
While this is a significant improvement in realism over SUMO's intersection model, it is hard to generalize to other intersections and cannot cover the plurality of trajectories chosen by real-world cyclists.

Similar to \textcite{kaths2016integration}, \textcite{grigoropoulos2022traffic} analyze video footage of intersections with the goal of better understanding the intersection behavior of cyclists.
Their focus, however, is not on deriving an improved intersection model but rather on identifying best practices for traffic planners working on intersections with high volumes or cycling traffic.
\textcite{grigoropoulos2019modelling} propose to adjust the default traffic infrastructure inside SUMO to achieve more realistic cyclist behavior at intersections.
Here, they focus on the number and shape of bicycle lanes which, however, are highly specific and differ from intersection to intersection.

\subsection{Longitudinal Behavior of Cyclists}
\label{sec:rw_longitudinal}

\textcite{twaddle2016modeling} examine four models for the longitudinal kinematic behavior of cyclists, i.e., acceleration and velocity.
The first, called Constant Model, is the most simple one and is the SUMO default:
Cyclists accelerate and decelerate at a constant rate until the desired velocity is reached.
This model works well when breaking to a full stop but leads to frequent acceleration jumps between a fixed positive or negative value and zero, which is not realistic cyclist behavior.
In the Linear Decreasing Model, maximum acceleration is reached, when starting the acceleration maneuver and then linearly declines until the desired velocity is reached.
This model is outperformed by all other models.
In the third and fourth models, Polynomial and Two Term Sinusoidal Model, acceleration or deceleration start at zero and then gradually grow over time.
In their paper, \textcite{twaddle2016modeling} analyze the video recordings of 1030 rides in four intersections in Munich, Germany and conclude that the Polynomial Model has overall the most realistic cyclist behavior but is, however, not trivial to implement in SUMO.

A different approach of achieving realistic cycling behavior in SUMO is taken by \textcite{heinovski2019modeling}.
The authors simulate multiple traffic scenarios in which accidents between cars and cyclists occur to investigate the effects of wireless communication between cyclists and other road users in the context of accident prevention.
In order to obtain realistic cycling behavior for SUMO, they set up a novel Virtual Cycling Environment (VCE) featuring an actual bicycle that is connected to the simulation via multiple sensors.
The VCE supports interactive empirical studies in a physically safe environment and allows the authors to record the cyclists' behavior in the form of trajectories.
They use a set of recorded trajectories from different cyclists for emulating realistic cycling behavior inside SUMO to simulate accidents.
Although their approach produces trajectories from cyclists created with an actual bicycle, it does only achieve limited realism, since no other road users were present when recording the trajectories.
Furthermore, deriving a realistic set of trajectories requires a large number of test persons.

\subsection{Acceleration}
\label{sec:analysis_acceleration}

\begin{figure}
  \centering
    \includegraphics[width=\columnwidth]{pdf/analysis_max_acceleration_dist_fit.pdf}
    \caption{Histogram of the empirical maximum acceleration capabilities of cyclists found in the SimRa dataset and the fitted EMG. The red scalar represents the default value in SUMO.}
    \label{fig:analysis_max_acceleration_dist_fit}
\end{figure}

For analyzing cyclist acceleration, we extracted acceleration maneuvers from the dataset.
For this, we slightly adapted the approach of \cite{ma2016modeling} and found \num{140736} acceleration maneuvers in the cleaned dataset.
Distribution fitting processes showed that the Burr (Type XII) distribution~\cite{burr1942cumulative} Burr($a_{max}; \Phi\mbox{*}$) fits the data best (see also \cref{fig:analysis_max_acceleration_dist_fit}).

Comparing the acceleration capability of actual cyclists (the SimRa dataset) with the default SUMO bicycle model, differences become apparent. By default, SUMO specifies $a_{max}^{SUMO}$ with 1.2m/s\textsuperscript{2}.
This deviates significantly from the findings in the SimRa dataset where only 7.7\% of the acceleration maneuvers are executed with a maximum acceleration of 1.2m/s\textsuperscript{2} or higher.
Furthermore, the empirical distribution is rather wide, indicating a broad variance across different cyclists and cycling situations, which is in stark contrast to SUMO's strategy of choosing a fixed maximum value.

\subsection{Velocity}
\label{sec:analysis_velocity}

To gain insights into cyclists' behavior regarding their velocities, we calculate the maximum velocity for each ride file in the cleaned SimRa dataset.
Using distribution fitting, we found that the S\textsubscript{$U$} distribution \textcite{johnson1949systems} JSU($v_{max};\Phi\mbox{*}$) fits the empirical data best (see also \cref{fig:analysis_max_velo_dist_fit}) and is therefore a valid fit for the specification of the empirical distribution of $v_{max}^{SimRa}$.

On the other hand, SUMO sets $v_{max}^{SUMO}$ at 5.56m/s by default.
This deviates significantly from the findings in the SimRa dataset where 86.7\% of the rides have a higher maximum velocity.
Bringing this together with the acceleration findings, real-world cyclists often (but not always) cycle much faster than SUMO cyclists and vary much more in their acceleration behavior.

\begin{figure}
  \centering
    \includegraphics[width=\columnwidth]
    {pdf/analysis_max_velo_dist_fit.pdf}
    \caption{Histogram of the empirical maximum velocity data and the fitted JSU. The red scalar represents the default value in SUMO.}
    \label{fig:analysis_max_velo_dist_fit}
\end{figure}

\subsection{Left-turn Behavior at Intersections}
\label{sec:analysis_pathfinding}

\begin{figure}
\includegraphics[width=\columnwidth]{pdf/analysis_im_loc_default.pdf}
\caption{
    Qualitative comparison between the SUMO default intersection model and real world data given by SimRa for the intersection between Alexanderstraße and Karl-Marx-Allee in Berlin.
    SimRa shows two distinct left-turn paths (i.e., a direct and an indirect one) whereas SUMO default only models the direct path.
}
\label{fig:analysis_im_traj_default}
\end{figure}

According to the SimRa dataset, cyclists either behave like cars (using the normal road) or pedestrians (using the pedestrian crossing) to take left-turns at intersections.
We call the former a \textit{direct} left turn and the latter an \textit{indirect} left turn.

SUMO's default model only provides cyclists with the \textit{direct} left turn behavior, thus significantly limiting the simulation's degree of realism (see also \cref{fig:analysis_im_traj_default}).

Taking a closer look at real world intersections in the SimRa dataset revealed that there are two distributions of left-turn behavior in practice.
In the first, the \textit{indirect} path is chosen with a probability of 57 $\pm$7\%, while on intersections following the second, almost all cyclists choose the \textit{indirect} path.
Randomly investigating intersections of both types revealed that the first type has no specific characteristics while the second type actively encourages cyclists to indirect turns through the design of the intersection, e.g., by having a traffic island in the center.
Since such information cannot be identified in \ac{OSM} data reliably and in an abstract way, we will consider only the first distribution in the following.

SUMO and real world data differ decisively in all metrics considered, namely acceleration, velocity, and left-turn behavior at intersections.
However, these three metrics are crucial for realistically simulating bicycle traffic.
In the following, we try to adapt SUMO to simulate a more realistic cyclist behavior.

\subsection{Longitudinal Kinematic Behavior}
\label{sec:concept_param}

In \cref{sec:analysis}, we derived maximum acceleration and maximum velocity characteristics from the SimRa dataset.
We now use them to improve the longitudinal kinematic behavior of the default SUMO bicycle model.
Contrary to the default parameterization, we use theoretical distribution functions instead of scalar values for the exposed kinematic parameters.
This enables the model to produce more realistic bicycle simulation results since the heterogeneity of real world cycling styles is reflected.

We derive the theoretical distributions by aggregating the respective features from \cref{sec:analysis_acceleration,sec:analysis_velocity}.
For this, we rely on the \textit{law of large numbers} which states that the average of the results obtained from a large number of trials of the same experiment eventually converges to its true expected value~\cite{etemadi1981elementary}.
In the context of this work, this means that individual rides do not matter but that the aggregates of multiple rides will converge towards their actual expected value given a sufficiently large number of rides.

In our analysis, we found no correlation between $a_{max}$ and $v_{max}$ and, hence, decided to use both independently in our kinematic model.
For the implementation, we used \textit{vTypeDistributions} following the results of our previous analysis and sample both distribution independently.

It should be noted that through the parameterizations with theoretical probability density functions SUMO's \textit{speedDev} parameter becomes obsolete as variance between the kinematic preferences among cyclists are already represented by the distribution function.

\subsection{Left-turn Behavior at Intersections}
\label{sec:concept_im}

To improve the degree of realism in cyclists' left-turn behavior at signaled intersections, we use an adapted version of the external intersection model (a Python script that steers cyclists via SUMO's \textit{Traffic Control Interface}) as proposed by \textcite{kaths2016integration} which is based on previously recorded real-world trajectories as their guidelines for cyclists across a single predefined intersection.
Our approach algorithmically synthesizes the cyclists' trajectories (i.e., their respective guidelines across the intersection) for any regular four-way intersection and can therefore be seen as a step towards a more universal solution.

The left-turn maneuver distribution, as we call it, specifies the probability of the cyclists choosing either the \textit{direct} or the \textit{indirect} path to cross the intersection.
For this, we use the distribution derived in \cref{sec:analysis_pathfinding} as the default for our intersection model.
Users, however, can adjust the distribution if desired or needed for their specific purposes (see also the exception cases in \cref{sec:analysis_pathfinding}).

\subsection{Simulation Setup}
\label{sec:eval_setup}

As SUMO users can import real-world scenarios from OSM data, simulation results can be compared to real-world data and thus be evaluated.
For our evaluation, we chose specific traffic scenarios that are representative and likely to showcase both strengths and weaknesses of our extensions.
For evaluating the longitudinal behavior (acceleration and velocity), we chose urban traffic scenarios with long straight sections.
As an example location, we use \textit{Oranienstraße} in Berlin.
For evaluating left-turn behavior, we chose compact scenarios around signaled intersections.
For this, we study three intersections in Berlin, namely at \textit{Mehringdamm} (see also \cref{fig:mehringdamm_sumo}), \textit{Warschauer Straße}, and \textit{Alexanderstraße}.

\begin{figure}
\includegraphics[width=\columnwidth]{plots/im_eval/mehringdamm_screenshot.png}
\caption{
    Excerpt from the \textit{Mehringdamm} scenario in SUMO.
    The scenario was created using OSM data only.
}
\label{fig:mehringdamm_sumo}
\end{figure}

For our evaluation, we use SUMO version 1.7.0 and a step size of \SI{1}{\s} in simulations.
The SUMO default results are obtained with SUMO's \textit{vType} \texttt{Bicycle} for cyclists.
Thus, the maximum acceleration and maximum veocity are scalars and set to \SI{1.2}{\m\per\s\squared} and \SI{5.6}{\m\per\s} respectively.

\subsection{Acceleration}%
\label{sec:eval_accel}

\begin{figure}
\includegraphics[width=\columnwidth]{pdf/eval_acc.pdf}
\caption{
    Histogram of SUMO's, SimRa's, and our approach's observed maximum accelerations inside the example \textit{Oranienstraße} scenario.
    While the maximum accelerations are heterogeneously distributed in the real-world data and our approach, the default values are clustered.
    Here, the observed accelerations deviate from the configured default value (1.2m/s\textsuperscript{2}) due to traffic effects inside the simulation.
}
\label{fig:eval_acc}
\end{figure}

\cref{fig:eval_acc} shows the empirical distributions of the maximum acceleration among cyclists inside a specific simulation scenario and the corresponding real world data.
It is evident that real-world acceleration maneuvers show heterogeneous maximum rates of acceleration.
Apparently, the default parameterization is not suitable to describe this acceleration behavior among cyclists, as it provides homogeneous maximum acceleration rates within the simulation.
Our new parameterization is significantly closer to the real-world behavior in the SimRa data set with its highly heterogeneous behavior across cyclists.
That our new parameterization is not a perfect fit indicates that there are probably additional influence factors, e.g., the traffic density or the the weather situation, not covered in our kinematic model which aggregates data from all SimRa rides.

\subsection{Velocity}%
\label{sec:eval_velocity}

\begin{figure}
\includegraphics[width=\columnwidth]{pdf/eval_velo.pdf}
\caption{
    Histogram of SUMO's, SimRa's, and our approach's observed maximum velocities inside the example \textit{Oranienstraße} scenario.
    While the maximum velocities are heterogeneously distributed in the real-world data and our approach, the default values are clustered.
}
\label{fig:eval_velo}
\end{figure}

\cref{fig:eval_velo} shows the empirical distributions of the cyclists' maximum velocities in the same simulation and the real-world scenario.
As with maximum acceleration rates, maximum velocities vary widely among real-world cyclists.
Once more, the default parameterization is not able to reflect this characteristic.
Our new parameterization is thus significantly closer to the real-world behavior of cyclists.
As for acceleration behavior, the fact that our new parameterization is not a perfect fit to the real-world data indicates that there are likely to be additional influence factors not captured in our model.

\subsection{Left-turn Behavior at Intersections}%
\label{sec:eval_turn}

\begin{figure}
\includegraphics[width=\columnwidth]{pdf/eval_im_loc_im.pdf}
\caption{
    Qualitative comparison between the results of our approach for the intersection model and real-world data given by SimRa for the intersection between Alexanderstraße and Karl-Marx-Allee in Berlin.
    SimRa shows two distinct left-turn paths (i.e., a direct and an indirect one), which are also modeled by our approach.
}
\label{fig:eval_im_traj_new}
\end{figure}

As shown in \cref{fig:eval_im_traj_new}, which shows the intersection between Alexanderstraße and Karl-Marx-Allee in Berlin, the 2D trajectories produced by the new intersection model converge towards the trajectories of the SimRa data set.
While the trajectories produced by SUMO's default bicycle model only offer direct turns (we omit those in the figure), the new model is significantly closer to real-world intersection behavior of cyclists.

\subsection{Combining Intersection Model and Kinematic Extensions}%
\label{sec:eval_combined}

To achieve a holistic comparison between SUMO's default bicycle model and our new approach, we measure the durations of left-turn maneuvers at multiple intersections and compare the empirical distributions of these measurements.
To specifically monitor the impact of our changes, we do not include any ride time before or after the intersection in the measurements.

Based on this, we identified the following three findings:

\begin{figure}[t]
\includegraphics[width=\columnwidth]{pdf/im_warschauer_edcf.pdf}
\caption{
    ECDFs of the measured durations for crossing the scenario \textit{Warschauer Straße}.
    It is apparent that our approach outperforms SUMO's default as the measured durations converge towards the real-world data.
}
\label{fig:im_warschauer}
\end{figure}

First, our new approach outperforms the default at most intersections, as its measured durations converge with real data, see for example \cref{fig:im_warschauer}.
Especially when given the option to use the \textit{indirect} path, cyclists take longer to cross an intersection as they need to stop at an additional traffic light.
This is consistent with real-world data as we find it in the SimRa dataset at multiple intersections.

\begin{figure}[t]
\includegraphics[width=\columnwidth]{pdf/im_mehringdamm_edcf.pdf}
\caption{
    ECDFs of the measured durations for crossing the scenario \textit{Mehringdamm}.
    The results when using our new approach are only slightly more realistic than when using the standard SUMO model.
    However, when the \textit{direct} path is blocked for cyclists, the simulation results outperform the default approach.
}
\label{fig:im_mehringdamm}
\end{figure}

Second, in some cases, we were able to improve our results by adjusting the left-turn behavior distribution following the second distribution discussed in \cref{sec:analysis_pathfinding}.
The ``lane only'' results in \cref{fig:im_mehringdamm} were achieved by prohibiting cyclists from using the \textit{direct} path.
Obviously, it takes much longer for cyclists to cross the intersection than SUMO's default simulation model suggests.
When examining SimRa trajectories at this particular intersection, almost all cyclists chose the \textit{indirect} path as the infrastructure guides cyclists to do so.
Hence, manually adjusting the left-turn behavior distribution for such intersections is crucial.

\begin{figure}[t]
\includegraphics[width=\columnwidth]{pdf/im_alex_edcf.pdf}
\caption{
    ECDFs of the measured durations for crossing the scenario \textit{Alexanderstraße}.
    Here, our new approach is not more precise than SUMO default behavior.
}
\label{fig:im_alex}
\end{figure}

Third, at a few intersections, the results of our approach do not yet sufficiently reflect real-world bicycle behavior (see \cref{fig:im_alex}).
We discuss possible reasons for this in \cref{sec:disc}.

\subsection{Methodological Challenges}
\label{sec:method}

Our initial assumption was that the behavior of cyclists in a single intersection cannot be generalized to all intersections~\cite{kaths2016integration} but that the average behavior across a large number of intersections will be close enough to cyclists' behavior at arbitrary intersections.
This seems to be true only for a (relatively large) subset of intersections -- apparently, the intersection behavior of cyclists is more heterogeneous than expected.
We believe that this is due to the fact that we averaged across all intersections in our dataset whereas there are apparently different classes of intersections that we did not account for.

Primarily, the intersection design is likely to have a strong impact:
Consider the example in \cref{fig:mehringdamm_traffic_island} where a traffic island partially blocks direct left turns and where markings on the ground suggest indirect turns.
As another example, the intersection Bismarckstraße/Leibnizstraße had no direct left turns in the SimRa dataset.
In this intersection, the reason would be that cyclists legally have to use a bike lane.
When using that bike lane, a direct left turn would require cyclists to first pass through a row of parked cars, then to cross four car lanes of a major street before being able to turn left.

Aside from that, other possible influence factors include the amount and velocity of traffic (higher numbers of cars or faster cars can be expected to lead to more indirect turns), gender and age group distributions of cyclists in the respective intersections, as well as weather and light conditions or the grade of the street.
In future work, we plan to explore these possible influence factors, focusing on the intersection design which we deem to have the strongest impact.

Another problem results from inaccuracy in the dataset used:
GPS and motion sensors of smartphones provide only imprecise insights into actual ``micro''-behavior of cyclists.
Using a broad group of cyclists as input will always result in this limitation which we tried to overcome based on preprocessing and filtering of the SimRa dataset.
Alternatives would be additional sensors (especially cameras) on bicycles or on intersections as in~\cite{kaths2016integration}.
These, however, have the inherent limitation that they will either limit the number of bicycles producing data or the number of intersections covered.

\subsection{Dataset Choice as Ground Truth}
\label{sec:problem_simra}

In this paper, we used the SimRa datasets as input for our analysis as it is, to the best of our knowledge, the first public dataset comprising a large number of rides that actually publishes individual rides in an anonymized but non-aggregated form.
We need to keep in mind, however, that SimRa was designed for a different purpose:
For example, the SimRa app records motion sensors at 50Hz but only persists every fifth value of a moving average over 30 values.
While this suffices for detecting near miss incidents~\cite{karakaya2020simra}, it further limits the resolution of motion data (and thus any conclusions we can draw from that).
Furthermore, the SimRa data which we used were recorded over a period of 1.5 years.
During such as long period of time, physical changes to the bicycle infrastructure (both temporary and permanent) will occur, thus, adding additional noise to the data.

Finally, SimRa relies on crowdsourcing as a data collection method which often leads to participation inequality.
As a result, individual users will be overrepresented in some intersections and street segments and not represented in others.
Furthermore, based on the data collection method using smartphones, the user group of SimRa is likely to have a slight gender bias towards males and an age group bias towards cyclists between the ages 20 and 50.
These biases will, of course, be reflected in our analysis results and cannot be compensated unless other cycling datasets become available in non-aggregated form.

\subsection{Generalizability}
\label{sec:problem_general}

Although the SimRa dataset contains rides from almost 100 regions, we only considered rides from Berlin for our data analysis and the development of cyclists' left turn behavior.
The main reason for this is that almost half the rides are from the Berlin region~\cite{karakaya2022cyclesense}.
To derive both turn model and acceleration behavior, however, we need data from "dense" street segments with many rides which are hence only available for Berlin at the moment.
This is further aggravated by the fact that the preprocessing step (see \cref{sec:analysis}) further reduces the number of eligible rides and with that the number of intersections with sufficient left-turn maneuvers.
Nevertheless, this does not pose a threat to the generalizability of our findings -- at least for Germany -- as traffic infrastructure guidelines throughout Germany are standardized.
Furthermore, adjacent countries such as Austria often also have comparable infrastructure.
We hence believe that our findings also apply to at least these countries.

\section{Introduction}
\label{sec:intro}
\input{content/1_introduction}

\section{Background}
\label{sec:background}
\input{content/2_background}

\section{Related Work}
\label{sec:rw}
\input{content/2_RW}

\section{Cycling Behavior in SimRa and SUMO}
\label{sec:analysis}
\input{content/3_analysis}

\section{Improving SUMO's Bicycle Simulation}
\label{sec:concept}
\input{content/4_concept}

\section{Evaluation}
\label{sec:eval}
\input{content/6_eval}

\section{Discussion}
\label{sec:disc}
\input{content/7_discussion}

\section{Conclusion}
\label{sec:conclusion}
\input{content/8_conclusion}

\printbibliography
\end{document}