Foundations of Artificial Intelligence and Machine LearningIntroduction and ContextArtificial intelligence (AI) is the study and engineering of computational systems that perform tasks commonly associated with human intelligence, such as perception, language understanding, reasoning, planning, learning, and decision-making. Machine learning (ML) is a major approach within AI in which systems improve their performance by learning patterns from data rather than relying entirely on explicitly programmed rules. AI and ML are now used in search engines, recommendation systems, medical diagnosis, fraud detection, autonomous vehicles, industrial maintenance, agriculture, education, finance, and public administration. Their importance arises not simply from technical novelty, but from their capacity to transform how organizations make predictions, allocate resources, automate work, and interact with customers and citizens. However, an AI system is not automatically intelligent, reliable, fair, or appropriate. Its quality depends on the problem formulation, data, objectives, model, evaluation process, deployment environment, and governance arrangements. This chapter establishes the conceptual foundation required for later study of neural networks and implementation with TensorFlow and PyTorch. Learning ObjectivesBy the end of this chapter, a student should be able to: 1. Define AI, machine learning, deep learning, data science, and related terminology. 2. Distinguish symbolic AI from statistical and data-driven AI. 3. Explain supervised, unsupervised, self-supervised, and reinforcement learning. 4. Describe the major stages of an ML model lifecycle. 5. Identify suitable and unsuitable applications of ML. 6. Analyze the limitations, risks, and governance requirements of AI systems. 7. Determine whether an organizational problem can be framed effectively as an ML task. 1. Artificial Intelligence: Scope and Terminology1.1 What is intelligence in a machine?Human intelligence includes several capabilities: acquiring knowledge, representing information, generalizing from experience, reasoning under uncertainty, communicating, and acting toward goals. AI research does not have one universally accepted definition because intelligence is a broad and contested concept. A practical engineering definition is: Artificial intelligence is the design of computational agents that perceive their environment, process information, and produce actions or outputs directed toward specified goals. An agent may be software, a robot, or an embedded system. Its environment may be physical, such as a factory, or digital, such as a website. An agent’s output may be a classification, recommendation, generated text, control action, or decision support signal. AI can be described as narrow AI when it is designed for a limited task, such as recognizing faces or detecting spam. Most current systems are narrow AI. Artificial general intelligence (AGI) refers to a hypothetical system with broad, flexible capabilities comparable to human intelligence across many domains. AGI remains a research and philosophical concept rather than an established technology. 1.2 Important termsA model is a mathematical or computational representation used to produce predictions, decisions, or generated outputs. A parameter is a value learned or adjusted by a model during training. A feature is an input variable used by a model, while a label or target is the desired output in supervised learning. An algorithm is a defined procedure for solving a problem. A training algorithm adjusts model parameters using data. Inference is the process of using a trained model to produce outputs for new inputs. Training data are examples used to fit the model; validation data support model selection and tuning; and test data provide a final estimate of performance on unseen examples. A dataset is a collection of observations. An observation may be called an instance, record, example, or sample. Generalization is the ability to perform well on new data drawn from the relevant deployment environment. Overfitting occurs when a model learns accidental details or noise in its training data and performs poorly on new data. Underfitting occurs when a model is too simple or insufficiently trained to capture important patterns. Deep learning is ML based primarily on multi-layer neural networks. It is especially effective for high-dimensional data such as images, audio, video, and natural language, although it can also be used with structured data. Data mining focuses on discovering useful patterns in large datasets, while data science combines statistics, computing, domain knowledge, communication, and decision analysis to obtain value from data. These fields overlap but are not identical. 2. Two Broad Traditions in AI2.1 Symbolic AISymbolic AI represents knowledge explicitly using symbols, rules, logic, ontologies, graphs, and search procedures. An expert system, for example, may contain rules such as: - If a patient has symptom A and test result B, then consider condition C.
- If an order is above a specified value and the account is new, request additional verification.
A symbolic system can often explain its reasoning by showing the rules or facts used. It is useful where knowledge is explicit, requirements are stable, decisions must be auditable, and data are scarce. Applications include theorem proving, configuration, planning, constraint satisfaction, and rule-based compliance checking. Its limitations include difficulty handling ambiguity, noisy sensory data, changing environments, and situations in which experts cannot articulate the relevant rules. A rule-based image-recognition system, for example, struggles to specify all possible variations in lighting, viewpoint, texture, and object appearance. 2.2 Statistical and data-driven AIStatistical AI learns relationships from examples. Instead of manually specifying every rule, developers provide data and an objective function, and a learning algorithm estimates useful parameters. A spam classifier may learn that certain combinations of words, senders, and message properties are associated with unwanted email. Statistical systems are effective where many examples exist and the relationship between inputs and outputs is difficult to specify manually. They can adapt to patterns that change over time, but their behavior may be difficult to interpret, sensitive to data quality, and unreliable outside the conditions represented in training data. The distinction between symbolic and statistical AI is useful but not absolute. Modern systems often combine both approaches. A hybrid system may use a neural network to extract information from images and symbolic rules to enforce safety constraints. This combination is sometimes called neuro-symbolic AI. 3. Machine Learning as Function Approximation and Decision ImprovementA supervised ML model can be viewed abstractly as a function that maps inputs to outputs: \[ \hat{y}=f_\theta(x) \] Here, \(x\) is an input, \(\hat{y}\) is the model’s prediction, \(f\) is the model family, and \(\theta\) represents learned parameters. The notation does not imply that every ML problem is supervised; it is a useful representation for prediction tasks. During training, the model parameters are adjusted to reduce a loss function. For a dataset of \(n\) examples, a common empirical objective is: \[ \min_\theta \frac{1}{n}\sum_{i=1}^{n}L\left(y_i,f_\theta(x_i)\right) \] where \(x_i\) is the input, \(y_i\) is the observed target, and \(L\) measures the discrepancy between the target and prediction. The objective assumes that examples are sufficiently representative of the intended task and that the loss reflects the practical cost of errors. In classification, cross-entropy is commonly used; in regression, squared error or absolute error may be appropriate, but the choice must reflect the problem. A model that minimizes training loss is not necessarily useful. The central goal is generalization: good performance on future cases. This is why validation procedures, test data, error analysis, and monitoring are essential. 4. Learning Paradigms4.1 Supervised learningIn supervised learning, each training example includes an input and a target label. The model learns to predict the target from the input. Classification predicts discrete categories. Binary classification has two classes, such as fraudulent or legitimate. Multiclass classification selects one among several classes, such as classifying an image as cat, dog, or bird. Multilabel classification allows multiple labels for one example, such as assigning several topics to a document. Regression predicts a numerical quantity, such as delivery time, energy consumption, or house price. The target is continuous or treated as numerical for the purpose of the task. A supervised project requires reliable labels. Labels may be produced by experts, historical records, user actions, or measurement instruments. Label errors, inconsistent definitions, and class imbalance can substantially affect results. Accuracy alone may be unsuitable when errors have unequal consequences. Precision, recall, specificity, F1 score, calibration, and cost-sensitive measures may be more informative. 4.2 Unsupervised learningUnsupervised learning operates without explicitly supplied target labels. It seeks structure in data. Clustering groups observations according to similarity; dimensionality reduction represents data in fewer dimensions while preserving selected information; and anomaly detection identifies observations that differ substantially from a learned pattern. Unsupervised results are not automatically meaningful. A clustering algorithm will produce groups even when no natural groups exist. The number and interpretation of clusters depend on representation, distance measure, algorithm, and business context. Domain experts must determine whether discovered structure is useful and stable. 4.3 Self-supervised learningSelf-supervised learning creates training signals from the data itself. For example, a language model may predict a hidden or next token, while an image system may predict a transformed view or missing portion of an image. The data provide a proxy task, often called a pretext task, from which the model learns general representations. A model trained by self-supervision can later be adapted to a supervised task through fine-tuning or used to generate embeddings. This approach is particularly valuable when raw data are abundant but manually labeled examples are expensive. Its limitations include the possibility that the proxy task does not produce representations useful for the final application, and the possibility that large-scale data encode undesirable social or historical biases. 4.4 Reinforcement learningReinforcement learning (RL) concerns an agent that interacts with an environment. At each time step, the agent observes a state, selects an action, receives a reward, and moves to a subsequent state. The objective is to learn a policy that obtains high cumulative reward. Important concepts include: - State: information describing the current situation.
- Action: a choice available to the agent.
- Reward: feedback associated with an action or outcome.
- Policy: a strategy mapping states to actions.
- Exploration: trying actions to gain information.
- Exploitation: selecting actions believed to yield good outcomes.
RL is useful for sequential decision problems such as robotics, resource allocation, game playing, and adaptive control. It is difficult when rewards are delayed, exploration is costly or unsafe, environments change, or a poorly specified reward encourages undesirable behavior. A system that optimizes a measurable proxy may satisfy the proxy while violating the actual organizational objective; this is known as reward misspecification or proxy optimization. 5. The Machine Learning Model LifecycleAn ML project is a lifecycle rather than a single act of training. Problem definitionThe team first identifies a decision, user need, or operational process. It should specify who will use the output, what action follows, what constraints apply, and how success will be measured. A technically impressive model can fail if it addresses no meaningful decision. Data acquisition and governanceData sources must be identified, accessed lawfully, documented, and evaluated for relevance. Questions include: How were the data generated? Whose data are missing? Are historical decisions biased? Is the data distribution likely to change? Are personal or sensitive attributes present? Data preparationPreparation may include correcting formats, handling missing values, deduplicating records, encoding variables, normalizing numerical inputs, and constructing features. The process must avoid data leakage, in which information unavailable at prediction time enters training data. For example, using a later loan repayment status to predict whether the loan should initially be approved is leakage. Splitting and experimental designData should be separated into training, validation, and test sets when appropriate. Time-dependent problems often require temporal splits rather than random splits. If records from the same person, patient, machine, or household appear in both training and test sets, performance may be artificially inflated. The split must reflect the deployment situation. Model developmentDevelopers select a baseline, model family, features, loss function, and optimization method. A simple baseline is valuable because it provides a reference point and may be easier to operate. Hyperparameters, such as learning rate or tree depth, are selected using validation data or cross-validation where assumptions permit. Evaluation and error analysisEvaluation should use metrics linked to operational consequences. A medical screening system may prioritize sensitivity, while a costly intervention may require high precision. Performance should be examined across relevant subgroups and operating conditions. Error analysis asks not only how many errors occur, but why they occur and whether they are concentrated in specific cases. DeploymentDeployment may involve an online API, a batch process, an embedded device, or decision-support software. Engineering concerns include latency, availability, security, model versioning, reproducibility, and compatibility with existing systems. Human users need understandable instructions about the model’s purpose and limitations. Monitoring and maintenanceAfter deployment, input data, prediction distributions, performance, latency, failures, and user outcomes should be monitored. Data drift occurs when input distributions change. Concept drift occurs when the relationship between inputs and targets changes. A model may require recalibration, retraining, rollback, or retirement. Monitoring must also detect fairness problems, security attacks, and harmful feedback loops. 6. Framing an Organizational Problem as an ML TaskNot every business problem should be solved with ML. A suitable ML formulation generally satisfies the following criteria: 1. A clear decision or prediction exists. The output must support a defined action or understanding. 2. Relevant data are available. Data should contain information available at the time of prediction. 3. The target can be defined. For supervised learning, labels must be sufficiently reliable and consistent. 4. Patterns are learnable. The input should contain predictive signal beyond random variation. 5. The task repeats at useful scale. Automation should produce benefits greater than development and operating costs. 6. Errors have acceptable consequences. A human review or fallback process may be necessary. 7. Success is measurable. Technical metrics and organizational outcomes should both be specified. 8. Use is lawful and legitimate. Privacy, consent, discrimination, intellectual property, and sector-specific regulation must be addressed. 9. Deployment is feasible. Data pipelines, computing resources, integration, staff capability, and monitoring must exist. A useful framing template is: > Given information available at time \(t\), predict or recommend outcome \(Y\) in order to support decision \(D\), subject to constraints \(C\), and evaluate success using metric \(M\). For example, “improve customer service” is too vague. A stronger formulation is: “Given a customer message and account history available when the message arrives, predict its support category so that it can be routed to an appropriate queue, while measuring macro-F1, routing delay, and escalation errors.” Some problems are better addressed by process redesign, a database query, a fixed rule, statistical reporting, or additional staffing. ML should not be used merely because data are available. 7. Applied Case: Predictive Maintenance in a Manufacturing PlantBackgroundThis illustrative case concerns a plant operating industrial pumps. Unexpected pump failures interrupt production and can create safety risks. The plant already collects vibration, temperature, pressure, operating-hours, and maintenance records. ProblemManagers want to reduce unplanned downtime. The initial request is “use AI to predict failures.” This request must be refined. The practical decision is whether to schedule an inspection or maintenance intervention during a planned service window. AnalysisA team examines whether the data include signals preceding failures and whether maintenance records reliably identify failure dates. It discovers that some sensors fail intermittently and that maintenance records use inconsistent terminology. A random data split would be inappropriate because future sensor readings could indirectly enter the training set and because operating conditions change over time. The team defines a prediction target: whether a pump will experience a specified failure mode within the next seven days, using only data available at the prediction time. It uses a time-based evaluation split and compares a simple rules-based baseline with supervised models. Because missed failures are more costly than unnecessary inspections, recall is important, but precision and maintenance capacity also matter. Approach and solutionData engineers create time-window features such as recent maximum temperature, vibration trend, and operating-hours accumulation. They document each feature’s availability time to prevent leakage. The model produces a risk score rather than an automatic shutdown command. High-risk cases are reviewed by maintenance engineers. The system is deployed as a daily batch process. Its dashboard reports the risk score, recent sensor trends, model version, and a warning that the score is decision support rather than proof of failure. Monitoring tracks sensor missingness, score distributions, inspection outcomes, and performance by pump type. OutcomeIn this illustrative scenario, the pilot reduces unexpected downtime while generating some false alarms. The organization decides that the model is valuable only when maintenance teams have sufficient capacity and when sensors remain reliable. It therefore invests in sensor maintenance and establishes a procedure for reviewing false negatives and false positives. Learning pointsThe central achievement was not selecting the most complex algorithm. It was defining a valid prediction time, a reliable target, an operational decision, an evaluation design, and a human response process. The case also shows that ML performance depends on organizational workflow and data governance. 8. Limitations, Ethics, and GovernanceTechnical limitationsML models may fail under distribution shift, rare events, missing data, adversarial inputs, noisy labels, or insufficient representation of important groups. Correlation does not establish causation. A model that predicts employee turnover, for example, does not prove that changing a predictive feature will prevent turnover. High benchmark performance may not transfer to real-world performance. Offline datasets can omit users who do not interact with the system, and evaluation procedures can inadvertently reward shortcuts. Generative systems may produce fluent but false outputs, sometimes called hallucinations. Human oversight is not effective if users cannot understand when the model is uncertain or if organizational incentives pressure them to accept every prediction. Ethical and legal concernsAI systems can affect privacy, autonomy, access to employment, credit, healthcare, education, and public services. Important principles include fairness, accountability, transparency, safety, privacy, security, and human oversight. Fairness is not one universal formula; different fairness criteria can conflict, especially when base rates differ. Teams should therefore define the relevant harm, affected groups, and decision context rather than claiming that a single metric proves fairness. Privacy protection may require data minimization, access controls, retention limits, de-identification where appropriate, and privacy-preserving technical methods. Consent and lawful use depend on jurisdiction and context. Organizations should maintain documentation such as data sheets, model cards, risk assessments, decision logs, and incident procedures. Responsible development practicesResponsible ML begins before model selection. Teams should conduct stakeholder analysis, identify affected non-users, assess foreseeable harms, and establish escalation channels. They should use representative evaluation data, test subgroup performance, document limitations, secure model interfaces, and provide meaningful human review where stakes are high. Models should be withdrawn when their risks exceed their benefits. 9. Contemporary DevelopmentsFoundation models are large models trained on broad data and adapted to many downstream tasks. Generative AI systems can produce text, images, audio, code, and other outputs. Their capabilities make transfer learning and natural-language interfaces more accessible, but they introduce concerns involving factual reliability, copyright, privacy, bias, provenance, and misuse. Multimodal systems process more than one data type, such as text and images. Federated learning trains models across distributed devices or organizations while keeping much raw data local, although updates and model behavior still require security and privacy analysis. Edge AI places inference closer to sensors or users, reducing latency and network dependence. Explainable AI includes techniques for interpreting or auditing model behavior, but an explanation method is not automatically a faithful explanation of the model’s actual reasoning. These developments do not eliminate the foundational requirements of good problem definition, appropriate data, valid evaluation, governance, and monitoring. Chapter SummaryArtificial intelligence concerns computational agents that perceive, reason, learn, and act toward goals. Symbolic AI uses explicit representations and rules, whereas statistical AI learns patterns from data; modern systems may combine both. Machine learning includes supervised learning for labeled prediction, unsupervised learning for discovering structure, self-supervised learning for creating training signals from raw data, and reinforcement learning for sequential decision-making through rewards. An ML project proceeds through problem definition, data governance, preparation, experimental design, modeling, evaluation, deployment, and monitoring. Generalization—not merely low training error—is the central objective. Organizational problems should be framed as ML tasks only when a clear decision, useful data, learnable patterns, measurable success criteria, feasible deployment, and acceptable risks exist. Ethical and governance considerations must address privacy, fairness, transparency, security, accountability, and human oversight. Effective AI is therefore a socio-technical undertaking involving models, data, people, processes, and institutions. Key TermsArtificial intelligence: Computational systems designed to perform tasks associated with intelligence. Agent: A system that perceives an environment and acts toward goals. Machine learning: Methods that learn patterns or decision strategies from data. Model: A computational representation used for prediction, decision, or generation. Parameter: A value learned or adjusted during model training. Feature: An input variable supplied to a model. Label: A target value used in supervised learning. Inference: Using a trained model to produce an output for new input. Generalization: Performance on relevant unseen data. Overfitting: Learning training-specific noise or details that harm new-case performance. Symbolic AI: AI based on explicit symbols, rules, logic, or structured knowledge. Statistical AI: AI that estimates patterns or relationships from data. Supervised learning: Learning from inputs paired with target labels. Unsupervised learning: Learning structure without explicit target labels. Self-supervised learning: Learning from targets constructed automatically from the data. Reinforcement learning: Learning sequential behavior through interaction and rewards. Data leakage: Use of information unavailable at prediction time during training. Data drift: Change in the distribution of model inputs over time. Concept drift: Change in the relationship between inputs and outcomes. Model lifecycle: The stages from problem definition through deployment and monitoring. Review QuestionsShort Answer Questions1. What is the difference between a model parameter and a feature? 2. Why is generalization more important than training accuracy alone? 3. Distinguish symbolic AI from statistical AI. 4. What is data leakage? Give one example. 5. Define reinforcement learning and identify its main feedback signal. Long Answer Questions1. Explain the four major learning paradigms and provide an application for each. 2. Describe the complete ML model lifecycle and explain why monitoring continues after deployment. 3. Compare the strengths and limitations of symbolic and statistical AI. 4. Discuss the ethical, legal, and governance issues that may arise in an AI system used for high-stakes decisions. 5. Explain why problem formulation, target definition, and evaluation design are often more important than choosing a sophisticated algorithm. Analytical / Application Questions1. A university wants to “use AI to improve student success.” Formulate a specific ML task, identifying inputs, target, decision, evaluation metrics, and major ethical risks. 2. A fraud model performs very well on a randomly split dataset but poorly after deployment. Analyze at least three possible causes and propose an improved evaluation design. 3. A factory has abundant sensor data but very few recorded failures. Decide whether supervised, unsupervised, self-supervised, or hybrid methods might be appropriate, and justify your proposal. Multiple Choice Questions with AnswersQuestion 1Which statement best describes machine learning? A. Writing every decision as an explicit rule B. Learning patterns or decision strategies from data C. Storing data in a relational database D. Replacing all human decisions with robots Correct Answer: B. Learning patterns or decision strategies from data Question 2Which approach uses explicit rules, logic, and symbolic representations? A. Symbolic AI B. Unsupervised learning C. Reinforcement learning D. Self-supervised learning Correct Answer: A. Symbolic AI Question 3What is the target in supervised learning? A. The hardware used for training B. The desired output associated with an input C. The number of model parameters D. The deployment server Correct Answer: B. The desired output associated with an input Question 4Which task is an example of regression? A. Classifying an email as spam or legitimate B. Grouping customers without labels C. Predicting tomorrow’s electricity demand D. Selecting an action from rewards Correct Answer: C. Predicting tomorrow’s electricity demand Question 5What distinguishes self-supervised learning? A. It requires no data B. It creates training signals from the data itself C. It always uses manually verified labels D. It can only be used for robotics Correct Answer: B. It creates training signals from the data itself Question 6In reinforcement learning, what provides feedback about an action? A. A reward B. A feature C. A validation split D. A database schema Correct Answer: A. A reward Question 7Which practice helps prevent data leakage? A. Using information available only after prediction time B. Ensuring features reflect information available at prediction time C. Removing the test set before training D. Increasing model complexity regardless of data Correct Answer: B. Ensuring features reflect information available at prediction time Question 8What is concept drift? A. A change in the relationship between inputs and outcomes B. A method for reducing image size C. A fixed rule in a symbolic system D. A technique for encrypting labels Correct Answer: A. A change in the relationship between inputs and outcomes Question 9Which is the strongest initial formulation of an organizational ML problem? A. Use AI to make the organization smarter B. Build the largest possible neural network C. Predict a defined outcome from available-at-prediction-time information to support a specified decision D. Collect all available data and find something interesting Correct Answer: C. Predict a defined outcome from available-at-prediction-time information to support a specified decision Question 10Why is a simple baseline valuable in an ML project? A. It guarantees perfect fairness B. It provides a reference for judging whether added complexity helps C. It eliminates the need for testing D. It prevents all forms of model drift Correct Answer: B. It provides a reference for judging whether added complexity helps
|