I am trying to predict the lithofacies, i.e. the rock type, from well log data, a project very similar to the one described in this tutorial.

A well log can be seen as a 1D curve tracking how a given property (e.g. gamma radiation, electrical resistivity, etc...) varies as a function of depth. The idea is to use these 1D arrays as the input features to train a Machine Learning model (e.g. SVM or Random Forest), to infer the facies at a given depth. For instance, in the image below:

  • the first 5 tracks (GR to PE) are the well logs used as features
  • while the last 2 tracks (Facies and Prediction) correspond to the true and predicted facies.

enter image description here

One of my colleague started using depth as a feature, thus obtaining much higher scores than when working with well logs only.

While this may make sense from a geological standpoint, as certain rock types are expected within a given depth range, I think that this will cause model overfitting [EDIT from June 1, 2022] I am concerned that doing so would put "too much constraint" on the model.

Is this explanation correct, or may depth (or position) be used as a feature to train a ML model?


1 Answer 1


I don't see any problem using depth. Instead of putting "too much constraint" on, I would say it provide "extra information" or "predictive power" to the model, just like the well logs. This is what a feature does.

Think it in another way, if depth would harm the model (say by 'overfit'), I can argue that any of the 5 tracks of well log features could do the same.

As a separate topic, "putting extra constraint on a model" usually ease overfitting, which is often done deliberately. This technique is called regularization.

  • $\begingroup$ Thanks for your answer, @Ipounng! You make a valid point: I know regularization from geophysical data inversion and it does indeed prevent overfitting by promoting a certain behavior (e.g. smoothness or "blockyness"). In that regards, you are right that constraining the model prevents it from overfitting. $\endgroup$
    – Sheldon
    Jun 1, 2022 at 19:59
  • $\begingroup$ Maybe I did not phrase my question properly. Imagine an algorithm aiming to identify a given target (e.g. a dog) from a series of photos. Would it make sense to use the position of the dog in each picture as a feature? $\endgroup$
    – Sheldon
    Jun 1, 2022 at 20:00
  • $\begingroup$ No sure if the dog example is a good comparison to the original question, but yes! ( if we know whereabouts a dog is in advance) This points the model to focus on important area thus improving performance. $\endgroup$
    – lpounng
    Jun 2, 2022 at 1:10
  • 1
    $\begingroup$ Another example from medical field: given some medical images (X-ray/MRI etc.), task to identify whether a certain tumor exist or not. A popular strategy is to train a model to seek potential areas which such tumor potentially exists (segmentation phase), then use these areas as input to train another model which classify if a tumor exists or not. $\endgroup$
    – lpounng
    Jun 2, 2022 at 1:16
  • 1
    $\begingroup$ True! Otherwise the model may be biased to keep looking at that corner. And this is a reason why we do image augmentation / a lot of random cropping and centering etc. in image classification to prevent overfitting. $\endgroup$
    – lpounng
    Jun 2, 2022 at 1:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.