TK Study

Software Engineering › Notes › Software Automation (Year 12)

Software Automation (Year 12)

AI v ML; ML supporting automation (DevOps, RPA, BPA)

Models of training ML

Applications of key ML algorithms

Decision trees

Neural networks

Regression models and KNN

Programming ML in an OOP language (example only)

python
import numpy as np
from sklearn.linear_model import LinearRegression
x = np.array([[2], [4], [6], [8], [10], [12], [14], [16]])
y = np.array([1, 3, 5, 7, 9, 11, 13, 15])
model = LinearRegression()
model.fit(x, y)                      # find line of best fit
print(model.predict([[4]]))          # prints 3
print(model.predict([[4.5]]))        # prints 3.5 (new data)
python
from sklearn.linear_model import LinearRegression

class PricePredictor:
    def __init__(self):
        self.model = LinearRegression()

    def train(self, sizes, prices):
        # sizes: [[50], [80], [120]]   prices: [200, 310, 450]
        self.model.fit(sizes, prices)

    def predict(self, size):
        return self.model.predict([[size]])[0]

p = PricePredictor()
p.train([[50], [80], [120]], [200, 310, 450])
print(p.predict(100))

Impact of automation on individuals, society and the environment

Human behaviour patterns influencing ML and AI development

Human bias and dataset source bias

Skeleton: Assess the impact of automation / discuss human bias (5-6 marks)

Part 2. School notes (Canvas, 12SENX2) by syllabus dot point

Corrections are marked in the text. Anything not marked is the school wording.

Investigate how machine learning (ML) supports automation through the use of DevOps, robotic process automation (RPA) and business process automation (BPA).

ML

Machine Learning (ML) is a subset of artificial intelligence (AI) that allows computer systems to learn from large datasets to find non-obvious patterns where decisions can be made.

DevOps

DevOps is a set of practices that combines software development and IT operations. Its goal is to shorten the system development life cycle and deliver high-quality software more efficiently. DevOps promotes continuous integration and continuous delivery (CI/CD), automates infrastructure, and fosters collaboration across teams.

How ML supports automation through DevOps

CI/CD

Managing CI/CD pipelines that build, test and deploy code involves frequent monitoring and adjustment, especially when builds or deployments fail. By analysing historical build data, ML can anticipate failure and flag risky codes. Additionally, it can identify performance bottlenecks and recommend solutions to optimise the build.

Example:

E.g.:

Spotify uses ML to analyse its CI/CD pipeline performance. ML models would detect a new module causing performance bottlenecks after a large update, alerting engineers to address the issue proactively.

Intelligent Resource Management

Traditional DevOps, infrastructure scaling is based on pre-defined rules to avoid over-provisioning (wasting resources) and under-provisioning (leading to system crashes), which is ineffective against unexpected traffic surges and complex cloud environments. ML can predictively allocate resource management by predicting future demands based on past system usage. This reduces cost and prevents operational disruption.

E.g.:

Netflix uses ML to predict the user's peak usage hour to allocate more resources while scaling down resource allocation during stable usage hours.

Automated Incident Management

ML can automate incident detection and root cause analysis by continuously monitoring system logs and identifying potential problematic patterns, reducing downtime typically caused by time-consuming, manual log analysis in complex, large-scale environments.

E.g.:

The ML tool of Amazon CloudWatch can automatically analyse logs to pinpoint causes of issues for engineers to patch problems faster, minimising downtime.

MLOps

MLOps is the automated process of designing, training and deploying machine learning models. It brings team involved in developing ML and operational teams involved in deploying and supporting the models in production.

Design

Model development

Operations

Robotic Process Automation (RPA)

RPA uses software robots to automate repetitive, rule-based tasks. RPA mimics human actions by interacting with UI, handling tasks that follow structured logic and defined workflows. RPA struggles with handling complex, unstructured data and tasks that require cognitive decision-making.

How ML supports automation through RPA

ML models like NLP, NLU, and Computer vision models allow RPA bots to interpret and process unstructured data. NLU models can be used to understand human language. Additionally, ML models can analyse large datasets to identify trends and predict outcomes, enabling RPA bots to make adaptive decisions based on the changes in workflows. Therefore, with the increasing model performance over time, RPA bots have great flexibility that empowers greater accuracy in changing complex workflows.

