Written informed consent was provided by all participants.
This retrospective observational study analyzed data from 3535 couples aged 18–43 who underwent IUI between January 2011 and December 2015 at a single university-affiliated fertility center in Montreal, Canada. The dataset created for this study includes de-identified patient characteristics and clinical outcomes from 9501 IUI cycles. Twenty-one features were extracted for each cycle, including the male and female patient age, sperm quality parameters, number of previous IUI cycles, type of ovarian stimulation protocol, and number of days between menses and insemination or pregnancy (see Supplementary Table S1 for details). The database was pre-processed for consistency and clinical accuracy, and was then split into training, validation, and test sets. Hyperparameters were optimized using a stratified four-fold cross-validation to determine which models performed better, ultimately ranking the features used for the model.
Data were included in the study if the couple underwent at least one IUI cycle for any of the following indications: mild male factor infertility, mild endometriosis, ovulatory dysfunction, and unexplained infertility.
The ovarian stimulation protocols involved oral agents, injectable gonadotropins, combination therapy, or natural cycles. Oral treatments, including clomiphene citrate (Clomid ® , Sanofi-Aventis Canada, Laval, QC, Canada; 50–200 mg/day), letrozole (Femara ® , Novartis Pharma Canada, Dorval, QC ,Canada; 2.5–5 mg/day), or tamoxifen (Nolvadex ® , AstraZeneca Canada Inc., Mississauga, ON, Canada ; 20–60 mg/day), were administered for five days, starting from the third day of the menstrual cycle. A recombinant human follicle-stimulating hormone alone (Gonal F ® , EMD Serono Canada, Mississauga, ON, Canada; Puregon ® , Merck Canada Inc., Kirkland, QC, Canada), or in combination with a luteinizing hormone (Menopur ® or Repronex ® , Ferring Canada, Toronto, ON, Canada), was administered at a dose ranging from 37.5 to 300 IU every one or two days until the trigger of ovulation, starting from the second or third day of the menstrual cycle. Protocols combining clomiphene citrate or letrozole with gonadotropins were employed in fewer cases. Patients undergoing natural cycles received no pharmacologic intervention.
All cycles were monitored using transvaginal ultrasound to assess the number and size of ovarian follicles as well as the endometrial thickness. When at least one antral follicle reached an average diameter of 18 mm, a subcutaneous injection of 250 μg of recombinant human chorionic gonadotropin (Ovidrel ® , EMD Serono Canada, Mississauga, ON, Canada) was administered to trigger ovulation.
Fresh sperm samples were collected by masturbation following two to three days of sexual abstinence. Specimens were liquefied at 37 °C for 30 min prior to processing. Spermatozoa concentration, motility, and progression were microscopically analyzed (100× magnification) using 10 μL of semen in a Makler Chamber.
Sperm was prepared for IUI using density gradient centrifugation. A colloidal gradient consisting of 1 mL of 80% medium under 1 mL of 40% medium (Gynotec Sperm filter, Fertitech Canda Inc., Saint-Laurent, QC, Canada) was layered with a maximum of 4 mL of the sperm. After initial centrifugation at 400× g for 20 min, motile spermatozoa were transferred into 5 mL SpermWash ® (Gynotec Sperm wash, Fertitech Canada Inc., Saint-Laurent, QC, Canada) using a sterile Pasteur pipette for a second centrifugation at 100× g for 10 min. The resulting pellet was re-suspended in 0.5 mL SpermWash ® (Gynotec Sperm wash, Fertitech Canada Inc., Saint-Laurent, QC, Canada) for a post-wash analysis of sperm quality parameters and to calculate the number of motile spermatozoa inseminated (NMSI).
Intrauterine insemination (IUI) was performed 35–39 h after the ovulation trigger, using an insemination catheter (Mini space ® , CCD, CooperSurgical, Toronto, ON, Canada). To support the luteal phase and promote implantation following IUI, patients were instructed to take 200 mg micronized progesterone (Prometrium ® , Merck Canada Inc., Kirkland, QC, Canada) daily for 15 days following the procedure until 8 weeks of pregnancy. Patients under natural cycles or oral agents alone did not receive a supplementation regimen. Confirmation of pregnancy occurred two weeks post IUI through a patient-reported urine pregnancy test. Subsequently, an ultrasound was conducted at 7 weeks to validate the clinical pregnancy, which was considered to be the main outcome of the model.
To ensure the dataset’s consistency and suitability for analysis, we excluded cycles with data missing from three or more features. If only one or two features were missing, the feature’s median or mode was used to replace the missing value, as proposed by some authors [ 15 ]. Each cycle was associated with a label indicating whether the cycle resulted in clinical pregnancy, serving as the target variable for the predictive model ( Figure 1 ).
Next, we tested six normalization methods (i.e., scale, normalization, robust scale, min–max, standard scaler, and PowerTransformer) to develop our ML model. The PowerTransformer yielded superior results by effectively transforming the data, aligning its distribution more closely with a Gaussian distribution, and was selected for further analysis [ 17 ]. The machine learning model was implemented in Python 3.11 using Scikit-learn for normalization [ 18 ].
The study dataset had four discrete, sixteen continuous, and one categorical variable/s (Supplementary Table S1) . As the majority of machine learning algorithms are designed to handle only continuous or discrete variables, the categorical variables underwent one-hot encoding, transforming them into discrete variables. This approach created binary values for each category, providing input information for our model [ 19 ].
The dataset was split into a training set (70% of the dataset; 6644 cycles from 2428 patients) and a testing set (30% of the dataset; 2856 cycles from 1041 patients) ( Figure 1 ). Given that some couples underwent several IUI cycles, a stratified four-fold cross-validation was employed to avoid the overrepresentation of cycles from the same couple in each set (training or test). This approach balanced the data into four unique subsets of the same size. To optimize the models’ performance and improve robustness, we trained and validated each model on various combinations of preliminary hyperparameters with a Random Search [ 20 ]. For each combination, we used one of the datasets for testing and the remaining three for training. Finally, the average performance of the four models was recorded.
The performance of seven ML classification algorithms, including AdaBoost [ 21 ], Linear SVM [ 22 ], Kernel SVM [ 23 ], Random Forest [ 24 ], Extreme Forest [ 25 ], and Bagging [ 26 ] and Voting classifiers [ 27 ] was evaluated using the training set and four-fold cross-validation. These models were compared using the Scikit-learn library [ 18 ] to identify the model with the best performance. Model performance was quantified regarding the area under the curve (AUC) and ranked according to the model’s accuracy in predicting pregnancy following IUI.
Data patterns identified by predictive ML classifiers are often difficult to interpret as most classifiers are black boxes. However, the importance of the features used by the classifier can be ranked using recursive feature elimination (RFE) [ 28 ]. Given a classifier that assigns weights to features (e.g., Linear SVM), RFE selects the stronger features by recursively considering smaller and smaller sets of features. In this case, the Linear SVM was initially trained on all 21 features, and the weight of each feature was ranked using the feature importance attribute of the Linear SVM. Weaker features were eliminated one at a time until only one feature was left, and the model’s accuracy was improved. This approach identified the four features that are sufficient to predict a positive pregnancy outcome following IUI with maximum accuracy.
To ensure transparency and support reproducibility, the full-analysis scripts are available upon request. Interested researchers may obtain the code by contacting the first author via email at:
[email protected] .