7.4 What Could Go Wrong?
In this chapter on feature engineering for deep learning, we explored integrating data preprocessing directly into TensorFlow/Keras workflows. However, even with these streamlined pipelines, several potential issues can arise. Here are common pitfalls to be aware of:
7.4.1 Mismatched Preprocessing Between Training and Inference
If preprocessing steps differ between training and inference, it can lead to discrepancies in data distribution, causing the model to underperform when deployed.
Solution: Use Keras preprocessing layers or tf.data transformations within the model. This ensures consistency, as the same transformations are applied during both training and inference.
7.4.2 Data Leakage During Preprocessing