Loading lesson...
Loading lesson...
This is the second of 8 Foundations modules. In Module 1, you learned what AI is and how AI, ML, and deep learning relate. This module examines the single most important factor in quality: data.
Amazon had been building computer programs since 2014 to review job applicants' resumes automatically, in a team based at its Edinburgh engineering hub that grew to around a dozen people. The group created 500 computer models tied to specific job functions and locations, and taught each to recognise some 50,000 terms that had appeared on past candidates' resumes. The tool scored candidates from one to five stars, much as shoppers rate products on the retail site. Recruiters looked at its recommendations, though they never relied on those rankings alone.
By 2015 the company had realised the system was not rating candidates for software developer jobs and other technical posts in a gender-neutral way. The models had been trained by observing patterns in resumes submitted to Amazon over a ten-year period, and most of those came from men. In effect the system taught itself that male candidates were preferable. It penalised resumes that included the word "women's", as in "women's chess club captain", downgraded graduates of two all-women's colleges, and favoured verbs more common on male engineers' resumes, such as "executed" and "captured".
Amazon edited the programs to make them neutral to those particular terms, but that was no guarantee the models would not find other ways of sorting candidates that proved discriminatory. Gender was not the only problem either. Weaknesses in the data behind the models meant unqualified candidates were often recommended for all manner of jobs, and with the technology returning results almost at random, Amazon shut the project down. The team was disbanded because executives had lost hope for it.
If the model was doing exactly what its training data told it to do, where should the team have looked for the defect?
The Amazon story is not an isolated failure. It is a predictable consequence of a principle that applies to every AI system: the quality, representativeness, and integrity of the determine the quality of the system's outputs. No amount of algorithmic sophistication can compensate for fundamentally flawed data.
If you already work with data regularly, use the knowledge checks to validate your understanding and skip to Module 3: How machines learn.
Garbage in, garbage out: why data quality is everything turns the previous idea into a check that can be reviewed.
The phrase "garbage in, garbage out" dates back to the 1950s, long before existed. But it has never been more relevant. In traditional software, a bug in the code produces a predictable wrong output. In machine learning, a problem in the data can produce an unpredictable wrong output that looks correct.
Andrew Ng, co-founder of Google Brain and Stanford adjunct professor, has argued that the AI community has been "model-centric" for too long, focusing on building better algorithms while neglecting data quality. His "data-centric AI" movement argues that for most practical applications, improving data quality yields larger gains than improving model architecture.
Garbage in, garbage out: why data quality is everything gives the mechanism. Common data problems shows where the next decision has to be made.
Data problems fall into several categories, each with different causes and different fixes:
Each of those five has a fix that sounds sensible and leaves the defect exactly where it was. The figure below runs the five in the order you meet them: the symptom as it appears in an evaluation report, the check that names which defect produced it, and then the two candidate fixes side by side. Only the second one clears the defect.
Every row carries two candidate fixes and only the red band clears the defect, so the check named on the arrow, not the symptom in the report, is what decides which of the two you buy.
Each data defect has a plausible fix that leaves it in place. Naming the defect from the check, not from the symptom, is what separates the two.
The data pipeline: from raw data to model-ready features is the next test of whether the concept works outside a toy example.
Common misconception
“More data always makes AI systems better”
More data helps only when the additional data is relevant, representative, and correctly labelled. Adding one million low-quality images does not help a medical imaging model. In many cases, a smaller, carefully curated dataset outperforms a larger noisy one. Teams should invest in data curation and quality assurance processes, not just data collection volume. A data quality budget is as important as a compute budget.
Common misconception
“AI can overcome biased data through better algorithms”
Algorithms learn patterns in the data. If the data contains systematic bias, the algorithm will learn that bias. Debiasing techniques exist (re-sampling, re-weighting, adversarial debiasing) but they mitigate rather than eliminate the problem. Organisations must audit their data pipelines for representativeness before training models. Fairness constraints applied after training are a remediation, not a solution.
Data does not arrive ready for model training. It passes through a pipeline of stages, each of which can introduce or remove problems:
is what happens when one of those pipeline stages lets information from outside the training window slip into the inputs the model sees. The diagram below makes the four checkpoints explicit. Each step has a clear success signature on the top half of the card and a clear leakage signature on the bottom red zone; missing a check at one step contaminates every step downstream.
Each card pairs what the step produces with the leakage signature that fails it, and every arrow between them is labelled only if clean, so a check skipped at one card leaves every later card validating data that is already contaminated.
Data leakage is caught at four checkpoints between raw records and a model that is ready to train. Each step has a clear success signature and a clear failure signature; missing a check at one step contaminates everything downstream.
Feature engineering: helping models see what matters moves the lesson from vocabulary to evidence.
Raw data often contains the signal a model needs, but in a form it cannot easily learn from. Feature engineering transforms raw inputs into representations that make patterns more visible to the model.
Examples of effective feature engineering:
For deep learning, manual feature engineering is less critical because the network learns its own features. But even in deep learning, thoughtful data preparation (augmentation, normalisation, tokenisation) remains essential.
A bank builds a loan approval model trained on historical decisions. The model denies loans to applicants from certain postcodes at a higher rate, even when their financial profile is similar to approved applicants from other areas. What is the most likely root cause?
A data scientist has 50,000 labelled images for training a medical imaging model. 49,500 are normal and 500 show the disease. She trains the model and reports 99% accuracy. What is the problem?
During data cleaning, a team discovers that 8% of records in their customer dataset have missing values for the 'annual_income' field. Which approach is most appropriate?
Reuters, 'Amazon scraps secret AI recruiting tool that showed bias against women' (October 2018)
Full article
Primary source for the opening case study. Documents how Amazon's experimental hiring tool learned gender bias from historical resume data. The system was never used as the sole determinant in hiring but demonstrated the principle of data-encoded bias.
Section 3 (Label Error Prevalence), Table 1
Demonstrated that major ML benchmarks (ImageNet, CIFAR-10, MNIST) contain 3-10% label errors. These errors systematically affect model training and evaluation, undermining confidence in published benchmark results.
Andrew Ng, 'Data-Centric AI' (NeurIPS 2021 workshop keynote)
Opening keynote
Ng's argument that the AI community should shift from model-centric to data-centric approaches. Cited the landing.ai steel defect example where improving label consistency increased accuracy from 76.2% to 93.1% without model changes.
UK Information Commissioner's Office, 'Guidance on AI and Data Protection' (2023)
Section on Fairness in AI
UK regulatory guidance on ensuring AI systems comply with data protection principles. Relevant to the data quality and bias discussion because GDPR Article 22 gives individuals the right not to be subject to solely automated decisions with legal effects.
Section 3 (Types of Bias), Section 5 (Mitigation Approaches)
A thorough taxonomy of 23 types of bias in ML systems. Used as background for the bias discussion in Section 2.2. Covers historical bias, representation bias, measurement bias, and aggregation bias among others.
You now understand why data is the foundation of every AI system and how data problems create system failures. The next question is: once you have good data, how does a machine actually learn from it? Module 3 introduces the three paradigms of machine learning: supervised, unsupervised, and reinforcement learning.
Module 2 of 33 · AI Foundations