Voice Passing : a Non-Binary Voice Gender Prediction System for evaluating Transgender voice transition
David Doukhan Simon Devauchelle Lucile Girard-Monneron Mía Chávez Ruz V. Chaddouk Isabelle Wagner Albert Rilliard


[
    M. Nakatsutsumi
    April 29, 2024
===================



This paper presents a software allowing to describe voices using a continuous Voice Femininity Percentage (VFP). This system is intended for transgender speakers during their voice transition and for voice therapists supporting them in this process. A corpus of 41 French cis- and transgender speakers was recorded. A perceptual evaluation allowed 57 participants to estimate the VFP for each voice. Binary gender classification models were trained on external gender-balanced data and used on overlapping windows to obtain average gender prediction estimates, which were calibrated to predict VFP and obtained higher accuracy than F_0 or vocal track length-based models. Training data speaking style and DNN architecture were shown to impact VFP estimation. Accuracy of the models was affected by speakers' age. This highlights the importance of style, age, and the conception of gender as binary or not, to build adequate statistical representations of cultural concepts.



Index Terms: Transgender voice, Gender perception,  Speaker gender classification, CNN, X-Vector 











§ INTRODUCTION




Care of transgender people offers, among other things, support for the modification of the gender perceived through their voice, a main component of identity - particularly of gender identity <cit.>.



During female-to-male transitions, the lowering of a voice's fundamental frequency (F_0) is relatively easy to obtain by taking testosterone, which produces a lengthening of vocal folds and a masculinization of voice. Conversely, raising one's vocal pitch so the voice is perceived as female is more complex, as taking female hormones does not influence the phonatory structure after puberty for males <cit.>.

However, voice's F_0 is not the only criterion for identifying voice gender. 
Voice quality (and typically vocal tract resonances) is also an important determinant, while prosody, speech rhythm, and vocabulary intervene as secondary cues <cit.>.

Beyond personal training, transgender persons are offered care by voice therapists and, if required, two types of vocal surgery that aim a raised voice pitch: cricothyropexy and Wendler glottoplasty <cit.> 

A recurrent question is how to evaluate this work and its outcome? (i.e., how do we estimate the gender that'll be perceived from a voice in a given language and culture?) Most available software (e.g., EvaF <cit.>
or VoiceUp <cit.>) proposing the evaluation of voice masculinity or femininity for non-expert essentially use voice F_0.
While this measurement alone does not capture gender perception (an extra-high F_0 may correspond to a falsetto voice, or a very low F_0 to a partial laryngectomy...), let alone not being tuned to cultural variation  <cit.>. 


This paper describes the setup and evaluation of a tool trying to close the gap between the reality of voice therapy practice and gender perception. A program allowing transgender persons to train their voice and measure their progress, and allowing voice therapists to evaluate and develop their techniques with a tool adapted to their daily needs.




This tool thus (i) shall take into account the complex characteristics of a voice (not only F_0); (ii) shall return a proportion of masculinity/femininity so transgender persons may adapt the output to their own want.

To develop this service, machine learning (ML) algorithms were trained to evaluate the voices' gender, and their outputs were tuned to the perceptual evaluation of a corpus of individual voices by naive French listeners. This perceptual evaluation and the setup of these algorithms, with their performance evaluation, is the topic of this paper. This study focuses on gender perception within the French culture and language.








§ RELATED WORK






Earlier gender prediction systems were based on LPC analysis <cit.>, MFCC gender-dependent HMM phone recognizer <cit.>, or Mel bands and pitch estimation HMM <cit.>.
This task was defined as a binary classification problem associated with high accuracy estimates (> 95%), often considered as solved.
However, the reported performances were not necessarily comparable since accuracy depends on e.g., corpora, sample duration, speech transcript, speaking style, speaker age, and language.
Recent studies, using pre-trained Transformer-based acoustic features <cit.> or Convolutional Neural Networks (CNN) trained on Mel bands <cit.>
, reported accuracy metrics above 90% on fixed-length speech samples (2 seconds, 680 ms, 30 seconds), but also gender classification biases defined as  accuracy differences between female and male speakers. 

For transgender voices, classification systems used three gender categories: a male, female, and transgender system was fitted to recordings of cis- and transgender (male & female) speakers, with an accuracy of 83% <cit.>.
The Trans-Voice App, used for transgender auto-evaluation, has a decision function based on a Multi-Layer Perceptron trained with a binary gender and arbitrary thresholds to obtain masculine, feminine, and androgynous voice categories. Its output was compared to speaker judgments on their own speech, with an accuracy of 88% <cit.>.


Categorical systems make it difficult to monitor the speaker's progress during their transition. Our working assumption is to favor systems producing  continuous gender estimates fitted to human perception of gender. An LDA system based on 29 acoustic features was trained on cisgender voices annotated on a continuous scale <cit.>. While not addressing transgender voices, this work required excerpts of at least 7 seconds to obtain predictions correlated with perception and found that mean F_0, third and fourth formants, and vocal tract length (VTL) were the most correlated features with perceived gender.





 













§ CIS- AND TRANSGENDER VOICES CORPUS




 §.§ Recording and analysis









41 speakers were recorded reading the French version of The North Wind and the Sun.
They were 8 cisgender males (CM), 12 cisgender females (CF), and 21 transgender females (TF), with age varying between 20 and 69 years old (mean: 39). 
The TF speakers had transgender voice therapy supervised by one author of this study; none of them received surgical processing of the vocal apparatus.
All speakers signed an informed consent form detailing the aims of the research project to allow their voices to be used for research purposes only.

Recordings were made either at hospital Tenon AP-HP in a quiet room for transgender and some cisgender speakers or at the LISN laboratory for some cisgender voices. Recordings were made using a microphone at about 30 cm from the speaker's mouth, with a Nacon microphone at the hospital or a Zoom H4n recorder with its default microphones at the lab.
The readings had an average duration of 39 seconds, varying between 30 and 51 seconds.


F_0 was estimated following recommendations in <cit.>, combining 's voicing estimation <cit.> with 's F_0 estimation <cit.>. 
F_0 was expressed in semitones (ST) relative to 1 Hz.



Estimation of VTL was made using the first four formants (measured on the vocalic part of the readings), using <cit.>'s equation and recommendations for formants estimation, using Praat's Burg algorithm <cit.> (i.e., estimating 6 formants with a 5.5kHz frequency threshold).














 §.§ Gender perception test


A perception test was conducted using PsyToolkit <cit.>, an online interface allowing the realization of in-browser experiments. A link to the online interface was sent to multiple French-speaking research mailing lists and  social media. 57 participants were enrolled in this perceptual evaluation. They were asked to provide their gender (35 female, 20 male, 2 other or confidential) and age range (18 in 18-35 years old, 25 in 36-50, 9 in 51-65, 4 over 65, 1 confidential).

Participants had to read the instructions and to accept participating in the study. Instructions described how this research aims at investigating why and how voices are perceived as produced by females or males and that the participants were supposed to evaluate how the voice they were about to listen to could have been produced by a female or a male, of a given age.  Participants were not told that the voices might contain transgender voices in order to avoid influencing their decisions. 
The 41 recordings were presented in a random order to each participant, who had to answer two questions intuitively and rapidly without having to listen to the whole speech sample. Participants had the possibility to answer "I don't know" (IDK). The questions were


Q1: What is the voice's gender? (answers: Female, Male, IDK); and 

Q2: How old is the speaker? (answers: 20-35, 36-50, 51-65, over 65, IDK).


Q1 answer buttons appeared at the beginning of the stimulus presentation. Participants had to answer Q1 to be able to answer Q2. They were not able to replay stimuli nor change their answers. Once the two answers were recorded, the next stimulus was presented after a short pause. The evaluation took about 6 minutes to complete, excluding the time required to read the instructions and provide demographic data.
The question related to speaker age (Q2) was aimed at distracting participants to avoid a focus on gender. 

For each question, the answers and the associated reaction times (RT) were recorded. The answers related to the speaker's age are not used in this study.



 §.§ Perceptual evaluation results


Table <ref> presents the proportion of Q1 answers by speaker's categories. For cisgender speakers, a negligible amount of errors or IDK answers were observed (resp. 0.4 and 0.2%) 
together with
shorter average RT: 3.4 and 3.7 seconds, versus 6.2 seconds for TF speakers. 
Participants tend to attribute a binary gender category to transgender voices, with a notable but modest increase (5%) of IDK answers. 
Mean gender judgments are 0.539 for female listeners and 0.565 for male listeners.  Wilcoxon rank sum test shows no significant differences with probability >= 95% between these 2 groups (W = 268.5, p-value = 0.1548).








From this perceptual evaluation, we defined a perceived "Voice Femininity Percentage" (VFP) index, derived from Q1 answers, and defined as the number of Female answers plus half of the IDK answers, divided by the total number of answers.
Figure <ref> shows the mean RT for each speaker's voice, according to their VFP.
While CM and CF speakers have VFP close to 0 and 100, TF VFPs are spread between 0 and 100.
A second-order polynomial gives a reasonable fit of the RT, as a function of voice VFP, with a maximal RT centered around 50% VFP.
































§ GENDER PREDICTION MODELS







The complete voice gender evaluation system is based on three components that take as input a wav file sampled at 16 kHz. 
The first step is based on the  Voice Activity Detector used to discard non-speech segments <cit.>.
Then, a 2D CNN gender classification model is applied using a sliding window. At each window step, it produces a binary gender prediction that is averaged over the complete recording.
Lastly, an Isotonic regression calibration procedure <cit.> transforms this average score to the VFP obtained on the Trans- and cis-gender corpus using a non-linear increasing mapping. 




 §.§ Binary speaker gender training corpora


Table <ref> presents the 4 corpora 
used to train or evaluate binary gender classification models.
Voxceleb 2 (Vox2) contains celebrity voices obtained from Youtube in various recording conditions <cit.>. Despite its size, it mostly features English speakers, which may be sub-optimal for training gender detection systems targeting French voices.
INA's speaker dictionary (INA1) and diachronic speaker corpus (INA2) contain voices of celebrities obtained from French audiovisual archives <cit.>.
INA1 is based on speech broadcast on French TV news between 2007 and 2013.

INA2 subset contains TV and radio speech broadcast in 2015-2016, balanced across 4 age ranges (20-35, 36-50, 51-65, 65+) and 2 genders (female, male).
The French set of Common Voice corpus (CVFr) contains a large number of anonymous volunteer speakers reading short sentences in French and recorded using their own devices <cit.>. CVFr has interesting properties with respect to our final use case, where individuals may use variable-quality recording devices.





 §.§ 2D CNN speaker gender classification


Two types of 2D CNN architectures were investigated for building the classification models. Both operate on Mel-scaled filterbank coefficients obtained from 25 ms windows with a step size of 10 ms.
2D CNN inputs are defined as patches of dimensions T*N, with N the number of Mel bands extracted from each analysis window, and T=150 being the time dimension (the number of signal windows required to create an input patch, corresponding to 1515 ms speech excerpts). 

















We defined Temporal Pooling CNN architectures (TpCnn) inspired by <cit.> using N=24 Mel-scaled filter bank inputs.
These architectures are based on NCONV convolutional blocks, a temporal pooling layer (), NDENSE dense layers, and a sigmoid activation.
Convolutional blocks are composed of valid K1*K2 kernels with NFILT filters followed by batch normalization and RELU activation.
Frequency (), Time (),  or Time-frequency () invariance pooling strategy were inserted between convolutions blocks.
Dense layers contain NN neurons and have Dropout rates of 0.2. The parameter space of architectures was explored with NCONV varying from 2 to 5, NDENSE varying from 0 to 4, NFILT and NN in set {32, 64, 128, 256, 512}, K1 and K2 in set {3,5,7,9} and varying pooling strategies.















We also defined several X-vector based architectures using VBX open-source extractor <cit.>.

X-vectors are 1-dimensional speaker embeddings obtained with DNN architectures, generally used for speaker-related tasks (recognition, verification, diarization) <cit.>.
VBX extractor is based on a  architecture pre-trained on Vox2 corpus, using 64-dimensional Mel filterbank coefficients to obtain 256-dimensional X-vectors.

This deep model (347 layers) has a relatively large amount of parameters (45 M) since it was trained for complex tasks. 
We build on top of this extractor several Multi-Layer Perceptron (MLP),
with a number of layers varying between 1 and 4 and the number of neurons per layer in set {32, 64, 128, 256, 512}.







 §.§ Training Strategy


We defined a DNN training strategy aimed at obtaining models with minimal gender, corpus, and speaker biases.
Male speakers were randomly excluded from corpora so to obtain balanced subsets containing the same amount of unique male and female speakers.
To mix training corpora, we discarded speakers from the largest in order to obtain subsets with the same amount of unique speakers per corpus.
Speech recordings were then grouped by unique speaker identifier and split into mutually exclusive training and development sets using ratios of 80 and 20%, so a speaker from the train set is absent from the dev set.
For each epoch, a 1515 ms speech excerpt was randomly drawn (position, recording condition) for each speaker, resulting in a sample number equal to the number of unique speakers, balanced across genders and corpora.
Models were then trained using an early stopping procedure with patience set at 50 epochs, monitoring the estimate defined as the global loss plus the absolute value of the loss difference between male and female speakers obtained on the development set.

Each model was trained using 3 random initializations, and objective function convergence was obtained within a maximal amount of 160 epochs.
1500 TpCNN and 200 Xvector-based models were trained using NVIDIA 2080 Ti GPUs, requiring 850 hours of computation time (30 minutes/model).








§ RESULTS


Evaluations were realized in a cross-corpus configuration.
Vox2, INA1, and CVFr corpora were used to train ML models in single and mixed corpus configurations (=INA1+CvFr and =Vox2+INA1+CvFr).


INA2 was used for testing models on the binary gender classification (BGC) task and to obtain estimates of accuracy per gender and age category.
The Trans- and Cisgender voice Corpus (TCC) was used for testing the Voice Femininity Percentage (VFP) prediction. 
Our proposals are compared to 4 baselines:  and  corresponding to median F_0 or VTL,  is a linear SVM fit on median F_0 and VTL features,  is a gender classification model provided in the open-source project  and pre-trained on French data <cit.>. 
These baselines were used in pipelines, including VAD and isotonic calibration.



Table <ref>  presents the best VFP prediction models.
VFP results are reported separately for cis- (CIS) and transgender (TF) speakers using the coefficient of determination (R^2) observed between model predictions and perceptual estimates.
Each model is associated with (i) a binary gender classification (BGC) performance metrics described as the harmonic mean of the accuracy obtained for male and female speakers (Hacc) and (ii) a Gender Bias (GB) defined as the difference between the accuracy for male minus for female speakers (GB > 0 if male accuracy is higher than female accuracy, else <0; GB close to 0 is better).
While F_0- and VTL-based models allowed obtaining reasonable VFP results for cisgender speakers (R^2=0.94), their ability to predict transgender VFP is lower (R^2=0.53), 

illustrating the limitation of the F_0 and VTL features for predicting transgender voices' perceived femininity (or gender).
While showing better abilities to estimate TF VFP (R^2=0.79), the  baseline was associated with lower scores than our proposals and a large gender bias (GB=+4.6).

For all training set configurations,  obtained lower scores than X-vector architectures.
Reported  results are limited to their best training set configuration using all available training data (TF VFP R^2=0.86); their lowest results were obtained while trained on CvFr (R^2=0.76).
X-vector models obtained CIS VFP R^2 > 0.99 for all training configurations, corresponding to almost perfect VFP estimation for cisgender speakers. 
Best TF VFP was obtained with a model using four 512 neuron hidden layers on the top of the  extractor, trained in a single corpus configuration using CvFr (R^2=0.94).
It was associated with the lowest reported BGC gender bias (GB=0.1) but also with the lowest BGC harmonic accuracy (Hacc=94.2).
Best BGC results were obtained with different settings: a single 512-neuron hidden layer MLP trained with all the available data (Hacc=98.1). 
This best BGC-performing model resulted in a lower but fair TF VFP prediction (R^2=0.92).
These two best-performing models (TF VFP and BGC) were associated with BGC harmonic accuracy decreasing with the speaker's age, as illustrated in table <ref>.







































































































































§ CONCLUSION


We presented an original approach for estimating a continuous ratio of perceived gender from voice, defined as a Voice Femininity Percentage, and fitted to the perceptual results of a group of French speakers. 
This approach differs from <cit.>, as we have chosen to base our estimates on external listener judgments rather than on speakers' own judgments, as the former better fits our aim: reflecting the gender perceived by the interlocutors.
Unlike  <cit.>, we asked perceptual test participants to provide binary gender judgments because gender is mostly perceived as a binary characteristic in the French society (as shown by the barely used IDK option) – but we considered the proportion of female answers, that allowed us working on a continuous dimension. 
While we considered this perception task more natural than asking for continuous gender judgments, it required a significant group of participants; resulting in costly perceptual gender estimations that we considered necessary with respect to our final use case – having a model that reflects how a voice would be perceived in a social interaction setting.



We implemented several machine learning models in charge of reproducing these perceptual judgments and obtained convincing results for cisgender (R^2>0.99) and transgender voices (R^2=0.94), which were shown to be much more accurate than predictions based on F_0 and/or VTL estimates only.
Best results were obtained using VBX X-vector features (pre-trained with English data) <cit.> with an MLP trained in a single corpus configuration using CvFr <cit.>. 
This result suggests that the best performances were linked to speaking style similarity between CvFr and the evaluation material (non-professional read speech) rather than to the training data language (no major differences between INA1 and Vox2) or the sheer size of the dataset (CvFr is smaller than Vox2). 
Additional work would be necessary to estimate the potential impact of training data language if style is controlled for, using X-vector extractors trained on French data.
This result also suggests that the trained models that obtained fair but not the best results on our evaluation task may be better suited to the analysis of spontaneous speech, which was not represented in our evaluation material. 
Additional work is necessary to constitute a spontaneous speech corpus using similar gender perceptual evaluation protocols.
Other factors, and typically the speaker's age, had a major effect on all models evaluation metrics, and typically gender bias: these results may reflect literature describing the evolution of voice with age during adulthood <cit.>, with decreased F_0 in female vs. an increase for male.
This illustrates the importance of models fitted to the voice of speakers with varied characteristics.

Results described in this study are currently limited to read speech in French.
Ongoing work consists in building Human-Machine Interfaces to investigate if these theoretical results match end-users expectations and allow to provide constructive voice-passing feedback to be used in addition or instead of F_0 estimates.





Best performing BGC models presented in this study have been integrated to  open-source project <cit.>. 
Discussions with French regulatory authorities are necessary to define how fitted calibration modules (BGC to VFP mapping) could be disseminated while preventing non-ethical uses 
related to the characterization of non-prototypical voices. 








§ ACKNOWLEDGEMENTS


This work has been partially funded by the French National Research Agency (project Gender Equality Monitor - ANR-19-CE38-0012).
For anonymity issues, authors will describe upon acceptance how this project has been funded together with instructions for obtaining the software.





IEEEtran






































































