AI Magazine Volume 17 Number 4 (1996) (© AAAI) Articles Using Artificial Neural Networks to Predict the Quality and Performance of Oil-Field Cements

P. V. Coveney, P. Fletcher, and T. L. Hughes

■ Inherent batch-to-batch variability, aging, and powder, is obtained by grinding cement clink- contamination are major factors contributing to er. The cement clinker is manufactured by variability in oil-field cement-slurry performance. firing limestone (providing calcium) and clay Of particular concern are problems encountered (providing silicon, aluminum, and iron). Gyp- when a slurry is formulated with one cement sum (calcium sulfate dihydrate) is then added sample and used with a batch having different properties. Such variability imposes a heavy bur- to moderate the subsequent hydration process. den on performance testing and is often a major After grinding the clinker and gypsum, the ce- factor in operational failure. ment powder consists of multisize, multiphase, We describe methods that allow the identi- irregularly shaped particles ranging in size fication, characterization, and prediction of the from less than a micrometer to slightly more variability of oil-field cements. Our approach in- than 100 micrometers. When this starting ma- volves predicting cement compositions, particle- terial is mixed with water, hydration reactions size distributions, and thickening-time curves occur that ultimately convert the water-ce- from the diffuse reflectance infrared Fourier trans- ment suspension into a rigid porous material, form spectrum of neat cement powders. Predic- which serves as the matrix phase for concrete, tions make use of artificial neural networks. Slurry formulation thickening times can be predicted a cement paste-sand-rock composite. with uncertainties of less than ±10 percent. Com- The various chemical phases within the ce- position and particle-size distributions can be pre- ment powder hydrate at different rates and in- dicted with uncertainties a little greater than mea- teract with one another to form various reac- surement error, but general trends and differences tion products. Some products deposit on the between cements can be determined reliably. remaining unhydrated cement particle sur- Our research shows that many key cement faces, but others form as crystals in the water- properties are captured within the Fourier trans- filled pore space between cement particles. form infrared spectra of cement powders and can Moreover, some of the hydration products be predicted from these spectra using suitable contain nanometer-sized pores, so that the size neural network techniques. Several case studies are given to emphasize the use of these tech- range of interest for these materials is from niques, which provide the basis for a valuable nanometers to hundreds of micrometers, or quality control tool now finding commercial use even centimeters if one includes the rock ag- in the oil field. gregates used in concrete. Because of these complexities, many questions remain unan- swered in the science of cementitious materi- ements are among the most widely used als. As with most materials of industrial impor- and the least well understood of all ma- tance, the key relationships between Cterials. Although cements are often processing and underlying physicochemical viewed as simple “low-tech” materials, they properties must be elucidated to obtain better are, in fact, inherently complex over many control over the material in use. length scales. The starting material, cement The most common application of cement

Copyright © 1996, American Association for Artificial Intelligence. All rights reserved. 0738-4602-1996 / $2.00 WINTER 1996 41 Articles

is, of course, in building construction, where it has been used since at least Roman times. However, the work described here is con- cerned with another important application of cement—in the oil industry, where about three percent of the world’s annual cement output is deployed. Cement is used to line oil and gas wells after drilling by pumping a cement slurry between the well bore and a steel casing inserted into the well, as shown in figure 1. During placement, the cement displaces all the drilling fluid originally pre- sent from the drilling operation itself. The cement then sets to form a low-permeability annulus, which isolates the productive hy- drocarbon-bearing zones of the well from the rest of the formations, surplus water, and the surface. Cement is used almost exclusively for oil- field cementing despite the fact that its per- formance is variable and not completely un- derstood. Cement variability is observed between cements from different manufactur- ers, different cement batches from the same manufacturer, and samples from the same batch of cement that might have aged differ- ently during storage. Because of all these problems, well cementing has remained un- til now more a black art than a science. Various cement-slurry properties, such as compressive strength development, perme- ability to oil and gas, and flow behavior, need to be specified and controlled, taking Figure 1. Cementing an Oil Well. into account the high temperature and pres- The main objective of such well cementing is to sure conditions prevailing down hole. For provide complete and permanent isolation of the oil-field cement slurries, the thickening time formation behind the steel casing previously placed in the bore hole. The cement must be mixed plays a central role during slurry formula- to meet appropriate design parameters and is then tion because it is a measure of the time with- pumped down hole, displacing all drilling mud in which the cement is pumpable (American from the annulus between casing and formation. Petroleum 1982). Experimentally, it is the Spacers or washes can be used along with top and time taken to reach a specified consistency bottom plugs to separate cement from drilling as measured under defined conditions. mud. Centralizers on the outside of the casing are Longer than required thickening times are a used to keep the annular gap as even as possible. potential waste of drilling time and an in- efficient use of expensive chemical additives. Operational problems as a result of short thickening times are especially dramatic be- cause the cement can set prematurely in the casing or pumping equipment. Such major operating failures (MOFs) can necessitate the complete redrilling of a many-thousands-of- feet well bore and can cost from $1 to $2 million; less severe MOFs in which a limited amount of redrilling is required typically cost around $0.6 million. Therefore, consid- erable, time-consuming experimental effort is devoted to precise control of slurry thick- ening times.

42 AI MAGAZINE Articles

