Skip to content
프로젝트

cttsai1985/kaggle-statoil-iceberg-solution

GitHub에서 보기

소개

Radar ship/iceberg solution. Historical log loss: public 0.19348 / private 0.19311 (public Top 49.76%); modern CNN: 0.21463 / 0.19855 (public Top 59.46%). Public reference: 2026-11-09.

AI 및 머신러닝

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Statoil: Iceberg and Ship Classification

Remote marine operations need timely information about possible ice hazards. The Statoil/C-CORE challenge focuses on one step: distinguish ships from icebergs in supplied radar image candidates. This solution uses paired HH/HV channels, a compact PyTorch CNN and grouped validation to produce iceberg probabilities.

The inference study finds a useful improvement: four-flip averaging lowers known-angle OOF log loss for both model variants. Adding incidence-angle metadata looks stronger on the aggregate metric, but 95% of that gain comes from missing-angle training records, a cohort absent from the test set. That difference changes which result should guide the inference recipe.

The potential operating role is to support an analyst's candidate-review queue. Problem and value connects model probabilities to review decisions; the retained workflow generates all 8,424 test predictions and verifies the saved preprocessing and weights used to produce them.

Model comparison · Results · Run the solution

Results

Leaderboard scores — log loss ↓.

Model / submission Public LB Private LB Public Top %
Historical single model, 2017-10-30 0.19348 0.19311 49.76%
Historical second single model, 2017-10-30 0.20507 0.20730 55.95%
Modern metadata CNN with four-flip inference 0.21463 0.19855 59.46%

Public Top % uses the 2026-11-09 public leaderboard snapshot (score-equivalent comparison, not an awarded final rank). Detailed results · Reference ranks, ties and calculation.

Private Top % is unavailable without a matched private leaderboard; OOF/holdout results have no leaderboard percentile.

Concentrated, repeatable errors

The hardest 161 of 1,604 retained OOF examples contribute 73.02% of total log loss; 134 remain in the hardest cohort across both training seeds. Most have known incidence angles, so missing metadata alone does not explain the failures. This motivates inspecting image and acquisition conditions before adding model capacity. Hard-case concentration, angle slices and next experiment.

What the zoom comparison shows

Extreme zoom raises the paired ensemble known-angle OOF log loss by 0.004056 versus mild zoom. The two seed deltas are +0.006397 and +0.003993; 8/10 paired seed/fold deltas worsen and 2/10 improve. The default remains unchanged; this is a matched research comparison, not a new leaderboard result. Study and limits · Executed notebook.

Model

A compact convolutional network learns spatial features from both radar bands together. Four progressively downsampled stages feed global average and maximum pooling; a dense head produces an iceberg probability. Native batch normalization, LayerNorm and AdamW replace the historical training implementation.

Channel scaling is fitted on training records only. Spatial augmentation transforms both channels together. An optional metadata branch combines the image features with a training-imputed, standardized incidence angle and a missingness indicator. The image-only and metadata variants share the same validation split.

The original Keras source is preserved in legacy/. Model and training changes describe the differences from the 2017 method.

Validation and results

The primary validation workflow uses five stratified folds grouped by observed incidence angle across two fixed training seeds. It retains every fold and reports pooled OOF metrics, fold dispersion, seed sensitivity and missing-metadata strata. The CV guide explains the protocol and analyzer.

Recorded metadata-reference CV diagnostic Observed result
Known-angle OOF log loss (test metadata availability) 0.2206
All-row paired-seed OOF log loss 0.2048
All-row training-seed pooled-loss range 0.0045
Known-angle overlap between fit/validation 0 in every fold
OOF coverage All 1,604 records, once per seed

All 133 missing-angle records are ships, while test records have known angles. The analyzer keeps both strata visible; known-angle performance is the more relevant test-cohort diagnostic. Folds and seeds are retained, including the weakest fold. Reported dispersion is descriptive, not a confidence interval.

The original single-model submissions scored 0.19348 and 0.20507 on the public leaderboard. These provide the historical benchmark. Current experiment results and their evaluation scope are recorded in benchmark results, with fingerprints in the validation receipt.

A separate model-development experiment uses the original 256-record holdout. Its metadata CNN scored 0.2012 holdout log loss, followed by 0.21463 public / 0.19855 private on Kaggle. It does not beat the best historical result; these scores are reported separately from the grouped CV.

Use the saved model

The model packaging and serving guide explains the actual input/output contract, export from saved artifacts and the shared HTTP parity check. A canary release retains the tested source, dependency lock and aggregate verification evidence; private model weights and request rows are not release assets.

Current real-model compatibility verification records the source, package/runtime identity, native-to-HTTP parity and rejected invalid request.

