Loading...
Hello, my name is Mrs. Holborow, and welcome to Computing.
I'm so pleased you've decided to join me for the lesson today.
In today's lesson, you'll be exploring machine learning engines, what are decision trees and neural networks.
You'll also explore how AI can be used for image generation.
Welcome to today's lesson from the unit Data science: AI and machine learning.
This lesson is called "Machine learning engines," and by the end of today's lesson, you'll be able to explore a range of machine learning engines which are used to build AI models.
Shall we make a start? We will be exploring these keywords throughout today's lesson.
Let's take a look at them together now.
Decision tree.
Decision tree: a type of machine learning or ML engine that makes predictions by splitting data into branches using conditions.
Neural network.
Neural network: a type of ML engine consisting of interconnected nodes, organised in layers, that is trained to find patterns in data.
Image generator.
Image generator: an AI tool that produces pictures from a prompt using patterns it has identified in large collections of existing images.
Look out for these keywords throughout today's lesson.
Today's lesson is split into two parts.
We'll start by comparing machine learning engines and then we'll move on to recognise how AI can be used for image generation.
Let's start by comparing machine learning engines.
Jun says, "Do all machine learning models work the same way?" Izzy says, "How do you choose the right model for the problem you want to solve?" Two really good questions there.
The engines of machine learning are the data structures and algorithms that are used to create a model.
The engine you choose will depend on the nature of the problem you want to solve and the characteristics of your data.
When choosing a machine learning engine, you should consider three fundamental things.
Firstly, the type of data.
Different algorithms are more suitable for some types of data than others.
For example, images, numerical values, et cetera.
The complexity of the problem.
More complex problems may require more complex algorithms. The need for explainability.
In some cases, it's necessary to explain the decisions made by algorithms. Decision trees are created using supervised learning and can be used to classify data.
Decision trees are made up of nodes.
The top node of a decision tree is called the root.
Leaf nodes will usually represent a single class.
When data is evaluated using a decision tree, the leaf you end on provides the predicted label for that data.
The nodes in a decision tree are either a decision node or a leaf.
Decision nodes contain conditions that will split the data, commonly in two directions.
The root is the first decision node.
This decision tree classifies animals.
The data set used to create the decision tree contains features.
Some features are either true or false, such as feathers or backbone.
Other features are numeric, such as number of legs.
To use a decision tree with new data, you start at the top and follow a path down the tree, making decisions at each node until you reach a leaf node which reveals the corresponding class label or numerical value for the new data.
Decision trees are simple to interpret, and decisions made by the algorithm are easy to trace.
This offers transparency, which is beneficial when the reasoning behind decisions made needs to be explained and justified.
However, decision trees are prone to overfitting.
Overfitting occurs when the tree is too specific to the training data and fails to generalise well on new, unprocessed data.
Time to check your understanding.
I have a question for you.
A decision tree is made up of nodes that can be described as root, leaf, or decision nodes.
Which two of the following types of node would contain a condition? And you've got the options to choose from: A, root node; B, decision node; and C, leaf node.
Pause the video whilst you have a think.
Well done.
A root node and a decision node are both nodes that would contain a condition.
A neural network is inspired by how our brains work.
It is a powerful tool that can be used for a wide range of tasks that involve finding patterns in very large data sets.
A neural network could be used to analyse your music listening history to identify genres, artists, and tracks you prefer.
The network can then process this information with a broader data set containing music preferences of various users, identifying patterns and similarities in music taste.
This allows the network to generate recommendations of new songs, artists, or playlists that you might enjoy based on the preferences of similar users.
The basic building block of a neural network is an artificial neuron.
The neurons are organised into layers.
The first layer is the input layer, which receives the raw input.
The last layer is the output layer, which provides the final classification.
All of the layers in between are called hidden layers.
Neural networks can handle complex data, and because of this, they power many modern AI applications like image and speech recognition, language translation, chatbots and virtual assistants, self-driving cars, and medical image analysis.
As neural networks can become very complex, it is sometimes difficult to trace the decisions made by the algorithm.
Because of this, it is often hard to understand why a neural network made a particular decision.
This is problematic in areas like healthcare or finance where the explanations and transparency are important.
Okay, time to check your understanding.
This time I have a true or false statement for you.
Neural networks offer transparency in terms of the decisions made by the algorithm.
Is this statement true or false? Pause the video whilst you have a think.
That's right.
It's false.
It's often hard to understand why a neural network made a particular decision, which makes transparency difficult.
Okay, we're moving on to our first task of today's lesson, Task A.
Explain the differences between decision trees and neural networks in your own words.
Pause the video whilst you have a go at the task.
How did you get on? Did you manage to explain the difference between decision trees and neural networks? Well done.
Let's have a look at a sample answer together.
Decision trees and neural networks are both types of machine learning engines, but they work in very different ways.
A decision tree makes predictions by asking a series of questions, splitting data into branches until it reaches an outcome.
This makes decision trees easy to interpret and explain.
Neural networks are inspired by the human brain.
Layers of connected neurons process information and find complex patterns.
While neural networks are much more powerful and can handle tasks like image recognition and speech, they are harder to interpret and require a lot more data and computing power.
In summary, decision trees are simple and interpretable, while neural networks are complex but better at solving advanced problems. Did you have some similar ideas in your response? Remember, if you'd like to pause the video and add any extra detail to your answer, you can do that now.
So we are moving on to the second part of today's lesson where we're going to recognise how AI can be used for image generation.
An AI image generator is a system that produces digital pictures from written instructions in a prompt by analysing patterns in a data set.
Lucas says, "The data sets often contain millions of images collected from the internet." AI image generators generate new visual content because the systems have been trained to identify patterns from millions of images in the training data.
Jun says, "But how do AI systems generate images?" Do you know how AI systems generate images? Maybe pause the video whilst you have a think.
An AI application is trained on millions of images with descriptions, for example, cat, mountain, cartoon, et cetera.
The application identifies the patterns of shapes, colours, and textures that match those descriptions.
When you give it a prompt like a cat flying a spaceship, the AI application puts those patterns together into a new image.
Neural networks are commonly used for AI image generation.
The neural network learns relationships between input information, like a text prompt, and output images.
Neural networks are trained using millions of images, which are sometimes paired with text captions.
Jun says, "What is a prompt?" Can you remember what a prompt is? Maybe pause the video and have a think.
Izzy's got a response.
"A prompt is the input information humans give to generative AI systems like image generators." Well done, Izzy.
A prompt can describe things like the subject, setting, mood, and style.
Describing these things guides the image generator to output an image that suits your needs.
Let's have a look at this example prompt.
So we've got a dog sitting on the beach wearing sunglasses, and this is the image generator output.
So we have a dog wearing sunglasses sitting on the beach.
Time to check your understanding.
Which of the following would be the best example of a detailed AI image prompt? Is it A, dog; B, a dog sitting on the beach wearing sunglasses; or C, a golden retriever? Pause the video whilst you think about your answer.
Did you select B? Well done.
Remember, we can give information about the context, the style, and the setting to give a detailed AI image prompt.
Some images generated by AI look so convincing that you might think that they are real photographs.
This photograph below was generated by an AI image generator.
The application used to generate the picture of the school gave the information that you are free to use, share, and modify the image, including for commercial purposes, as long as you don't claim the image itself is copyrighted or created by a human artist.
One of the issues is that the artwork that was used to train the model may have been subject to copyright restrictions.
Some artists are now campaigning to be able to prevent their work being used to train machine learning models.
Remember to use image generators responsibly by following simple safety and fairness guidelines.
Respect other people's works and rights.
Avoid creating harmful or misleading images.
Be honest when sharing AI-generated images.
Be mindful of potential bias, stereotypes, and how people, places, and cultures are shown in your images.
Okay, I have a true or false statement for you now.
AI image generation models are completely objective and cannot reflect societal biases.
Is this true or false? Pause the video whilst you have a think.
Did you select false? Well done.
AI image generation models find patterns from their training data.
If the data has imbalances, for example, more images of certain ethnicities, genders, et cetera, the generated images may reflect those imbalances, leading to biassed outputs.
Okay, we're moving on to our second task of today's lesson.
For part one, in your own words, explain how AI can be used for image generation.
For part two, if you can, experiment with an AI image generator.
Part 2a, write a detailed prompt.
For b, explain did you get the results that you expected? And then for part c, did you have to refine your prompt to improve the output? Pause the video whilst you go and have a go at the task.
How did you get on with the task? Did you manage to use an AI image generator? Let's have a look at a sample answer together.
So in part one, you were asked in your own words to explain how AI can be used for image generation.
An AI application can be used for image generation by training a neural network on a large set of images, which are sometimes paired with text captions.
The AI application is trained to identify patterns, shapes, colours, and relationships between objects.
Once trained, it can generate new images based on a text prompt by combining these patterns and relationships in new ways.
Remember, if you'd like to pause the video here and add some detail to your answer, you can do that now.
For part two, you were asked if you can to experiment with an AI image generator, and for part 2a, you were asked to write a detailed prompt.
So here we've got Izzy's example.
Izzy's prompt is "generate an image of a rabbit," and we've got the image generator output.
Izzy says, "The subject in my first prompt was a rabbit." For part 2b, you were asked, did you get the results you expected? Izzy says, "No.
I wanted the image to be more suitable for a children's storybook.
I think a cartoon-style illustration would be better than a photo." For part 2c, you were asked, did you have to refine your prompt to improve the output? So Izzy has refined her prompt here.
She's now got the prompt, which says, "Generate an image of a rabbit.
The rabbit should be sitting inside an old boot in the setting of a vegetable plot.
The style of the image should be like an illustration from a children's book." And you can see the new image generator output, which looks quite different from the rabbit that was produced in a photographic style for part a.
Izzy says, "My new prompt made a much more suitable image." Okay, we've come to the end of today's lesson, "Machine learning engines," and you've done a fantastic job, so well done.
Let's summarise what we have learned together in this lesson.
The engines of machine learning are the data structures and algorithms that are used to create a model.
The engine you choose will depend on the nature of the problem you want to solve and the characteristics of your data.
A decision tree is a supervised machine learning algorithm.
Machine learning developers use decision trees to structure a set of conditions which can be used to make a prediction.
A neural network is a type of machine learning model inspired by the human brain.
It consists of layers of connected nodes called neurons that work together to recognise patterns in data.
I hope you've enjoyed the lesson, and I hope you'll join me again soon.
Bye.