Application Description: The FTIR Spectra of Cements In view of the overwhelming complexity of SPECULAR REFLECTANCE cement hydration, a valuable quality control tool would be a model predicting perfor- DIFFUSE REFLECTANCE mance properties of a given cement sample prior to its use. However, the mathematical modeling of cement hydration based on mechanistic understanding is still in its in- fancy (but see Coveney and Humphries [1996]). The approach taken here is to dis- pense with detailed physicochemical charac- terization of the cement particles in favor of methods based on a combination of statistics and AI. With this approach, cement composi- tion and performance properties are correlat- ed with a judiciously chosen measurement that implicitly contains key information on Figure 2. Schematic of the Diffuse Reflectance Process. cement composition, particle-size distribu- tion, and surface chemistry. To give the method any chance of commercial success, radiation penetrates the sample and is reflect- this measurement also has to be relatively in- ed from particle surface to particle surface. At expensive and easy to perform on a routine each reflection, a degree of energy absorption basis. occurs as indicated in figure 2. The measurement chosen was based on the Energy is absorbed because of the vibration use of infrared , a common analyt- and stretching of chemical bonds in the ic technique used in the chemical sciences. It molecules of the powder. The reflected light is well known that every chemical species has reemerges from the sample and is collected its own unique infrared spectrum. Indeed, by a second ellipsoidal mirror. The Fourier chemists most commonly use this technique transform technique is used to convert the in a qualitative mode by matching up spec- emergent radiation into a spectrum of ab- tral features in an unknown compound with sorbance versus frequency. The experimental previously recorded spectral data on known method for collecting FTIR spectra of cement compounds available in lookup tables. An ex- powders has been described elsewhere (Hugh- perienced chemist, working in a specified area es et al. 1995, 1994). The wavelength range of of chemistry, can often identify a chemical by the mid-infrared region of the electromagnet- direct visual inspection of its infrared spec- ic spectrum is approximately 2.5 × 10–3 cm to trum. A more specialized yet equally well-es- 2.5 × 10–4 cm or 4000 to 400 wave numbers, tablished application is quantitative analysis of where wave numbers are reciprocal wave- chemical mixtures, wherein measured spectra length in units of cm–1. of unknown chemical composition are re- gressed against linear combinations of in- Information Contained within frared spectra either of the pure chemical Cement FTIR Spectra components or of mixtures of known chemi- Particle Size: The extent of diffuse reflectance cal composition (Beebe and Kowalski 1987). is inherently related to the particle size of the The particular variant used in this work is sample but in a generally unknown manner. that of the Fourier transform infrared (FTIR) Large coarse particles allow the incident radia- spectrum of dry cement powders, sometimes tion to penetrate deeply into the sample, thus known as diffuse reflectance infrared Fourier increasing absorption. However, large particles transform spectroscopy (DRIFTS). In this tech- show greater specular reflectance that distorts nique, white-light radiation from a Michelson the frequency spectrum. As the particle size of interferometer is focused on a compacted a sample is reduced, the depth of penetration sample using a moving mirror. Radiation im- and, therefore, absorption is less because more pinging on the sample undergoes two types of particles are present to reflect and limit the reflection. The first is specular reflectance, depth of penetration. Spectra are therefore where the radiation is reflected from the sam- distorted as a function of particle size al- ple surface as if from a mirror. The second is though sample dilution in KBr minimizes diffuse reflectance whereby a proportion of the these effects. Accordingly, our spectral mea-

WINTER 1996 43 Articles

surement is made with samples diluted to a The Cement Properties Database concentration of 10 percent by weight in fine- The methods we use for making quantitative ly ground, infrared inactive, potassium bro- predictions are based on establishing statistical mide. correlations between cement infrared spectra Composition: To a good first approxima- and selected cement physicochemical parame- tion, the FTIR spectrum of any multicompo- ters. Specifically, we were interested in seeking nent mineral assembly is a linear superposition to establish unambiguous relationships be- of the spectra of the pure mineral com- tween the infrared spectra and cement proper- ponents. In the case of oil-field cements, the ties such as chemical composition, particle-size American Petroleum Institute (API) lays down distribution, and thickening time. To achieve notional chemical composition specifications such correlations required the construction of based on the so-called Bogue clinker phases: a database containing data on 158 oil well ce- alite (tricalcium silicate), belite (dicalcium sili- ments collected worldwide. Our database is cate), aluminate (tricalcium aluminate), and one of the most comprehensive currently aluminoferrite (tetracalcium aluminoferrite). available on oil-field cement properties. It con- These Bogue phases, which themselves provide tains the following standard physical and only an approximate chemical description, are chemical data on each of the 158 cements: traditionally specified by means of a linear First is the cement mineral composition ex- transformation of the chemical composition of pressed in weight percent (wt%) of the fol- the clinker expressed in terms of its major ox- lowing minerals: alite, belite, aluminate, fer- ides, which can be determined directly by oth- rite, gypsum, the sulfates bassanite and er, more lengthy, noninfrared methods. Spec- syngenite, calcium hydroxide, and calcium tral features of the major Bogue cement carbonate. chemical phases in the mid-infrared are domi- Second is the cement oxide composition nated by vibrations and stretching modes of expressed in weight percent of the following water molecules that are located on mineral oxides: SO3, Al2O3, Fe2O3, MgO, Na2O, CaO, surfaces, within the sulfate and carbonate min- SiO2, P2O5, TiO2, CrO2, MnO2, ZnO, and SrO2. erals, or in calcium hydroxide. Within the Third is the binned particle-size distribu- mineral phases present, chemical bonds be- tion (PSD bin), in volume fraction occupancy, tween silicon and oxygen, aluminium and and mean particle diameter, in microns, as oxygen, and iron and oxygen are also active in measured by Cilas granulometry. the mid-infrared region. Despite the aforemen- Fourth is weight loss on ignition, free lime tioned complexities that are the result of parti- content, and insoluble residue. 2 –1 cle-size distributions and the occlusion of min- Fifth is the surface area (in cm g ) as mea- erals, it is established that linear statistical sured by Blaine’s method, which provides an techniques can be used to correlate spectral estimate of the total surface area of all the ce- characteristics with cement chemical composi- ment particles. Sixth is the digitized thickening-time curve tion, provided due care is taken in the sample ° for a neat cement slurry at 50 C and solid/ preparation (Hughes et al. 1995, 1994). water ratio of 0.44. Other Spectral Attributes: Lack of crys- Seventh is the digitized thickening-time tallinity, impurities in minerals, and prehydra- curve for a slurry retarded with 0.2-percent tion have a more subtle effect on spectra, usu- D13 (a Schlumberger Dowell proprietary ce- ally broadening absorbance peaks and shifting ° ment-setting retarder) at 85 C and solid/wa- the frequencies at which absorbance occurs. ter ratio of 0.44. We can therefore assert with confidence Eighth is the diffuse reflectance FTIR spec- that diffuse reflectance infrared spectra of ce- tra recorded at 2 cm–1 resolution using a ments contain information on the composi- Nicolet 5DX spectrometer. tion, particle-size distribution, and surface chemistry of the material, all of which Modeling Techniques influence cement hydration. The primary objective of this research was to construct models to predict cement proper- Methods for Predicting Cement ties from FTIR spectra as the sole input data. Properties from FTIR Spectra The most important cement information that one would hope to extract from infrared In this section, we discuss the design and spectra are (1) chemical composition accord- construction of a cement properties database, ing to the Bogue and oxide representations, modeling techniques, and the predictive ca- (2) particle-size distribution, and (3) thicken- pabilities of the models. ing-time profiles for neat and retarded ce-