Which observations drive the improvement

A lower aggregate loss initially makes the angle branch look useful. Checking where that improvement comes from changes what the result can support: 95% of the all-row gain comes from 133 missing-angle ships, while test observations have known angles. On known-angle rows, the small benefit reverses sign between training seeds.

The model comparison therefore follows the population expected at inference. The report therefore retains known-angle and all-row results, both seeds and every fold; the metadata recipe stays a frozen reference alongside the simpler comparison. Evidence and reasoning · Executed checks.

Problem and data

Each observation contains two 75 × 75 radar bands, HH and HV polarization, and an incidence angle. The target is the probability that the observation contains an iceberg. The official dataset provides 1,604 labeled observations and 8,424 test observations. Predictions are evaluated with log loss, so confident mistakes are costly.

See the competition data description for field definitions and data access.

Run it yourself

Start with the executed walkthrough for the data, model decisions and measured results. The reproduction guide contains the complete download, training, evaluation and artifact recipe.

Use Python 3.12 or 3.13, authorized competition inputs and a fresh run directory.

Command-line reproduction
uv sync --locked --group dev --group lab --group data
export ICEBERG_DATA_DIR=/absolute/path/outside/git/iceberg
.venv/bin/kaggle auth login
.venv/bin/iceberg download --data-dir "$ICEBERG_DATA_DIR"
.venv/bin/iceberg validate --data-dir "$ICEBERG_DATA_DIR"
.venv/bin/iceberg cv --data-dir "$ICEBERG_DATA_DIR" \
  --config configs/metadata.json --run-dir .local/my-cv \
  --strategy grouped --folds 5 --split-seed 25 \
  --seeds 1017 2027 --workers 2 --device cpu
.venv/bin/iceberg analyze --run-dir .local/my-cv \
  --data "$ICEBERG_DATA_DIR/train.json"
.venv/bin/iceberg predict-cv --run-dir .local/my-cv \
  --data "$ICEBERG_DATA_DIR/test.json" --output .local/my-cv/submission.csv

Docker JupyterLab and dev container

With ICEBERG_DATA_DIR set:

.venv/bin/python scripts/create_lab_token.py
docker compose up --build -d lab

Open http://127.0.0.1:8890/lab using the token in the ignored .local/jupyter_token file. The container mounts project files, read-only data and writable experiment outputs. The dev container uses the same Docker image.

Kaggle notebook

The Kaggle entry notebook runs the package from an attached code wheel and saves predictions and experiment artifacts. See Kaggle execution for packaging, execution and scoring instructions.

Analysis notebook

The data-science notebook examines radar inputs, missing metadata, validation, model training, holdout predictions and test inference. It uses the same package as the command-line workflow.

Recovering a prediction batch

In the controlled batch drill, model verification and evaluation completed before an unavailable dependency blocked prediction and delivery. Repeating the entire job would mix an external failure with already completed scientific computation.

The runner instead preserves stage identities and output hashes. After the dependency is repaired, it reuses the evaluation, produces all 8,424 predictions in the expected ID order and verifies model bytes retrieved from storage. A separately rejected quality gate blocks delivery while retaining the original evaluation. This explains the separate evaluation, readiness and delivery states—and why retries must have an explicit scope.

This solution consumes shared orchestration, tracking and storage services. The evidence is a saved-model batch drill and client recovery tests, rather than a deployed maritime service. Consumer contract · Capability boundaries · Original walkthrough.

Model artifacts and delivery

The architecture guide explains package boundaries, training-only preprocessing, portable artifacts, failure recovery and the release process. Local notebooks, CLI commands, Docker and Kaggle use the same implementation.

Project layout

src/iceberg/     Data preparation, model, training, evaluation and CLI
configs/         Experiment recipes
notebooks/       Analysis and Kaggle entry notebooks
docs/            Results, methodology and operating guides
tests/           Data, model and workflow checks
docker/          Runtime image and shared-storage mount configuration
scripts/         Small packaging and runtime helpers
legacy/          Preserved 2017 implementation

Each experiment saves its configuration, split, source and input identities, metrics and checkpoint checksums. An optional MLflow import connects completed runs to an existing tracker. Shared storage and service deployment remain external; tracking and storage explains the integration.

Development

uv sync --locked --group dev --group serving --group tracking --group tracking-test
.venv/bin/ruff check src tests scripts
.venv/bin/ruff format --check src tests scripts
.venv/bin/pytest -q

Data, trained weights, credentials and prediction rows are excluded from Git.

License

Source code is licensed under the MIT License. Competition data follows its own terms.

관련 프로젝트 살펴보기

불러오는 중…