Secret Code

ChatGPT for Makers

Rob Bell

Issue 69, April 2023

We dive deep into how ChatGPT and other next-generation AI tools can accelerate your understanding of electronics, and find the gaps for education. - by Rob Bell

Unless you’ve been living under a rock, or sunning yourself on the beach with no internet connection for the last several months, you’ve almost certainly heard of ChatGPT.

Developed by OpenAI, the entire tech world has been buzzing about it since it launched, and has even pushed competitors such as Google to rush their own versions to market as fast as possible.

It’s the most exciting thing to launch online since NFTs, and arguably far more useful in the real world too.

WHAT IS IT?

Let’s be clear… an AI that can generate text isn’t exactly the androids we all expected to be living with by 2023, but it’s still a huge leap forward in practical AI that helps humans directly. After all, written language has aided humans for over 5,000 years.

Let’s ask ChatGPT what it is and go from there:

Naturally, that’s a fairly predictable question and the answer reads something like an “about us” page could too. Not exactly groundbreaking, but we received a useful answer nonetheless.

I feel that the easiest way to describe what ChatGPT is doing, is to think of it like asking a friend or colleague about a topic they’re particularly knowledgeable about.

If you were to ask them “How do I change a light bulb?”, they’re unlikely to hand you a list of Google search results with that question as the query. They’re going to describe, based on their knowledge and experience of once learning how to do it, then perhaps actually doing it (if they haven’t forgotten since most things are LEDs now), in a way that likely makes sense to you.

This is the primary difference between how, say, Google Search returns information, compared to how ChatGPT does it.

We're no-doubt all familiar with Google Assistant or Siri, so let's ask Siri how we change a lightbulb?

This is a relatively useful link to a website which describes how to change a lightbulb. Handy, and a useful tool, and something many of us have come to leverage consistently in our daily lives.

The primary difference between what a service like Siri does, and what ChatGPT does, is not only in the delivery itself, but by how it develops the result.

Of course, this isn’t to say Siri or Google Assistant etc aren’t amazing at what they are built for. They’re designed primarily as a voice-command system for various apps and operating systems to allow hands-free operation. In the case of Google Assistant devices and similar, voice is the primary interface. So while comparisons can be drawn, you also shouldn’t judge a fish by its ability to climb a tree.

How do you change a lightbulb?

Changing a lightbulb is a simple task that most people can do with just a few steps. Remember to always prioritize safety when working with electrical components. Here's a step-by-step guide on how to change a lightbulb:

Turn off the power: Make sure the light switch is turned off before you begin. It's also a good idea to unplug any lamps before changing the bulb.

Allow the bulb to cool: If the light has been on recently, wait for the bulb to cool down before attempting to change it. Hot bulbs can cause burns.

Choose the right replacement bulb: Check the wattage and base type (e.g., screw or bayonet) of the old bulb and make sure your replacement bulb matches these specifications. LED bulbs are energy-efficient and long-lasting, making them a popular choice.

Prepare for safe handling: If you're using a ladder or step stool to reach the bulb, make sure it's stable and secure. Consider wearing gloves to protect your hands from potential broken glass.

Remove the old bulb: For screw-type bulbs, gently grasp the bulb and turn it counterclockwise until it comes loose. For bayonet-type bulbs, push the bulb gently upwards, twist it counterclockwise, and then pull it out.

Install the new bulb: Carefully insert the new bulb into the socket. For screw-type bulbs, turn it clockwise until it's secure. For bayonet-type bulbs, push the bulb gently upwards, twist it clockwise, and release it to lock it in place.

Test the new bulb: Turn the power back on and switch on the light to ensure the new bulb is working correctly.

Dispose of the old bulb: Follow local guidelines for proper disposal of lightbulbs, especially if they are CFLs or other types containing hazardous materials.

Remember to always handle lightbulbs with care to avoid breaking them or cutting yourself on broken glass. If you encounter any issues or are unsure about any part of the process, consult a professional.