44 AI MAGAZINE Articles ment slurries. Accordingly, five independent statistical models were constructed for the prediction from FTIR spectra of the following properties selected from the database: Model A: The concentrations of the four inputs API-specified Bogue minerals plus gypsum, syngenite, bassanite, calcium hydroxide, and calcium carbonate transfer function Model B: The concentrations of the major computes output Output oxides together with loss on ignition, free lime content, and insoluble residue Model C: Particle-size distributions and Inputs mean particle diameter Model D: Digitized neat thickening-time curves Model E: Digitized retarded thickening- Figure 3. Schematic of a Single Node. time curves These models were subsequently used inde- pendently of one another. The strength of the output signal is given It has previously been demonstrated that ce- by a nonlinear function called the transfer ment mineral compositions (model A) can be function. Commonly, the transfer function is predicted from FTIR using linear statistical based on a weighted sum of the input signals. techniques (Hughes et al. 1994; Fierens and A complete neural network is constructed Verhagen 1972). A suitable procedure, de- from an arrangement of individual neurons scribed elsewhere (Martens and Naes 1989; that link input data to output data by a net- Beebe and Kowalski 1987; Sharf, Illman, and work of arbitrary complexity. Within any ar- Kowalski 1986), is based on partial least squares chitecture the strength of the signal received (PLS). This technique is a variant on simple by any one node is a weighted sum of input multiple linear regression, which has the ca- sent by all the nodes to which it is connected. pacity to filter noise and redundant informa- In the commonly used, supervised, feed-for- tion from spectra prior to prediction. In this ward, layered networks, nodes in an input lay- study, PLS is used for the prediction of mineral er first receive signals equal to the values of compositions only. All other models make full the external input data. This information is use of artificial neural networks (ANNs). passed on in a nonlinearly convolved fashion The full relationships between the measur- to nodes in an output layer representing out- able properties of a cement powder and its put data (figure 4). The network architectures slurry performance are not known and are ex- and nonlinear expressions are modified using pected to be complex, that is, highly nonlin- a supervised training procedure such that in- ear (Coveney and Humphries 1996; Fletcher put data are correlated with output data. In and Coveney 1995; Fletcher et al. 1995; Ben- some networks, there can be one or more lay- sted and Beckett 1993; Billingham and Cov- ers of neurons connecting the input and out- eney 1993; Hunt 1986). Therefore, it is best to put layers. These (hidden) layers add mathe- choose a technique for finding such correla- matical features to networks necessary to tions that makes as few assumptions as possi- model complex relationships. ble regarding their nature. ANNs offer the A fully trained ANN is effectively a nonlin- possibility of finding input-output correla- ear map between specified variables that is ca- tions of essentially arbitrary complexity and pable of filtering noise in the input data and consequently formed the basis for the AI has a predictive capacity; that is, it is capable methods we used in this work. The main fea- of making predictions for situations not pre- ture of the neural network methodology is viously encountered. The procedures for opti- that input-output information is correlated mizing ANNs are described elsewhere (Mas- using a system of interconnected nodes ters 1993) and use goodness-of-fit criteria (Hush and Hornee 1993; Lippmann 1987; based on minimum residual prediction errors Rumelhart and McClelland 1986). These for test data. nodes, also called neurons, are the computa- Neural networks have the following valu- tional analog of nerve cells in the human able features: (1) they respond with high brain. A single node is a processing element speed to input signals, (2) they have general- that combines a set of input to produce a sin- ized mapping capabilities, (3) they filter noise gle numeric output (figure 3). from data, (4) they can perform classification

WINTER 1996 45 Articles