E.g.:

RPA bots can use ML-powered OCR to extract insurance claim reasons and review claims based on past data to predict its potential to be approved.

Business Process Automation (BPA)

BPA is the use of technology to automate cross-system and cross-functional workflows that traditionally use predefined rules and processes. It typically involves multiple workflows and automates end-to-end complex business processes. It is limited in making business decisions that aren’t fully captured by predefined logic.

How ML supports automation in BPA

By analysing large volumes of historical data and current contexts, ML models can identify flexible patterns that guide nuanced decision-making, establishing more dynamic and responsive workflows without significant reprogramming. In this way, the efficiency of BPA is enhanced with greater accuracy. Using NLP and computer vision models, BPA can automate tasks that involve interpreting unstructured data.

E.g.:

In supply chain management, ML enhances BPA by predicting inventory levels based on past sales, current trends, and external factors like seasonality. Instead of manually adjusting orders or running reports, BPA systems equipped with ML automatically place orders or make recommendations to optimise stock levels and avoid shortages or overstocking.

Distinguish between artificial intelligence (AI) and machine learning (ML)

Artificial Intelligence (AI)

AI refers to the development of computer systems that can perform tasks typically requiring human intelligence. These tasks include reasoning, problem-solving, understanding natural language, perception (e.g., visual processing), and decision-making. AI aims to simulate or replicate aspects of human cognition and behaviour.

E.g.:

Siri uses AI to process and respond to voice commands, answer questions, and manage tasks like setting alarms or sending texts. AI enables these systems to understand natural language and simulate human-like conversations.

Machine Learning (ML)

ML is a subset of AI that learns from vast datasets, identifies patterns, and makes decisions with minimal human intervention. The performance should improve over time.

E.g.:

Netflix uses ML to recommend movies based on a user's previous choices. The more the user watches, the better the system becomes at suggesting content tailored to the user.

Explore models of training ML, including supervised learning, unsupervised learning, semi-supervised learning, and reinforcement learning.

Supervised Learning

Data Requirement: Labelled Data

Learning Type: Predictive or Classification

Algorithms: Linear Regression, Decision Trees, Support Vector Machines (SVM), Neural Networks.

E.g.:

A binary classification model is trained a dataset of spam and non-spam emails. Once trained, the model can predict whether a new email is spam.

Unsupervised Learning

Data Requirement: Unlabelled Data

Learning Type: Pattern recognition, Clustering

Algorithms: K-nearest neighbour, Principal Component Analysis (PCA).

E.g.:

Unsupervised learning can be used to group customers based on their buying behaviour, enabling businesses to target specific segments with personalised offers.

Semi-Supervised Learning

Principle: the labelled data helps guide the learning process while leveraging the abundance of unlabelled data to improve performance

Data Requirement: Mostly unlabelled data with a small portion of labelled data

Learning Type: Prediction, classification, pattern finding, clustering

Algorithms: Label Propagation, Semi-supervised Support Vector Machines (S3VM)

E.g.:

Labelling large image datasets can be time-consuming. Semi-supervised learning allows for the use of fewer labelled images while still achieving high accuracy in classifying new images.

Reinforcement Learning

Reinforcement learning involves training a model through interactions with an environment. The model, called an agent, learns by receiving feedback in the form of rewards or penalties based on the actions it takes. The goal is to learn a policy that maximises the cumulative reward over time. The model learns to make decisions by balancing exploration (trying new actions) and exploitation (using known actions that yield high rewards).

Algorithms: Deep Q-Networks (DQN), Proximal Policy Optimisation (PPO).

E.g.:

AlphaZero reinforcement learning models can be trained to play chess by rewarding the model for making moves that lead to a win.

Investigate common applications of key ML algorithms, including data analysis and forecasting, virtual personal assistants, and image recognition.

Data Analysis and Forecasting

ML algorithms can identify non-obvious patterns in large datasets.

E.g.:

Clustering algorithms (e.g. k-means; note: KNN is a supervised classification/regression algorithm, not clustering. The school notes are wrong here), can allow businesses to segment customer groups based on purchasing behaviour or preferences.

Predictive models, such as time series algorithms and regression models, are used to make forecasts based on historical data.

E.g.:

In weather forecasting, recurrent neural networks (RNNs) are employed to model temporal data and predict future weather conditions based on past data patterns.

Virtual Personal Assistants

Virtual personal assistants use deep neural networks (DNNs) to convert spoken language into text, which is then processed by transformer models (e.g. BERT) for contextual understanding and intent recognition. Through reinforcement learning and collaborative filtering, they continuously adapt to user preferences, enabling more accurate, personalised responses and recommendations over time.

E.g.:

Virtual assistants might suggest music based on past music requests

Image Recognition

CNNs are used to identify patterns within images, making them effective for tasks like facial recognition, medical image analysis (e.g., detecting tumours in X-rays), and autonomous vehicle navigation.

Object Detection and Classification

Algorithms such as YOLO (You Only Look Once) are used to detect and classify objects within images. These are applied in areas like surveillance, where detecting suspicious items or identifying individuals is crucial, and in social media, where photos are automatically tagged based on face recognition.

Research models used by software engineers to design and analyse ML, including decision trees and neural networks.

Decision Trees

A decision tree is a visual representation that illustrates all possible combinations of decisions and their corresponding actions. It is commonly used in both classification and regression tasks in ML. The structure of the tree follows a sequence of decisions, where each decision path leads to either another decision or an outcome.

Key Strengths

Interpretability: The flowchart-like structure makes decision trees easy to understand and interpret, showing how decisions lead to specific actions.

Versatility: Decision trees are useful for a wide range of problems, particularly when the goal is to map out possible outcomes based on a set of conditions.

Limitations

Overfitting: Decision trees can grow too complex when trained on noisy data, leading to overfitting.

Instability: Small changes in the data can lead to a very different tree structure.

Common Use Cases

Classification: E.g., determining whether an email is spam or not.

Regression: E.g., predicting the price of a house based on its features like size and location.

Neural Networks

Inspired by biological neurons, Neural networks are a type of deep learning model that captures non-linear relationships, making them suitable for both structured (e.g., tabular) and unstructured (e.g., images, text) data.

Structure

Input Layer (e.g., pixel values in an image, numerical features in tabular data)

Hidden Layers

The layers between the input and output layers. A neural network can have multiple hidden layers. Each layer consists of neurons that apply an activation function to introduce non-linearity into the model, allowing it to learn complex patterns.

Common activation functions:

ReLU (Rectified Linear Unit): Sets negative values to zero and leaves positive values unchanged, making it highly efficient for deep learning models.

Sigmoid: Maps values between 0 and 1, often used in binary classification tasks.

Output Layer

The output layer produces the final prediction based on the learned weights and transformations.

Learning Mechanism

Forward Propagation

Data moves from the input layer, through the hidden layers, to the output layer. Each neuron applies a weighted sum of its inputs, passes the result through an activation function, and forwards the output to the next layer.

Loss Function

The loss function calculates the error between the predicted output and the actual target.

Backpropagation

Once the loss is calculated, the model adjusts the weights of the connections using an optimisation algorithm, typically gradient descent. Gradient descent updates the weights in the direction that minimises the error, with the learning rate controlling the size of the steps taken during each update.

Training and Convergence

The process of forward propagation, loss computation, and backpropagation is repeated iteratively over many epochs, minimising loss and improving overall performance.

Types of Neural Networks

Feedforward Neural Networks (FNN)

Data moves in one direction, from input to output, without cycles or feedback loops. It is used in regression or basic classification (e.g., predicting the outcome of a stock market price).

Convolutional Neural Networks (CNN)

CNNs have convolution layers that apply kernels to detect local visual features. Pooling layers are used to reduce the spatial dimension while keeping essential feature information. It is used in computer vision tasks like image classification (e.g., identifying objects in images), object detection (e.g., detecting faces in a picture), and video analysis.

Deep Neural Networks (DNN)