While the text output itself may seem little more than a chatbot, it goes far deeper than that. Instead of preset pathways for the conversation and simple prompts, inputs and responses are conversational. It's not simply returning you a predefined response as most chatbots do.

LIMITATIONS

What use is an AI language model if you can’t ask it yourself?

What are your limitations?

As an AI language model, I have several limitations that you should be aware of:

  1. 1. Knowledge cutoff: My training data only goes up until September 2021, which means I am not aware of any developments, events, or information that have occurred since then.
  2. 2. Accuracy: While I strive to provide accurate information, I may sometimes generate incorrect or outdated responses. It is always a good idea to verify any critical information with other reliable sources.
  3. 3. Understanding context: I may sometimes misinterpret the context or intent behind a question or statement, which could lead to an irrelevant or nonsensical response.
  4. 4. Ambiguity: When faced with ambiguous questions or statements, I might not always ask for clarification and instead make assumptions based on the limited information provided.
  5. 5. Lack of emotions and personal experiences: As an AI language model, I do not have personal experiences or emotions, which means my responses are purely based on patterns found in my training data and not on personal opinions or feelings.
  6. 6. Ethical considerations: While efforts have been made to reduce biases and prevent inappropriate content, I may sometimes unintentionally generate biased or offensive responses.
  7. 7. Long-term memory: I don't have the ability to recall specific details of past interactions, so you may need to provide context for any ongoing conversations or follow-up questions.
  8. 8. Real-time updates: I cannot provide real-time updates or information on current events, stock prices, or similar time-sensitive topics.

It is essential to be aware of these limitations when using an AI language model like me and to always verify any critical information with other reliable sources.

Example Usage: An Education in Arduino

We started with the analogy of asking a friend about changing lightbulbs. Since ChatGPT is useful for this type of “digested knowledge”, we’re going to push it on something relevant to us. Arduino.

With little more than a simple question, we can get a relatively well-informed response.

Explain to me what an Arduino is

Arduino is an open-source hardware and software platform that is widely used for building digital
devices and interactive projects. It consists of a programmable microcontroller board and a software development environment that allows you to write and upload code to control the board's functions.

The Arduino board is the physical component of the platform and consists of a microcontroller, a USB port for communication and programming, and input/output pins that allow you to connect various sensors, actuators, and other components. The board is usually programmed using the Arduino Integrated Development Environment (IDE), which is a software tool that provides a user-friendly interface for writing and uploading code to the board.

The Arduino platform is highly versatile and can be used for a wide range of applications, from simple projects such as controlling a light switch to complex ones such as building a robotic arm. Its popularity is largely due to its open-source nature, which means that anyone can contribute to the platform by creating their own boards and software libraries, as well as sharing their projects and code with the community. This has led to a large and active community of developers, makers, and enthusiasts who use Arduino for a variety of projects and applications.

Now, as with our very first question about what ChatGPT is, this does read a little like the “about us” page you’d expect to find on Arduino’s own website. If you asked a maker what it is they might say something like “it’s a tiny computer you can get to do cool stuff”. I don’t think you’ll find such a casual response inside anything you get from ChatGPT.

But we’re just warming up a little here... Let's start to see what’s possible, and we might find areas of limitation with ChatGPT.

Give me an example of some basic arduino code

Sure, here's an example of basic Arduino code that turns on and off an LED connected to pin 13:

// Define the pin to which the LED is connected
int ledPin = 13;
void setup() {
  // Set the LED pin as an output
  pinMode(ledPin, OUTPUT);
}
void loop() {
  // Turn the LED on
  digitalWrite(ledPin, HIGH);
  delay(1000); // Wait for 1 second
  // Turn the LED off
  digitalWrite(ledPin, LOW);
  delay(1000); // Wait for 1 second
}

This code sets the pin 13 as an output pin and then repeatedly turns the LED on for 1 second and off for 1 second, creating a blinking effect. You can connect an LED to the pin 13 of the Arduino board using a resistor to limit the current, and then upload this code to see the LED blink.