suitable for predicting cement properties em- Outputs ployed Gaussian radial basis functions (Moo- dy and Darken 1989, 1988) in a single hidden layer. We preferred these networks because their underlying learning algorithms are fast, and based on linear algebra, they are guaran- Hidden Layer teed to find global optima. In such radial basis function networks, also sometimes referred to as localized receptive field networks, the nodes in the hidden layer are different than those in a multilayer perceptron: They are radial-distri- bution functions that have centers and widths expressed in terms of the n-dimensional space defined by the input data vectors. These Gaus- sian basis functions produce a nonzero re- Input Data sponse only when an input vector falls within a small, localized region of this n-dimensional space centered on the mean and within the Figure 4. Schematic of an Artificial Neural Network. specified width of the basis function. The process of constructing and optimizing such networks involves several stages: First, an arbitrary number of Gaussian basis func- as well as function modeling, and (5) they tions have to be selected. Their means and can encode information by regression or iter- standard deviations (widths) are determined ative supervised learning. on the basis of the available data vectors to Some drawbacks of neural network meth- be used for training by a procedure such as n- ods are (1) they are data intensive; (2) train- dimensional K-means clustering. This stan- ing is computationally intensive and requires dard statistical procedure exploits the natural significant elapsed wall-clock time; (3) they clustering of the input data to locate the have a tendency to overtrain if the network means (that is, the centers) of the selected topology is not optimized, resulting in their number of nodes such that their average Eu- mapping training data extremely well but be- clidean distances from all the input data vec- coming unreliable in dealing with new data; tors are minimized. The output from this ar- and (4) predictions are unreliable if extrapo- bitrarily chosen number of radial basis lated beyond the boundaries of the training functions are then linearly correlated to the data. supplied target (output) vectors. The final Many different types of neural network can stage of network optimization is performed be implemented to solve a wide range of by systematically varying the number of clus- complex nonlinear problems. We originally ters and overlap parameters to achieve an op- worked with multilayer perceptrons (MLPs), timum fit with the training data. which are composed of three layers in which For all types of ANN architecture employed the number of nodes in the input and output and models constructed (A to E), the net- layers were fixed by virtue of the mapping works were trained using a subset of the full sought. Thus, the number of nodes in the in- database and their predictive capabilities eval- put layer is equal to the number of individual uated using a completely independent test pieces of data in a single-cement input data data set—that is, one containing data that record (also called an input vector), but the had not previously been used by the network number of nodes in the output layer is equal during training—selected randomly from the to the number of separate parameters being database. The importance of network opti- predicted from the input vector. However, mization and training in the construction of there are certain computational drawbacks to reliable and robust ANN models cannot be these MLP networks: Finding the optimal overstressed. number of nodes in the hidden layer is time The extensive computation time for opti- consuming because network training by the mizing even radial basis function neural net- back–propagation-of-errors algorithm is slow, works becomes an issue when spectral data are and in addition, there is some possibility of used as input variables. A typical mid-infrared the network becoming trapped in a local, FTIR spectrum collected at 2-wave– number rather than the global, error minimum. resolution of the kind used here has approxi- The network type we found to be the most mately 2000 digitized points. Thus, to use

46 AI MAGAZINE Articles

FTIR spectra as input data for neural networks, Table 1. Uncertainties in Model A Predictions. it was found necessary to first reduce the number of variables representing any spec- trum. This reduction was performed using the Component Concentration Range Uncertainty/2σ principal component method based on spec- (wt%) (wt%) tral eigenvector analysis and led to a reduc- Alite 42–70 ±5 tion in the useful information content in each Belite 4–35 ±5 spectrum to 35 principal components, which Alite + Belite 70–82 ±1.5 allows network training and validation to be Aluminate 0–15 ±1 performed on PCs and workstations. For each Ferrite 5–20 ±1 of the models B to E, the spectra were always Syngenite 0–3 ±0.6 reduced to 35 principal components, al- Gypsum 0–6 ±0.6 though the optimum architectures were dif- Bassanite 0–6 ±0.6 ferent for each model. More details of the the- Ca(OH) 0–3 ±0.1 oretical basis of the modeling procedure are 2 CaCO 0–4 ±0.2 given elsewhere (Fletcher and Coveney 1996). 3 Predictive Capabilities of the Models In this section, we discuss the predictive ca- pabilities of the five models. Model A—Mineral Composition Pre- Table 2. Uncertainties in Model B Predictions. dictions, PLS Model The expected uncer- tainties in mineral composition predictions Component Concentration Range Uncertainty/2σ have been described in detail elsewhere (wt%) (wt%) (Hughes et al. 1995, 1994). They are summa- SO 1.5–4.0 ±0.2 rized in table 1, which lists the various chem- 3 Al O 3.0–7.0 ±0.3 ical phases present as well as the concentra- 2 3 Fe O 1.8–7.0 ±0.3 tion ranges and associated uncertainties with 2 3 MgO 0.5–3.0 ±0.3 which the phases are found (in weight per- Total alkalis 0.2–1.5 ±0.2 cent). As in all the models to be discussed, CaO 61–67 ±1 the quoted uncertainties refer to the impreci- SiO 19.5–24 ±0.4 sion of the model predictions (σ is the stan- 2 Insoluble residue 0–0.9 ±0.3 dard deviation) compared with the known, Loss on ignition 0.5–2.5 ±0.3 experimentally measured values of the same Free lime 0.4–2.1 ±0.3 quantities. The predictions of the sulfate min- erals (gypsum, bassanite, and syngenite), cal- cium hydroxide, calcium carbonate, alumi- nate, and ferrite are generally good and can be used to detect aging of cements, as our lat- As with the mineral composition model er case studies show. The major uncertainties A, cement-oxide compositions can be esti- lie in the prediction of the individual silicate mated with errors a little greater than those phases, although total silicates (alite + belite) of the direct composition measurement it- is predicted well. self, but general trends in chemical compo- Model B—Major Oxide Analyses, ANN sition can be determined readily from both Model Table 2 displays the cement chemical models. analysis represented more fundamentally in terms of the major oxides present, together Model C—Particle-Size Distribution with the concentration ranges and associated Bins and Mean Diameter, ANN Model uncertainties with which these oxides occur. Figure 5 shows a typical particle-size–distribu- In all cases, the oxides, weight loss on igni- tion prediction for an oilwell cement, and tion (LOI), free lime, and insoluble residue table 3 lists its uncertainties. In all cases, the variables are predicted well, although the un- prediction errors are greater than the expect- certainties are greater than expected errors on ed measurement errors, although general the measurements. The major uncertainties trends are predicted well. lie in the predictions of the concentrations of Models D and E—Thickening-Time CaO and MgO. These uncertainties arise from Curve Predictions, ANN Model Figure 6 the fact that the variance in the levels of CaO shows predictions of the full digitized thick- and MgO is known to be small, and the errors ening-time curves for the retarded and neat in prediction are proportionately large. slurries for a typical oil-field cement. In this