DNNs are NNs with many hidden layers to learn more complex features. They require a large dataset and computational power. It is used in complex recommendation systems (e.g., Netflix movie recommendations) and advanced AI systems like OpenAI's GPT.

Key Concept

Weight Initialisation

The initial values of the weights can significantly impact how fast the network converges. Poor initialisation may lead to vanishing gradients or slow training.

Regularisation techniques (prevent overfitting)

Dropout: Randomly drops a subset of neurons during training, forcing the network to learn more robust features.

Strengths of NN

Versatility: Can be applied to various tasks, from image recognition to language processing.

Representation Learning: Automatically learns features from raw data, reducing the need for manual feature engineering.

Scalability: Can handle massive datasets and is capable of scaling across distributed systems (e.g., cloud computing frameworks like TensorFlow or PyTorch).

State-of-the-Art Performance: Especially in tasks such as speech recognition, object detection, and game playing.

Limitations of NN

Data Hungry: Neural networks typically require large datasets for optimal performance. Small datasets may lead to overfitting and poor generalisation.

Computationally Intensive: Training deep neural networks is resource-heavy, requiring high-performance hardware such as GPUs or TPUs.

Black Box Nature: NN is a black box that lacks interpretability, making it hard to understand why a network makes certain decisions.

Overfitting: Without proper regularisation, neural networks may perform very well on training data but fail to generalise to new, unseen data.

Describe types of algorithms associated with ML, including linear regression, logistic regression, and K-nearest neighbour.

Regression

Regression is a type of ML algorithm used to predict continuous values by finding non-obvious patterns. It helps to understand the relationship between one or more input variables (features or independent variables) and an output variable (the dependent variable).

Linear Regression

Linear regression is a type of algorithm that helps predict continuous values through a linear relationship.

Logistic Regression

Logistic regression is used for classification tasks. Logistic regression predicts the probability of specific categories. The sigmoid activation function is used to convert any number into a probability between 0 and 1.

E.g.:

Predicting students pass or fail based on homework scores and study scores

K-Nearest Neighbour (KNN)

KNN is an algorithm used for both classification and regression. It predicts new outcomes by looking at the labels of the K Nearest Neighbours.

E.g.:

To determine whether a fruit is an apple or an orange based on its size and colour, KNN compares the fruit to the K nearest examples in the dataset.

Design, develop and apply ML regression models using an OOP to predict numeric values, including linear regression, polynomial regression, and logistic regression.

Why use OOP to design models?

The Traditional Regression model is written in procedural or declarative. With OOP, scalability is ensured through inheritance. Encapsulation keeps data and logic together. Structured models are enforced with abstraction to ensure maintainability. Polymorphism offers greater flexibility in modifying regression models.

Polynomial Regression OOP

Logistic Regression OOP

Model Type Task Type Equation Type Use Cases
Linear Regression Predicting continuous values Linear equation Predicting housing prices based on numbers of bedroom
Polynomial Regression Predicting continuous values Polynomial equation Predicts non-linear relationships like temperature variation
Logistic Regression Binary classification Sigmoid Binary outcomes like spam detection for emails

Apply neural network models using an OOP to make predictions.

By using an OOP approach, flexible and reusable neural network models can be defined. The structure of the class will allow for flexibility in modifying the network's architecture and training process.

OOP allows for encapsulating the functionality of the neural network into a single class. This class can manage the network's architecture (layers, neurons, weights, and biases), the forward and backward passes, and the training loop.

Attributes

Layers

Define the architecture of the neural network (e.g., input layer, hidden layers, output layer).

Weights and Biases

Initialise random weights and biases for the connections between neurons in different layers.

Learning Rate

Controls how much the model's weights are updated with respect to the error gradient during training.

Assess the impact of automation on the individual, society and the environment, including safety of workers, people with disability, the nature and skills required for employment, production efficiency, waste and the environment, and the economy and distribution of wealth.

Safety of Workers [Individual]

By replacing humans in dangerous tasks, automation significantly reduces the risk of injury or fatality. However, automation introduces new safety risks related to technical malfunctions.

E.g.:

Autonomous haulage systems are used to reduce the risks miners face from potential cave-ins and the toxic environment. Yet, when a robotic arm malfunctions, it can endanger the workers working on the same factory line.

