AI Preprocessing Difficulty — Text, Image, Audio, Video, 3D in Order of Complexity
model(input) is one line, but the preprocessing to create that input is completely different per domain
All AI inference follows this structure:
processed_input = preprocess(raw_data) # ← differs by domain
output = model(processed_input) # ← always the same
result = postprocess(output) # ← differs by domain
model(input) just takes a PyTorch tensor and returns a tensor. The challenge is converting raw data into that tensor.
Level 1: Text — Tokenization (★☆☆☆☆)
Easiest. Start here.
tokens = tokenizer("Hello world")["input_ids"]
# → [15496, 995] — lookup table, that's it
Why easy: 1D sequence, discrete integers, deterministic, tiny data.
Level 2: Tabular Data — Normalize (★★☆☆☆)
features = (features - features.mean()) / features.std()
Already numbers. Just scale them.
Level 3: Image — Resize + Normalize (★★☆☆☆)
preprocess = transforms.Compose([Resize(224), CenterCrop(224), ToTensor(), Normalize(...)])
tensor = preprocess(Image.open("cat.jpg")) # [3, 224, 224]
Why harder than text: continuous values, larger data, need normalization stats.
Level 4: Audio — STFT + Mel (★★★★☆)
mel_spec = MelSpectrogram(sr=44100, n_fft=2048, n_mels=80)(wav)
log_mel = torch.log(mel_spec + 1e-9) # [80, time_frames]
Why hard: need Fourier transform understanding, model-specific hyperparameters, non-intuitive frequency domain.
Level 5: Video — Frames + Temporal (★★★★☆)
frames = video[sampled_indices] # [16, 3, 224, 224]
Image preprocessing × N frames + temporal dimension + sampling strategy.
Level 6: 3D / Point Clouds (★★★★★)
points -= centroid; points /= max_dist # normalize
points = farthest_point_sampling(points, 1024) # [1024, 3]
Hardest: irregular data, order-invariant, coordinate alignment, immature ecosystem.
Study Order
- Text → 2. Image → 3. Audio → 4. Video → 5. 3D
Text has the shortest distance to model(input). That's why it's the best starting point.
Key Concepts
Text (★☆☆☆☆) — tokenization is a lookup table. String → integer array. Easiest
Image (★★☆☆☆) — resize + normalize. Convert to [3, 224, 224] tensor
Audio (★★★★☆) — STFT + mel filter bank + log scale. Requires Fourier transform understanding
Video (★★★★☆) — frame sampling + image preprocessing × N frames + temporal dimension
3D (★★★★★) — point cloud normalization + FPS + coordinate alignment. Hardest