WINTER 1996 47 Articles

example, the digitization simplifies the curve, yet the general trends, including the point of departure for cement setting and the actual thickening time, can be seen clearly. 16.00 The expected error limits for thickening- time predictions for both neat and retarded 14.00 Measured Data formulations are shown in table 4. These un- 12.00 Predictions certainties are typically less than experimen- tal thickening-time measurement errors and, 10.00 thus, support the use of FTIR as a rapid, quan- titative predictor of cement-slurry thickening 8.00 times.

6.00 Application Case Studies

Occupancy 4.00 The application offers two basic levels of inter-

Volume Percentage pretation: One is the qualitative assessment of 2.00 cement FTIR spectral features. The other is the interpretation of quantitative predictions from 0.00 the models. In this section, we provide a few 0 1 2 3 4 5 6 7 8 9 1011 1213 1415 16 examples of how this AI-based application PSD Bin works in commercial operations where it has been deployed for almost two years. Qualitative Interpretation Qualitative interpretation involves identifying Figure 5. Measured and Predicted Particle Size and comparing relevant features of cement for a Typical Oil-Field Cement. spectra with no reference to the AI system. The simplest qualitative method is direct vi- sual inspection of the spectra. This inspection involves identifying the presence of specific Table 3. Uncertainties in Model C Predictions. components by the presence of characteristic absorbance bands and reference to the spec- tra of pure components provided in preexist- ing lookup tables (Hughes et al. 1995, 1994). Bin Diameter Range/µm Uncertainty/ 2σ (%)1 The relative spectral changes can give indica- 1 0–1 ±1 tors to changes in performance between 2 1–1.5 ±1 batches. An alternative qualitative technique 3 1.5–3 ±1 is spectral subtraction where one FTIR spec- 4 2–3 ±1 trum is subtracted from a second to leave a 5 3–4 ±1 so-called residual spectrum that is used to 6 4–6 ±1 identify differences in the spectra. The residu- 7 6–8 ±1.2 al spectrum is particularly useful in the detec- 8 8–1 ±1.2 10 16–24 ±1.2 tion of contaminants. 11 24–32 ±1 Quantitative Interpretation 12 32–48 ±1 13 48–64 ±1 Quantitative interpretation involves predicting 15 96–128 ±1 the composition, particle-size distribution, 16 128–192 ±1 and performance properties of the cement us- ing the ANN-based prediction modules. Most 1. Error on mean particle diameter 2σ = ±1µm. applications involve comparing the proper- ties of one cement with another possibly sus- pect batch using the cement FTIR spectra passed through our predictive models. Any statistically significant differences in compo- sition or particle-size distribution will indi- cate differences in performance. In some cas- es, such as the detection of aged cements, the changes in mineral compositions can indicate

48 AI MAGAZINE Articles changes in performance. The performance predictions themselves can be used to sup- port or confirm the qualitative interpreta- tions. In some cases, the compositional differ- 100 ences between cements are subtle and not Retarded Slurry (Measured) easily interpreted. In these cases, direct pre- 80 Neat Slurry (Measured) diction of performance is informative. 60 Case A—Detecting a Barite-Contami- Model Predictions A cement sample was ob- nated Cement 40 served to yield an unexpectedly long thick- ening time compared with a normal cement 20 taken from a different storage silo. A residual FTIR spectrum was obtained by subtracting 0 the spectrum of the normal cement from 0 50 100 150 200 250 that of the rogue cement. Figure 7 shows the Time / Minutes residual spectrum compared with the spec- trum of pure barite; the barite characteristics are confirmed by table lookup from existing databases. (Use of the AI system is unneces- sary for this application). The correspon- Figure 6. Measured and Predicted Thickening-Time Curves for a Typical Oil- dence of spectral features confirmed the Field Cement. presence of barite in the rogue sample. The upper continuous curve displays the artificial neural network Barite contamination leads to the slurry be- predictions for a neat slurry, and the continuous lower curve shows ing overretarded when the cement is used in similar predictions for a retarded slurry. a slurry formulated on the basis of an un- contaminated cement. Case B: Detecting an Aged Cement A cement from one storage silo was observed to show mixing and pumping problems and Table 4. Uncertainties for Thickening-Time Predictions. yield a short thickening time compared to ce- ment samples from other silos. The spectrum of the problem cement is shown in figure 8, where it is compared with the spectrum of a Neat Slurry Retarded Slurry1 normal cement. Enhanced syngenite features Mean errors/minutes ±16.0 ±19.5 are visible in the spectrum of the problem ce- 2σ /minutes* ±31 ±37 ment; as in the case of the barite-contaminat- Mean % error ±9.5 ±10.6 ed sample, the spectral features characteristic Range of fit/minutes 50–350 50–50 of syngenite are confirmed by table lookup from existing databases. 1. 2σ indicates upper maximum expected errors. The linear partial least squares composition model A predicted the syngenite content of the problem cement to be 2.7 wt% compared with 0.9 wt% for the normal cement. Aging to form syngenite is consistent with the ob- served shortening of thickening times and pumping problems. The retarded slurry per- formance ANN model predicted the thicken- ing time for the aged cement to be 50 min- utes shorter than for the normal cement. Case C: Identification of a Rogue Ce- ment Figure 9 shows a retarded thickening- time curve for an oilwell cement as predicted from its FTIR spectrum using our ANN model. The predicted data are compared to an aver- age thickening-time curve obtained from ex- perimental measurements on five different batches of the same cement. An indication of the normal batch-to-batch variation because of storage is given by the two standard-devia-