People with Disability [Individual]

Automation offers significant opportunities to improve the lives and employment prospects of people with disabilities through assistive technologies. Nevertheless, automation risks displacing people with disability in roles that involve repetitive tasks

E.g.:

Robotic exoskeletons enable people with mobility impairments to walk again, allowing individuals who were previously excluded from physically demanding jobs to participate in the workforce. On the other hand, previous factory workers with cognitive disabilities are displaced unless retraining initiatives are created.

The Nature and Skills Required for Development

Automation is displacing roles that involve repetitive or predictable tasks. It is creating demand for skilled workers in fields such as AI and data science, necessitating workers to upskill in more skilled roles continuously.

E.g.:

Factory workers are getting replaced by robotic arms, with new employment opportunities for robotics engineers to maintain the automated systems.

Production Efficiency, Waste and Environment [Environment]

Automation increases production efficiency, leading to cost savings and higher output. By using automated systems that minimise faulty processes, less waste is produced. However, it also raises environmental concerns, particularly when energy use is elevated.

E.g.:

Tesla’s Gigafactory automates vehicle production and operates 24/7, increasing production time and costs. Precision manufacturing from the robotic arms ensures minimal material loss. Nevertheless, it uses large amounts of energy, which is an environmental concern.

Economy and Distribution of Wealth [Society]

While automation drives economic growth by increasing productivity, it poses significant challenges to the fair distribution of wealth. Automation tends to disproportionately benefit capital owners and highly skilled workers, potentially widening the wealth gap between the rich and the poor.

In response, some governments like Finland are exploring policies like universal basic income (UBI) to mitigate the economic displacement caused by automation.

E.g.:

Amazon utilises robots to transport products within its warehouses, enabling sales to scale rapidly and support better company growth. However, this leads to job displacements for low-skilled workers, where the wealth generated primarily benefits Amazon’s shareholders and executives.

Explore by implementation how patterns in human behaviour influence ML and AI software development, including psychological responses, patterns related to acute stress response, cultural protocols, and belief systems.

AI developers create algorithms that analyse data and also interact effectively with users, reflecting human behavioural patterns.

Psychological Responses

Trust and User Adoption

Users are more likely to adopt AI systems if they trust the recommendations or decisions made by the system. Trust is built through transparency and reliability.

E.g. Medical AI need to justify their diagnosis, increasing user adoption and transparency.

Fear and Resistance

Psychological fear of AI can affect how users interact with AI systems. Developers need to create systems that feel intuitive and friendly to reduce resistance.

Cognitive Bias

AI systems must be designed to account for human cognitive biases.

E.g.: users may experience confirmation bias, where they favour AI outputs that confirm their pre-existing beliefs.

Acute Stress Response

In high-stress situations where cognitive load is already elevated, users need quick, straightforward solutions, so AI systems should minimise mental effort by providing clear, concise outputs instead of complex, data-heavy recommendations.

E.g.:

In AI-driven disaster management systems, simplified formats are used where visual alerts and concise instructions are prioritised to help first responders make quick, informed decisions under pressure.

Cultural Protocols

To ensure the technology is respectful and acceptable within cultural contexts, AI systems should be tailored to align with the cultural practices and expectations of the target users. This can include language preferences, gender roles, or traditional values that differ across cultures.

E.g.:

Google Assistant undergoes significant cultural adaptation when being deployed in different countries. These systems are programmed to recognise local dialects and respect local customs by addressing people more formally in certain cultures.

Belief Systems

Developers must account for belief systems to avoid ethical conflicts and ensure that AI systems operate within acceptable moral boundaries. AI systems must be designed to avoid bias, especially in culturally diverse societies. Developers should incorporate fairness and inclusivity into AI algorithms, ensuring that systems do not discriminate based on belief systems.

E.g.:

In facial recognition technology, ethical AI development considers potential biases against specific racial or ethnic groups, ensuring the technology works equally well across different demographics.

Investigate the effect of human and dataset source bias in the development of ML and AI solutions.

Bias arises when the models, data, or decisions made by developers unintentionally favour certain outcomes, groups, or perspectives over others.

