<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Detecting anomalous methane in groundwater within hydrocarbon production areas across the United States</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>07/01/2021</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10347105</idno>
					<idno type="doi">10.1016/j.watres.2021.117236</idno>
					<title level='j'>Water Research</title>
<idno>0043-1354</idno>
<biblScope unit="volume">200</biblScope>
<biblScope unit="issue">C</biblScope>					

					<author>Tao Wen</author><author>Mengqi Liu</author><author>Josh Woda</author><author>Guanjie Zheng</author><author>Susan L. Brantley</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[Numerous geochemical approaches have been proposed to ascertain if methane concentrations in groundwater, [CH4], are anomalous, i.e., migrated from hydrocarbon production wells, rather than derived from natural sources. We propose a machine-learning model to consider alkalinity, Ca, Mg, Na, Ba, Fe, Mn, Cl, sulfate, TDS, specific conductance, pH, temperature, and turbidity holistically together. The model, an ensemble of sub-models targeting one parameter pair per sub-model, was trained on groundwater chemistry from Pennsylvania (n=19,086) and a set of 16 analyses from putatively contaminated groundwater. For cases where [CH4] > 10 mg/L, salinity-and redox-related parameters sometimes show that CH4 may have moved into the aquifer recently and separately from natural brine migration, i.e., anomalous CH4. We applied the model to held-out data for Pennsylvania (n=4,786) and groundwater data from three other gas-producing states: New York (n=203), Texas (n=688), and Colorado (n=10,258). The applications show that 1.4%, 1.3%, 0%, and 0.9% of tested samples in these four states, respectively, have high [CH4]     and are >50% likely to have been impacted by gas migrated from exploited reservoirs. If our approach is indeed successful in flagging anomalous CH4, we conclude that: i) the frequency of anomalous CH4 (# flagged water samples / total samples tested) in the Appalachian Basin is similar in areas where gas wells target unconventional as compared to conventional reservoirs, and ii) the frequency of anomalous CH4 in Pennsylvania is higher than in Texas + Colorado. We cannot, however, exclude the possibility that differences among regions might be affected by differences in data volumes. Machine learning models will become increasingly useful in informing decisionmaking for shale-gas development.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Introduction</head><p>If natural gas production in the United States (US) doubles from 2000 to 2050 as expected, shale gas production will account for more than three-quarters of this natural gas production (U.S.</p><p>Energy Information <ref type="bibr">Administration, 2018)</ref>. This development is largely driven by the combined usage of high-volume hydraulic fracturing and horizontal drilling (U.S. Energy Information <ref type="bibr">Administration, 2018)</ref>. Other countries and regions (e.g., China, Canada, Middle East) are also ramping up their natural gas production from newly discovered technically recoverable shale reserves (U.S. Energy Information Administration, 2017). In the meantime, putative incidents of deterioration of water quality caused by shale gas development have been investigated throughout the US <ref type="bibr">(Brantley et al., 2014;</ref><ref type="bibr">Darrah et al., 2014;</ref><ref type="bibr">Guo et al., 2014;</ref><ref type="bibr">Nicot and Scanlon, 2012;</ref><ref type="bibr">Vidic et al., 2013;</ref><ref type="bibr">Wen et al., 2019b</ref><ref type="bibr">Wen et al., , 2019a;;</ref><ref type="bibr">Woda et al., 2018;</ref><ref type="bibr">Yang et al., 2013)</ref>, where it is not rare to see that hydrocarbon wells show signs of compromised well integrity <ref type="bibr">(Lackey et al., 2021)</ref>.</p><p>Proving that contamination was caused by shale gas development activities is always difficult, and estimating the frequency of problems is even more problematic. However, for the public to make decisions about granting social license for shale gas development requires some information about the frequency of problems. In this paper we explore the use of a machine learning model on large groundwater datasets from one region to see if such data-driven models can be used in other regions to assess incidents of contamination.</p><p>We developed the model by application to data from Pennsylvania (PA), the state in the US with the longest history of conventional oil/gas (OG) drilling and coal mining. PA has become a leading area for shale gas production through use of horizontal drilling and high-volume hydraulic fracturing to extract gas and liquids from the Marcellus and Utica shales. The contaminant that has been identified as the most common problem in PA is methane (CH4), the chief component of natural gas <ref type="bibr">(Brantley et al., 2014)</ref>. Many studies investigating groundwater quality in shale gas basins have focused on contamination by such anomalous CH4 <ref type="bibr">(Hammond, 2016;</ref><ref type="bibr">Hammond et al., 2020;</ref><ref type="bibr">Li and Carlson, 2014;</ref><ref type="bibr">Molofsky et al., 2013;</ref><ref type="bibr">Nicot et al., 2017c;</ref><ref type="bibr">Osborn et al., 2011;</ref><ref type="bibr">Sherwood et al., 2016;</ref><ref type="bibr">Siegel et al., 2015a;</ref><ref type="bibr">Wen et al., 2017</ref><ref type="bibr">Wen et al., , 2016))</ref>. Here 'anomalous CH4' is used to denote dissolved or free-phase CH4 found in groundwater that putatively derived from the effects of recent human activities related to shale gas development. In general, naturally occurring CH4 may have long affected an aquifer whereas anomalous CH4 represents a new source at the impacted site.</p><p>The identification of new (anomalous) CH4 is difficult at least partly because naturally occurring CH4 is common in many basins, including in PA groundwater <ref type="bibr">(Baldassare et al., 2014;</ref><ref type="bibr">Siegel et al., 2015b;</ref><ref type="bibr">Wen et al., 2019b)</ref>. In a limited number of areas, the causes of elevated CH4 in groundwater have been attributed to OG production activities (conventional or unconventional) <ref type="bibr">(Darrah et al., 2014;</ref><ref type="bibr">Grieve et al., 2018;</ref><ref type="bibr">Hammond, 2016;</ref><ref type="bibr">Hammond et al., 2020;</ref><ref type="bibr">Jackson et al., 2013;</ref><ref type="bibr">Osborn et al., 2011;</ref><ref type="bibr">U.S. Environmental Protection Agency, 2015;</ref><ref type="bibr">Warner et al., 2012;</ref><ref type="bibr">Wen et al., 2019b;</ref><ref type="bibr">Woda et al., 2018)</ref>. Identification of anomalous versus natural CH4 in groundwater often relies on measurement of carbon isotopes in the gas (e.g., <ref type="bibr">Baldassare et al., 2014;</ref><ref type="bibr">Jackson et al., 2013)</ref>, but this is somewhat expensive and seldomly definitive. Researchers have also sometimes used other hydrogeochemical patterns to identify anomalous CH4. For example, the migration of natural CH4 from deeper formations into shallow groundwater in the Appalachian Basin is often accompanied by salt-containing waters, which leads to slightly elevated salt contents in the shallow aquifer and distinctive chemical signatures <ref type="bibr">(Siegel et al., 2015a</ref><ref type="bibr">(Siegel et al., , 2015b;;</ref><ref type="bibr">Warner et al., 2012;</ref><ref type="bibr">Wen et al., 2019b)</ref>. Therefore, major and trace elements (e.g., calcium, sodium, and bromide) <ref type="bibr">(Brantley et al., 2014;</ref><ref type="bibr">Cantlay et al., 2020b;</ref><ref type="bibr">Grieve et al., 2018;</ref><ref type="bibr">Lu et al., 2015;</ref><ref type="bibr">McMahon et al., 2017b;</ref><ref type="bibr">Schout et al., 2018;</ref><ref type="bibr">Warner et al., 2012;</ref><ref type="bibr">Wen et al., 2019b;</ref><ref type="bibr">Woda et al., 2018)</ref> have been proposed to distinguish varying sources of subsurface fluids. In addition, electron acceptors can be reduced (e.g., SO4 can be reduced to sulfide) by bacteria that use CH4 as an electron donor <ref type="bibr">(McMahon et al., 2017b;</ref><ref type="bibr">Schout et al., 2018;</ref><ref type="bibr">Van Stempvoort et al., 2005;</ref><ref type="bibr">Woda et al., 2018)</ref>. The concentration of sulfate in waters has sometimes been used to detect anomalous CH4 as it is easier to collect and analyze water samples for sulfate than sulfide. Other tracers were also proposed recently to detect anomalous CH4 in groundwater, e.g., strontium isotopes <ref type="bibr">(Warner et al., 2012;</ref><ref type="bibr">Woda et al., 2018)</ref>, lithium and boron isotopes <ref type="bibr">(Warner et al., 2014)</ref>, and noble gas isotopes <ref type="bibr">(Darrah et al., 2015</ref><ref type="bibr">(Darrah et al., , 2014;;</ref><ref type="bibr">Wen et al., 2017</ref><ref type="bibr">Wen et al., , 2016;;</ref><ref type="bibr">Woda et al., 2018)</ref>. These latter isotopic tools require a high level of expert knowledge and advanced (and expensive) analytical facilities to ensure proper data acquisition and interpretation. Such characteristics so far have prevented these tracers from being applied widely for monitoring of baseline water quality in the area of shale gas production. Among these hydrogeochemical tracers, no single parameter is characteristic of a particular source for anomalous CH4 <ref type="bibr">(Cantlay et al., 2020b)</ref>. In past studies determining the attribution of anomalous CH4, bivariate plots were often used, in which the dependent and independent variables are generally concentrations of hydrogeochemical parameters (e.g., chloride) and/or concentration ratios (e.g., Ca/Na). No single bivariate plot has been suggested that provides definitive answers about whether anomalous CH4 is present. Instead, the source of elevated CH4 is more likely to be identified through a combination of parallel bivariate plots <ref type="bibr">(Cantlay et al., 2020b;</ref><ref type="bibr">Wen et al., 2019b;</ref><ref type="bibr">Woda et al., 2018)</ref>.</p><p>We wanted to test machine learning approaches to identifying anomalous CH4 in multiple shale gas plays. Logistic Regression (LR), introduced in the late 1980s <ref type="bibr">(McCullagh and Nelder, 1989)</ref>, is a type of machine learning algorithm used to make dichotomous prediction (e.g., whether the dissolved CH4 concentration is higher or lower than a threshold value). LR has been used in environmental science to predict the presence of certain redox-sensitive contaminants in groundwater, e.g., arsenic <ref type="bibr">(Ayotte et al., 2016)</ref>, nitrate <ref type="bibr">(Nolan et al., 2002)</ref>, and the redox state <ref type="bibr">(Tesoriero et al., 2015)</ref>. LR was also used to predict the probability of CH4 occurrence in aquifers in Alberta (Canada) <ref type="bibr">(Humez et al., 2019)</ref>. In these studies, a LR model was built based on a few selected categorical or continuous variables. No interactions between variables were explicitly considered. For example, <ref type="bibr">Humez et al. (2019)</ref> used sulfate and total dissolved solids as input variables to predict the presence of CH4, but no concentration ratios of these variables were ever considered. Recognizing that the concentrations of chemical constituents in groundwater are prone to differences in the baseline effects of local geology, topography, and hydrology, we suspected that the exclusion of concentration ratio variables in these previously used models largely hampered investigators' ability to generalize the models and findings to other areas. In addition, in the above-mentioned studies, all variables were fed into a single LR model to generate the final dichotomous prediction, and this made it difficult to completely understand how each variable contributed to the prediction.</p><p>In this study, we developed an ensemble LR model trained on data <ref type="bibr">(Shale Network, 2015)</ref> from the northern Appalachian Basin in PA. Each sub-model focusses on a pair of hydrogeochemical parameters. More complex classifiers like Random Forest or XGBoost <ref type="bibr">(Chen and Guestrin, 2016)</ref> were not used because their outputs are harder to explicitly interpret and visualize. We considered predictor features themselves and their interactions. We then explored use of the refined ensemble model on additional held-out hydrogeochemistry data from PA and other data from New York, Texas, and Colorado (Figures 1). To the best of our knowledge, this study is the first to apply an ensemble LR model to predict whether CH4 in groundwater is anomalous or natural. With the improved availability of hydrogeochemistry data, such a prediction model could be potentially beneficial for other areas in the US and even for other countries/regions with existing or planned OG production. Although we do not have definitive evidence for which groundwater samples in each basin are affected by anomalous methane, we validated the model against a dataset of 13 sites with high [CH4] presumed to be caused by gas development activity and 1 site with high [CH4] thought to be unaffected by anthropogenic activities. We also explored the model by testing it against the following hypotheses we derived from the literature: i) the frequency of detection of anomalous methane (# impacted water samples / total water samples tested) in the Appalachian Basin is greater where gas wells target unconventional as compared to conventional reservoirs <ref type="bibr">(Brantley et al., 2014;</ref><ref type="bibr">Ingraffea et al., 2014)</ref>, and ii) the frequency of detection of anomalous methane in groundwater in the Marcellus/Utica shale play is higher than in western shale plays such as those in Texas and Colorado (e.g., <ref type="bibr">Brantley et al., 2014;</ref><ref type="bibr">Hammond et al., 2020;</ref><ref type="bibr">McMahon et al., 2017a;</ref><ref type="bibr">Sherwood et al., 2016;</ref><ref type="bibr">Woda et al., 2018)</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Methods and Materials</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Groundwater Quality Data Used in Model Development and Application</head><p>We collated groundwater chemistry analyses from shale plays that are some of the largest in the U.S. and that also are associated with large groundwater datasets: the Appalachian Basin within <ref type="bibr">Pennsylvania (n=23,858;</ref><ref type="bibr">Shale Network, 2015)</ref>; the Fort Worth, TX-LA-MS Salt, and Western Gulf basins within Texas (n=688; <ref type="bibr">Darvari et al., 2017;</ref><ref type="bibr">Nicot et al., 2017a</ref><ref type="bibr">Nicot et al., , 2017b</ref><ref type="bibr">Nicot et al., , 2017c))</ref>; and the Denver-Julesburg, Raton, San Juan, Paradox, Uinta-Piceance, Greater Green, and North Park basins within Colorado (n=10,258; <ref type="url">https://cogcc.state.co.us/</ref>). We decided not to include some shale plays such as the Fayetteville shale in Arkansas in our study because 1) that play has shown little evidence for gas migration <ref type="bibr">(McMahon et al., 2017a;</ref><ref type="bibr">Warner et al., 2013)</ref>; 2) we were unaware of a large dataset of groundwater chemistry for analysis; and 3) this region is not one of the major shale gas production areas. The samples we analyzed were compiled from a variety of data sources (Figures 1; Table <ref type="table">1</ref>). A relatively small dataset of groundwater quality in the counties of New York (n=203; <ref type="bibr">Christian et al., 2016)</ref> that neighbor Pennsylvania was also tested for comparison because it represents a region of long-standing exploitation of conventional but not unconventional hydrocarbon reservoirs. More detailed descriptions of these datasets and sources are included in the supporting information. Upon publication of this work, all datasets discussed in this study will be released at: <ref type="url">https://doi.org/XXXXXXXX</ref>. We trained the model to a set of 19,102 groundwater sample analyses that included a small set of groundwater quality data compiled from sites that are presumed to have been impacted by anomalous CH4. We then used an additional subset of analyses from such putatively contaminated samples to validate the model performance. Samples are referred to here as putatively contaminated when they were reported to be contaminated in published journal articles or government reports based on field and laboratory investigations <ref type="bibr">(Llewellyn et al., 2015;</ref><ref type="bibr">U.S. Environmental Protection Agency, 2015;</ref><ref type="bibr">Wen et al., 2019b;</ref><ref type="bibr">Woda et al., 2018)</ref>. These data were divided into a set for training (n=16) [from Granville Road and Paradise Road (Bradford Co.), and Gregs Run (Lycoming Co.)] and a set for validation (n=13) <ref type="bibr">[from Paradise Road (Bradford Co.)</ref> and Sugar Run <ref type="bibr">(Lycoming Co.)</ref>]. An additional sample of a well-known brine spring that is naturally CH4-rich from northern PA was also used as part of the validation dataset. Sites were largely determined to be putatively contaminated based on temporal changes in methane concentration, carbon isotope data in collected water samples, and geological investigations.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Predictor Features Used in the Model</head><p>We strove to develop a machine learning-based ensemble model that could use geochemical analyses to quantify the likelihood that a groundwater sample with dissolved CH4 had been impacted by anomalous rather than natural CH4. A total of 118 geochemical parameters were considered as potential "predictor features" in the model. In other words, these features were tested for their ability to predict if CH4 in a given sample was anomalous or natural. These predictor features divide into three main sub-categories discussed in the next paragraphs. Detailed descriptions of these predictor features can also be found in the supporting information.</p><p>Data for many of the concentrations were beneath detection (i.e., censored). For example, many of the CH4 concentrations (31.1%) were censored (i.e., below reporting limits). To maximize the number of measurements for each feature, we chose the fifteen geochemical parameters for which the percent of non-censored measurements was &gt;31.1%. These 15 features are referred to as 'Single Geochemical Features' or 'SGF' in Table <ref type="table">2</ref>. These 15 water quality parameters were reported in the training data from PA (Shale Network, 2015) with over 10,000 measurements each (Bicarbonate Alkalinity -Alk, Calcium -Ca, Chloride -Cl, Magnesium -Mg, Sodium -Na, Sulfate or SO4 2--SO4, Total Dissolved Solids -TDS, Barium -Ba, Iron -Fe, Manganese -Mn, pH, Hydrogen Ion -H, Specific Conductance -SC, Temperature -Temp, and Turbidity. Specific conductance of a water solution is a measure of its ability to conduct electricity. Turbidity is a measure of the degree to which the water solution has lost transparency due to the presence of suspended particulates. pH was considered in addition to hydrogen ion concentration because pH, the more commonly reported term, is a calculated parameter [pH = -log (hydrogen ion concentration)] that is not directly comparable to the other concentrations.</p><p>The second and third sub-categories of predictor features are the reciprocals of the concentrations of all the SGF except for pH and water temperature (n=13; 'Reciprocal Feature'), and the ratios of any two SGF ('Ratio Features'). Ratio features were calculated for all features except for pH, H + , SC, water temperature, turbidity (n=90). The inclusion of features in the second and third categories was motivated by the observation that these two types of arithmetic combinations of geochemical parameters have been widely used by geoscientists in tracing the source of solutes in groundwater because they can represent stoichiometric coefficients in the governing geochemical reactions (e.g., <ref type="bibr">Bau et al., 2004;</ref><ref type="bibr">Brantley et al., 2014;</ref><ref type="bibr">Cantlay et al., 2020d</ref><ref type="bibr">Cantlay et al., , 2020a</ref><ref type="bibr">Cantlay et al., , 2020c;;</ref><ref type="bibr">Tisherman and Bain, 2019)</ref>. Furthermore, we reasoned that the stoichiometries of these geochemical reactions need not be restricted to one hydrocarbon basin alone, and thus might be more predictive across basins. Subtraction and multiplication of SGF were not considered because, unlike ratios, there are no known fundamental reasons why such functions should be predictive.</p><p>A machine learning model using only geochemical predictor features allows us to focus on assessing the interplay of geochemical parameters as well as their relative importance in determining whether the elevated [CH4] present in groundwater samples is likely to represent anomalous CH4. Therefore, no non-geochemical features (e.g., land use and bedrock geology) were considered in this study.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Machine Learning-based Ensemble Model</head><p>Our workflow included sequential phases: ensemble model development (which included training), validation, and application (Figure <ref type="figure">2</ref>). Taking two parameters from the 118 parameters at a time without repetition yields a total number of 6,903 pair combinations. We started with these 6,903 possible geochemical pairs that were each tested in a sub-model. The process of model development described in the next paragraphs identified the subset of 6,903 predictor pairs that were most successful in determining the likelihood of a groundwater sample being impacted by anomalous CH4. The likelihood was calculated as the ratio of the number of sub-models flagging the CH4 as not being naturally derived (and therefore, putatively, "anomalous") divided by the total number of models considered. The collection of sub-models is termed here the ensemble model.</p><p>At the stage of ensemble model development (green in Figure <ref type="figure">2</ref>), sub-models using the full list of 118 geochemical features paired into 6,903 predictors were trained on 19,102 analyses referred to as training data (Table <ref type="table">1</ref>; Figure <ref type="figure">2</ref>). Each of the 6,903 sub-models (Figure <ref type="figure">2</ref>) considers only one pair of predictor features. In effect, each sub-model imitates the traditional procedure of using bivariate plots of geochemical variables to investigate the origin of dissolved CH4 in groundwater [see, for example, Figure <ref type="figure">S10</ref> in <ref type="bibr">Woda et al. (2018)</ref>]. The performance of each submodel was evaluated with respect to two tasks. First, it was evaluated for its ability to predict whether the [CH4] is above or below the threshold identified as potentially problematic, 10 mg/L, in the 19,086 water samples (Task 1). Given that these samples were collected by professional consultants working for gas companies before drilling gas wells within a few kilometers of the water wells, the waters could be contaminated or uncontaminated by CH4 from previous oil/gas activity, but we have no outside evidence of contamination. We hypothesized that successful submodels would predict [CH4] &lt; 10 mg/L for samples reported to have [CH4] &#8805;10 mg/L. We inferred these samples are impacted by anomalous CH4. This approach is implicitly built on the assumption that natural high-[CH4] waters are chemically distinct from anomalous high-[CH4] waters.</p><p>However, we acknowledge that our method will not detect anomalous methane in waters with very low values of [CH4]. In Task 2, each sub-model was additionally evaluated to see if it successfully identified the CH4 in 16 of the putatively contaminated training samples as anomalous (Task 2).</p><p>The concentration of 10 mg/L was selected because it is a threshold above which immediate action is needed <ref type="bibr">(Eltschlager et al., 2001;</ref><ref type="bibr">Wen et al., 2019b)</ref>.</p><p>During ensemble model development (green in Figure <ref type="figure">2</ref>), a linear classifier -logistic regression (LR) -is used in the two tasks with 5-fold cross-validation. LR is generally used to solve binary classification problems. With LR, the relationship between predictor features and the prediction outcome can be described by a sigmoidal function as illustrated by Equation (1) in which x represents predictor features and y is the binary model output of 0 ([CH4] &lt;10 mg/L) or 1</p><p>In the training, the sub-model allows optimization of w and b to best predict the training data.</p><p>Once w and b are optimized, each sub-model can be used in Task 1 to predict which groundwater samples are characterized by [CH4] &#8805; 10 mg/L. For this task, Area Under the Curve (AUC) is considered as the performance metric where a higher AUC value indicates higher accuracy of prediction. AUC, in particular, was chosen as the accuracy measure as it holistically evaluates the model performance in predicting both positive (i.e., high methane sample) and negative (i.e., low methane sample) results.</p><p>In Task 2 the sub-model was applied to 16 putatively contaminated samples. F1 score was calculated following Equation (2) as the performance metric:</p><p>Here recall is defined as the proportion of the 16 samples identified correctly while precision is the proportion of predicted anomalous CH4 samples that are actually contaminated. F1 score was chosen to prioritize maximizing true positives (i.e., known problematic samples correctly identified) as it does not consider true negatives (i.e., known natural samples correctly identified).</p><p>Both Tasks 1 and 2 were used to identify the best ensemble model to detect anomalous CH4 in impacted waters. Samples reported to have high [CH4] that were incorrectly classified as low [CH4] samples by sub-models in Task 1 were inferred to have been impacted by anomalous CH4.</p><p>We chose sub-models with higher accuracy of prediction in Task 1 to yield a lower number of false positives. To evaluate the performance of each sub-model for both Tasks 1 and 2, we defined a synthesized metric, namely, 0.7 x F1 score + 0.3 x AUC. The selection of coefficients 0.7 and 0.3 is not entirely arbitrary. We assigned the higher weight (0.7) to F1 as that task is more critical.</p><p>All sub-models (and the associated pair of features; n=6,903) were ranked by the final synthesized score. We also completed a sensitivity test of the coefficients (Table <ref type="table">S1a</ref> and<ref type="table">S1b</ref>) and determined that feature members in the top feature list (e.g., top 20) are mostly unchanged (e.g., SC, Na, Cl/SO4), although the exact rank of features by frequency changes to a limited extent.</p><p>In the phases of model validation and application, the prediction results for the best performing sub-models were used to estimate the likelihood of impact of groundwater samples by anomalous CH4 (Figure <ref type="figure">2</ref>). This likelihood was defined as the percentage of considered sub-models that classified the sample as impacted by anomalous CH4. We calculated four types of likelihood for each water sample using the best n sub-models where we explored n = 100, 200, 500 as well as 1,000. We ultimately chose n = 1,000 to be conservative. The selection of n =1,000 is supported by the observation that (1) an ensemble model with fewer sub-models would be more likely to be biased towards a few geochemical parameters (e.g., the ensemble model for n = 100 was observed to be highly biased towards SC as discussed in the text below) and (2) an ensemble model with a larger number of sub-models (e.g., n = 1,000) was expected to assess water chemistry more holistically, improving model applicability and performance for new datasets with less likelihood of overfitting.</p><p>In this study, the ensemble model was trained and validated with hydrogeochemistry data in Pennsylvania (i.e., Marcellus shale) and then was tested in other natural gas production regions in Colorado, Texas, and New York. Differences in bedrock geology, regional hydrogeochemistry, topography, and land use between testing and training/validation datasets might in some cases hamper the applicability of the developed ensemble model. We strove to minimize this issue by considering interactions of ratios of concentrations of single geochemical features as these concentration ratios tend to yield less variability across different regions. As more hydrogeochemical data become available, in particular from presumably contaminated sites, the ensemble model can be further validated and even re-trained with new data.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Results and Discussion</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Model Development</head><p>Two statistical methods -Pearson correlation and Spearman's rank correlation -were adopted to assess the pairwise correlation of the 15 single geochemical features in predicting the target feature, [CH4]. The Pearson correlation is used to evaluate linear relationships between continuous variables that are assumed to obey normal distributions, while the Spearman's rank correlation is used to evaluate monotonic relationships between two continuous variables without the requirement that variables are normally distributed. Therefore, the Spearman's rank correlation identifies more pairs of features that report statistically significant correlations (p &lt; 0.05) compared to the Pearson correlation (Figure <ref type="figure">3</ref>).</p><p>The pairwise correlations led us to note three groups for the fifteen single geochemical features: 1) salinity-related (Alk, Ba, Ca, Cl, Mg, Na, TDS, SC); (2) redox-sensitive (Fe, Mn, and SO4); and (3) other (pH, Temp, Turbidity, and H + ). These groupings are used to categorize the best-performing sub-models in subsequent discussions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>General Observations</head><p>The synthesized scores of all sub-models (n=6,903) are listed and ranked in Table <ref type="table">S1a</ref>. The best performing sub-model (synthesized score = 0.9579, F1 = 0.9677, AUC = 0.9350) corresponds to the pair, 1/SC and Ca/Ba (Table <ref type="table">S1a</ref>). From this observation we inferred that salinity is an effective tool to detect anomalous CH4 samples (SC, Ca, and Ba are all salinity-related features).</p><p>Previous studies (e.g., <ref type="bibr">Brantley et al., 2014;</ref><ref type="bibr">Cantlay et al., 2020c;</ref><ref type="bibr">Tisherman and Bain, 2019;</ref><ref type="bibr">Wen et al., 2019b;</ref><ref type="bibr">Woda et al., 2020</ref><ref type="bibr">Woda et al., , 2018) )</ref> have also identified other salinity-related parameters (Cl, Ca/Na, Mg/Na, Ca/Mg, and Ba/Cl) that are helpful in detecting anomalous CH4 in groundwater samples or distinguishing chemical signatures of produced waters from shale gas development from other types of contamination. These same parameters, i.e., Cl, Ca/Na, Mg/Na, Ca/Mg, and Ba/Cl, show up in sub-models ranked as high as 8 th , 13 th , 19 th , 82 nd , and 191 st (Table <ref type="table">S1a</ref>), respectively. Furthermore, the frequency of inclusion of these features in the top 1000 sub-models are 87, 4, 2, 11, and 8, respectively (Table <ref type="table">S1b</ref> and<ref type="table">Figure</ref>  <ref type="figure">4</ref>). In addition to the salinity-related parameters mentioned by previous authors, a few new ones were identified as important (i.e., high frequency) in the top 1,000 performance sub-models, e.g., Ca/TDS (49) and Ba/Alk (81) (Table <ref type="table">S1b</ref>). These salinity-related features can effectively distinguish natural migration of thermogenic CH4 from anomalous CH4 presumably because CH4 often migrates naturally with salt-containing Appalachian Basin brine into shallow groundwater (e.g., <ref type="bibr">Warner et al., 2012;</ref><ref type="bibr">Wen et al., 2019b;</ref><ref type="bibr">Woda et al., 2018)</ref>. Alkalinity may appear because it increases during sulfate reduction, one of the redox processes (see next paragraph) that sometimes couple to methane oxidation <ref type="bibr">(Woda et al., 2018)</ref>.</p><p>In addition to salinity, redox-sensitive features (e.g., Fe/SO4, SO4/Na) are also frequently found in the top performing sub-models (Table <ref type="table">S1</ref>, and Figure <ref type="figure">4</ref>). For example, SO4 and Fe concentrations have previously been used to detect anomalous CH4 in groundwater <ref type="bibr">(Wen et al., 2019b;</ref><ref type="bibr">Woda et al., 2020</ref><ref type="bibr">Woda et al., , 2018) )</ref> and the frequency of SO4-containing and Fe-containing features (e.g., Fe/SO4) appearing in the top 100 sub-models are 17 and 10, respectively. It is worth noting that many SO4-or Fe-containing features also incorporate salinity-related features, e.g., SO4/Na and Fe/Ba. Redox features are expected because the presence of CH4 creates an anoxic environment that in turn promotes reduction of redox-sensitive species such as sulfate (SO4 2-) to sulfide (S 2-) and Fe(III) to Fe(II). The formation of sulfide leads to precipitation of metal sulfide and a decrease in SO4 and Fe concentrations over time <ref type="bibr">(Woda et al., 2020</ref><ref type="bibr">(Woda et al., , 2018))</ref>. Low concentrations of all of these redox-sensitive parameters are expected when the source of CH4 is natural and the groundwater has had a relatively long time to reach thermodynamic equilibrium.</p><p>In contrast, when anomalous CH4 migrates into shallow, oxygenated groundwater, months can pass before the water reaches chemical equilibrium, allowing the co-existence of transiently high methane, sulfate, and iron in the same water samples that can be detected during the transient <ref type="bibr">(Wen et al., 2019b;</ref><ref type="bibr">Woda et al., 2020</ref><ref type="bibr">Woda et al., , 2018))</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Specific Observations</head><p>Best performing features are summarized for the top 100, 200, 500, and 1,000 models in Figure <ref type="figure">4</ref> and the likelihood of the presence of anomalous CH4 in groundwater is calculated for all of these four top lists in the following sections. It is clear that in the first two lists (i.e., top 100, 200), the frequency of SC-containing features (SC and 1/SC) dominate over the other top features.</p><p>So, if the likelihood of groundwater samples being impacted by anomalous CH4 is calculated from an ensemble model considering only the top 100 (or 200) features, the calculated likelihood will be largely biased towards SC. Two more features (Na and Cl) are reported with high frequency in the top 500 list, but the calculated likelihood of groundwater samples being impacted by anomalous CH4 still depends strongly on the salinity features SC, Na, and Cl. To holistically assess groundwater chemistry and to be more conservative, we focus the most extensive discussion mainly about the results based on the list for the top 1,000 (the "top 1,000 model", Figure <ref type="figure">4</ref>).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Model Validation</head><p>After training with the use of putatively contaminated sample data (n = 16), the top 1,000 submodels were validated against another groundwater quality dataset of 14 high-[CH4] groundwater samples from northeastern or central PA. All were reported with [CH4] &#8805;10 mg/L. Of these, 13 were reported for 4 sites putatively impacted by anomalous CH4 <ref type="bibr">(Llewellyn et al., 2015;</ref><ref type="bibr">Wen et al., 2019b;</ref><ref type="bibr">Woda et al., 2018)</ref>. The likelihood of contamination was &gt;90% for each of these 13 validation samples (Tables <ref type="table">3</ref> and<ref type="table">S2</ref>) by the ensemble model using the top 1,000 sub-models. This suggests that the ensemble model has high sensitivity (i.e., high recall rate), i.e., the model is very effective in detecting anomalous CH4 in groundwater samples (true positives). The 14 th sample that we used for validation was groundwater from Salt Spring State Park in northern PA. That spring sample is known to contain naturally occurring CH4 with [CH4] &gt; 10 mg/L ('Salt Spring State Park' in Table <ref type="table">S2</ref>). The predicted likelihood that this groundwater sample is impacted by anomalous CH4 is 14%, which means that the ensemble model predicts that this sample is likely not contaminated by anomalous CH4 (i.e., a true negative). Thus, the proposed ensemble model is very effective in distinguishing whether high [CH4] in groundwater is naturally occurring (e.g., &lt;20% likelihood) or anomalous (e.g., &gt;90% likelihood).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Model Application</head><p>We now apply this ensemble model to the hold-out Pennsylvania data (data not incorporated in the training dataset) as well as groundwater data from other states (Figure <ref type="figure">5</ref>) to seek to detect anomalous CH4 in other groundwater samples as a way to explore our two hypotheses and to compare to previous research <ref type="bibr">(Christian et al., 2016;</ref><ref type="bibr">Darvari et al., 2017;</ref><ref type="bibr">Nicot et al., 2017a</ref><ref type="bibr">Nicot et al., , 2017b</ref><ref type="bibr">Nicot et al., , 2017c;;</ref><ref type="bibr">Sherwood et al., 2016;</ref><ref type="bibr">Wen et al., 2019b</ref><ref type="bibr">Wen et al., , 2018))</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Pennsylvania Hold-out Data</head><p>A total of 4,772 groundwater samples from the Shale Network database are in the Pennsylvania hold-out dataset. Among these, only 64 show both [CH4] &#8805; 10 mg/L as well as measurements for all the single predictor features. These 64 groundwater samples are all located in northeastern PA (Figures <ref type="figure">5</ref> and<ref type="figure">6</ref>; Table <ref type="table">S3</ref>). The top 1,000 model predicts that 29 of these 64 groundwater samples show a &gt;50% likelihood and, of these, 13 show &#8805;80% likelihood of being impacted by anomalous CH4 (Figures <ref type="figure">5</ref> and<ref type="figure">6</ref>; Table <ref type="table">S3</ref>).</p><p>To assess the efficacy of the ensemble model for Pennsylvania, we compare the machine learning results to the results based on a more simplified and streamlined approach by <ref type="bibr">Wen et al. (2019b)</ref>. Based on six selected geochemical parameters (CH4, Cl, Ca, Na, Fe, and sulfate concentration), <ref type="bibr">Wen et al. (2019b)</ref> categorized groundwater samples into five geochemical types.</p><p>Their type 4 and 5 waters were considered to the most likely to be impacted by anomalous CH4: their characteristics include Ca/Na mass ratio &#8805;0.52, Cl &#8804;30 mg/L, [CH4] &#8805;10 mg/L, and disequilibrated Fe concentrations (&#8805;0.3 mg/L) and/or dis-equilibrated sulfate concentration (&#8805; 6 mg/L). Using this simplified workflow from <ref type="bibr">Wen et al. (2019b)</ref>, we identified a total of 17 samples of types 4 or 5 in the hold-out PA dataset. Ten of these 17 samples were used to train the ensemble model and five were not considered by the ensemble model because they lacked values for all of the 15 geochemical features. The remaining two analyses (sample IDs are "PADEP_Predrill_CHK_827" and "PADEP_Predrill_Bradford-Burlington_T_005-well"; Table <ref type="table">S3</ref>) were detected accurately (true positives) by the top 1,000 model as showing a high likelihood of impact by anomalous CH4.</p><p>In addition to the two samples detected by both the ensemble model in this study as well as by <ref type="bibr">Wen et al. (2019b)</ref>, the ensemble model also identified 27 other samples with a predicted likelihood of &gt;50% (12 samples &#8805;80%) of anomalous CH4. The workflow of <ref type="bibr">Wen et al. (2019b)</ref> did not detect these 27 samples as impacted by anomalous methane because Cl &#8805;30 mg/L or sulfate &#8804;6 mg/L. If the new ensemble model approach is correct, these samples are impacted by anomalous methane and were false negatives in the previous study. Lending credence to the conclusion that these sites were impacted by anomalous methane is the observation that all but 11 of these 27 samples were from four areas that lie near locations with known contamination as reported in the literature <ref type="bibr">(Llewellyn et al., 2015;</ref><ref type="bibr">Wen et al., 2019b</ref><ref type="bibr">Wen et al., , 2018) )</ref> (Figures <ref type="figure">5</ref> and<ref type="figure">6</ref>; Table <ref type="table">S3</ref>). The last eleven putatively-false-negatives are not close to any sites previously identified as problematic.</p><p>Given that all the other 16 sites show some history of local contamination, we conclude that all these putatively-false-negatives were impacted by recent intrusion of anomalous methane (which might be caused by nearby shale gas drilling) at the time of sampling, and should have received in-depth analysis to determine the source and mechanism of the elevated [CH4].</p><p>Although the streamlined workflow from <ref type="bibr">Wen et al. (2019b)</ref> is easy to implement and effective in detecting anomalous methane samples, it is limited in the number of geochemical parameters considered and it likely returned at least 27 false negatives for the PA hold-out dataset.</p><p>In contrast, our ensemble model evaluates a fuller set of groundwater chemistry data and can identify waters that are contaminated that were missed by the streamlined workflow of <ref type="bibr">Wen et al. (2019b)</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>New York</head><p>Although New York is almost geologically identical to Pennsylvania in the counties considered here, it is not producing shale gas because high-volume hydraulic fracturing with horizontal drilling is banned. Instead, conventional oil and gas drilling has long been important in the state. <ref type="bibr">Brantley et al. (2014)</ref> summarized reports from the PA regulator that showed that the reporting rate of problems of anomalous CH4 from conventional oil and gas well development in PA was much smaller than that observed for shale gas development after 2004. We thus hypothesized that we would see a very low rate of anomalous CH4 in the small dataset of groundwater quality available for the region of oil and gas production in New York <ref type="bibr">(Christian et al., 2016)</ref>. This hypothesis is especially compelling because geologically, northern PA is very similar to NY, but the laws are different, and the use of high-volume high-pressure hydraulic fracturing in NY unconventional reservoirs is not allowed. Therefore, unlike PA samples, all of the New York samples were collected in advance of high-volume hydraulic fracturing but might postdate some of the nearby conventional drilling.</p><p>In the New York dataset of 203 groundwater samples, only five are reported with high [CH4] (&#8805;10 mg/L). Four of these five samples are predicted by the top 1,000 ensemble model as low likelihood (i.e., &lt;30%) of containing anomalous methane (Tables <ref type="table">3</ref> and<ref type="table">S4</ref>; Figures <ref type="figure">5</ref> and<ref type="figure">6</ref>).</p><p>However, one ("ST35B"), with a [CH4] of 13.8 mg/L, yields a 71% likelihood of impact by anomalous CH4 (Table <ref type="table">S4</ref> and<ref type="table">Figures 5</ref> and<ref type="table">6</ref>). Sample ST35B was identified in the ensemble model because it has a very low [Cl] of 4.1 mg/L, but relatively high [sulfate] and [Fe] of 8.99 and 0.42 mg/L, respectively. It is thus also detected as a contaminated sample by the streamlined test of <ref type="bibr">Wen et al. (2019b)</ref> and is likely, based on these tests, to contain CH4 that has infiltrated the groundwater recently.</p><p>Although this sample appears to have been infiltrated with CH4 recently, other lines of evidence suggest that the migration was not caused by oil or gas development. For example, the distance between site ST35B (sampled in 2013) and the nearest oil or gas well (drilled prior to 1980) is &#8764;6 km. The large distance and long period of time between gas well drilling and water sample collection render the source of methane in water wells unlikely to have originated from the gas wells. But this water well is drilled into the very gas-rich Canadaway Formation near a large number of faults and lineaments, and may nonetheless have been affected by recent migration of naturally occurring CH4 to the water well. Consistent with this conclusion, <ref type="bibr">Christian et al. (2016)</ref> pointed out that values of [CH4] in the NY groundwater data (including, implicitly, ST35B) do not statistically vary with proximity to gas wells or faults. They argued that elevated [CH4] in the NY samples is most likely of natural origin. This conclusion was based on the observation that high [CH4] is often associated with Na-rich waters in valleys in NY that are impacted by natural brines <ref type="bibr">(Christian et al., 2016)</ref>. However, while ST35B had a high [Na] (30.1 mg/L), it had very low <ref type="bibr">[Cl]</ref> (4.1 mg/L). Therefore, the high Na in that sample did not derive from contamination by NaCl-rich brine (and was not flagged as such by the ensemble model). On the other hand, water from ST35B was reported to smell like 'rotten egg' (i.e., H2S) and is locally associated with brownish red stains (pers. comm., Laura Lautz), perhaps pointing to ongoing sulfate reduction coupled with methane oxidation <ref type="bibr">(Wen et al., 2019b;</ref><ref type="bibr">Woda et al., 2020</ref><ref type="bibr">Woda et al., , 2018))</ref>. Our prediction that ST35B contains anomalous methane might be a false positive: in particular, it could be water that was recently impacted by natural CH4 rather than CH4 migrated from hydrocarbon development activities. In future predictions with the ensemble model, a filter for proximity to oil/gas wells should be included (e.g., waters sampled within 5 km).</p><p>A Fisher exact test was used to test our original hypothesis, i.e., to test if the frequency of detection of CH4-impacted groundwater samples (&#8805;50% likely to be impacted by anomalous methane) differ between PA (i.e., 42/2,983) and NY (i.e., 1/78). Whether we assume that ST35B is an example of anomalous methane caused by oil/gas development or not, the Fisher test results</p><p>show no statistically significant difference between PA and NY at a confidence level of 95% (p&gt;0.05). Thus, we must reject the hypothesis in that the ensemble model reveals similar frequencies of putative contamination by anomalous methane in the part of the Marcellus shale play utilizing horizontal drilling + hydraulic fracturing as compared to the part with conventional resource development.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Texas and Colorado</head><p>We also compiled groundwater quality data from Texas to test the hypothesis that the frequency of identification of anomalous methane in groundwater wells is higher in PA than in other shale plays/states. A total of 688 groundwater samples are included in the compiled Texas data, which cover three major shale gas plays in Texas: Barnett Shale, Eagle Ford Shale, and Haynesville Shale. Among these samples, [CH4] is larger than 10 mg/L in 34 groundwater samples (Table <ref type="table">S5</ref> and<ref type="table">Figures 5</ref> and<ref type="table">6</ref>). Of these 34 samples, none were identified to have a likelihood of anomalous CH4 larger than 50%. This is consistent with the findings from previous investigations of the sources of CH4 in these three shale plays <ref type="bibr">(Darvari et al., 2017;</ref><ref type="bibr">Nicot et al., 2017a</ref><ref type="bibr">Nicot et al., , 2017b</ref><ref type="bibr">Nicot et al., , 2017c))</ref>, i.e., no CH4 in these shallow water wells is associated with recent development of nearby shale gas.</p><p>The ensemble model was also applied to a large groundwater quality dataset of 10,258 water samples collected across Colorado mainly within the Denver-Julesburg, Raton, San Juan, and Uinta-Piceance basins (Figure <ref type="figure">1</ref>). Of these samples, high [CH4] (&#8805;10 mg/L) samples (n=58) with complete measurements for all required single geochemical features exist only in the Denver-Julesburg Basin and Raton Basin (Figure <ref type="figure">1</ref>). These 58 samples were collected from 29 sites (Table <ref type="table">S6</ref>), of which only four samples from four sites <ref type="bibr">(i.e., 705739, 755481, 752672, 750143)</ref>  With these data, we test our second hypothesis, namely that the frequency of detection of anomalous methane in the Marcellus shale play is higher than in Texas + Colorado. Treating the Colorado and Texas measurements as one dataset, the combined frequency of detection of groundwater samples showing &gt;50% likelihood is 4/795, statistically lower than the rate in Pennsylvania (i.e., 42/2,983) at a confidence level of 95% (p=0.04) using the Fisher exact test. This finding supports our second hypothesis that the frequency of detection in the Marcellus shale play is higher than in Texas and Colorado. To explain this result, we point to <ref type="bibr">Hammond et al. (2020)</ref> who suggested that most of the anomalous CH4 released from gas wells in the US occurs because primary cementation is not completed along the full lengths of production casings from the target shale to intermediate casings (or to surface casings, if intermediate casings are not used).</p><p>The higher frequency in the Marcellus play could therefore derive from differences in casings and cementation or differences in gas contents at intermediate depths for boreholes in that play as compared to other plays.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Conclusion</head><p>We presented a machine learning ensemble model that shows that salinity-related and redoxrelated measurements are effective geochemical features that can detect anomalous methane in groundwater. One problem with the application of the model to date is that we cannot exclude the possibility that differences in sample sizes contributed to differences in detection frequencies.</p><p>Clearly, larger datasets for all shale gas plays could be used to eliminate this problem. Furthermore, a machine learning model that incorporated additional geochemical measurements such as isotopes would presumably be even more adept at finding evidence of anomalous CH4.</p><p>For the regions we studied (PA, TX, CO, NY), the frequency of reported water samples with [CH4] &#8805;10 mg/L, the level often considered to be dangerous, was 2.1%, 5.8%, 7.4%, and 3.4%. In contrast, the frequency of identification of anomalous methane by the ensemble machine learning model was 1.4%, 0%, 0.9%, 1.3% (with ST35B) and 0% (without ST35B). These values were determined by application of the ensemble model where we detected 42/2,983, 0/338, 4/457, and 1/78 (or 0/77) of the water samples were &gt;50% likely to be impacted by newly migrated natural gas in these states, respectively. One NY sample, flagged as likely to have newly migrated methane, was sampled ~6 km from the nearest oil/gas well, and thus may be contaminated by new methane from a different source. Fisher exact tests show statistically significant differences between the results for PA versus TX+CO (i.e., with evidence for a higher frequency of migrated methane sites in PA) but show no statistically significant difference within the Marcellus shale play between regions using versus not using high-pressure high-volume hydraulic fracturing. The new machine learning tool appears to be useful in detecting anomalous methane in multiple shale plays. Future work should include additional training and validation of data-driven models as new data from presumably impacted sites in shale plays other than the Marcellus become available.     </p></div></body>
		</text>
</TEI>
