After this lesson you can explain what a training dataset is and why data quality matters; describe the training loop including loss functions and gradient descent; distinguish between a model and its training process; explain inference and why it differs from training; and categorise AI learning approaches as supervised, unsupervised, or reinforcement learning.
Lesson 1 established that Machine Learning inverts classical programming: instead of writing rules, you provide data and let the machine discover the rules. But that description skips an enormous amount of engineering and mathematics. What does "providing data" actually mean? What does "learning" actually look like inside a computer? What is a model, and how do you know it has learned something useful?
These questions are not academic. Every practical AI deployment — a vessel maintenance anomaly detector, a document classification system for port state control reports, a generative model that drafts technical responses — is built on the foundations this lesson covers. You cannot evaluate an AI system's reliability, safety, or security without understanding how it was trained and what its failure modes are.
This lesson focuses on supervised learning — the dominant paradigm in production AI today — and introduces unsupervised and reinforcement learning as contrasting approaches. The mathematics is kept to intuition level; the goal is conceptual clarity, not derivation.
1. Data — The Foundation of Every Model
A dataset is a collection of examples, where each example is a pair: an input (also called a sample, observation, or instance) and an output (also called a label, target, or ground truth — in supervised learning). The model learns to map inputs to outputs by seeing thousands or millions of such pairs.
For a vessel engine vibration anomaly detector, each input might be 60 seconds of vibration sensor readings from a main engine bearing; each label might be "normal" or "pre-failure." For a maritime document classifier, each input might be the text of a port state control report; each label might be a category like "deficiency — fire safety" or "detained."
The training set is used to fit the model. The validation set is used to tune hyperparameters and detect overfitting during development. The test set is held out entirely until final evaluation — it simulates the model's performance on data it has never seen, which is what actually matters in deployment.
2. Features, Labels, and the Learning Signal
Features are the measurable properties of the input that the model uses to make predictions. For tabular data, features are the columns: vessel age, engine RPM, sea state, fuel consumption per nautical mile. For images, features are pixel values (or, in deep learning, learned representations of those pixels). For text, features are token embeddings — high-dimensional numerical vectors that represent each word or subword.
In classical ML, feature engineering is the art of choosing which features to compute from raw data. A domain expert decides that the ratio of fuel consumption to propeller speed is more predictive of engine wear than either measurement alone, and adds that ratio as a feature. In deep learning, the network learns features automatically from raw inputs — but the raw inputs must be in a form the network can process (pixels, tokens, audio spectrograms).
Everything a machine learning model processes must be a number. Text is converted to integers (token IDs) then to floating-point vectors (embeddings). Images are grids of RGB integers normalised to floats. Categorical variables (vessel type: "bulk carrier", "tanker", "container") are converted to one-hot encoded vectors or learned embeddings. The transformation from raw data to numerical representation is called encoding or preprocessing and is a source of subtle bugs and quality problems in production AI systems.
3. The Training Loop — How a Model Updates Its Parameters
A model is a mathematical function with parameters (also called weights): numbers that are initialised randomly and then iteratively adjusted during training. For a neural network, these are the connection weights between neurons. For a linear model, these are the coefficients in the equation y = w₁x₁ + w₂x₂ + b.
Training is the process of finding parameter values that make the model's predictions match the labels as closely as possible. This is formalised through a loss function — a measure of how wrong the model's current predictions are on the training set. Common loss functions include Mean Squared Error (for regression) and Cross-Entropy Loss (for classification).
The learning rate is one of the most important hyperparameters: too large and the parameter updates overshoot the minimum; too small and training is slow and may get stuck. Modern optimisers like Adam (Kingma and Ba, 2014, arXiv:1412.6980) adapt the learning rate per parameter, making training more robust. GPT-3 was trained with Adam; most production models use similar adaptive optimisers.
4. Overfitting, Underfitting, and Generalisation
The goal of training is not to minimise loss on the training set. The goal is to minimise loss on new data — data the model has never seen. This capability is called generalisation and it is the core challenge of machine learning.
❌ Underfitting
Model is too simple or trained too briefly. High loss on both training and test sets. Does not capture the patterns in the data. Fix: more complex model, longer training.
✅ Good Fit
Low loss on both training and test sets. Model captures real patterns without memorising noise. Generalises to new data. The goal.
⚠️ Overfitting
Model memorises training examples including noise. Very low training loss, high test loss. Does not generalise. Fix: regularisation, dropout, more data, early stopping.
For maritime AI, overfitting has a specific dangerous form: a maintenance anomaly model that is highly accurate on the training vessels but performs poorly on new vessel classes, or on the same vessels after a scheduled drydock that changed the baseline sensor readings. Regular re-evaluation on held-out data and periodic retraining with new operational data are operational requirements, not optional improvements.
5. Inference — The Model in Production
Inference is what happens when a trained model is deployed and used on new data. The parameters are frozen — no learning is happening. The model receives an input, runs a single forward pass, and produces an output. For an LLM, this is called "generation": the model autoregressively samples the next token until an end-of-sequence token is produced.
Training and inference have very different computational profiles. Training requires backpropagation across all parameters and all training examples — enormous GPU memory and compute over hours or days or weeks. Inference requires only a forward pass on a single input — much faster, though for large models like GPT-4, still requiring significant hardware.
Adversarial attacks exploit inference — they craft inputs designed to cause the model to produce an incorrect output without modifying the model's parameters. A manipulated AIS signal, a corrupted sensor reading, or a carefully constructed text prompt can steer a deployed model away from its intended behaviour. This is different from poisoning attacks (which modify training data) and model theft attacks (which replicate the model by querying it). Each attack vector requires a different defence.
6. Supervised, Unsupervised, and Reinforcement Learning
The training loop described above assumes labels — a ground-truth output for each input. This is supervised learning, the most widely deployed paradigm. But two other paradigms are increasingly important in maritime AI and in the LLMs at the core of this roadmap.
비지도 학습과 강화학습 개념이 실제 AI 에이전트 설계에 어떻게 적용되는지, Park et al. (2023) 논문을 통해 분석합니다. 이번 섹션 6을 읽은 후 이 논문 리뷰에서 learning paradigm의 실전 적용 사례를 확인하세요.
The dominant paradigm in LLM development combines all three: self-supervised pre-training (predict the next token in massive text corpora — no labels required), followed by supervised fine-tuning (train on high-quality curated examples of the desired behaviour), followed by RLHF (use human preference feedback to further align output quality). This three-stage pipeline produced ChatGPT (Ouyang et al., 2022, "Training language models to follow instructions with human feedback," arXiv:2203.02155).
7. Maritime Connection — Why Data Quality Is a Safety-Critical Problem
Maritime AI systems face dataset challenges that are structurally different from other domains. Unlike consumer AI, where training data is abundant (billions of web pages, millions of labelled images), maritime operational data is:
During E26 CRSI 프로젝트 수행, one of the most consistent gaps I observe is the absence of documented model validation for AI-based OT monitoring systems. Vendors often provide accuracy numbers from their internal testing — but those numbers were produced on their own proprietary dataset, which may not reflect the distribution of data on the vessel being assessed.
The key question to ask any AI vendor in a maritime cybersecurity context is: "What was the training data distribution, and how does it compare to our operational environment?" If they cannot answer that question specifically — naming vessel types, sensor types, operational condition ranges, time periods, and known data quality issues — the validation evidence is incomplete.
A model that is 97% accurate in aggregate may be 60% accurate on the specific failure mode that matters most for your vessel's risk profile. Training data provenance and distribution shift assessment should be treated as cybersecurity evidence, not just technical documentation.
- A dataset is a collection of (input, label) pairs. Quality, volume, balance, and distribution determine model performance more than any architectural choice.
- Features are the numerical representation of inputs. Feature engineering is the art of deciding which representations to compute; deep learning automates this for unstructured data.
- The training loop is: forward pass → compute loss → backpropagate gradients → update parameters. Repeat until convergence.
- Overfitting is the key failure mode: the model memorises training data but fails on new data. Regularisation, dropout, and early stopping mitigate it.
- Inference is the deployed use of a frozen model — computationally different from training, and the stage at which adversarial attacks are most relevant.
- The three learning paradigms — supervised, unsupervised, reinforcement — correspond to different problem structures and different failure modes.
- Maritime AI faces structural data quality challenges (sparse faults, sensor drift, fleet heterogeneity) that must be addressed in vendor assessment and IACS compliance review.
Lesson 3 — CNN, RNN and the Deep Learning Era examines the two neural architectures that dominated AI from 2012 to 2017: Convolutional Neural Networks (for spatial data — images) and Recurrent Neural Networks (for sequential data — time series and text). Understanding why CNNs and RNNs were breakthroughs — and why they were eventually superseded by the Transformer — is essential context for understanding why the Transformer architecture works the way it does.
- Goodfellow, I., Bengio, Y., and Courville, A. (2016). Deep Learning. MIT Press. Available free at deeplearningbook.org — the canonical textbook for training loop mechanics and optimisation.
- Kingma, D., and Ba, J. (2014). "Adam: A Method for Stochastic Optimization." arXiv:1412.6980.
- Ouyang, L., Wu, J., Jiang, X., et al. (2022). "Training language models to follow instructions with human feedback." arXiv:2203.02155 (InstructGPT / RLHF paper).
- Park, J., O'Brien, J., Cai, C., et al. (2023). "Generative Agents: Interactive Simulacra of Human Behavior." arXiv:2304.03442.
- IACS UR E26 (Rev.3, 2024) — Section 4.3: Network Monitoring and Verification. iacs.org.uk
- NIST AI RMF 1.0 (2023) — MAP Function: data quality as a risk factor in AI deployment. airc.nist.gov
⚓ Join the ShipPaulJobs Community
Join →
Comments
Post a Comment