Human Bias

Human bias refers to the implicit and explicit preferences or assumptions that developers may hold, which can influence the design and decision-making processes involved in creating AI systems.

Feature Selection Bias

The choice of variables or features for a model can reflect the developer's priorities or preconceived notions about what is important.

E.g.: If socio-economic status is prioritised as a feature in predictive models for employment, the model may perpetuate existing inequalities.

Algorithm Design Bias

Developers might unintentionally favour certain algorithmic structures or processes that reflect their own experiences or goals, even if those structures introduce bias.

Dataset Source Bias

Dataset bias occurs when the data used to train machine learning models is not representative of the broader population or task.

Historical Bias

This occurs when the dataset reflects past inequalities or discrimination.

E.g.: If a hiring algorithm is trained on historical data from an industry with low gender diversity, it may learn to favour male candidates over female candidates.

Sampling Bias

If certain groups are overrepresented or underrepresented in the dataset, the model will generalise poorly to the underrepresented groups.

E.g.: Medical AI systems trained on data from one demographic may fail to diagnose or recommend treatments for another accurately.

Labelling Bias [Both human and Dataset]

During the creation of datasets, humans often label data (e.g., tagging images or categorising information). Their labels may reflect personal biases, reinforcing stereotypes or errors.

Consequences of Bias in AI Systems

Discrimination

Biased AI systems may discriminate against certain groups based on race or gender.

Reduced Trust

Users and society may lose trust in AI systems if they consistently produce unfair or biased outcomes.

Poor Decision-Making

Bias in models can lead to inaccurate or inappropriate decisions.

Legal and Ethical Implications

Many countries have anti-discrimination laws, and biased AI systems could lead to legal challenges. Furthermore, there are growing concerns about the ethical responsibility of organisations deploying AI systems.

Mitigating Bias in AI Development

Diverse Teams [Human Bias]

Building teams with diverse perspectives can help mitigate bias by ensuring that different viewpoints are considered during AI development.

Algorithmic Fairness [Human Bias]

Using fairness-aware algorithms that aim to equalise outcomes for different groups can be an effective mitigation strategy.

Bias Audits and Testing [Data Bias]

Conducting audits and testing models for bias across different demographic groups can help identify and correct biased behaviour.

Inclusive Datasets [Data Bias]

Curating and using datasets that are representative of the entire population can help prevent dataset bias. This might include collecting additional data for underrepresented groups.

E.g.:

To reduce gender bias in hiring algorithms, companies anonymise candidate resumes and train models on more inclusive datasets that do not reflect historical gender biases.

Part 3. Where this has been examined (see ../../question_bank.md)

ID Marks Source Topic / type
hsc2025-q3 1 2025 HSC Machine learning training (multiple choice)
hsc2025-q11 1 2025 HSC DevOps (multi-select)
hsc2025-q12 2 2025 HSC Logistic regression (multi-select (true/false check boxes))
hsc2025-q24 5 2025 HSC Safety of workers (impact of automation) (extended response (discuss))
hsc2025-q25 5 2025 HSC Patterns in human behaviour; neural networks (virtual personal assistant) (extended response (explain))
hsc2025-q27 6 2025 HSC Bias in AI (human bias and data set source bias) (extended response (explain, video stimulus))
sample-q15 3 Sample Exam Machine learning in data analysis (short answer (describe, max 75 words))
sample-q20a 1 Sample Exam Decision trees (table (decision tree))
sample-q20b 3 Sample Exam Decision trees (drawing (decision tree))
sample-q23a 3 Sample Exam Bias in machine learning (short answer (max 75 words))
sample-q23b 3 Sample Exam Linear regression v K-nearest neighbour (short answer (compare, max 75 words))
sample-q25 8 Sample Exam ML, DevOps, RPA, BPA in security (extended response (discuss, max 300 words, slideshow stimulus))
fam-q7a 1 Familiarisation Decision trees (table (decision tree outcomes))
fam-q7b 3 Familiarisation Decision trees (drawing (decision tree))
fam-q14 8 Familiarisation AI and ML in society; privacy (extended response (judgement, slideshow stimulus))