Pretty solid! Right out of the Arduino playbook.

However things can get very interesting as, just like a human conversation, ChatGPT is aware of the previous conversational thread. So you can submit simple followup questions to get additional information.

How do i speed up the LED?

To speed up the blinking of the LED in the Arduino
code I provided earlier, you can reduce the value
of the delay function. The delay function causes the program to pause for a specified amount of time, in milliseconds. In the example code I provided, the delay is set to 1000 milliseconds (1 second) for both the on and off states of the LED.

If you want to speed up the blinking, you can reduce the delay time. For example, if you want to blink the LED every 500 milliseconds (0.5 seconds), you can change the delay time to 500 milliseconds like this:

// Define the pin to which the LED is connected
int ledPin = 13;
void setup() {
  // Set the LED pin as an output
  pinMode(ledPin, OUTPUT);
}
void loop() {
  // Turn the LED on
  digitalWrite(ledPin, HIGH);
  delay(500); // Wait for 0.5 seconds
  // Turn the LED off
  digitalWrite(ledPin, LOW);
  delay(500); // Wait for 0.5 seconds
}

By reducing the delay time, you will increase the frequency of the LED blinking. You can experiment with different delay times to find the speed that works best for your project.

The same code is provided again, along with an explanation what you’re changing and why.

This is pretty impressive on its own, but we’re looking to push a few limits here (not with our Arduino necessarily, but with what we’re requesting of ChatGPT).

So now we’ll try and step away from the code example if already provided and see what happens.

How can I make the LED go from dim to bright, and not on and off?

To make the LED go from dim to bright instead of
on and off, you can use the analogWrite function in Arduino instead of the digitalWrite function. The analogWrite function is used to output a variable voltage (a pulse-width modulated (PWM) signal) on a digital pin, which can simulate an analog voltage.

In this case, we can use analogWrite to vary the brightness of the LED by changing the duty cycle of the PWM signal. The duty cycle represents the percentage of time the signal is high (on) during one period of the signal. A duty cycle of 0% means the signal is always low (off), and a duty cycle of 100% means the signal is always high (on).

Here's an example code that fades an LED in and out using the analogWrite function:

// Define the pin to which the LED is connected
int ledPin = 9;
void setup() {
  // Set the LED pin as an output
  pinMode(ledPin, OUTPUT);
}
void loop() {
  // Fade in
  for (int i = 0; i <= 255; i++) {
    analogWrite(ledPin, i);
    delay(10); // Wait for 10 milliseconds
  }
  // Fade out
  for (int i = 255; i >= 0; i--) {
    analogWrite(ledPin, i);
    delay(10); // Wait for 10 milliseconds
  }
}

In this code, the LED is connected to pin 9 instead of pin 13, since pin 9 is capable of analog output. The for loop is used to increase or decrease the duty cycle of the PWM signal, gradually increasing or decreasing the brightness of the LED over time.

The delay function is used to pause for 10 milliseconds between each step of the loop, controlling the speed of the fade.

You can adjust the delay time and the range of the for loop to control the speed and the range of the fade effect.

That's a fairly incredible response. Not only did ChatGPT understand what we meant by asking "dim to bright", it gave us a completely usable response too. Now to test its awareness of electronic components and what we can do we’ll push it a little further.

How can we add a potentiometer to the hardware to allow variable delay rates?

To add a potentiometer to the hardware and allow variable delay rates, you can connect one of the potentiometer's outer pins to ground and the other to 5V on the Arduino board. Then, connect the middle pin of the potentiometer to one of the analog input pins of the board, such as pin A0.

Here's an example code that uses a potentiometer to control the delay time of an LED blink:

// Define the pin to which the LED is connected
int ledPin = 9;
// Define the analog input pin to which the 
// potentiometer is connected
int potPin = A0;
void setup() {
  // Set the LED pin as an output
  pinMode(ledPin, OUTPUT);
  // No need to set the potPin as an input, 
  // since it's an analog input by default
}
void loop() {
  // Read the value of the potentiometer
  int potValue = analogRead(potPin);
  // Map the potentiometer value to a delay 
  // time between 50 and 1000 milliseconds
  int delayTime = map(potValue, 0, 1023, 50, 1000);
  // Turn the LED on
  digitalWrite(ledPin, HIGH);
  delay(delayTime); // Wait for the delay time
  // Turn the LED off
  digitalWrite(ledPin, LOW);
  delay(delayTime); // Wait for the delay time
}

In this code, the analogRead function is used to read the value of the potentiometer from the analog input pin potPin. The map function is used to map the potentiometer value, which ranges from 0 to 1023, to a delay time between 50 and 1000 milliseconds. The delay function is then used with the variable delayTime to control the delay between the LED on and off states.

You can adjust the minimum and maximum delay time values in the map function to suit your needs. You can also connect the potentiometer to a different analog input pin and change the potPin variable to match the pin you use.

OK, so we’re still impressed. It's aware of the previous conversation we've already had, it knows what a potentiometer is, and it can determine that we're trying to control aspects of the code with additional hardware to derive an outcome.

But we asked specifically about connecting a component to the system. What happens if we are a little more abstract, and simply describe our objective?

Can we make a sequence of LEDs instead of just one?

Yes, you can make a sequence of LEDs light up in a specific pattern using Arduino code. One way to do this is by using a for loop to iterate through an array of pin numbers, turning each LED on or off in a specific sequence.

Here's an example code that lights up a sequence of LEDs one after the other:

// Define an array of pins to which the LEDs are connected
int ledPins[] = {9, 10, 11, 12};
void setup() {
  // Set all LED pins as outputs
  for (int i = 0; i < 4; i++) {
    pinMode(ledPins[i], OUTPUT);
  }
}
void loop() {
  // Turn on each LED in sequence for 
  // 200 milliseconds
  for (int i = 0; i < 4; i++) {
    digitalWrite(ledPins[i], HIGH);
    delay(200);
    digitalWrite(ledPins[i], LOW);
  }
}

In this code, an array ledPins is defined to hold the pin numbers of the four LEDs. In the setup function, a for loop is used to set each pin in the array as an output using the pinMode function.

In the loop function, another for loop is used to iterate through each pin in the ledPins array. For each pin, the digitalWrite function is used to turn on the corresponding LED by setting the pin's output to HIGH, followed by a delay of 200 milliseconds. Then, the digitalWrite function is used again to turn off the LED by setting the pin's output to LOW.

You can modify this code to create other LED sequences, such as blinking or pulsing patterns, by changing the digitalWrite commands or adding more for loops with different delays and pin sequences.

Now there’s a clear caveat here… in that it's described what to do, but given no insight into how to connect things together... but more on that later.

Let’s push the hardware questions even further!

What if i want to do that with more LEDs than the Arduino supports with its own hardware?

If you want to control more LEDs than the number of digital output pins available on the Arduino board, you can use additional hardware components to expand the number of output pins.

One common way to do this is by using shift registers, such as the 74HC595, which are ICs that can take a serial input and output it in parallel to multiple output pins. By chaining multiple shift registers together, you can control a large number of output pins with just a few digital pins on the Arduino board.

Here's an example code that uses a shift register to control eight LEDs:

// Define the pins connected to the shift register
int latchPin = 8; 
// latch (ST_CP) pin of the shift register
int clockPin = 12; 
// clock (SH_CP) pin of the shift register
int dataPin = 11; 
// data (DS) pin of the shift register
void setup() {
  // Set the shift register pins as outputs
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}
void loop() {
  // Shift out a value to the shift register 
  // to turn on the LEDs
  shiftOut(dataPin, clockPin, MSBFIRST, B00001111); 
  // Turn on the first four LEDs
  shiftOut(dataPin, clockPin, MSBFIRST, B11110000);   
  // Turn on the last four LEDs
  digitalWrite(latchPin, HIGH); 
  // Latch the shift register data to the outputs
  delay(500); // Wait for 500 milliseconds
  // Shift out a different value to turn off 
  // the LEDs in reverse order
  shiftOut(dataPin, clockPin, MSBFIRST, B11110000);
  // Turn off the last four LEDs
  shiftOut(dataPin, clockPin, MSBFIRST, B00001111); 
  // Turn off the first four LEDs
  digitalWrite(latchPin, HIGH); 
  // Latch the shift register data to the outputs
  delay(500); // Wait for 500 milliseconds
}

In this code, the shiftOut function is used to send a binary value to the shift register's data pin, which is then shifted out to eight output pins connected to LEDs. The digitalWrite function is used to set the latch pin to HIGH after each shiftOut command to latch the data to the output pins.

You can connect multiple shift registers together to control even more LEDs. The specific wiring and configuration of the shift registers will depend on the specific model and the number of LEDs you want to control.

Now if i’m asking questions about how to code an Arduino with a shift register, you aren’t likely to know how to wire one to your circuit either. After all, Arduino is rarely about software alone.

ChatGPT is all about natural language processing… but it could give us code examples (which admittedly are a type of language), so what else can we get from it?

Can you show me how to wire up the shift register?

Sure! Here's an example circuit diagram that shows how to wire up a shift register to control eight LEDs:

                   +---------+
Arduino            |         |
Digital Pin 11 ----| DS (14) |
Digital Pin 12 ----| SH_CP (11) |
Digital Pin 8 -----| ST_CP (12) |
                   |         |
                   +---------+
                        |
                        |
                       ===
                       | | 220 ohm resistor
                       ===
                        |
                   +---------+
                   | LED 1   |
                   +---------+
                        |
                   +---------+
                   | LED 2   |
                   +---------+
                        |
                   +---------+
                   | LED 3   |
                   +---------+
                        |
                   +---------+
                   | LED 4   |
                   +---------+
                        |
                   +---------+
                   | LED 5   |
                   +---------+
                        |
                   +---------+
                   | LED 6   |
                   +---------+
                        |
                   +---------+
                   | LED 7   |
                   +---------+
                        |
                   +---------+
                   | LED 8   |
                   +---------+

In this code, an array ledPins is defined to hold the pin numbers of the four LEDs. In the setup function, a for loop is used to set each pin in the array as an output using the pinMode function.

In the loop function, another for loop is used to iterate through each pin in the ledPins array. For each pin, the digitalWrite function is used to turn on the corresponding LED by setting the pin's output to HIGH, followed by a delay of 200 milliseconds. Then, the digitalWrite function is used again to turn off the LED by setting the pin's output to LOW.

You can modify this code to create other LED sequences, such as blinking or pulsing patterns, by changing the digitalWrite commands or adding more for loops with different delays and pin sequences.

At the very least, it reminds us that it’s a language-based AI. That's a pretty solid attempt at a circuit diagram using text-characters, and does make reasonable sense.

If we want pictures, that’s where we start to get to the edge of possibilities, but it does try...

Do you have a clearer circuit diagram?

Yes, here's a clearer circuit diagram that shows how to wire up a shift register to control eight LEDs:


In this circuit diagram, the pins of the shift register are labeled according to their functions:

DS (Data): This is the data input pin. The Arduino sends serial data to this pin to control the outputs.

SH_CP (Shift Clock): This is the clock input pin. The Arduino sends a clock signal to this pin to shift the data through the shift register.

ST_CP (Store Clock): This is the latch input pin. When the Arduino sends a signal to this pin, the output pins of the shift register update to reflect the current data in the shift register.

The LEDs are connected to the output pins of the shift register, with each LED connected to its own current-limiting resistor. The anodes of the LEDs (positive legs) are connected to the output pins, and the cathodes of the LEDs (negative legs) are connected to ground.

