Kaggle Data Format Verification Before Research
Problem
Competition names and file sizes can be misleading. Investing in RAG research, technical
planning, or model architecture design before verifying the actual data format leads to
significant wasted effort when assumptions don't match reality.
Real example:
- Competition: "vesuvius-challenge-surface-detection"
- Expected (from RAG): 3D TIFF stacks, TopoScore, 128³ patches
- Actual data: 2D grayscale images (320×320), binary masks
- Waste: Hours of RAG research on wrong problem
Context / Trigger Conditions
Use this skill when:
- Starting ANY new Kaggle competition
- Competition name is ambiguous about data dimensionality (2D vs 3D)
- Data size suggests one format but could be another
- Planning to do RAG research or extensive technical planning
- File extensions are generic (.tif, .png, .npy could be anything)
Red flags:
- Competition name mentions "3D", "volume", "surface" but you haven't verified
- Large download size (>5GB) but unsure what format it actually is
- Multiple data directories with unclear purpose (train_images vs train vs train_data)
Solution
Phase 1: Quick Format Check (Before ANY Research)
Step 1: Download only a sample first
# If possible, download just one file to verify format
# Or download full data but check structure immediately
kaggle competitions download -c {competition-slug}
unzip {competition-file}.zip
Step 2: Verify data structure in <5 minutes
import os
from PIL import Image
import numpy as np
# Quick check script
data_dir = "path/to/unzipped/data"
# What files exist?
print("Directories:", [d for d in os.listdir(data_dir) if os.path.isdir(os.path.join(data_dir, d))])
print("Files:", [f for f in os.listdir(data_dir) if os.path.isfile(os.path.join(data_dir, f))][:10])
# Check dimensions of first sample
samples = []
for root, dirs, files in os.walk(data_dir):
for f in files:
if f.endswith(('.tif', '.png', '.jpg', '.npy')):
path = os.path.join(root, f)
if f.endswith('.npy'):
data = np.load(path)
else:
data = np.array(Image.open(path))
print(f"Sample: {f}")
print(f" Shape: {data.shape}")
print(f" Dtype: {data.dtype}")
print(f" Range: [{data.min()}, {data.max()}]")
samples.append({
'path': path,
'shape': data.shape,
'dtype': str(data.dtype)
})
if len(samples) >= 3:
break
if len(samples) >= 3:
break
# Determine data type
if all(len(s['shape']) == 2 for s in samples):
print("✓ Data Type: 2D Images")
elif all(len(s['shape']) == 3 for s in samples):
print("✓ Data Type: 3D Volumes")
else:
print("⚠ Mixed or irregular dimensions")
Step 3: Confirm with competition description
# Read competition description on Kaggle
# Check Data tab for file descriptions
# Look at sample notebooks from other participants
Phase 2: Match Format to Approach
| Data Format |
Typical Approach |
Red Flags to Avoid |
| 2D Images |
U-Net 2D, ResNet, segmentation |
❌ Using 3D architectures |
| 3D Volumes |
nnU-Net 3D, 3D U-Net, V-Net |
❌ Flattening to 2D loses context |
| Tabular |
XGBoost, LightGBM, CatBoost |
❌ Using CNN/RNN unnecessarily |
| Time Series |
LSTM, GRU, Temporal Fusion |
❌ Treating as i.i.d. samples |
| Text |
Transformers, BERT, RoBERTa |
❌ Using bag-of-words |
Phase 3: Proceed with Confidence
Only AFTER verifying data format:
- Do RAG research with correct context
- Design appropriate architecture
- Plan training strategy
- Set up evaluation metrics
Verification
Success criteria:
- ✅ You know exact dimensions (2D vs 3D vs 4D)
- ✅ You know data type (image, volume, tabular, text)
- ✅ You know number of channels/samples
- ✅ You verified labels match expectations
- ✅ Research/planning now matches actual data
Failure signs (means you need to re-verify):
- ❌ Using 3D CNNs on 2D data
- ❌ Researching TopoScore for binary masks
- ❌ Planning patch extraction for already-small images
- ❌ RAG answers don't match your data structure
Example
Bad workflow (what happened):
- ❌ Saw competition name "vesuvius-challenge-surface-detection"
- ❌ Assumed 3D based on name
- ❌ Did extensive RAG research on 3D surface detection
- ❌ Created technical plan for 3D nnU-Net
- ❌ Downloaded 24GB data
- ❌ Discovered data is 2D segmentation
- ❌ Wasted hours on wrong approach
Good workflow (what should have happened):
- ✅ Saw competition name
- ✅ Downloaded data FIRST (5 minutes)
- ✅ Ran quick format check script (2 minutes)
- ✅ Discovered: 2D grayscale (320×320), binary masks
- ✅ Adjusted research query: "Vesuvius Challenge 2D segmentation"
- ✅ Created appropriate 2D U-Net plan
- ✅ Total time saved: Several hours
Notes
Why this happens:
- Competition names are marketing, not technical specs
- "Surface Detection" could mean 2D edge detection OR 3D surface reconstruction
- File size (24GB) could be: many 2D images OR fewer 3D volumes OR compressed videos
- Multiple Kaggle competitions may have similar names but different tasks
Time investment:
- Format check: 5-10 minutes
- Cost of skipping it: 2-10 hours of wasted research
Integration with RAG:
- Always verify data format FIRST
- Then use verified format in RAG queries
- Example: "2D grayscale segmentation for papyrus scrolls" NOT "Vesuvius Challenge 3D"
Related skills:
kaggle-competition-best-practices - Overall workflow
kaggle-top-performer-replication - After format is verified
kaggle-reid-submission-workflow - Task-specific workflows
References
1---2name: kaggle-data-format-first3description: Prevent wasted research by verifying Kaggle competition data format BEFORE investing in RAG, technical planning, or model architecture design. Use when: (1) Starting any new Kaggle competition, (2) Competition name/size is ambiguous about data format, (3) Planning to do extensive research before implementation, (4) Download size doesn't match expected data structure. Critical for competitions where name suggests one format (e.g., "3D Surface Detection") but actual data is different (e.g., 2D images).4---56# Kaggle Data Format Verification Before Research78## Problem910Competition names and file sizes can be misleading. Investing in RAG research, technical11planning, or model architecture design before verifying the actual data format leads to12significant wasted effort when assumptions don't match reality.1314**Real example**:15- Competition: "vesuvius-challenge-surface-detection"16- Expected (from RAG): 3D TIFF stacks, TopoScore, 128³ patches17- Actual data: 2D grayscale images (320×320), binary masks18- Waste: Hours of RAG research on wrong problem1920## Context / Trigger Conditions2122**Use this skill when**:23- Starting ANY new Kaggle competition24- Competition name is ambiguous about data dimensionality (2D vs 3D)25- Data size suggests one format but could be another26- Planning to do RAG research or extensive technical planning27- File extensions are generic (.tif, .png, .npy could be anything)2829**Red flags**:30- Competition name mentions "3D", "volume", "surface" but you haven't verified31- Large download size (>5GB) but unsure what format it actually is32- Multiple data directories with unclear purpose (train_images vs train vs train_data)3334## Solution3536### Phase 1: Quick Format Check (Before ANY Research)3738**Step 1**: Download only a sample first39```bash40# If possible, download just one file to verify format41# Or download full data but check structure immediately4243kaggle competitions download -c {competition-slug}44unzip {competition-file}.zip45```4647**Step 2**: Verify data structure in <5 minutes48```python49import os50from PIL import Image51import numpy as np5253# Quick check script54data_dir = "path/to/unzipped/data"5556# What files exist?57print("Directories:", [d for d in os.listdir(data_dir) if os.path.isdir(os.path.join(data_dir, d))])58print("Files:", [f for f in os.listdir(data_dir) if os.path.isfile(os.path.join(data_dir, f))][:10])5960# Check dimensions of first sample61samples = []62for root, dirs, files in os.walk(data_dir):63 for f in files:64 if f.endswith(('.tif', '.png', '.jpg', '.npy')):65 path = os.path.join(root, f)66 if f.endswith('.npy'):67 data = np.load(path)68 else:69 data = np.array(Image.open(path))7071 print(f"Sample: {f}")72 print(f" Shape: {data.shape}")73 print(f" Dtype: {data.dtype}")74 print(f" Range: [{data.min()}, {data.max()}]")7576 samples.append({77 'path': path,78 'shape': data.shape,79 'dtype': str(data.dtype)80 })8182 if len(samples) >= 3:83 break84 if len(samples) >= 3:85 break8687# Determine data type88if all(len(s['shape']) == 2 for s in samples):89 print("✓ Data Type: 2D Images")90elif all(len(s['shape']) == 3 for s in samples):91 print("✓ Data Type: 3D Volumes")92else:93 print("⚠ Mixed or irregular dimensions")94```9596**Step 3**: Confirm with competition description97```bash98# Read competition description on Kaggle99# Check Data tab for file descriptions100# Look at sample notebooks from other participants101```102103### Phase 2: Match Format to Approach104105| Data Format | Typical Approach | Red Flags to Avoid |106|-------------|------------------|-------------------|107| 2D Images | U-Net 2D, ResNet, segmentation | ❌ Using 3D architectures |108| 3D Volumes | nnU-Net 3D, 3D U-Net, V-Net | ❌ Flattening to 2D loses context |109| Tabular | XGBoost, LightGBM, CatBoost | ❌ Using CNN/RNN unnecessarily |110| Time Series | LSTM, GRU, Temporal Fusion | ❌ Treating as i.i.d. samples |111| Text | Transformers, BERT, RoBERTa | ❌ Using bag-of-words |112113### Phase 3: Proceed with Confidence114115**Only AFTER verifying data format**:1161. Do RAG research with correct context1172. Design appropriate architecture1183. Plan training strategy1194. Set up evaluation metrics120121## Verification122123**Success criteria**:124- ✅ You know exact dimensions (2D vs 3D vs 4D)125- ✅ You know data type (image, volume, tabular, text)126- ✅ You know number of channels/samples127- ✅ You verified labels match expectations128- ✅ Research/planning now matches actual data129130**Failure signs** (means you need to re-verify):131- ❌ Using 3D CNNs on 2D data132- ❌ Researching TopoScore for binary masks133- ❌ Planning patch extraction for already-small images134- ❌ RAG answers don't match your data structure135136## Example137138**Bad workflow** (what happened):1391. ❌ Saw competition name "vesuvius-challenge-surface-detection"1402. ❌ Assumed 3D based on name1413. ❌ Did extensive RAG research on 3D surface detection1424. ❌ Created technical plan for 3D nnU-Net1435. ❌ Downloaded 24GB data1446. ❌ Discovered data is 2D segmentation1457. ❌ Wasted hours on wrong approach146147**Good workflow** (what should have happened):1481. ✅ Saw competition name1492. ✅ Downloaded data FIRST (5 minutes)1503. ✅ Ran quick format check script (2 minutes)1514. ✅ Discovered: 2D grayscale (320×320), binary masks1525. ✅ Adjusted research query: "Vesuvius Challenge 2D segmentation"1536. ✅ Created appropriate 2D U-Net plan1547. ✅ Total time saved: Several hours155156## Notes157158**Why this happens**:159- Competition names are marketing, not technical specs160- "Surface Detection" could mean 2D edge detection OR 3D surface reconstruction161- File size (24GB) could be: many 2D images OR fewer 3D volumes OR compressed videos162- Multiple Kaggle competitions may have similar names but different tasks163164**Time investment**:165- Format check: 5-10 minutes166- Cost of skipping it: 2-10 hours of wasted research167168**Integration with RAG**:169- Always verify data format FIRST170- Then use verified format in RAG queries171- Example: "2D grayscale segmentation for papyrus scrolls" NOT "Vesuvius Challenge 3D"172173**Related skills**:174- `kaggle-competition-best-practices` - Overall workflow175- `kaggle-top-performer-replication` - After format is verified176- `kaggle-reid-submission-workflow` - Task-specific workflows177178## References179180- [GitHub - jayinai/how-to-kaggle](https://github.com/jayinai/how-to-kaggle) - Kaggle workflow research181- [Kaggle Competitions Documentation](https://www.kaggle.com/docs/competitions) - Official competition guidelines182- [Towards Data Science - Organizing Code for Kaggle](https://towardsdatascience.com/organizing-code-experiments-and-research-for-kaggle-competitions/) - Code organization best practices