WINTER 1996 49 Articles

eney 1996). These networks can be used to investigate the sensitivity of, for example, Barite Characteristics changes in thickening time to changes in the values of input parameters, such as the amount of aluminum or iron in the cement, Pure Barite Spectrum and so on. In some cases, these models have confirmed previously established qualitative trends known within the cementing commu- nity, such as the observation that increasing

Absorbance the iron content increases thickening times, Residual Spectrum but at the same time have made these rela- tionships more quantitative. However, in many other instances, including, for exam- ple, the dependence on composition variables 3500 2500 1500 500 of the kickoff time (“point of departure”) and Wavenumber (1/cm) the subsequent rapidity of thickening follow- ing the usual quiescent period during which there is essentially constant slurry consisten- cy (see figures 6 and 9), no previous knowl- edge—either qualitative or quantitative—ex- Figure 7. A Barite-Contaminated Cement. isted. Moreover, we have shown that a Pure-barite FTIR spectrum and residual spectrum obtained by genetic algorithm can be used to invert the subtracting the FTIR spectrum of a barite-contaminated cement nonlinear forward mapping provided by such from the spectrum of a normal cement. an ANN to furnish the precise physicochemi- cal composition of a cement needed to deliv- er specified performance properties. This ca- tions limit. The rogue batch is identified as pability is particularly remarkable because it having a very short thickening time com- implies that in principle at least, it might one pared to the expected range for this cement day be possible to tailor-make a cement to and an unusually high initial consistency. suit any particular application. These predictions were subsequently con- The cement quality-assurance tool that we firmed experimentally. have described here is the result of the power- This example makes critical use of the ANN- ful combination of a modern AI technique based performance-prediction capability to (ANNs) and the established laboratory mea- identify a rogue cement without recourse to surement technique of FTIR spectroscopy. The interpreting cement composition or particle- integration of these two methodologies is size distribution, which, on its own, is likely achieved in routine use by passing the digi- to provide ambiguous results. Recall that pre- tized output from an FTIR spectrometer into a mature setting of the slurry, as is the case 486 PC on which the trained ANNs reside. In here, would likely lead to a costly major oper- this way, a single cement powder FTIR spec- ating failure if such a cement were pumped in trum provides information simultaneously on the field. cement chemical composition, particle-size These case studies indicate the scope and distribution, and setting profile (including power of prediction afforded by ANNs. How- thickening time), together with a flag indicat- ever, the intriguing issue remains of how ing the degree of statistical reliability to be ex- these ANNs actually succeed in making cor- pected from the predictions emanating from rect composition and performance predic- the AI device. This flag indicates whether or tions from the compressed and convolved not a cement being analyzed lies within the representation of cement FTIR spectra. part of infrared parameter space on which the ANNs have been criticized at times because ANNs have been trained: If the former, the they appear to work like black boxes. Howev- predictions are classified as reliable; if the lat- er, the substantial quantity of knowledge ter, they are described as unreliable. As a con- they encode is available for more detailed in- sequence, one can record the FTIR spectrum terrogation and can be used effectively in its of a cement powder and predict its setting own right. To illustrate, we mention in pass- time in about 15 minutes of real time rather ing that we have constructed other ANN than wait for more than 4 hours to observe models that map chemical compositions and when the slurry will actually set. particle-size distributions directly onto slurry Our radial basis function neural network thickening-time curves (Fletcher and Cov- and other codes were homemade and were

50 AI MAGAZINE Articles developed on UNIX platforms. At the time when the method was transferred from Schlumberger Cambridge Research, where it had been developed, to Schlumberger Dow- Syngenite Feature ell’s Europe-Africa Technology Center in Ab- erdeen, a decision was taken to port all codes Aged Sample to the MATLAB commercial package—which is platform independent and, thus, immediately

accessible on a PC available in the field. The Absorbance porting of codes to MATLAB reduced the coding requirements of the commercial product to a Normal Sample minimum. It should be noted that our ANN codes made no special use of MATLAB’s intrin- sic features, nor did MATLAB influence in any 3500 2500 1500 500 way our choice of network architecture; our work was completed prior to the availability Wavenumber (1/cm) of the neural network toolbox within this package.

Application Use and Payoff Figure 8. A Syngenite Aged Cement. The cement quality control technique de- scribed here proved so successful in our re- search laboratories that a decision was made to turn it into a commercial product, called elimination of bad cements saves about 10 CEMQUEST (cement quality estimation). The percent of the time taken by the lengthy pro- technique is now being used in our Aberdeen cess of formulation optimization. This sav- regional field laboratories to detect and avoid ings translates to about $1000 a week for each cementing problems normally associated formulation in routine laboratory testing. with cement quality and variability. CEMQUEST We expect additional benefits to arise in can predict, directly from the FTIR spectrum, time for at least two reasons: The first reason composition, particle-size distribution, and will be as a result of the buildup of a larger ce- thickening times for certain cement-slurry ment database, extending the domain of va- formulations. lidity of the existing neural network models The advantages of using CEMQUEST compared (which will require periodic retraining). A sec- with previous cementing practice are mani- ond reason will be as a result of an enhanced fold. Obviously, there is the large time and per- reputation for Schlumberger Dowell based on sonnel savings that accrues from predicting ce- the increasing reliability of its cementing jobs ment-setting properties in this way. Other through the use of the current product on a benefits include the avoidance of operational day-to-day basis. cementing failures because of batch-to-batch variation, aging or cement contamination, and Application Development improved efficiency of cement- slurry formula- and Deployment tion design through the identification of im- portant slurry performance characteristics. The development of the CEMQUEST prototype Since early 1995, CEMQUEST has been in rou- at Schlumberger Cambridge Research was the tine use within Schlumberger Dowell, where result of about 12 person-years of effort, be- it is part of the overall set of techniques em- ginning in 1991 and ending in mid-1993. ployed for achieving improved cement-slurry The work involved coordinating a vast ce- design and reliability on a daily basis. It has ment data-collection exercise, with samples also attracted the attention of cement manu- sent from all areas of the world in which facturers and clients (oil companies) for Dowell has cementing operations. Thus, whom cement quality control work is also about 160 distinct cements, with various now being done on a regular basis. CEMQUEST physicochemical properties—chemical com- is able to save about $3 to $5 million a year position, particle-size distribution, FTIR spec- for each client through its ability to detect tra, slurry thickening curves, and so on—had potential major operating failures before they to be recorded. The reproducibility of all arise. The costs of slurry formulation are also these measurements had to be investigated. reduced by CEMQUEST: Rapid screening and All this work required the cooperation of

WINTER 1996 51 Articles

Maintenance Experience in the transfer of this product from research to operations showed that the 100 key limitation is associated with the record- 2 ing of FTIR spectra in field laboratories. Ow- Rogue API 80 Cement ing to the large size of the database and the Averaged API technical issues involved in producing accu- 60 Cement rate predictive models, all these models were developed in our research laboratory during 40 1992 to 1993, using FTIR spectra recorded 20 there. Thus, it was of paramount importance

Consistency / Bc to ensure that FTIR cement spectra recorded 0 on different spectrometers in the field center were closely coincident with the database 0 200 400 spectra recorded in research. Clear guidelines Time / Minutes for ensuring reproducible spectra had to be laid down by the research group. Maintenance of the software and the database is now the responsibility of Ab- Figure 9. Thickening-Time Curve Predictions for a Rogue Oil-Field Cement. erdeen. To date, it has not proved necessary to update this knowledge base, owing to the many colleagues in our product center (then rather wide representative coverage of the in St Etienne, France) and in Aberdeen. In ad- original cement data. However, data are being dition, some of the chemical-analysis work kept on all significant outlier cements detect- was performed externally at low cost. The ed by the reliability flag within the current AI samples needed careful storage in the absence system. Predictions of the physicochemical and performance properties of such outlier of moisture and carbon dioxide to prevent al- cements cannot be made reliably using the teration of cement properties with time be- existing database; so, at a future stage, their cause these substances are readily absorbed measured FTIR spectra and performance by cement powders. The end result was a sub- properties will be added to supplement the stantial cement database that was used for de- data set. When an addition is made, new veloping the final neural network models. ANN and other models will also need to be While data were being acquired, approxi- constructed and validated. This activity will mately three person-years of effort were de- be carried out entirely in Aberdeen on a peri- voted to an investigation of the feasibility of odic basis. cement-quality estimation using FTIR spectra linked to thickening-time curves. The initial aim was to establish whether any of the ce- Summary and Conclusions ment data could reliably be used for such pre- Using ANNs and conventional statistical dictive purposes. When it was decided possi- methods, we showed that the information in ble in late 1991 and early 1992, the target was the FTIR powder spectra of cements can be to demonstrate that the same could be used to predict composition, particle-size dis- achieved on the basis of the single and easily tributions, and thickening-time curves for performed FTIR powder measurement. The simple slurries. This discovery has established feasibility of this process was fully confirmed the FTIR measurement as a signature for ce- in late 1992 and opened the way to a com- ment performance. The measurement can be mercially viable product. During 1993, about used as a rapid technique to estimate cement one person-year’s effort was assigned to the quality and detect batch-to-batch variability development of the basic MATLAB code for in cements. Specific case studies have demon- transfer to Aberdeen in mid-1993. One of the strated that the product can detect batch-to- authors was transferred to Aberdeen to ensure batch variability between manufacturers as correct technical implementation of the well as aging and contamination of a given product and prepare for its commercializa- cement. Thus, it is capable of preventing the tion. This transfer was seen as important to occurrence of costly major operating failures guarantee a successful future for the product in oil-field cementing operations. Under the because at that site, there was previously only name of CEMQUEST, the application is finding limited expertise in the recording and inter- successful commercial application use in the preting of FTIR spectra. oil field.

52 AI MAGAZINE Articles

Acknowledgments crostructure of Cognition, Volume 1. Cambridge, Mass.: MIT Press. PVC is grateful to Reid Smith for helpful com- ments and advice made during the prepara- Sharf, M. A.; Illman, D. L.; and Kowalski, B. R. 1986. Chemometrix. New York: Wiley Interscience. tion of this article.

Peter Coveney is a senior scien- References tist at the Schlumberger Cam- bridge Research Laboratory, Unit- American Petroleum. 1982. API Spec 10: Materials ed Kingdom. He holds a B.A., an and Testing for Well Cements. Dallas: American M.A., and a D.Phil. from Oxford Petroleum Institute. University. Before joining Beebe, K. R., and Kowalski, B. R. 1987. An Introduc- Schlumberger Cambridge Re- tion to Multivariate Calibration and Analysis. Ana- search, he was a lecturer in physi- lytical Chemistry 59:1007A. cal chemistry at the University of Bensted, J., and Beckett, S. J. 1993. Advances in Ce- Wales, a junior research fellow at Oxford Universi- ment Research 5:111. ty, and a visiting fellow at . He Billingham, J., and Coveney, P. V. 1993. Journal of also currently holds a visiting fellowship at Wolf- the Chemical Society: Faraday Transactions 89:3021. son College, Oxford University, in theoretical Coveney, P. V., and Humphries, W. 1996. Journal of . Coveney is the coauthor of two books, The the Chemical Society: Faraday Transactions 92:831. Arrow of Time (Ballantine, 1991) and Frontiers of Complexity (Ballantine, 1995), both with Roger Fierens, P., and Verhagen, J. P. 1972. Journal of the Highfield. American Ceramic Society 55:306. Fletcher, P., and Coveney, P. V. 1996. Predicting Ce- ment Composition and Performance with Artificial Philip Fletcher is a senior scien- Neural Networks and FTIR Spectroscopy. The Amer- tist and section head at Schlum- ican Institute of Chemical Engineering Journal. Forth- berger Dowell Europe-Africa Tech- coming. nology Center in Aberdeen, Scotland. He holds a B.Sc. in Fletcher P., and Coveney, P. V. 1995. Advanced chemistry and a Ph.D. in physical Cement Based Materials 2:21. chemistry. Before joining Schlum- Fletcher P.; Coveney, P. V.; Hughes, T.; and berger Cambridge Research in Methven, C. M. 1995. Journal of Petroleum Technolo- 1984, he held research fellow- gy 47:129. ships at Oxford University, the University of Cali- Hughes, T. L.; Methven, C. M.; Jones, T. G. J.; Pel- fornia, and the City University London. He has re- ham, S. E.; Fletcher, P.; and Hall, C. 1995. Advanced searched in theoretical physical chemistry, solution Cement-Based Materials 2:91. chemistry, mineral chemistry, colloid chemistry, Hughes, T. L.; Methven, C. M.; Jones, T. L. H; Pel- and applications of statistics. His current work is in ham, S. E.; Vidick, B.; and Fletcher, P. 1994. Rapid product development and field support. Fletcher is Cement Quality Control Method for Improved also the author of an undergraduate textbook in Oilfield Cementing. Paper presented at the Off- geochemical thermodynamics. shore Technology Conference, 2–5 May, Houston, Texas. Trevor Hughes is a research sci- Hunt, L. P. 1986. Cement and Concrete Research entist at the Schlumberger Cam- 16:190. bridge Research Laboratory, Unit- Hush, D. R., and Hornee, B. G. 1993. Progress in ed Kingdom, where he has Supervised Neural Networks. IEEE Signal Processing worked since 1985. He obtained a Magazine 10:8. B.Sc. in geochemistry from the University of Liverpool and an Lippmann, R. P. 1987. An Introduction to Comput- M.Sc. in mineral chemistry from ing with Neural Nets. IEEE Signal Processing Maga- the University of Birmingham. zine 4:4. Hughes began his career in the precious metals Martens, H., and Naes, T. 1989. Multivariate Calibra- mining and refining industry. He holds 5 U.S. tion. Chichester, U.K.: Wiley. patents concerning techniques for monitoring the Masters, T. 1993. Practical Neural Network Recipes in composition of oil-field drilling fluids and has pub- C++. San Diego, Calif.: Academic. lished 17 scientific papers. Moody J., and Darken, C. J. 1989. Neural Computa- tion 1:281. Moody, J., and Darken, C. J. 1988. Learning with Localized Receptive Fields. In Proceedings of the 1988 Connectionist Models Summer School, eds. A. N. Touretzky, G. Hinton, and T. Sejnowski, 133. San Francisco, Calif.: Morgan Kaufmann. Rumelhart, D. E., and McClelland, J. J., eds. 1986. Parallel Distributed Processing: Explorations in the Mi-

WINTER 1996 53 Diagrammatic Reasoning Cognitive & Computational Perspectives

Edited by Janice Glasgow, N. Hari Narayanan, and B. Chandrasekaran Foreword by Herbert Simon

“Understanding diagrammatic thinking will be of special importance to those who design human-computer interfaces, where the diagrams presented on computer screens must find their way to the Mind’s Eye.… In a society that is preoccupied with ‘Information Superhighways,’ a deep understanding of diagrammatic rea- soning will be essential to keep the traffic moving.” – Herbert Simon

Diagrammatic reasoning—the understanding of concepts and ideas by the use of diagrams and imagery, as op- posed to linguistic or algebraic representations—not only allows us to gain insight into the way we think but is a potential base for constructing representations of diagrammatic information that can be stored and processed by computers.

Diagrammatic Reasoning brings together nearly two dozen recent investigations into the cognitive, the logical, and particularly the computational characteristics of diagrammatic representations and the reasoning that can be done with them. Following a foreword by Herbert Simon (coauthor of one of the most influential papers on reasoning with diagrams, which is included here) and an introduction by the editors, chapters provide an overview of the recent history of the subject, survey and extend the underlying theory of diagrammatic representation, and pro- vide numerous examples of diagrammatic reasoning (human and mechanical) that illustrate both its powers and its limitations. Each of the book’s four sections begins with an introduction by an eminent researcher who pro- vides an interesting personal perspective while he or she places the work in proper context.

ISBN 0-262-57112-9 800 pp., index. $50.00 softcover The AAAI Press • Distributed by The MIT Press Massachusetts Institute of Technology, Cambridge, Massachusetts 02142 To order, call toll free: (800) 356-0343 or (617) 625-8569. MasterCard and VISA accepted.

54 AI MAGAZINE