Note that the specific resistor values used in the circuit may vary depending on the voltage and current rating of the LEDs used. Be sure to choose an appropriate resistor value to limit the current through the LEDs to a safe level.

As you can see the image that it has tried to provide is no longer linked. Perhaps the age of the training data used means that the image referenced has been removed or moved, such is the age-old issue of online resources.

However the explaination that it gives along with the image (assuming it's correct with respect to the image it intended to show us) is very thorough.

Naturally, in its current format, you need to have enough understanding and knowledge to utilise the response provided. However this is no different to asking a friend for help too.

Regardless of the tool being used, there's always going to be some kind of threshold where our own understanding of a topic.

Knowledge barriers will always exist for complex topics, but tools such as ChatGPT could certainly begin to accellerate how rapidly we can overcome these.

Example Usage: Code Debugging

Debugging code is a never-ending task. While code editing has come a long way, and most editors provide some syntax checking and basic assistance, it's still a challenging task.

Often there will be absolutely no issue with your actual syntax, and everything looks perfect on the surface. However a single variable mis-referenced, or a function in the wrong place, and you can find yourself spending hours trying to figure it out.

ChatGPT spruiks some ability to help debug code. After all, if it can understand the meaning of English language, why not understand Python, C, or various other languages.

Not only can you paste code into ChatGPT, you can provide some conversational context around what's going wrong, so it has a language-based understanding of what you're trying to achieve. Let's give this a crack!

Now the obvious limitation here is that with much of the software we write, it's not limited to simply one file, and the a problem we're debugging may not be limited to just one function. So this could have limited efficacy on more complex code.

However when it comes to Arduino in particular, we're in luck! Sure, we can utilise libraries for many complex functions, but we're unlikely to need to debug those.

However even if we're writing libraries or multi-file code for more complex software, many of the challenges we encounter and issues we need to debug can be islolated to the function we're working on right then and there.

We're going to start with a simple test. We'll grab a few Arudino code examples from the IDE, create a few intentional errors or typos, and see what ChatGPT returns to us.

Naturally, a good place to start is Blink, the classic Arduino starting point. We'll modify the second digitalWrite function with analogWrite. Now the syntax here is entirely valid, there's no clear typo, so we'll see what happens.

Can you help me debug this code?

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 
  // LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over 
// and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH); // turn 
  // the LED on (HIGH is the voltage level)
  delay(1000); // wait for a second
  analogWrite(LED_BUILTIN, LOW); // turn the 
  // LED off by making the voltage LOW
  delay(1000); // wait for a second
}

It looks like there's a mistake in the code. In the loop() function, the analogWrite() function is being used to turn the LED off, but it should be digitalWrite() instead.

Here's the corrected code:

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000);
}

This code should turn on the built-in LED for one second, then turn it off for one second, and then repeat the process indefinitely.

As you can see ChatGPT has not only identified our error quickly, it's also provided a plain English explanation of where the error was. Conveniently it's also then provided the corrected code for us too!

This is impressive in its own right, but let's try some something a little more subtle on the third last line.

Can you tell me why lastInterruptTime isn't incrementing in this code?

ICACHE_RAM_ATTR void handleDND() {
  unsigned long interruptTime = millis();
// disregard repeated interrupts within 0.5s
if (interruptTime - lastInterruptTime > 500){
  if (dndStatus == false) {
    enableDND();
  } else {
    disableDND();
  }
  // update the last interrupt time
    lastInterruptTime == interruptTime;
  }
}

The reason why lastInterruptTime isn't incrementing in this code is because of a typo in the line where lastInterruptTime is being updated.

In the line lastInterruptTime == interruptTime;, you're using the comparison operator "==" instead of the assignment operator "=".

So, the line should be changed to lastInterruptTime = interruptTime;. This will correctly update the value of lastInterruptTime with the value of interruptTime.

Here's the corrected code:

