Abstract:
The invention relates to using autoencoder-derived features for predicting well failures (e.g., rod pump failures) using a machine learning classifier (e.g., a Support Vector Machine (SVMs)). Features derived from dynamometer card shapes are used as inputs to the machine learning classifier algorithm. Hand-crafted features can lose important information whereas autoencoder-derived abstract features are designed to minimize information loss. Autoencoders are a type of neural network with layers organized in an hourglass shape of contraction and subsequent expansion; such a network eventually learns how to compactly represent a data set as a set of new abstract features with minimal information loss. When applied to card shape data, it can be demonstrated that these automatically derived abstract features capture high-level card shape characteristics that are orthogonal to the hand-crafted features. In addition, experimental results show improved well failure prediction accuracy by replacing the hand crafted features with more informative abstract features.

Description:
RELATED APPLICATIONS 
       [0001]    This application claims the benefit of U.S. Patent Application No. 62/327,040; entitled “AUTOENCODER-DERIVED FEATURES AS INPUTS TO CLASSIFICATION ALGORITHMS FOR PREDICTING FAILURES”; filed on Apr. 25, 2016; the content of which is incorporated herein by reference. 
     
    
     BACKGROUND 
       [0002]    The invention relates to a method and system for predicting failures of an apparatus, such as well failures of a well. 
       SUMMARY 
       [0003]    In machine learning, effective classification of events into separate categories relies upon picking a good feature set to describe the data. For various reasons, dealing with the raw data&#39;s dimensionality may not be desirable so the data is often reduced to a smaller space known as a feature set. Feature sets are typically selected by subject-matter experts through experience. This disclosure describes, among other things, the use of dynamometer card shape data reduced to hand-crafted features (e.g., card area, peak surface load, and minimum surface load) to predict well failures using previously developed support vector machines (SVM) technology. 
         [0004]    An alternate method of generating a good feature set is to pass the raw data through a type of deep neural network known as an autoencoder. Compared to selecting a feature set by hand, there are two benefits of autoencoders. First, the process is unsupervised; so, even without expertise in the data being classified, one can still generate a good feature set. Second, the autoencoder-generated feature set loses less information about the raw data than a hand-selected feature set would. Autoencoders minimize information loss by design, and the additional information preserved in autoencoder features is carried through to the classification algorithms, manifesting as improved classification results. 
         [0005]    In the experiments described herein, two feature sets are generated from the raw dynamometer card shapes. One set is hand-selected and the other set is derived from an autoencoder. The feature sets are used to train and test a support vector machine that classifies each feature vector as a normally operating well or a well that will experience failure within the next 30 days. In an extended experiment, the results of combining the two feature sets are presented to produce a concatenated version containing both autoencoder-derived features and hand-selected features. 
         [0006]    Other aspects of the invention will become apparent by consideration of the detailed description and accompanying drawings. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0007]      FIG. 1  represents an autoencoder structure composed of 9 layers. 
           [0008]      FIG. 2  depicts an example of an autoencoder reconstruction. The original card shape (top) is composed of 30 points, and the reconstructed (also 30 points) is generated from only 3 abstract features. 
           [0009]      FIG. 3  depicts a Restricted Boltzmann Machine. 
           [0010]      FIG. 4  is a block diagram representing a prior art prediction system with a feature extractor. 
           [0011]      FIG. 5  is a block diagram representing a prediction system with an autoencoder. 
           [0012]      FIG. 6  depicts a comparison of SVM results for different feature sets. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0013]    Before any embodiments of the invention are explained in detail, it is to be understood that the invention is not limited in its application to the details of construction and the arrangement of components set forth in the following description or illustrated in the following drawings. The invention is capable of other embodiments and of being practiced or of being carried out in various ways. Also, it is to be understood that the phraseology and terminology used herein is for the purpose of description and should not be regarded as limiting. The use of “including,” “comprising,” or “having” and variations thereof herein is meant to encompass the items listed thereafter and equivalents thereof as well as additional items. Unless specified or limited otherwise, the terms “mounted,” “connected,” “supported,” and “coupled” and variations thereof are used broadly and encompass both direct and indirect mountings, connections, supports, and couplings. Further, “connected” and “coupled” are not restricted to physical or mechanical connections or couplings. 
         [0014]    Additionally, the functionality described herein as being performed by one component may be performed by multiple components in a distributed manner. Likewise, functionality performed by multiple components may be consolidated and performed by a single component. Similarly, a component described as performing particular functionality may also perform additional functionality not described herein. For example, a device or structure that is “configured” in a certain way is configured in at least that way, but may also be configured in ways that are not listed. Furthermore, some embodiments described herein may include one or more electronic processors configured to perform the described functionality by executing instructions stored in non-transitory, computer-readable medium. Similarly, embodiments described herein may be implemented as non-transitory, computer-readable medium storing instructions executable by one or more electronic processors to perform the described functionality. Described functionality can be performed in a client-server environment, a cloud computing environment, a local-processing environment, or a combination thereof. 
         [0015]    Autoencoders 
         [0016]    Autoencoders are a type of deep neural network that can be used to reduce data dimensionality. Deep neural networks are composed of many layers of neural units, and in autoencoders, every pair of adjacent layers forms a full bipartite graph of connectivity. The layers of an autoencoder collectively create an hourglass figure where the input layer is large and subsequent layer sizes reduce in size until the center-most layer is reached. From there until the output layer, layer sizes expand back to the original input size. 
         [0017]    For example,  FIG. 1  represents an autoencoder structure  10  composed of nine layers  15 . Every layer  15  in the network  10  is fully connected with its adjacent layers. The layer sizes are 30 units (input), 60 units, 40 units, 20 units, 3 units, 20 units, 40 units, 60 units, and 30 units (output). Autoencoder-derived features are pulled from the center-most layer composed of 3 units. The number of units and layers shown with  FIG. 1  are exemplary. 
         [0018]    Data passed into an autoencoder experiences a reduction in dimensionality. With each reduction, the network summarizes the data as a set of features. With each dimensionality reduction, the features become increasingly abstract. (A familiar analogy is image data: originally an image is a collection of pixels, which can first be summarized as a collection of edges, then as a collection of surfaces formed by those edges, then a collection of objects formed by those surfaces, etc.). At the center-most layer, the dimensionality is at a minimum. From there, the network reconstructs the original data from the abstract features and compares the reconstruction result against the original data. Based on the error between the two, the network uses backpropagation to adjust its weights to minimize the reconstruction error. When reconstruction error is low, one can be confident that the feature set found in the center-most layer of the autoencoder still carries important information that accurately represents the original data despite the reduced dimensionality. In  FIG. 2 , one can see that much of the original card shape&#39;s information  20  is retained within the abstract features  25  generated by the autoencoder enough to reconstruct the original data relatively accurately. 
         [0019]    Performing a similar reconstruction may not be feasible with hand-selected features. In one example, the hand-selected features are card area, peak surface load, and minimum surface load. Using just these three features loses some important information. For example, it would be hard to determine that gas-locking is occurring in the well pictured in  FIG. 2 . There are many possible card shapes one can draw that have the same card area, peak surface load, and minimum surface load, most of which will not necessarily show indications of gas-locking. But if autoencoder-derived abstract features are used and one looks at the reconstruction, such as in  FIG. 2 , one can see the stroke pattern that indicates that the gas-locking behavior is preserved. 
         [0020]    Dimensionality Reduction 
         [0021]    Reducing the dimensionality of data is helpful for many reasons. An immediately obvious application is storage: by representing data using fewer dimensions, the amount of memory required is reduced while suffering only minor losses in fidelity. While storage capacity is of less concern nowadays, limited bandwidth may still be an issue, especially in oilfields. One can look at the savings achievable with an autoencoder. Rod pumps, for example, used in this disclosure, for each card shape, transmit 30 points of position versus load. Once trained, an autoencoder can represent the 30 original values using only 3 values. Compression using autoencoders is not a lossless process, but as  FIG. 2  shows, the error is small. 
         [0022]    One may also want to avoid the curse of dimensionality in which machine learning algorithms run into sampling problems, reducing the predictive power of each training example. As the number of dimensions grows, the number of possible states (or volume of the space) grows, e.g., exponentially. Thus, to ensure that there are several examples of each possible state shown to the learning algorithm, one could provide exponentially greater amounts of training data. If we cannot provide this drastically increased amount of data, the space may become too sparse for the algorithm to produce any meaningful results. 
         [0023]    Constructing and Training Autoencoders 
         [0024]    The final form of an autoencoder can be built in two steps. First, the overall structure is created by stacking together several instances of a type of artificial neural network known as a Restricted Boltzmann Machine (RBM). These RBMs are greedily trained one-by-one and form the layered structure of the autoencoder. After this greedy initial training, the network begins fine-tuning itself using backpropagation across many epochs. 
         [0025]    An RBM is an artificial neural network that learns a probability distribution over its set of inputs. RBMs are composed of two layers of neural units that are either “on” or “off.” Neurons in one layer are fully connected to neurons in the other layer but connections within a single layer are restricted (see  FIG. 3 ). There are no intra-layer connections, and the network can be described as a bipartite graph. The first layer  30  is called the visible layer and the second layer  35  is called the hidden layer. This restricted property allows RBMs to utilize efficient training algorithms that regular Boltzmann Machines cannot use. 
         [0026]    The two layers within an RBM are known as the visible and hidden layers. The goal of training an RBM is to produce a set of weights between the neural units such that the hidden units can generate (reconstruct) the training vectors with high probability in the visible layer. An RBM can be described in terms of energy, and the total energy is the sum of the energies of every possible state in the RBM. One can define the energy E of a network state v as 
         [0000]    
       
         
           
             
               
                 
                   
                     E 
                      
                     
                       ( 
                       v 
                       ) 
                     
                   
                   = 
                   
                     
                       - 
                       
                         
                           ∑ 
                           i 
                           
                               
                           
                         
                          
                         
                           
                             s 
                             i 
                             v 
                           
                            
                           
                             b 
                             i 
                           
                         
                       
                     
                     - 
                     
                       
                         ∑ 
                         
                           i 
                           &lt; 
                           j 
                         
                         
                             
                         
                       
                        
                       
                         
                           s 
                           i 
                           v 
                         
                          
                         
                           s 
                           j 
                           v 
                         
                          
                         
                           w 
                           ij 
                         
                       
                     
                   
                 
               
               
                 
                   [ 
                   E1 
                   ] 
                 
               
             
           
         
       
     
         [0000]    where s i   v  is the binary (0 or 1) state of unit i as described by the network state v, b i  is the bias of unit i, and w ij  is the mutual weight between units i and j. The total energy of all possible states, then, is 
         [0000]    
       
         
           
             
               
                 
                   
                     ∑ 
                     u 
                     
                         
                     
                   
                    
                   
                     - 
                     
                       E 
                        
                       
                         ( 
                         u 
                         ) 
                       
                     
                   
                 
               
               
                 
                   [ 
                   E2 
                   ] 
                 
               
             
           
         
       
     
         [0000]    and one can find the probability that the network will produce a specific network state x by taking the log expression 
         [0000]    
       
         
           
             
               
                 
                   
                     P 
                      
                     
                       ( 
                       x 
                       ) 
                     
                   
                   = 
                   
                     
                       e 
                       
                         - 
                         
                           E 
                            
                           
                             ( 
                             x 
                             ) 
                           
                         
                       
                     
                     / 
                     
                       
                         ∑ 
                         u 
                         
                             
                         
                       
                        
                       
                         e 
                         
                           - 
                           
                             E 
                              
                             
                               ( 
                               u 
                               ) 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   [ 
                   E3 
                   ] 
                 
               
             
           
         
       
     
         [0027]    The method of training RBMs is known as contrastive divergence (CD). Each iteration of CD is divided into positive and negative phases. In the positive phase, the visible layer&#39;s state is set to the same state as that of a training vector (a card shape in our case). Then, according to the weight matrix describing the connection strengths between neural units, the hidden layer&#39;s state is stochastically determined. The algorithm records the resulting states of the hidden units in this positive phase. Next, in the negative phase, the hidden layer&#39;s states and the weight matrix stochastically determine the states of the visible layer. From there, the network uses the visible layer to determine the final state of the hidden units. After this, the weights can be according to the equation 
         [0000]      Δ w   ij =ε(( v   i   h   j ) data −( v   i   h   j ) reconstruction )  [E4]
 
         [0000]    where ε is the learning rate, &lt;v i h j &gt; data  is the product of visible and hidden units in the positive phase, and &lt;v i h i &gt; reconstruction  is the product of visible and hidden units in the negative phase. 
         [0028]    Once the first RBM is trained using the CD method, all the training vectors are shown to the RBM once more and record the resulting hidden unit states are recorded corresponding to each vector. Then the next RBM in the “stack” can be moved to within the autoencoder and to the hidden states are used as input vectors into the new RBM, beginning the process anew. From there, the new RBM is trained, new hidden states are gathered, and the next RBM in line is trained. This is a greedy training method because the CD process only requires local communication between adjacent layers. 
         [0029]    Once all RBMs in the autoencoder have been trained, the process of standard gradient descent using backpropagation begins. Normally, gradient descent requires labels to successfully backpropagate error, which implies supervised training. However, due to the function and structure of the autoencoder, the data labels happen to be the data itself: the autoencoder&#39;s goal is to accurately reproduce the data using lower dimension encodings. 
         [0030]    Data 
         [0031]    In some systems, dynamometer card shape data is two-dimensional and measures rod pump position versus load. Each oil well generates card shapes every day, and these card shapes are used to classify wells into normal and failure categories. From these card shapes, one can hand-select the following three features: card area, peak surface load, and minimum surface load. These three features are used as inputs for an SVM model. The results represent the typical case where one uses hand-selected features as inputs to the classification algorithm.  FIG. 4  represents an example of this prior art system  40 . 
         [0032]    To generate a feature set derived from autoencoders, the raw data is processed first.  FIG. 5  provides an example of a system  45  utilizing an autoencoder  50 . In one example, one is more with the general shape of a card rather than absolute values of position or load, and because one wants to compare card shapes across many different wells, the card shapes are normalized to a unit box. Furthermore, one can interpolate points in the card shapes so that each shape contains 30 points: 15 points for the upstroke and 15 points for the downstroke. 
         [0033]    The autoencoder used to generate the abstract features, in one example, is composed of 9 layers. The layer sizes are 30 units (input), 60 units, 40 units, 20 units, 3 units, 20 units, 40 units, 60 units, and 30 units (output/reconstruction). After autoencoder training and testing, the abstract features are collected from the center-most layer that consists of 3 units. Thus, from the original raw card shapes, a 3-feature abstract representation is chosen to pass to the SVM model (because one only wants to replace the hand-selected features). The results represent the case where autoencoder-derived features are used as inputs to classification algorithm. 
         [0034]    A final setup in one example uses a mix of autoencoder-derived features and hand-selected features. One dataset uses 3 autoencoder features concatenated with card area, peak surface load, and minimum surface load features to generate 6-dimensional data vectors. Another reduced dataset uses 3 autoencoder features concatenated with just card area to generate 4-dimensional data vectors. 
         [0035]    Results 
         [0036]    Whenever a well reports downtime for any reason, it is considered a failure scenario. When the SVM model, upon reviewing a day&#39;s card shape, makes a failure prediction, one can look ahead in a 30-day window in the data to see whether there is any well downtime reported. If there exists at least one downtime day within that window, the prediction can be considered to be correct. This is how one can calculate the failure prediction precision. Furthermore, we compress failure predictions on consecutive days into a single continuous failure prediction (e.g. failure predictions made for day x, day x+1, and day x+2 would be considered a single failure classification). 
         [0037]    For calculating the failure prediction recall, each reported failure date is examined and the 30 days preceding the failure. If there is at least one failure prediction during this period of time, the failure can be correctly predicted. Otherwise, the failure is missed. 
         [0038]    Using the three hand-selected features (card area, peak surface load, minimum surface load), in one test implementation, the inventors obtained a failure prediction precision of 81.4% and a failure prediction recall of 86.4%. 
         [0039]    After passing the raw data through an autoencoder to obtain three abstract features describing the shapes, the new features are used as inputs to the SVM. Under this arrangement, in one test implementation, the inventors obtained a failure prediction precision of 90.0% and a failure prediction recall of 86.1%. An expected improvement in failure prediction precision may be in the range of 10% with negligible change in failure prediction recall. 
         [0040]    The results show that the use of autoencoder-derived features as input to an SVM produces better results than using hand-selected features. A precision improvement from 81.4% to 90.0% will almost halve the number of false alerts in a failure prediction system. At the same time, the improved precision does not come at any significant cost to recall. 
         [0041]    Additional experiments were conducted by altering the size of our failure prediction window. The results are in Table 1 and Table 2. 
         [0000]    
       
         
               
             
               
               
               
               
               
             
               
               
               
               
               
               
             
           
               
                 TABLE 1 
               
             
             
               
                   
               
               
                 Precision and recall results for differing failure window sizes using 
               
               
                 3 hand-selected features. 
               
             
          
           
               
                   
                 30 days 
                 40 days 
                 50 days 
                 60 days 
               
               
                   
                   
               
             
          
           
               
                   
                 Precision 
                 81.4 
                 85.0 
                 99.6 
                 100.0 
               
               
                   
                 Recall 
                 86.4 
                 88.1 
                 92.9 
                 97.0 
               
               
                   
                   
               
             
          
         
       
     
         [0000]    
       
         
               
             
               
               
               
               
               
             
               
               
               
               
               
               
             
           
               
                 TABLE 2 
               
             
             
               
                   
               
               
                 Precision and recall results for differing failure window sizes using 
               
               
                 3 autoencoder-derived features. 
               
             
          
           
               
                   
                 30 days 
                 40 days 
                 50 days 
                 60 days 
               
               
                   
                   
               
             
          
           
               
                   
                 Precision 
                 90.0 
                 94.4 
                 99.6 
                 96.0 
               
               
                   
                 Recall 
                 86.1 
                 89.8 
                 93.2 
                 97.6 
               
               
                   
                   
               
             
          
         
       
     
         [0042]    The learning task is more difficult with a smaller failure window due to the size of the date range in our data. The disclosed data spans half a year, so a window of 60 days already spans one-third of the data. Simply predicting failure randomly would still produce a superficially decent result. One sees that when the learning task becomes less trivial, the use of autoencoder-derived features as input to the SVM produces better precision values. Thus, additional emphasis is placed on the results of the 30-day window, where performance differences are both more relevant and more substantial. 
         [0043]    For an extension of the previous efforts, the same procedure was repeated with hybrid feature sets consisting of autoencoder-derived features mixed with hand-selected features. The results are summarized in Table 3. 
         [0000]    
       
         
               
             
               
               
               
               
               
             
               
               
               
               
               
               
             
           
               
                 TABLE 3 
               
             
             
               
                   
               
               
                 Precision and recall results for differing failure window sizes using a 
               
               
                 hybrid feature set consisting of 3 autoencoder-derived features 
               
               
                 and 3 hand-selected features. 
               
             
          
           
               
                   
                 30 days 
                 40 days 
                 50 days 
                 60 days 
               
               
                   
                   
               
             
          
           
               
                   
                 Precision 
                 65.8 
                 71.1 
                 78.6 
                 83.0 
               
               
                   
                 Recall 
                 63.3 
                 63.2 
                 71.0 
                 75.3 
               
               
                   
                   
               
             
          
         
       
     
         [0044]    The results of using a hybrid feature set are poor compared to using solely autoencoder features or hand-selected features. To test this, Table 4 includes the results from using 4 dimensions: 3 autoencoder features and card area. 
         [0000]    
       
         
               
             
               
               
               
               
               
             
               
               
               
               
               
               
             
           
               
                 TABLE 4 
               
             
             
               
                   
               
               
                 Precision and recall results for differing failure window sizes using three 
               
               
                 autoencoder-derived features and card area for a total of 4 dimensions. 
               
             
          
           
               
                   
                 30 days 
                 40 days 
                 50 days 
                 60 days 
               
               
                   
                   
               
             
          
           
               
                   
                 Precision 
                 86.7 
                 87.8 
                 96.5 
                 99.3 
               
               
                   
                 Recall 
                 86.4 
                 88.9 
                 93.3 
                 97.2 
               
               
                   
                   
               
             
          
         
       
     
         [0045]    The results from using a 4-dimension mixed set are better than those from using a 6-dimension mixed set. They are still not as good as using purely autoencoder-derived features, though they do fare better than using only hand-selected features. There could be many reasons for this beyond simply dimensionality issues—attempting to combine disparate feature sets may increase the difficulty of learning, for example.  FIG. 6  depicts a comparison of SVM results for different feature set. 
         [0046]    Discussion 
         [0047]    Despite the power of machine learning, simply throwing raw data at various algorithms will produce poor results. Picking a good feature set to represent the raw data in machine learning algorithms can be difficult: to avoid the curse of dimensionality, the feature set should remain small, yet if one uses too few dimensions to describe the data, important information that is helpful for making correct classifications in machine learning may be lost. Hand-selecting features works but requires extensive experience or experimentation with the data, which can be time-consuming or technically difficult. But if one uses autoencoders to generate feature sets, we can achieve comparable results even though the process is unsupervised. 
         [0048]    Using autoencoder-derived features as inputs to machine learning algorithms is a generalizable technique that can be applied to most any sort of data. In one example, one uses it for dynamometer data, but in principle the technique can be applied to myriad types of data. Originally, autoencoders were applied towards pixel and image data; here it was modified for use with position and load dynamometer data. It is envisioned that it can be applied to time-series data gathered from electrical submersible pumps. If a problem involves complex, high-dimensional data and there exists potential for machine learning to provide a solution, using autoencoder-derived features as input to the learning algorithm might prove beneficial. 
         [0049]    Accordingly, the invention provides new and useful method of predicting failures of an apparatus and a failure prediction system including the method. Various features and advantages of the invention are set forth in the following claims.