Chapter 2: AI-Ready Geoscience DataΒΆ
This chapter is the AI-ready-data pillar of the course. Machine learning projects in the geosciences succeed or fail on the quality of their data, and most of the work is upstream of any model: understanding what the data are, reading and writing standard formats, cleaning tables, reshaping arrays, resampling, characterizing distributions, transforming and filtering signals, generating honest synthetic data, engineering features, and reducing dimensionality. The chapter ends with a capstone lesson that defines AI-ready data operationally β provenance, metadata, tidy shapes, benchmark splits, and leakage controls β and that definition is graded in the final project. Three data streams run through the chapter and get equal treatment: gridded fields (climate rasters, imagery), regular high-rate sensor series (100 Hz seismograms, hourly tide gauges, daily GNSS), and irregular sparse point observations (multi-well groundwater networks, field campaigns) β because every geoscience project ends up handling at least two of them.
The Arc of the ChapterΒΆ
The lessons build in order:
- 2.1 Data Definitions β data modalities in geoscience; arrays vs data frames; common and cloud-optimized formats.
- 2.2 Data Formats β hands-on reading and writing of CSV, GeoJSON, GeoTIFF, netCDF, HDF5, Parquet, and Zarr; comparing file sizes on disk.
- 2.3 Pandas DataFrames β series and data frames, datetime handling, filtering, grouping, aggregating, and mapping station metadata.
- 2.4 Preparing DataFrames β cleaning a whole-rock geochemistry table: missing data, sentinel values, censored values at a detection limit, informative missingness, correlations, and per-class distributions.
- 2.5 Arrays β NumPy and Xarray arrays, indexing and reshaping, labeled dimensions, and a first look at PyTorch tensors.
- 2.6 Resampling β statistical resampling (randomization, bootstrap, Monte Carlo) for uncertainty, then signal resampling: anti-alias decimation of a tide-gauge record, gap-policy interpolation of a degraded GNSS series, aggregation of an irregular multi-well network, and the block bootstrap for correlated noise β synthetic and real GNSS throughout.
- 2.7 Statistical Considerations β moments, distributions, and the Gutenberg-Richter law, on synthetic and real geochemical data.
- 2.8 Spectral Transforms β Fourier and wavelet transforms of seismograms and 2D fields.
- 2.9 Filtering β low-, high-, and band-pass filtering; zero-phase vs causal filters; separating trend, seasonal cycle, and noise; filtering across gaps and recovering a clock error on a real seismogram.
- 2.10 Synthetic Data β building synthetic seismograms and spectrum-matched noise; a worked STA/LTA detection-floor measurement with binomial error bars; when synthetic data is admissible in science.
- 2.11 Feature Engineering β hand-built and automated features for time series, with a real seismic waveform benchmark.
- 2.12 Dimensionality Reduction β PCA, EOFs on climate fields, ICA, and t-SNE.
- 2.13 AI-Ready Data (Capstone) β the operational checklist: data cards, benchmark splits, the raster-to-station join for gridded covariates, leakage-by-preprocessing, and correct splits for autocorrelated data.
The chapter closes with the final project assignment for this pillar (2.20): build an AI-ready dataset for your own project, with a data card and benchmark splits, following the 2.13 checklist.
Learning OutcomesΒΆ
By the end of this chapter, you will:
- Recognize the data types, modalities, and formats common in the geosciences, including cloud-optimized formats.
- Manipulate tabular data with Pandas and array data with NumPy and Xarray.
- Characterize data with statistical moments, distributions, and resampling methods.
- Repair instrument pathologies β gaps, aliasing, timing errors, censored values β with the repair graded against known ground truth.
- Apply Fourier and wavelet transforms and design digital filters.
- Generate synthetic data responsibly and disclose its use.
- Engineer features and reduce dimensionality for downstream ML tasks.
- Assemble an AI-ready dataset with documented provenance, a data card, and leakage-safe benchmark splits.
AssignmentsΒΆ
- Final Assignment (2.20): Build an AI-ready dataset for your final project. Apply the 2.13 checklist: document provenance and licensing, write a data card, define benchmark splits, and demonstrate that your preprocessing does not leak information across splits.