ICACHE_RAM_ATTR void handleDND() {
  unsigned long interruptTime = millis();
  // disregard repeated interrupts within 0.5s
  if (interruptTime - lastInterruptTime > 500) {
    if (dndStatus == false) {
      enableDND();
    } else {
      disableDND();
    }
    // update the last interrupt time for debounce
    lastInterruptTime = interruptTime;
  }
}

With this change, lastInterruptTime should be correctly incremented when handleDND() is called.

ChatGPT has correctly identified the deliberate error we put into the code, fixed it, and given us the updated code. Try it yourself! It's really handy!

AI Images

Part of the usefulness in ChatGPT for makers becomes lost with the inability to generate images, such as we do at DIYODE. But wait, can’t AI conjure up images out of thin air too?

Of course! There is an increasing number of image generation tools that conjure images from text, even on stock-image websites that have sold images for decades, as they don’t want to be made redundant by this technology. OpenAI itself has software dedicated to this too called DALL-E 2. But this isn’t something integrated with ChatGPT.

What can you create?

Well, you can literally give anything a shot! But the results will vary greatly. There have been photography competitions recently where AI-produced images have been submitted and have won the competitions.

Naturally, this creates all sorts of questions; and raises questions about "what makes art", or more specifically "what makes an artist". After all, if you can type a few words into an AI system and generate artwork or an image, are you truly an artist?

Even if one can argue "yes" to that question, can you compare them to a traditional artist who is putting paint to canvas, or picking up a camera? Perhaps not, just as you can't compare a photographer to a painter, as they are both unique skills. Perhaps an AI artist is an artist because they select from the AI results, just as a photographer selects the best images from all the stills they've captured.

How good are they?

It really depends on what you’re asking it to generate. We all know that the internet is full of cat pictures. So training an AI to illustrate a cat, is relatively straight-forward because o

One thing that you can see clearly as a limitation of AI-generated images is the lack of fine detail. Or at least, coherent fine detail.

AI images are great at getting a “sense” of what you’ve asked for. And you can see how they take “inspiration” from various images that the model has been trained with.

It’s essentially the reverse of what an image classifier does. When you provide an photo to an image classifier, it looks at characteristics of that image, then uses the training date to tell you it’s a picture of a dog, or a human face, or whatever the case may be.

The reverse of this process is essentially what’s happening with AI image generation. However sometimes assembling various characteristics into a single image actually becomes somewhat nonsensical, or the finer details fall outside of the training data’s accuracy.

We also notice that AI generated images usually struggle with fine detail, particularly things human's struggle to draw such as human hands and facial features. But that will no-doubt improve with time.

As you can see from this example, while the image gives a good "sense" of what we've asked for, some features simply don't make sense, such as the keyboard which looks like it's been baked in an oven for a few hours.

Some features here such as fingers and multiple hands which don't seem to logically make sense, are what tends to give these images away. In many ways, you can see how this image was inspired by various other images with variable hand gestures, but overall it doesn't totally make sense.

We also asked an image generator for an image of a 3D printer. While it gives a good sense of things, there are features which don't make sense in reality. This includes the "reflection" underneath the solid build plate, as well as ribbons of filament which are near impossible to actually get from a regular 3D printer.

WHERE TO FROM HERE?

AI is all about training data. It’s fairly easy to see where ChatGPT excels, and where its limitations are, but it's still proving to be exceptionally useful at many tasks already.

OpenAI is working to make all of its models open too. This would allow the model behind ChatGPT to be deployed into more specific functions with specialised training data.

Using the fundamental structure of ChatGPT, it’s entirely feasible that a system such as “DoctorGPT” could be created, if it was specifically trained in medical information. Or “MechanicGPT” which is specifically trained to diagnose mechanical faults… you get the idea. Specialisation is where the power of ChatGPT will become fully realised.

AI image generators could also be trained into specialised areas, such as electronics. It could be more aware of specific components and how they interconnect, wiring patterns, PCBs, and more. Only time will tell how far we can push this technology!

Rob Bell

Editor-in-Chief